/* ============================================================
   Fahavi — single blog post  (fahavi-post.css)
   Loaded only on is_singular('post'); tokens from fahavi.css.
   Editorial: hierarchy from typography + whitespace; the article
   body stays unboxed — only the sidebar uses cards.
   ============================================================ */

.fahavi-post .ct-container,
.fahavi-post .ct-container-full { width: 100%; max-width: none; }

.fh-ps { background: #F7F8FB; padding-bottom: 56px; }
.fh-ps__wrap { width: min(100% - clamp(32px, 4vw, 64px), 1360px); margin-inline: auto; }

/* ---- breadcrumb ---- */
.fh-ps__crumb { display: flex; align-items: center; gap: 8px; padding: 22px 0 20px; font-size: 13px; color: var(--fh-muted); min-width: 0; }
.fh-ps__crumb a { color: var(--fh-muted); text-decoration: none; white-space: nowrap; }
.fh-ps__crumb a:hover { color: var(--fh-navy); }
.fh-ps__crumbtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fh-ink); font-weight: 600; }

/* ---- layout ---- */
/* columns stretch: the sidebar must span the full article height so the
   TOC's flexible lane gives the sticky card room to travel */
.fh-ps__grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: clamp(28px, 3.4vw, 52px); }
.fh-ps__main, .fh-ps__side { min-width: 0; }

