/* ============================================================================
   PinTrax articles - layered on top of styles.css, loaded on /articles/ and
   /calculator/ pages.

   The b- class prefix (bcard, bfeature, bprose, bpost) is historical, from when
   this lived at /blog/. Kept deliberately: renaming ~40 selectors across this
   file and the generator templates is churn with a cosmetic payoff and a real
   chance of missing one. The path and the nav label are what users see.

   Inherits everything from the landing page: the :root tokens, the "Avenir Next"
   system stack, .shell, .section, .aurora-bg, the fixed header and the footer.
   Adds only what the three blog layouts need. Per DESIGN.md there is no second
   type family and no second gradient family - the signature --aurora carries the
   hero band, exactly as it carries the landing hero, privacy and CTA panels.
   ========================================================================== */

/* Active nav item. The landing page nav is anchor-based, so nothing there is
   ever "current"; on the blog, Blog is. */
.primary-nav > a.is-active { color: var(--teal); }
.site-header:not(.scrolled) .primary-nav > a.is-active { color: #7fe0d6; }
@media (min-width: 901px) {
  .primary-nav > a.is-active { position: relative; }
  .primary-nav > a.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 2px;
    border-radius: 2px;
    background: var(--aurora);
  }
}

/* Post pages have no dark hero behind the fixed header, so it has to start in
   the solid state. script.js only adds .scrolled past a threshold measured from
   #top, and a post page has no #top - without this the white-on-light nav from
   the landing page's over-the-hero treatment is illegible. These selectors match
   the specificity of the rules they override and win on load order (blog.css is
   linked after styles.css). */
