/* ==========================================================================
   Blog article
   Loaded only by blog_post.php, via the $fm_extra_css hook in the header.

   Written against the live green theme.css tokens directly. The previous
   version was a violet-theme file kept alive by a compatibility shim that
   aliased --violet* / --ink-* / --soft onto the green palette; that shim is
   gone and the names below are the real ones.
   ========================================================================== */

.art {
  --art-rail: 244px;
  /* An explicit measure, not a ch value: Plus Jakarta Sans has a wide "0", so
     70ch resolved to 861px here — about 108 characters a line, far past the
     60–75 that reads comfortably. 38rem lands at roughly 76. */
  --art-measure: 38rem;
}

/* The layout sits inside Bootstrap's .container (the site's own container —
   .wrap belonged to the retired theme and is no longer loaded, which is why
   this page previously ran flush to the viewport edge). A reading page wants a
   narrower column and a wider gutter than Bootstrap's 1320px/12px default, and
   capping it here keeps the hero, cover, article and closing band all aligned
   on the same left edge. */
.art .container,
.post-related .container {
  max-width: 1160px;
  padding-inline: clamp(1.15rem, 4vw, 3rem);
}

/* ---- reading progress --------------------------------------------------- */

/* Above .hdr (z-index 1030) so it stays visible once the header goes glassy. */
.art-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 1040;
  background: transparent;
  pointer-events: none;
}

.art-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--lime);
  border-radius: 0 3px 3px 0;
  transition: width .1s linear;
}

@media (prefers-reduced-motion: reduce) {
  .art-progress span { transition: none; }
}

/* ---- hero --------------------------------------------------------------- */

/* Full-bleed tinted band. The cover image below straddles its bottom edge. */
.art-hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(4rem, 9vw, 6.5rem);
}

.art-hero .ih-crumbs { margin-bottom: clamp(1.4rem, 2.6vw, 1.9rem); }

.art-hero .ih-crumbs i { font-size: .6rem; color: var(--muted); }

/* The current page is the full article title; keep it from dominating the row. */
.art-hero .ih-crumbs span[aria-current] {
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 500;
}

.art-tag {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .36rem .85rem .36rem .7rem;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--acc-line);
  color: var(--acc);
  font-family: var(--font-h);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.art-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acc);
}

/* A headline is display type, not body copy, so it takes the full container.
   style.css sets text-wrap: balance on all h1–h4; that evens the line lengths
   and keeps it reading as capped without a max-width. */
/* Sized so a typical article title fits on one line at desktop width; longer
   ones wrap to two balanced lines (theme.css sets text-wrap: balance on h1). */
.art-hero h1 {
  /* No measure cap: a headline is display type, and the container already
     bounds it. text-wrap: balance splits the genuinely long titles evenly
     instead of leaving a short second line. */
  max-width: none;
  margin: clamp(1rem, 2vw, 1.4rem) 0 0;
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  line-height: 1.12;
  letter-spacing: -.028em;
}

.art-lead {
  max-width: 58ch;
  margin: clamp(1rem, 2vw, 1.4rem) 0 0;
  font-size: clamp(1.06rem, 1.75vw, 1.28rem);
  line-height: 1.62;
  color: var(--body);
}

/* meta row */
.art-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem 1rem;
  margin-top: clamp(1.6rem, 3vw, 2.25rem);
  padding-top: clamp(1.4rem, 2.5vw, 1.8rem);
  border-top: 1px solid var(--line);
}

.art-who { display: flex; align-items: center; gap: .65rem; }

.art-who img {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

/* Fallback monogram when the author has no photo. */
.art-who .art-mono {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--navy);
  color: var(--lime);
  font-family: var(--font-h);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.art-who b {
  font-family: var(--font-h);
  font-size: .93rem;
  font-weight: 600;
  color: var(--ink);
}

.art-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .7rem;
  font-size: .86rem;
  color: var(--muted);
}

.art-facts i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .6;
}