/* ---- article header ---- */
.fh-ps__badge {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: #2563EB; color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.fh-ps__title { margin: 14px 0 12px; max-width: 780px; font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--fh-ink); }
.fh-ps__dek { margin: 0 0 18px; max-width: 680px; font-size: clamp(15px, 1.3vw, 17px); line-height: 1.65; color: var(--fh-muted); }

.fh-ps__metarow { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 0; border-block: 1px solid var(--fh-border); margin-bottom: 22px; }
.fh-ps__author { display: flex; align-items: center; gap: 11px; }
.fh-ps__avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--fh-navy); color: #fff; font-weight: 800; font-size: 17px;
}
.fh-ps__authname { display: block; font-size: 14px; font-weight: 700; color: var(--fh-ink); }
.fh-ps__authmeta { display: block; font-size: 12.5px; color: var(--fh-muted); margin-top: 2px; }
.fh-ps__share { display: flex; align-items: center; gap: 8px; }
.fh-ps__share > span { font-size: 12.5px; font-weight: 600; color: var(--fh-muted); margin-right: 2px; }
.fh-ps__share a, .fh-ps__copylink {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--fh-border);
  display: grid; place-items: center; background: #fff; color: var(--fh-muted); cursor: pointer;
}
.fh-ps__share a:hover, .fh-ps__copylink:hover { border-color: #2563EB; color: #2563EB; }
.fh-ps__share svg { width: 15px; height: 15px; }
.fh-ps__copylink.is-done { border-color: var(--fh-green-deep); color: var(--fh-green-deep); }

/* ---- hero image ---- */
.fh-ps__hero { margin: 0 0 26px; }
.fh-ps__hero img { width: 100%; height: auto; max-height: 560px; object-fit: cover; border-radius: 14px; display: block; }

/* ---- mobile TOC ---- */
.fh-ps__tocm { display: none; margin: 0 0 22px; background: #fff; border: 1px solid var(--fh-border); border-radius: 12px; padding: 12px 16px; }
.fh-ps__tocm summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--fh-ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.fh-ps__tocm summary::-webkit-details-marker { display: none; }
.fh-ps__tocm summary::after { content: '\2304'; color: var(--fh-muted); font-size: 16px; line-height: 1; transition: transform .15s; }
.fh-ps__tocm[open] summary::after { transform: rotate(180deg); }

/* ---- article body ---- */
.fh-ps__body { max-width: 720px; font-size: 16px; line-height: 1.75; color: #2A3040; }
.fh-ps__body > p { margin: 0 0 18px; }
.fh-ps__body a { color: #2563EB; }
.fh-ps__body h2 { margin: 34px 0 14px; font-size: clamp(20px, 2vw, 25px); font-weight: 800; line-height: 1.3; color: var(--fh-ink); }
.fh-ps__body h3 { margin: 26px 0 10px; font-size: 18px; font-weight: 700; color: var(--fh-ink); }
.fh-ps__body ul, .fh-ps__body ol { margin: 0 0 18px; padding-left: 24px; }
.fh-ps__body li { margin: 7px 0; }
.fh-ps__body li::marker { color: #2563EB; }
.fh-ps__body img { max-width: 100%; height: auto; border-radius: 12px; margin: 6px 0 10px; }
.fh-ps__body figcaption { font-size: 12.5px; color: var(--fh-muted); }
.fh-ps__body blockquote {
  margin: 22px 0; padding: 14px 18px;
  background: #EFF4FF; border: 1px solid #D6E2FB; border-radius: 10px;
  font-size: 15px; color: #23406E;
}
.fh-ps__body blockquote p { margin: 0; }

/* numbered section markers */
.fh-ps__body--numbered { counter-reset: fhsec; }
.fh-ps__body--numbered > h2 { counter-increment: fhsec; display: flex; align-items: baseline; gap: 12px; }
.fh-ps__body--numbered > h2::before {
  content: counter(fhsec);
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  display: inline-grid; place-items: center; align-self: center;
  background: #2563EB; color: #fff; font-size: 15px; font-weight: 800;
}

/* ---- mid-article CTA ---- */
.fh-ps__cta {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 20px; align-items: center;
  margin: 34px 0; padding: clamp(22px, 2.6vw, 34px);
  border-radius: 16px; color: #fff;
  background:
    radial-gradient(60% 100% at 85% 30%, rgba(37, 99, 235, .3), transparent 60%),
    linear-gradient(120deg, #060D1F, #0B1443 70%, #060D1F);
}
.fh-ps__ctaeyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6D9BFF; }
.fh-ps__ctahead { margin: 10px 0 10px; font-size: clamp(19px, 2vw, 25px); font-weight: 800; line-height: 1.25; color: #fff; }
.fh-ps__cta p { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: #B8C2DC; }
.fh-ps__ctabtns { display: flex; gap: 12px; flex-wrap: wrap; }
.fh-ps__ctashop, .fh-ps__ctawa {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 10px;
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.fh-ps__ctashop { background: #2563EB; color: #fff !important; }
.fh-ps__ctashop:hover { background: #1D4ED8; }
.fh-ps__ctawa { border: 1.5px solid rgba(255, 255, 255, .35); color: #fff !important; }
.fh-ps__ctawa:hover { border-color: #22C55E; color: #22C55E !important; }
.fh-ps__ctashop svg, .fh-ps__ctawa svg { width: 16px; height: 16px; }
.fh-ps__ctavis img { width: 100%; height: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }

/* ---- feedback ---- */
.fh-ps__fb { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 30px 0 0; padding: 16px 0; border-top: 1px solid var(--fh-border); }
.fh-ps__fbq { font-size: 14px; font-weight: 700; color: var(--fh-ink); }
.fh-ps__fbbtns { display: flex; gap: 8px; }
.fh-ps__fbbtns button {
  min-width: 62px; height: 36px; padding: 0 16px;
  border: 1px solid var(--fh-border); border-radius: 999px;
  background: #fff; color: var(--fh-ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.fh-ps__fbbtns button:hover { border-color: var(--fh-navy); color: var(--fh-navy); }
.fh-ps__fbdone { display: none; font-size: 13.5px; color: var(--fh-green-deep); font-weight: 600; }
.fh-ps__fb.is-voted .fh-ps__fbbtns { display: none; }
.fh-ps__fb.is-voted .fh-ps__fbdone { display: inline; }

/* ---- prev / next ---- */
.fh-ps__pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--fh-border); }
.fh-ps__pnitem { text-decoration: none; min-width: 0; }
.fh-ps__pnitem--next { text-align: right; }
.fh-ps__pnlabel { display: block; font-size: 12.5px; font-weight: 700; color: #2563EB; margin-bottom: 8px; }
.fh-ps__pnrow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fh-ps__pnitem--next .fh-ps__pnrow { flex-direction: row-reverse; }
.fh-ps__pnrow img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.fh-ps__pntitle {
  font-size: 13.5px; font-weight: 700; line-height: 1.4; color: var(--fh-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fh-ps__pnitem:hover .fh-ps__pntitle { color: #2563EB; }

/* ---- sidebar ---- */
.fh-ps__side { display: flex; flex-direction: column; gap: 18px; }
.fh-ps__siderest { display: flex; flex-direction: column; gap: 18px; }
/* the TOC gets its own flexible lane BELOW the cards: sticky travel is
   bounded by this wrapper, so it can never slide over the other cards
   (user-reported overlap) */
.fh-ps__tocwrap { flex: 1 1 auto; min-height: 0; }
.fh-ps__card { background: #fff; border: 1px solid var(--fh-border); border-radius: 14px; padding: 20px; }
.fh-ps__card > h2 { margin: 0 0 12px; font-size: 16px; font-weight: 800; color: var(--fh-ink); }
.fh-ps__toc { position: sticky; top: calc(var(--fh-header-offset, 114px) + 12px); max-height: calc(100vh - var(--fh-header-offset, 114px) - 34px); overflow: auto; }
.fh-ps__toclist { list-style: none; margin: 0; padding: 0; counter-reset: fhtoc; }
.fh-ps__toclist li { counter-increment: fhtoc; border-left: 2px solid transparent; }
.fh-ps__toclist a {
  display: flex; gap: 9px; padding: 7px 0 7px 10px;
  font-size: 13px; line-height: 1.45; color: var(--fh-muted); text-decoration: none;
}
.fh-ps__toclist a::before { content: counter(fhtoc) '.'; color: #9AA5BF; font-weight: 700; }
.fh-ps__toclist a:hover { color: #2563EB; }

.fh-ps__trend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.fh-ps__trend a { display: flex; gap: 11px; align-items: center; text-decoration: none; }
.fh-ps__trendthumb { position: relative; flex: none; width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--fh-surface); }
.fh-ps__trendthumb img { width: 100%; height: 100%; object-fit: cover; }
.fh-ps__trendnum { position: absolute; top: 0; left: 0; min-width: 21px; height: 21px; display: grid; place-items: center; background: #2563EB; color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 10px 3px 10px 3px; }
.fh-ps__trendtitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--fh-ink); }
.fh-ps__trend a:hover .fh-ps__trendtitle { color: #2563EB; }
.fh-ps__trendmeta { display: block; margin-top: 3px; font-size: 11.5px; color: var(--fh-muted); }

.fh-ps__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fh-ps__chip {
  display: inline-flex; min-height: 30px; align-items: center; padding: 0 12px;
  border: 1px solid var(--fh-border); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--fh-ink); text-decoration: none; background: #fff;
}
.fh-ps__chip:hover { border-color: #2563EB; color: #2563EB; }

.fh-ps__newscard { background: linear-gradient(150deg, #0A1024, #101B46); border: 0; color: #fff; text-align: center; }
.fh-ps__newsico { width: 54px; height: 54px; margin: 4px auto 10px; border-radius: 50%; display: grid; place-items: center; background: #2563EB; color: #fff; }
.fh-ps__newsico svg { width: 24px; height: 24px; }
.fh-ps__newscard h2 { color: #fff; margin-bottom: 6px; }
.fh-ps__newscard > p { margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: #B8C2DC; }
.fh-ps__newscard input[type="email"] { width: 100%; height: 44px; border: 0; border-radius: 9px; padding: 0 14px; font-size: 13.5px; color: var(--fh-ink); }
.fh-ps__newscard button[type="submit"] { width: 100%; height: 44px; margin-top: 9px; border: 0; border-radius: 9px; background: #2563EB; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.fh-ps__newscard button[type="submit"]:hover:not(:disabled) { background: #1D4ED8; }
.fh-ps__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fh-ps__newsnote { margin: 9px 0 0; font-size: 11.5px; color: #8FA0C7; }
.fh-ps__newsnote.is-ok { color: #4ADE80; }
.fh-ps__newsnote.is-err { color: #F87171; }

/* ---- related ---- */
.fh-ps__rel { margin-top: 44px; }
.fh-ps__rel > h2 { margin: 0 0 18px; font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; color: var(--fh-ink); padding-bottom: 10px; position: relative; }
.fh-ps__rel > h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px; border-radius: 2px; background: #2563EB; }
.fh-ps__relgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.fh-ps__relcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--fh-border); border-radius: 12px; overflow: hidden; text-decoration: none; }
.fh-ps__relmedia img { width: 100%; height: 150px; object-fit: cover; display: block; }
.fh-ps__relbody { padding: 13px 15px 15px; }
.fh-ps__relcat { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #2563EB; margin-bottom: 5px; }
.fh-ps__reltitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; font-weight: 700; line-height: 1.4; color: var(--fh-ink); }
.fh-ps__relcard:hover .fh-ps__reltitle { color: #2563EB; }
.fh-ps__relmeta { display: block; margin-top: 7px; font-size: 12px; color: var(--fh-muted); }
.fh-ps__relall { margin: 16px 0 0; }
.fh-ps__relall a { font-size: 14px; font-weight: 700; color: #2563EB; text-decoration: none; }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .fh-ps__grid { grid-template-columns: minmax(0, 1fr); }
  .fh-ps__toc { display: none; }
  .fh-ps__tocm { display: block; }
  .fh-ps__body { max-width: none; }
}
@media (max-width: 768px) {
  .fh-ps__relgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fh-ps__cta { grid-template-columns: 1fr; }
  .fh-ps__ctavis { order: 2; }
  .fh-ps__ctavis img { max-width: 320px; margin-inline: auto; display: block; }
}
@media (max-width: 600px) {
  .fh-ps__relgrid { grid-template-columns: 1fr; }
  .fh-ps__pn { grid-template-columns: 1fr; }
  .fh-ps__pnitem--next { text-align: left; }
  .fh-ps__pnitem--next .fh-ps__pnrow { flex-direction: row; }
  .fh-ps__crumb { flex-wrap: wrap; }
  .fh-ps__hero img { max-height: 300px; }
  .fh-ps__body { font-size: 15.5px; }
}