/* BLOG — index list + article page */

body { padding-left: 0 !important; opacity: 1; }
body > header,
body > footer { margin-left: 0 !important; width: 100% !important; }

.nav-item a.nav-active,
.mobile-nav-link.nav-active { color: var(--pink); }

.blog-index {
  max-width: 900px;
  margin: 0 auto;
  padding: 64px 24px 110px;
  font-family: var(--font-body);
  color: var(--black);
}

.blog-index-head { margin-bottom: 40px; }
.blog-index-head h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 46px);
  font-weight: 800;
  /* Cyrillic descenders collide below 1.12 at this tracking */
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.blog-index-head p {
  font-size: 16.5px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.58);
  max-width: 620px;
}

.blog-empty {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 500;
  color: rgba(0, 0, 0, 0.55);
  text-align: center;
  padding: 60px 0 40px;
}

/* --thumb-h drives the whole card: the cover is exactly this tall and the text
   column may not exceed it, so every card in the list ends up the same height */
.post-list {
  --thumb-h: 170px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.post-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: #fff;                 /* opaque: body grid must not show through */
  box-shadow: 0 2px 10px -6px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.post-card:hover {
  border-color: rgba(232, 24, 109, 0.35);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.post-card-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  padding: 18px;
  text-decoration: none;
  color: inherit;
}

/* Fixed height, free width: cards line up without any cover being cropped */
.post-card-thumb {
  border-radius: 12px;
  overflow: hidden;
}
.post-card-thumb img {
  height: var(--thumb-h);
  width: auto;
  border-radius: 12px;
  display: block;
}

.post-card-body {
  max-height: var(--thumb-h);
  overflow: hidden;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  /* Two lines of title + three of excerpt fit the thumbnail exactly */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card:hover .post-card-title { color: var(--pink); }

.post-card-excerpt {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.58);
  margin: 0 0 10px;
  /* Clamped so a long excerpt can't outgrow the thumbnail */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta,
.post-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.3px;
  color: var(--pink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-meta-dot { color: rgba(0, 0, 0, 0.25); }

.post-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 110px;
  font-family: var(--font-body);
  color: var(--black);
}

.post-crumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.post-crumbs a { color: var(--pink); text-decoration: none; }
.post-crumbs a:hover { text-decoration: underline; }

.post-inner h1 {
  font-family: var(--font-display);
  /* 38px max — the column is 760px */
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
  text-wrap: balance;
}

.post-meta { margin-bottom: 30px; }

.post-cover {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
  margin-bottom: 36px;
  background: #f1f1f4;
}

.post-figure {
  margin: 28px 0 30px;
}
.post-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  background: #f1f1f4;
}
.post-figure figcaption {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.52);
}

.post-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 46px 0 14px;
}
.post-inner h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin: 30px 0 10px;
}

.post-inner p {
  font-size: 16.5px;
  line-height: 1.75;
  color: rgba(0, 0, 0, 0.78);
  margin-bottom: 16px;
}

.post-lead {
  font-size: 18.5px !important;
  font-weight: 600;
  color: var(--black) !important;
}

.post-inner ul {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
}
.post-inner ul li {
  position: relative;
  padding-left: 22px;
  font-size: 16.5px;
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.78);
  margin-bottom: 8px;
}
.post-inner ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
}

.post-note {
  border-left: 3px solid var(--pink);
  background: #fdf6f9;
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 22px 0 24px;
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.72);
}

.post-formula {
  font-family: var(--font-mono) !important;
  font-size: 16px !important;
  font-weight: 600;
  background: #f3f3f5;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 8px 0 22px !important;
  color: var(--black) !important;
  overflow-x: auto;
}

.post-table-wrap { overflow-x: auto; margin: 10px 0 26px; }
.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  min-width: 420px;
}
.post-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
  padding: 0 14px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.post-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  color: rgba(0, 0, 0, 0.8);
  line-height: 1.5;
}
.post-table tbody tr:last-child td { border-bottom: none; }
.post-table td:last-child { font-weight: 600; white-space: nowrap; }