.bpost-page .site-header {
  background: rgba(244,247,249,.9);
  border-bottom-color: rgba(203,220,229,.8);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(10,53,80,.05);
}
.bpost-page .site-header .brand img { filter: none; }
.bpost-page .site-header .menu-toggle { border-color: var(--border); background: rgba(255,255,255,.8); }
.bpost-page .site-header .menu-toggle span:not(.sr-only) { background: var(--ink); }
@media (min-width: 901px) {
  /* :not(.nav-cta) matters - the CTA keeps its white-on-gradient treatment, and
     this selector is specific enough to override it otherwise. */
  .bpost-page .site-header .primary-nav > a:not(.nav-cta) { color: #3d5d70; }
  .bpost-page .site-header .primary-nav > a:not(.nav-cta):hover { color: var(--teal); }
  .bpost-page .site-header .primary-nav > a.is-active { color: var(--teal); }
}

/* ---- Blog index hero ------------------------------------------------------
   The signature gradient over a faint molecular lattice. The lattice is three
   repeating-linear-gradients at 60-degree offsets, which is a triangular mesh -
   the same motif that sits behind the body map in the app. Pure CSS, so there
   is nothing to fetch. */
.blog-hero {
  position: relative;
  overflow: hidden;
  padding: 150px 0 92px;
  text-align: center;
}
.blog-hero::before { opacity: 1; }
.blog-hero-lattice {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .30;
  background-image:
    repeating-linear-gradient(60deg, rgba(126,224,214,.55) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(-60deg, rgba(126,224,214,.55) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(126,224,214,.40) 0 1px, transparent 1px 40px);
  mask-image: radial-gradient(70% 78% at 50% 42%, #000 30%, transparent 100%);
}
.blog-hero-inner { position: relative; z-index: 1; }
/* The kicker is inline-block in styles.css; with an inline-block h1 beside it
   the two would share a line. */
.blog-hero .section-kicker { display: block; }
/* As a link (the guides' "Guides" label) it keeps its own line but shrinks to
   its text, so the tappable area is the word and not the whole row. */
.blog-hero a.section-kicker { display: table; text-decoration: none; }
.blog-hero a.section-kicker:hover, .blog-hero a.section-kicker:focus-visible { text-decoration: underline; }
.blog-hero h1 {
  margin: 0;
  /* inline-block so the clipped gradient box hugs the word. As a full-width
     block the sweep spans the shell and a short word lands entirely in the
     violet middle stop, losing the teal and emerald ends. */
  display: inline-block;
  font-size: clamp(58px, 9vw, 104px);
  line-height: .95;
  letter-spacing: -.06em;
  font-weight: 800;
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.blog-hero p {
  max-width: 620px;
  margin: 22px auto 0;
  color: var(--on-ink);
  font-size: 17px;
  line-height: 1.65;
}

/* Sections sit closer together than the landing page's 112px rhythm; a list of
   posts reads better dense than airy. */
.blog-featured-section { padding: 74px 0 0; }
.blog-grid-section,
.blog-related-section { padding: 62px 0 104px; }

.bsection-title {
  margin: 0 0 30px;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -.045em;
  font-weight: 800;
}

/* ---- Featured card (most recent post) ------------------------------------ */
.bfeature {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.bfeature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.bfeature-link {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  text-decoration: none;
  color: inherit;
}
.bfeature-media { display: block; background: var(--night); }
/* contain, not cover: every hero here carries text - the generated placeholders
   set the title into the artwork and the real ones are infographics. The grid
   stretches this column to the text column's height, which is narrower than
   1.91:1, so cover was slicing the first characters off each line. The night
   ground fills the letterbox. */
.bfeature-media { display: flex; align-items: center; justify-content: center; }
.bfeature-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bfeature-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 44px 46px;
}
.bfeature-body .section-kicker { margin-bottom: 12px; }
.bfeature-title {
  display: block;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -.045em;
  font-weight: 800;
}
.bfeature-excerpt {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.bfeature-foot { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 26px; }
.bfeature-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--teal);
  font-size: 15px;
  font-weight: 800;
}
.bfeature:hover .bfeature-read span { transform: translateX(3px); }
.bfeature-read span { transition: transform .2s ease; }

/* ---- Shared card (post grid + related posts) ----------------------------- */
.bgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.bcard {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.bcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.bcard-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.bcard-media { display: block; background: var(--night); }
.bcard-media img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.bcard-body { display: block; flex: 1; padding: 24px 24px 18px; }
.bcard-title {
  display: block;
  font-size: 21px;
  line-height: 1.24;
  letter-spacing: -.035em;
  font-weight: 800;
}
.bcard-excerpt {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}
.bcard-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
}
.bcard-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5b7181;
  font-size: 13px;
  font-weight: 700;
}
.bcard-meta .bc-ico { flex: none; color: var(--teal); }

/* ---- Post page ----------------------------------------------------------- */
.bpost-head { padding: 128px 0 34px; }
.bpost-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}
.bpost-back:hover { color: var(--navy); }
.bpost-headrow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}
.bpost-headmain { min-width: 0; }
.bpost-headmain h1 {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.03;
  letter-spacing: -.055em;
  font-weight: 800;
}
.bpost-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; }

.bshare { display: flex; align-items: center; gap: 9px; flex: none; padding-top: 10px; }
.bshare-label {
  color: #5b7181;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.bshare-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.8);
  color: var(--ink);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.bshare-btn:hover { color: #fff; border-color: transparent; background: var(--aurora-cta); }
.bshare-copied {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* Full-bleed hero. This sits outside .shell as a direct child of .bpost, which
   is already full width - so plain block flow is the whole trick. Deliberately
   not 100vw + negative margin: 100vw counts the scrollbar and pushes the page
   ~8px wider than its own content box. */
.bpost-hero {
  margin-bottom: 56px;
  background: var(--night);
}
.bpost-hero img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

/* Reading measure. Deliberately narrower than .shell. */
.bprose {
  max-width: 720px;
  margin-inline: auto;
  padding-bottom: 96px;
  color: #26445a;
  font-size: 17.5px;
  line-height: 1.78;
}
.bprose > * + * { margin-top: 26px; }
.bprose h2 {
  margin-top: 52px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -.04em;
  font-weight: 800;
  color: var(--ink);
}
.bprose h3 {
  margin-top: 42px;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -.03em;
  font-weight: 800;
  color: var(--ink);
}
.bprose p { margin-bottom: 0; }
.bprose strong { color: var(--ink); font-weight: 800; }
.bprose a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.bprose a:hover { color: var(--navy); }
.bprose ul, .bprose ol { margin-top: 22px; padding-left: 22px; }
.bprose li { margin-top: 10px; }
.bprose li::marker { color: var(--teal); }
.bprose blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--teal-bright);
  color: var(--muted);
  font-style: italic;
}
.bprose code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: .9em;
}
.bprose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}
.bprose pre code { padding: 0; border: 0; background: none; }
.bprose img { border-radius: 16px; }
.bprose hr { margin-top: 44px; border: 0; border-top: 1px solid var(--border); }

