/* =========================================================================
   Luv Health — the Journal
   Loads on top of landing.css, so the burgundy/ivory/gold tokens and the
   Fraunces display face are already in scope via .landing.
   ========================================================================= */

/* ---------------- Reading progress ---------------- */
.j-progress {
  position: fixed; inset: 0 0 auto; z-index: 120; height: 3px;
  background: transparent; pointer-events: none;
}
.j-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--red-500), var(--gold-lit));
  transition: width .12s linear;
}

/* ---------------- Article head ---------------- */
.j-head, .j-index__head {
  position: relative; overflow: hidden; color: #fff;
  padding-block: clamp(116px, 13vw, 168px) clamp(44px, 6vw, 76px);
  background:
    radial-gradient(120% 100% at 78% -14%, rgba(225,38,47,.32), transparent 58%),
    linear-gradient(168deg, var(--burgundy-900) 0%, var(--ink-950) 78%);
}
.j-head::after, .j-index__head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 3px 3px; opacity: .5; mix-blend-mode: overlay;
}
.j-head > *, .j-index__head > * { position: relative; z-index: 1; }

.j-crumbs {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: var(--sp-6);
}
.j-crumbs a { color: rgba(255,255,255,.72); }
.j-crumbs a:hover { color: #fff; text-decoration: underline; }

.j-kicker { color: var(--gold-lit) !important; margin: 0 0 var(--sp-4); }

.j-head h1, .j-index__head h1 {
  color: #fff; font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.5rem);
  line-height: 1.04; letter-spacing: -.035em; margin: 0 0 var(--sp-5); max-width: 20ch;
}
.j-index__head h1 {
  font-size: clamp(2.2rem, 1.2rem + 3.8vw, 3.8rem); max-width: 17ch;
}
.j-index__head h1 em {
  font-style: italic; font-variation-settings: "SOFT" 60, "WONK" 1;
  background: linear-gradient(96deg, var(--blush), var(--gold-lit));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.j-standfirst {
  font-size: clamp(1.02rem, .96rem + .38vw, 1.2rem); line-height: 1.55;
  color: rgba(255,255,255,.74); max-width: 52ch; margin: 0;
}

/* ---------------- Topic strip ----------------
   Sits on the hero's lower edge. A journal that declares four topics should
   let a reader browse by one; before this, the only route in was scrolling. */
.j-topics {
  margin-top: clamp(32px, 4.5vw, 56px);
  border-top: 1px solid rgba(255,255,255,.12);
}
.j-topics__row {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: clamp(18px, 2.4vw, 26px);
}
.j-topic {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 14px 8px 16px;
  border: 1px solid rgba(255,255,255,.16); border-radius: var(--r-pill);
  color: rgba(255,255,255,.78);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease),
              color .2s var(--ease);
}
.j-topic span {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px;
  padding: 0 6px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.62);
  font-size: .64rem; letter-spacing: 0;
}
.j-topic:hover { border-color: rgba(255,255,255,.4); color: #fff; }
.j-topic.is-on {
  border-color: transparent; background: #fff; color: var(--burgundy-900);
}
.j-topic.is-on span { background: var(--red-050); color: var(--red-700); }
.j-topic:focus-visible { outline: 3px solid var(--gold-lit); outline-offset: 2px; }

.j-byline {
  display: flex; align-items: center; gap: 12px; margin-top: clamp(28px, 3.5vw, 44px);
  padding-top: clamp(22px, 2.6vw, 30px); border-top: 1px solid rgba(255,255,255,.14);
}
.j-byline__mark { background: var(--red-500); color: #fff; }
.j-byline__text { min-width: 0; }
.j-byline__who { display: block; font-weight: 620; font-size: .9rem; color: #fff; }
.j-byline__meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: .76rem; color: rgba(255,255,255,.58);
}
.j-byline__rev {
  display: inline-flex; align-items: center; gap: 5px; color: var(--gold-lit);
}

/* ---------------- Shell: rail + body ---------------- */
.j-shell {
  display: grid; gap: clamp(28px, 4vw, 64px);
  grid-template-columns: minmax(0, 1fr);
  padding-block: clamp(40px, 5vw, 72px) clamp(48px, 6vw, 88px);
}
@media (min-width: 1000px) {
  .j-shell { grid-template-columns: 232px minmax(0, 1fr); align-items: start; }
  .j-rail { position: sticky; top: calc(var(--header-h) + 24px); }
}

.j-toc { border-top: 1px solid var(--sand-2); padding-top: var(--sp-4); }
.j-toc summary {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; list-style: none; gap: var(--sp-3);
}
.j-toc summary::-webkit-details-marker { display: none; }
.j-toc summary .luv-icon { color: var(--ink-4); transition: transform .25s var(--ease); }
.j-toc[open] summary .luv-icon { transform: rotate(180deg); }
@media (min-width: 1000px) {
  .j-toc summary { pointer-events: none; }
  .j-toc summary .luv-icon { display: none; }
}
.j-toc__list {
  list-style: none; margin: var(--sp-4) 0 0; padding: 0;
  counter-reset: toc; border-left: 1px solid var(--sand-2);
}
.j-toc__list li { counter-increment: toc; }
.j-toc__list a {
  display: block; padding: 8px 0 8px 16px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: .82rem; line-height: 1.4; color: var(--ink-3);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.j-toc__list a::before {
  content: counter(toc, decimal-leading-zero) " ";
  font-family: var(--font-mono); font-size: .68rem; color: var(--ink-4);
  letter-spacing: .1em;
}
.j-toc__list a:hover { color: var(--ink); }
.j-toc__list a.is-here { color: var(--red-600); border-left-color: var(--red-500); font-weight: 560; }
.j-toc__list a.is-here::before { color: var(--red-500); }

.j-share { margin-top: var(--sp-7); }
.j-share__row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-3); }
.j-share__btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: #fff;
  font-family: var(--font-body); font-size: .78rem; font-weight: 560;
  color: var(--ink-2); cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.j-share__btn:hover { border-color: var(--ink-4); color: var(--ink); }
.j-share__btn .luv-icon { color: var(--ink-4); }

/* ---------------- Prose ---------------- */
.j-body { max-width: 40rem; }

.j-takeaways {
  background: var(--sand); border-radius: var(--r-xl);
  padding: clamp(22px, 2.6vw, 32px); margin-bottom: clamp(32px, 4vw, 48px);
}
.j-takeaways ul { list-style: none; margin: var(--sp-4) 0 0; padding: 0; }
.j-takeaways li {
  display: flex; gap: 12px; align-items: flex-start;
  padding-block: 10px; border-top: 1px solid var(--sand-2);
  font-size: var(--step-0); line-height: 1.5; color: var(--ink-2);
}
.j-takeaways li:first-child { border-top: 0; padding-top: 0; }
.j-takeaways .luv-icon { color: var(--green-500); flex: none; margin-top: 4px; }

.j-guardline {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--red-050); border-radius: var(--r-lg);
  padding: 14px 18px; margin-bottom: clamp(28px, 3.5vw, 44px);
  font-size: var(--step--1); line-height: 1.6; color: var(--red-900);
}
.j-guardline .luv-icon { color: var(--red-600); flex: none; margin-top: 2px; }
.j-guardline strong { color: var(--red-900); }