/* ---- cover ------------------------------------------------------------- */

.art-cover { margin: clamp(-3.25rem, -7vw, -5.25rem) 0 0; }

.art-cover .art-cover-in {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: var(--sh-md);
}

/* width/height are always set on the img, so the space is reserved before the
   file arrives and nothing below jumps. */
.art-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

/* ---- layout ------------------------------------------------------------ */

.art-body { padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1rem, 2vw, 2rem); }

.art-grid { display: grid; gap: clamp(2rem, 4vw, 3rem); }

@media (min-width: 1060px) {
  .art-grid {
    grid-template-columns: var(--art-rail) minmax(0, 1fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: start;
  }
}

.art-main { min-width: 0; }

/* The prose is capped for readability; tables, callouts and the FAQ opt out
   below so comparison data gets the room it needs. */
.art-main > p,
.art-main > h2,
.art-main > h3,
.art-main > ul,
.art-main > ol,
.art-main > blockquote { max-width: var(--art-measure); }

/* ---- prose ------------------------------------------------------------- */

.art-main > * + * { margin-top: 1.2rem; }

.art-main p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--body);
}

/* Opening paragraph reads as a lead-in. */
.art-main > p:first-child {
  font-size: 1.16rem;
  line-height: 1.68;
  color: var(--ink);
}

.art-main h2 {
  margin-top: clamp(2.6rem, 5vw, 3.4rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-2);
  font-size: clamp(1.45rem, 2.7vw, 1.95rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  scroll-margin-top: calc(var(--hdr-h) + 28px);
}

/* The FAQ block brings its own h2; it is styled as part of that card. */
.art-main > section.post-faq { margin-top: clamp(2.75rem, 5vw, 3.5rem); }

.art-main h3 {
  margin-top: 2rem;
  font-size: clamp(1.14rem, 1.9vw, 1.32rem);
  line-height: 1.32;
  letter-spacing: -.01em;
  scroll-margin-top: calc(var(--hdr-h) + 28px);
}

.art-main ul,
.art-main ol { display: grid; gap: .65rem; padding-left: 0; }

.art-main ul { list-style: none; }

.art-main ul li {
  position: relative;
  padding-left: 1.65rem;
  color: var(--body);
  line-height: 1.68;
}

.art-main ul li::before {
  content: "";
  position: absolute;
  left: .25rem;
  top: .66em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--acc);
}

.art-main ol {
  counter-reset: art-ol;
  padding-left: 0;
  list-style: none;
}

.art-main ol li {
  position: relative;
  counter-increment: art-ol;
  padding-left: 2.35rem;
  color: var(--body);
  line-height: 1.68;
}

.art-main ol li::before {
  content: counter(art-ol);
  position: absolute;
  left: 0;
  top: .1em;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--acc-soft);
  color: var(--acc);
  font-family: var(--font-h);
  font-size: .8rem;
  font-weight: 600;
}

.art-main a:not(.btn) {
  color: var(--acc);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--acc-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color .2s, color .2s;
}

.art-main a:not(.btn):hover {
  color: var(--navy);
  text-decoration-color: var(--acc);
}

.art-main strong { color: var(--ink); font-weight: 600; }

.art-main blockquote {
  margin: clamp(1.75rem, 3vw, 2.25rem) 0;
  padding: 0 0 0 1.5rem;
  border-left: 3px solid var(--lime);
  font-family: var(--font-h);
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  line-height: 1.5;
  letter-spacing: -.015em;
  color: var(--ink);
}

.art-main blockquote p { font: inherit; color: inherit; }
.art-main blockquote > *:first-child { margin-top: 0; }

/* ---- callout ----------------------------------------------------------- */

.post-note {
  max-width: var(--art-measure);
  margin: clamp(1.9rem, 3.5vw, 2.5rem) 0;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--acc-line);
  border-left: 3px solid var(--acc);
  border-radius: 4px var(--r-md) var(--r-md) 4px;
  background: var(--acc-soft);
}