.blog-related-section { border-top: 1px solid var(--border); padding-top: 66px; }

/* ---- Responsive ----------------------------------------------------------
   Matching the landing page's breakpoints: 1100 / 900 / 680. */
@media (max-width: 1100px) {
  .bgrid { grid-template-columns: repeat(2, 1fr); }
  .bfeature-body { padding: 36px 34px; }
}

@media (max-width: 900px) {
  .blog-hero { padding: 122px 0 72px; }
  .bfeature-link { grid-template-columns: 1fr; }
  .bfeature-media img { max-height: 340px; }
  .bpost-head { padding-top: 104px; }
  .bpost-headrow { flex-direction: column; gap: 26px; }
  .bpost-headmain h1 { max-width: none; }
  .bshare { padding-top: 0; }
  .bpost-hero { margin-bottom: 42px; }
  .bpost-hero img { max-height: 360px; }
}

@media (max-width: 680px) {
  .bgrid { grid-template-columns: 1fr; }
  .blog-featured-section { padding-top: 54px; }
  .blog-grid-section, .blog-related-section { padding-bottom: 76px; }
  .bfeature-body { padding: 28px 24px; }
  .bprose { font-size: 16.5px; }
  .bpost-hero img { max-height: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  .bcard, .bfeature, .bfeature-read span { transition: none; }
  .bcard:hover, .bfeature:hover { transform: none; }
}

/* ---- Article byline / publisher block ------------------------------------
   Names PinTrax as publisher and carries the visible "last updated" date that
   the Article schema's dateModified mirrors. No personal name, ever. */
.bbyline {
  margin-top: 54px;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.7);
}
.bbyline > * + * { margin-top: 10px; }
.bbyline-pub { color: var(--ink); font-size: 15px; font-weight: 600; }
.bbyline-dates { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.bbyline-dates span { color: #5b7181; font-size: 13px; font-weight: 700; }
.bbyline-note { color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ---- FAQ + comparison list (real HTML, mirrored in schema) --------------- */
.bfaq, .bcompare { margin-top: 54px; }
.bfaq h3 { margin-top: 30px; font-size: 19px; }
.bfaq h3 + p { margin-top: 10px; }
.bcompare ol { margin-top: 16px; }

/* ---- Calculator ---------------------------------------------------------- */
.calc-section { padding: 62px 0 0; }
.calc-privacy {
  max-width: 760px;
  margin: 0 auto 30px;
  padding: 15px 20px;
  border: 1px solid rgba(11,126,139,.22);
  border-radius: 14px;
  background: #eaf7f7;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
  text-align: center;
}
.calc-tool {
  max-width: 760px;
  margin-inline: auto;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-soft);
}
.calc-modes { display: flex; gap: 8px; margin-bottom: 24px; }
.calc-mode {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.calc-mode.is-on { border-color: transparent; background: var(--aurora-cta); color: #fff; }
.calc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.calc-field { display: flex; flex-direction: column; gap: 7px; }
.calc-field label { color: var(--muted); font-size: 13px; font-weight: 700; }
.calc-inline { display: flex; gap: 8px; align-items: center; }
.calc-inline input { flex: 1; min-width: 0; }
.calc-field input, .calc-field select, .calc-blend-row input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}
.calc-sub { margin: 26px 0 6px; font-size: 17px; font-weight: 800; }
.calc-note { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.calc-blend-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.calc-blend-row label { display: inline-flex; align-items: center; gap: 6px; }
.calc-add {
  min-height: 40px;
  margin-top: 12px;
  padding: 0 15px;
  border: 1px dashed var(--border-strong);
  border-radius: 11px;
  background: none;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}
.calc-reverse-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.calc-reverse-row label { display: inline-flex; align-items: center; gap: 8px; }
.calc-out {
  display: block;
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--night);
  color: #dff3f4;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.calc-noscript {
  max-width: 760px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.calc-explainer { padding-top: 62px; }

@media (max-width: 680px) {
  .calc-tool { padding: 22px 18px; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-blend-row { flex-direction: column; align-items: stretch; }
}

/* ---- Medical disclaimer --------------------------------------------------
   One shared constant in the generator renders into this block on every article
   and the calculator. Visually distinct from the byline above it: warmer ground
   and a heavier rule, so it reads as a legal notice rather than more body copy.
   Launch draft wording, pending the same legal pass as the ToS. */
.bdisclaimer {
  margin-top: 20px;
  padding: 22px 26px;
  border: 1px solid #e6d9bd;
  border-radius: 20px;
  background: #fdf8ed;
}
.bdisclaimer-label {
  margin-bottom: 8px;
  color: #7a5f21;
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.bdisclaimer p:last-child {
  color: #5d4d2c;
  font-size: 13.5px;
  line-height: 1.68;
}

/* ---- In-body cluster reading list ---------------------------------------
   Distinct from the related-article cards at the foot of the page: this one is
   editorial, sits inside the prose column, and is driven by the cluster field. */
.bcluster {
  margin-top: 48px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-soft);
}
.bcluster h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.02em; }
.bcluster ul { margin-top: 12px; padding-left: 20px; }
.bcluster li { margin-top: 8px; }
.bcluster a { color: var(--teal); font-weight: 600; }

@media (max-width: 680px) {
  .bdisclaimer, .bcluster { padding: 18px 20px; }
}

/* ---- Articles index empty state -----------------------------------------
   Shown when every article is drafted. The URL stays valid and crawlable so
   the index does not 404 while the writer's pieces are still unpublished. */
.bempty {
  max-width: 620px;
  margin-inline: auto;
  padding: 44px 40px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.7);
  text-align: center;
}
.bempty h2 { margin: 0 0 14px; font-size: 28px; letter-spacing: -.035em; }
.bempty p { color: var(--muted); font-size: 16px; line-height: 1.7; }
.bempty p + p { margin-top: 22px; }
.bempty-cta { color: var(--teal); font-weight: 800; text-decoration: none; }
.bempty-cta:hover { color: var(--navy); }

/* ---- 30 Sep 2026: tables ------------------------------------------------------------------
   Article tables (the comparison) and the calculator's vial-size table. Real <table>s so the
   numbers are data to a crawler; the wrapper scrolls sideways on a phone instead of squeezing. */
.calc-table-wrap { overflow-x: auto; }
.bprose table, .calc-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.bprose table { display: block; overflow-x: auto; }
.bprose th, .bprose td, .calc-table th, .calc-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.bprose thead th, .calc-table thead th { background: var(--surface-soft); color: var(--ink); font-weight: 700; white-space: nowrap; }
.calc-table td { font-variant-numeric: tabular-nums; }
.calc-table th, .calc-table td { white-space: nowrap; }

/* ---- 30 Sep 2026: phone overflow on /calculator/ (pre-existing, found in the AI-legibility pass).
   A grid item defaults to min-width:auto, so the reverse-mode select's long option text forced
   its column past a 390px screen and the whole page scrolled sideways by ~40px. */
.calc-grid > *, .calc-field { min-width: 0; }
.calc-field input, .calc-field select { width: 100%; max-width: 100%; min-width: 0; }
@media (max-width: 680px) {
  .blog-hero h1 { font-size: clamp(32px, 9vw, 44px); overflow-wrap: break-word; }
}

/* ---- 30 Sep 2026: vial-size presets on /calculator/<compound>/ pages. Same chip as the
   mode buttons, 44px tall, wrapping as a row under their label. */
.calc-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 22px; color: var(--muted); font-size: 13px; font-weight: 700; }
.calc-presets span { flex-basis: 100%; }
.calc-preset {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.calc-preset:hover { border-color: var(--teal); color: var(--teal); }