.j-sec { margin-bottom: clamp(36px, 4.5vw, 60px); scroll-margin-top: 96px; }
.j-sec h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.12;
  letter-spacing: -.028em; margin: 0;
}
.j-deck {
  margin: 12px 0 var(--sp-5); font-size: var(--step-0); line-height: 1.55;
  color: var(--ink-3); font-style: italic;
}
.j-sec > .j-deck + .j-prose { margin-top: 0; }

.j-prose p { font-size: 1.04rem; line-height: 1.72; color: var(--ink-2); margin: 0 0 var(--sp-5); }
.j-prose p:last-child { margin-bottom: 0; }
.j-prose strong { color: var(--ink); font-weight: 620; }
.j-prose em { font-style: italic; }
.j-prose a { text-decoration: underline; text-underline-offset: 3px; }
.j-prose ul, .j-prose ol { margin: 0 0 var(--sp-5); padding-left: 1.35em; }
.j-prose li { font-size: 1.02rem; line-height: 1.65; color: var(--ink-2); margin-bottom: 10px; }
.j-prose li::marker { color: var(--red-500); font-weight: 600; }
.j-prose > :last-child { margin-bottom: 0; }

/* Callouts */
.j-note { margin-top: var(--sp-6); border-radius: var(--r-lg); }
.j-note--guard {
  border-left: 3px solid var(--red-500); border-radius: 0;
  padding: 4px 0 4px 20px;
}
.j-note--guard .j-prose p,
.j-note--guard .j-prose li { font-size: var(--step--1); color: var(--ink-3); line-height: 1.65; }