.post-note b {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
  font-family: var(--font-h);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--acc);
}

.post-note b::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--acc);
  border-top-color: transparent;
}

.post-note p {
  margin: 0;
  font-size: .98rem;
  line-height: 1.68;
  color: var(--navy);
}

/* ---- tables ------------------------------------------------------------ */

/* Comparison tables are the point of several of these articles, so they break
   out past the prose measure and scroll on their own rather than widening the
   page. */
.post-table {
  margin: clamp(1.9rem, 3.5vw, 2.5rem) 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  box-shadow: var(--sh-xs);
}

/* A right-edge fade tells the reader there is more to scroll to; the class is
   added by article.js only when the table actually overflows. */
.post-table.is-scrollable { position: relative; }

.post-table table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: .94rem;
}

.post-table th,
.post-table td {
  padding: .85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-2);
}

.post-table thead th {
  position: sticky;
  top: 0;
  background: var(--navy);
  border-bottom: 0;
  color: var(--white);
  font-family: var(--font-h);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.post-table thead th:first-child { border-radius: var(--r-md) 0 0 0; }
.post-table thead th:last-child  { border-radius: 0 var(--r-md) 0 0; }

.post-table tbody tr:nth-child(even) { background: var(--paper); }

/* First column carries the label — give it the weight. */
.post-table tbody td:first-child {
  color: var(--ink);
  font-weight: 500;
  min-width: 8rem;
}

.post-table td { color: var(--body); line-height: 1.6; }
.post-table tbody tr:last-child td { border-bottom: 0; }

/* ---- FAQ --------------------------------------------------------------- */

.post-faq {
  display: grid;
  gap: .6rem;
  margin-top: 1.4rem;
}

.post-faq .fq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}

.post-faq .fq-item:hover { border-color: var(--acc-line); }

.post-faq .fq-item[open] {
  border-color: var(--acc-line);
  background: var(--paper);
  box-shadow: var(--sh-xs);
}

.post-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.2rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::marker { content: ""; }

/* The chevron is drawn here rather than marked up, so the stored article
   bodies stay plain HTML. */
.post-faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: .2rem;
  border-right: 2px solid var(--acc);
  border-bottom: 2px solid var(--acc);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}

.post-faq .fq-item[open] summary::after { transform: rotate(-135deg) translateY(-2px); }

.post-faq .faq-a { padding: 0 1.2rem 1.15rem; }

.post-faq .faq-a,
.post-faq .faq-a p {
  margin: 0;
  font-size: .97rem;
  line-height: 1.7;
  color: var(--body);
}

/* ---- mobile contents --------------------------------------------------- */

.art-toc-m {
  margin: 0 0 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
}

@media (min-width: 1060px) { .art-toc-m { display: none; } }

.art-toc-m summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .95rem 1.1rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-h);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--acc);
}

.art-toc-m summary::-webkit-details-marker { display: none; }
.art-toc-m summary::marker { content: ""; }

.art-toc-m summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--acc);
  border-bottom: 2px solid var(--acc);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .25s;
}

.art-toc-m[open] summary::after { transform: rotate(-135deg) translateY(-2px); }

.art-toc-m ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 1.1rem 1rem;
  list-style: none;
  counter-reset: none;
}

.art-toc-m ol li { padding: 0; counter-increment: none; }
.art-toc-m ol li::before { display: none; }

.art-toc-m ol a {
  display: block;
  padding: .45rem 0;
  font-size: .93rem;
  line-height: 1.45;
  color: var(--body);
  text-decoration: none;
}

/* ---- rail -------------------------------------------------------------- */

.art-rail { display: grid; gap: 1rem; }

@media (max-width: 1059px) { .art-rail { display: none; } }

@media (min-width: 1060px) {
  .art-rail {
    position: sticky;
    top: calc(var(--hdr-h) + 24px);
  }

  /* Only the contents list scrolls. Making the whole rail scrollable pushed
     the share row and the CTA card out of view on a long article, which is
     exactly the part a reader needs to reach. */
  .art-toc ul {
    max-height: 44vh;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
  }
}