.post-cta {
  margin: 48px 0 36px;
  padding: 30px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fdf0f6 0%, #f6f1fd 100%);
  border: 1px solid rgba(232, 24, 109, 0.16);
  text-align: center;
}
.post-cta h2 {
  margin: 0 0 10px !important;
  font-size: clamp(20px, 2.4vw, 26px) !important;
}
.post-cta p {
  margin: 0 auto 22px !important;
  max-width: 520px;
  font-size: 15.5px !important;
}

.post-links { margin-top: 36px; padding-top: 24px; border-top: 1px solid rgba(0, 0, 0, 0.09); }
.post-links ul { list-style: none; padding: 0; margin: 0; }
.post-links li { margin-bottom: 10px; padding-left: 0; }
.post-links li::before { display: none; }
.post-links a {
  color: var(--pink);
  text-decoration: none;
  font-size: 15.5px;
  border-bottom: 1px solid rgba(232, 24, 109, 0.3);
}
.post-links a:hover { border-color: var(--pink); }

.post-also { margin-top: 44px; }
.post-also h2 { font-size: 22px !important; margin: 0 0 18px !important; }
.post-also-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s;
}
.post-also-card:hover { border-color: rgba(232, 24, 109, 0.35); }
.post-also-card img {
  height: 68px;
  width: auto;
  border-radius: 9px;
  display: block;
}
.post-also-card span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
}

@media (max-width: 700px) {
  .blog-index { padding: 34px 16px 70px; }
  .blog-index-head { margin-bottom: 26px; }
  .blog-index-head p { font-size: 15px; }

  .post-list { gap: 14px; }
  .post-card-link {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }
  /* Stacked: the cover spans the card, so the shared height goes away */
  .post-card-thumb img { width: 100%; height: auto; }
  .post-card-body { max-height: none; }
  .post-card-title { font-size: 17.5px; }
  .post-card-excerpt { font-size: 14px; margin-bottom: 10px; }
  .post-card-meta, .post-meta { font-size: 11.5px; }

  .post-inner { padding: 26px 16px 70px; }
  .post-inner p,
  .post-inner ul li { font-size: 15.5px; line-height: 1.7; }
  .post-lead { font-size: 17px !important; }
  .post-cover { border-radius: 12px; margin-bottom: 26px; }
  .post-inner h2 { margin: 34px 0 12px; }
  .post-cta { padding: 22px 18px; }
  .post-figure { margin: 22px 0 24px; }
  .post-figure img { border-radius: 10px; }
  .post-figure figcaption { font-size: 13px; }
  .post-also-card img { height: 54px; }
  .post-also-card span { font-size: 14.5px; }

  .post-table-wrap { overflow-x: visible; }
  .post-table { min-width: 0; font-size: 15px; }
  .post-table thead { display: none; }
  .post-table tbody,
  .post-table tr,
  .post-table td { display: block; width: 100%; }
  .post-table tr {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #fff;
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .post-table tr:last-child { margin-bottom: 0; }
  .post-table td { border: none; padding: 0; }
  .post-table td:first-child {
    color: rgba(0, 0, 0, 0.6);
    font-size: 13.5px;
    margin-bottom: 4px;
  }
  .post-table td:last-child {
    white-space: normal;
    font-weight: 700;
    font-size: 15.5px;
    color: var(--black);
  }

  .post-formula {
    font-size: 14px !important;
    line-height: 1.6;
    white-space: normal;
    overflow-x: visible;
    word-break: break-word;
  }
}

.scroll-top-btn {
  display: flex;
  bottom: 24px;
  right: 24px;
}
@supports (padding: env(safe-area-inset-bottom)) {
  .scroll-top-btn { bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) {
  .scroll-top-btn { bottom: 18px; right: 16px; }
}

/* (hover: hover) — :hover latches after a tap on touch screens */
@media (hover: hover) {
  .scroll-top-btn {
    transition: opacity .3s, transform .25s, background .25s, box-shadow .25s;
  }
  .scroll-top-btn:hover {
    background: var(--pink);
    transform: translateY(-3px);
    box-shadow: 0 12px 26px -6px rgba(232, 24, 109, 0.55);
  }
  .scroll-top-btn:hover svg { transform: translateY(-1px); }
  .scroll-top-btn svg { transition: transform .25s; }
}
.scroll-top-btn:active {
  background: var(--pink);
  transform: translateY(0) scale(0.9);
}