.j-note--gold {
  display: flex; gap: 14px; background: var(--gold-soft);
  padding: clamp(18px, 2.2vw, 24px);
}
.j-note--gold .j-note__icon { color: #8A6A14; flex: none; margin-top: 2px; }
.j-note--gold .j-prose p,
.j-note--gold .j-prose li { font-size: var(--step--1); color: #57430F; line-height: 1.65; }

.j-note--flag {
  display: flex; gap: 14px; background: #FFF3F3;
  border: 1px solid var(--red-200); padding: clamp(18px, 2.2vw, 24px);
}
.j-note--flag .j-note__icon { color: var(--red-600); flex: none; margin-top: 2px; }
.j-note--flag .j-prose p { font-size: var(--step-0); color: var(--red-900); }
.j-note--flag .j-prose li { font-size: var(--step--1); color: #7A1119; margin-bottom: 7px; }
.j-note--flag .j-prose li::marker { color: var(--red-600); }
.j-note--flag .j-prose ul { margin-bottom: var(--sp-4); }

.j-faq details { border-radius: var(--r-lg); }
.j-faq summary { font-size: var(--step-0); }
.j-faq p { font-size: var(--step-0); line-height: 1.65; color: var(--ink-3); }

.j-sources { margin: 0; padding-left: 1.3em; }
.j-sources li { margin-bottom: 12px; font-size: var(--step--1); line-height: 1.55; }
.j-sources li::marker { color: var(--ink-4); font-family: var(--font-mono); font-size: .8em; }
.j-sources a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.j-sources a:hover { color: var(--red-600); }
.j-sources .luv-icon { color: var(--ink-4); display: inline-block; vertical-align: -1px; }

.j-stamp {
  margin: clamp(36px, 4vw, 56px) 0 0; padding-top: var(--sp-5);
  border-top: 1px solid var(--sand-2);
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4); line-height: 1.9;
}

/* ---------------- Closing CTA ---------------- */
.j-cta {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  padding-block: clamp(56px, 7vw, 104px);
  background:
    radial-gradient(90% 130% at 50% -10%, rgba(225,38,47,.4), transparent 60%),
    linear-gradient(165deg, var(--burgundy-900), var(--ink-950));
}
.j-cta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 3px 3px; opacity: .5; mix-blend-mode: overlay;
}
.j-cta > * { position: relative; z-index: 1; }
.j-cta h2 {
  color: #fff; font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.9rem);
  max-width: 18ch; margin-inline: auto; line-height: 1.06;
}
.j-cta h2 em {
  font-style: italic; font-variation-settings: "SOFT" 60, "WONK" 1;
  background: linear-gradient(96deg, var(--blush), var(--gold-lit));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.j-cta p { color: rgba(255,255,255,.76); max-width: 44rem; margin-inline: auto; }

/* ---------------- Cards ----------------
   auto-fill, not auto-fit: with two posts, auto-fit stretched each card to half
   the page. auto-fill keeps the empty track, so a card is always card-sized. */
.j-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.j-grid--index { margin-top: clamp(20px, 2.6vw, 30px); }

.j-card {
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: clamp(22px, 2.4vw, 30px); color: inherit;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease);
}
.j-card:hover {
  transform: translateY(-4px); border-color: var(--sand-2);
  box-shadow: 0 24px 50px -26px rgba(59,6,15,.34); color: inherit;
}
.j-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.j-card__topic { color: var(--red-600) !important; }
.j-card__time {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  color: var(--ink-4); text-transform: uppercase;
}
.j-card h3 {
  font-size: clamp(1.14rem, 1.02rem + .42vw, 1.4rem); line-height: 1.2;
  letter-spacing: -.022em; margin: 0; color: var(--ink);
}
.j-card p { font-size: var(--step--1); line-height: 1.62; color: var(--ink-3); margin: 0; }
.j-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4);
}
.j-card__meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Only rendered when reviewer_name is set — which the model insists happens
   only after a clinician has actually read the piece. */