.rail-h {
  margin: 0 0 .85rem;
  font-family: var(--font-h);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.art-toc ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }

.art-toc a {
  display: block;
  padding: .42rem 0 .42rem .85rem;
  border-left: 2px solid var(--line);
  font-size: .88rem;
  line-height: 1.45;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s, border-color .2s;
}

.art-toc a:hover { color: var(--ink); border-left-color: var(--acc-line); }

.art-toc a.is-current {
  color: var(--acc);
  border-left-color: var(--acc);
  font-weight: 600;
}

/* share */
.art-share { display: grid; gap: .6rem; }

.art-share-row { display: flex; flex-wrap: wrap; gap: .45rem; }

.share-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}

.share-btn:hover {
  border-color: var(--acc);
  background: var(--acc-soft);
  color: var(--acc);
}

.share-btn svg { width: 16px; height: 16px; fill: currentColor; }

.share-btn.is-done {
  border-color: var(--acc);
  background: var(--acc);
  color: var(--white);
}

/* CTA card */
.rail-cta {
  padding: 1.35rem 1.3rem;
  border-radius: var(--r-md);
  background: var(--navy);
  color: var(--white);
}

.rail-cta .rail-h { color: rgba(255, 255, 255, .5); }

.rail-cta b {
  display: block;
  margin-bottom: .5rem;
  font-family: var(--font-h);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.rail-cta p {
  margin: 0 0 1.05rem;
  font-size: .9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .72);
}

.rail-cta .btn { width: 100%; justify-content: center; }

/* ---- author + end share ------------------------------------------------ */

.art-end {
  max-width: var(--art-measure);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(1.75rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line);
}

.art-author {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  align-items: flex-start;
}

.art-author img,
.art-author .art-mono {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.art-author .art-mono {
  display: grid;
  place-items: center;
  background: var(--navy);
  color: var(--lime);
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 600;
}

.art-author .who { flex: 1 1 15rem; min-width: 0; }

.art-author b {
  display: block;
  margin-bottom: .3rem;
  font-family: var(--font-h);
  font-size: .98rem;
  font-weight: 600;
  color: var(--ink);
}

.art-author p {
  margin: 0;
  font-size: .93rem;
  line-height: 1.68;
  color: var(--body);
}

.art-end-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem 1rem;
  margin-top: 1.75rem;
}

.art-end-share span {
  font-family: var(--font-h);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- ad slot ----------------------------------------------------------- */

.post-ad {
  display: block;
  max-width: var(--art-measure);
  margin: clamp(2rem, 4vw, 2.75rem) 0 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
}

/* ---- related ----------------------------------------------------------- */

.post-related {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.post-related .rel-grid {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px)  { .post-related .rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .post-related .rel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.rel-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--white);
  text-decoration: none;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s, border-color .3s;
}

.rel-card:hover {
  transform: translateY(-4px);
  border-color: var(--acc-line);
  box-shadow: var(--sh-md);
}

.rel-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.rel-card .rel-in { padding: 1.2rem 1.25rem 1.4rem; }

.rel-card .rel-cat {
  font-family: var(--font-h);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--acc);
}

.rel-card h3 {
  margin: .5rem 0 .55rem;
  font-size: 1.05rem;
  line-height: 1.32;
  letter-spacing: -.01em;
  color: var(--ink);
}

.rel-card p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--muted);
  /* Standfirsts vary in length; clamp so the cards stay level. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- print ------------------------------------------------------------- */

@media print {
  .art-progress, .art-rail, .art-toc-m, .post-related,
  .art-cover, .art-cta, .post-ad, .art-end-share { display: none !important; }
  .art-main, .art-main > * { max-width: none; }
  .art-hero { background: none; padding-bottom: 1rem; }
  .post-faq .fq-item { break-inside: avoid; }
  .post-faq .faq-a { display: block !important; }
}