.j-reviewed {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--green-500); font-weight: 600;
}
.j-reviewed .luv-icon { color: var(--green-500); }
.j-card__go {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--red-600); font-weight: 600; letter-spacing: .08em;
}
.j-card:hover .j-card__go .luv-icon { transform: translateX(3px); }
.j-card__go .luv-icon { transition: transform .25s var(--ease); }

/* Lead item on the index */
.j-lead {
  display: block; color: inherit; background: var(--sand);
  border-radius: var(--r-2xl); padding: clamp(28px, 4vw, 56px);
  border: 1px solid var(--sand-2);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.j-lead:hover {
  color: inherit; transform: translateY(-3px);
  box-shadow: 0 30px 60px -30px rgba(59,6,15,.36);
}
.j-lead__body { max-width: 46rem; }
.j-lead__flag { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.j-lead__flag .mark { margin: 0; }
.j-lead__badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--burgundy-900); color: var(--gold-lit);
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase;
}
.j-lead h2 {
  font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.8rem); line-height: 1.06;
  letter-spacing: -.032em; margin: var(--sp-4) 0 var(--sp-4);
}
.j-lead__sub { font-size: var(--step-1); line-height: 1.5; color: var(--ink-3); margin: 0; }
.j-lead__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: var(--sp-6); padding-top: var(--sp-5);
  border-top: 1px solid var(--sand-2);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4);
}
.j-lead__foot .j-card__go { margin-left: auto; }
.j-lead:hover .j-card__go .luv-icon { transform: translateX(3px); }

.j-morehead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-4); margin: clamp(40px, 5vw, 64px) 0 0;
  padding-top: var(--sp-5); border-top: 1px solid var(--sand-2);
}
.j-morehead h2 {
  margin: 0; font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); letter-spacing: -.026em;
}
.j-morehead__count {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4); white-space: nowrap;
}
.j-more__all {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red-600); white-space: nowrap;
}

.j-empty { text-align: center; padding-block: clamp(40px, 6vw, 80px); }
.j-empty h2 { margin: var(--sp-4) 0 var(--sp-4); }
.j-empty p {
  font-size: var(--step-0); max-width: 44ch; margin-inline: auto; color: var(--ink-3);
}

/* ---------------- Homepage strip ---------------- */
.l-journal__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-5); flex-wrap: wrap; margin-bottom: clamp(28px, 3.5vw, 44px);
}
.l-journal__head .l-titleblock { margin-bottom: 0; }

/* Safety net: reveal animations start at opacity 0, so if JavaScript never
   runs the content must still be visible. The scripts set .js on <html>. */
html:not(.js) .reveal,
html:not(.js) .stagger > * { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .j-topics__row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 4px; margin-inline: calc(var(--sp-5) * -1);
    padding-inline: var(--sp-5); }
  .j-topics__row::-webkit-scrollbar { display: none; }
  .j-morehead { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .j-card, .j-lead, .j-card__go .luv-icon, .j-progress i, .j-topic { transition: none; }
  .j-card:hover, .j-lead:hover { transform: none; }
}

/* ---------------- Search + readable topics (review note 79) ---------------- */
.j-browse { margin-top: clamp(28px, 4vw, 48px); border-top: 1px solid rgba(255,255,255,.12); padding-top: clamp(18px, 2.4vw, 26px); }
.j-browse .j-topics { margin-top: 16px; border-top: 0; }
.j-browse .j-topics__row { padding-top: 6px; }
.j-topics__label { margin: 0; color: rgba(255,255,255,.8); font-size: .86rem; font-weight: 650; }
.j-search { display: flex; gap: 8px; max-width: 520px; }
.j-search input[type="search"] {
  flex: 1; min-width: 0; min-height: 42px; padding: 8px 14px; border-radius: var(--r-pill, 999px);
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; font: inherit;
}
.j-search input[type="search"]::placeholder { color: rgba(255,255,255,.7); }
.j-search input[type="search"]:focus { outline: 3px solid var(--gold-lit, #f3d08a); outline-offset: 1px; }
.j-topic { font-family: var(--font-body, inherit); font-size: .88rem; letter-spacing: 0; text-transform: none; color: rgba(255,255,255,.9); }
.j-topic span { font-size: .72rem; color: rgba(255,255,255,.8); }
