/* DaBro Editorial v2 — Page Layout
 * Extracted from Claude Design bundle (2026-04-17)
 *
 * Contains: structural styles for article template —
 * progress bar, topnav, hero, sticky TOC, article prose, callouts (4 kinds),
 * stat, pullquote, figure, table, divider, FAQ, sources, author card,
 * CTA block, related articles grid, footer, inline tags, reduced-motion.
 *
 * Depends on tokens.css (CSS variables).
 */

/* =========================================================================
   PAGE LAYOUT — editorial article template
   Tokens come from colors_and_type.css — this file only adds layout.
   ========================================================================= */

/* --- Read-progress bar (top) ----------------------------------- */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--accent-green); z-index: 100; transition: width 80ms linear; }

/* --- Top nav --------------------------------------------------- */
.topnav { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--paper-edge); }
.topnav__inner { max-width: var(--w-page); margin: 0 auto;
  padding: 14px 24px; display: flex; align-items: center; gap: 24px; }
.topnav__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.topnav__logo img { height: 28px; display: block; }
.topnav__links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; font-weight: 500; }
.topnav__links a { color: var(--fg-1); text-decoration: none; }
.topnav__links a:hover { color: var(--link); background: transparent; }
.topnav__cta { padding: 8px 16px; border-radius: 6px; background: var(--ink); color: var(--fg-on-ink-1) !important;
  font-weight: 600; }
.topnav__cta:hover { background: var(--accent-green); color: var(--ink) !important; }
@media (max-width: 720px) {
  .topnav__links a:not(.topnav__cta) { display: none; }
}

/* --- Hero (inverse) ------------------------------------------- */
.hero { background: var(--ink); color: var(--fg-on-ink-1); position: relative; overflow: hidden;
  border-bottom: 1px solid var(--paper-edge); }
.hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--dabro-gradient); }
.hero__inner { max-width: var(--w-page); margin: 0 auto;
  padding: clamp(56px, 10vw, 120px) 24px clamp(48px, 8vw, 88px); position: relative; z-index: 1; }
.hero__eyebrow { color: var(--accent-green); font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase; margin: 0 0 clamp(16px, 2vw, 28px); }
.hero__h1 { color: var(--fg-on-ink-1); font-size: var(--fs-hero); line-height: 0.98;
  letter-spacing: var(--tracking-tight); font-weight: 700; margin: 0 0 clamp(24px, 3vw, 40px);
  max-width: 18ch; }
.hero__h1 mark { background: var(--accent-green); color: var(--ink); padding: 0 0.08em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero__dek { color: var(--fg-on-ink-2); font-size: var(--fs-body-lg); line-height: 1.5;
  max-width: 52ch; margin: 0 0 clamp(28px, 4vw, 48px); font-weight: 400; }
.hero__meta { display: flex; gap: clamp(16px, 2vw, 28px); flex-wrap: wrap; font-size: var(--fs-meta);
  color: var(--fg-on-ink-2); font-variant-numeric: tabular-nums; }
.hero__meta b { color: var(--fg-on-ink-1); font-weight: 500; }
.hero__bust { position: absolute; right: -6%; bottom: -8%; width: clamp(320px, 42vw, 540px);
  opacity: 0.9; pointer-events: none; filter: grayscale(0.2); mix-blend-mode: screen; }
@media (max-width: 900px) { .hero__bust { display: none; } }

/* --- Main layout: sidebar + article --------------------------- */
.layout { max-width: var(--w-page); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: var(--w-toc) 1fr; gap: clamp(40px, 6vw, 96px);
  align-items: start; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } .toc-desktop { display: none; } }

.toc-desktop { position: sticky; top: 88px; padding-top: clamp(40px, 5vw, 80px); }
.toc-desktop .k { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-2); font-weight: 700; margin: 0 0 14px; }
.toc-desktop ol { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.toc-desktop li { counter-increment: step; }
.toc-desktop a { display: flex; gap: 10px; padding: 8px 0 8px 12px; border-left: 2px solid transparent;
  color: var(--fg-2); text-decoration: none; font-size: 14px; line-height: 1.4;
  transition: all var(--t-med) var(--ease-out); }
.toc-desktop a::before { content: counter(step, decimal-leading-zero); color: var(--fg-3);
  font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; flex-shrink: 0; padding-top: 1px; }
.toc-desktop a:hover { color: var(--fg-1); background: transparent; }
.toc-desktop a.active { color: var(--fg-1); border-color: var(--accent-green); font-weight: 500; }
.toc-desktop a.active::before { color: var(--accent-green); }

/* Mobile TOC (inline at top of article) */
.toc-mobile { display: none; background: var(--paper-2); border: 1px solid var(--paper-edge);
  border-radius: var(--radius-2); padding: 16px 18px; margin: 32px 0 40px; }
.toc-mobile summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "↓"; color: var(--accent-violet-ink); font-weight: 700;
  transition: transform var(--t-med); }
.toc-mobile[open] summary::after { transform: rotate(180deg); }
.toc-mobile ol { list-style: decimal-leading-zero; padding-left: 2em; margin: 14px 0 4px;
  font-size: 14px; color: var(--fg-2); }
.toc-mobile a { color: var(--fg-1); text-decoration: none; }
.toc-mobile a:hover { color: var(--link); background: transparent; }
@media (max-width: 960px) { .toc-mobile { display: block; } }

/* --- Article prose -------------------------------------------- */
.article { padding: clamp(40px, 5vw, 80px) 0 clamp(48px, 6vw, 96px); min-width: 0; }
.article > * { max-width: var(--w-text); }
.article > .wide { max-width: var(--w-wide); }
.article > .full { max-width: none; }

/* H2 with counter + green marker */
.article { counter-reset: sect; }
.article h2 { counter-increment: sect; display: flex; align-items: baseline; gap: 16px;
  scroll-margin-top: 88px; }
.article h2::before { content: counter(sect, decimal-leading-zero); color: var(--accent-green);
  font-variant-numeric: tabular-nums; font-size: 0.6em; font-weight: 600; letter-spacing: 0;
  flex-shrink: 0; }

.article h3 { scroll-margin-top: 88px; }

.article .lede { font-size: var(--fs-body-lg); line-height: var(--lh-relaxed);
  color: var(--fg-1); font-weight: 400; margin-bottom: var(--space-7); }

/* --- Callouts ------------------------------------------------- */
.callout { margin: var(--flow-block) 0; padding: 20px 22px 18px;
  border-left: 3px solid; border-radius: 0 var(--radius-2) var(--radius-2) 0;
  max-width: var(--w-wide); display: grid; grid-template-columns: auto 1fr; column-gap: 16px; }
.callout__kind { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 700; grid-column: 2; margin: 0 0 6px; }
.callout__body { grid-column: 2; font-size: var(--fs-body); line-height: 1.55; margin: 0;
  color: var(--fg-1); }
.callout__body p { margin: 0 0 0.7em; }
.callout__body p:last-child { margin: 0; }
.callout__icon { grid-column: 1; grid-row: 1 / span 2; width: 28px; height: 28px;
  align-self: start; margin-top: 3px; flex-shrink: 0; }
.callout__icon svg { width: 100%; height: 100%; display: block; }

.callout--info { background: var(--callout-info-bg); border-color: var(--callout-info-edge); }
.callout--info .callout__kind,
.callout--info .callout__icon { color: #0c6faa; }
.callout--tip { background: var(--callout-tip-bg); border-color: var(--callout-tip-edge); }
.callout--tip .callout__kind,
.callout--tip .callout__icon { color: #047c04; }
.callout--warn { background: var(--callout-warn-bg); border-color: #d18300; }
.callout--warn .callout__kind,
.callout--warn .callout__icon { color: #a15a00; }
.callout--myth { background: var(--callout-myth-bg); border-color: var(--callout-myth-edge); }
.callout--myth .callout__kind,
.callout--myth .callout__icon { color: #5a2bb8; }

/* --- Inline myth (no box) — when a myth is mentioned in passing --- */
.myth-inline { max-width: var(--w-text); margin: 0 0 var(--flow-paragraph);
  padding-left: 18px; border-left: 3px solid var(--accent-violet); }
.myth-inline .myth-inline__k { color: var(--accent-violet-ink); display: block;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 700; margin-bottom: 4px; }
.myth-inline q { quotes: "«" "»"; font-weight: 500; color: var(--fg-1); }

/* --- Stat-fact ------------------------------------------------ */
.stat { display: flex; gap: 24px; align-items: center; margin: var(--flow-block) 0;
  padding: 28px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  max-width: var(--w-wide); }
.stat__num { font-size: clamp(64px, 9vw, 112px); font-weight: 700; line-height: 0.95;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.stat__num .unit { font-size: 0.45em; color: var(--accent-green); margin-left: 4px; }
.stat__label { font-size: var(--fs-body); line-height: 1.5; color: var(--fg-2); max-width: 32ch; }
.stat__label b { color: var(--fg-1); font-weight: 600; display: block; font-size: 1.05em;
  margin-bottom: 4px; }

/* --- Pull quote (doodle speech-bubble bg) --------------------- */
.pullquote { margin: var(--flow-block) 0; padding: 36px 44px 48px; position: relative;
  max-width: var(--w-wide); }
.pullquote blockquote { border: 0; padding: 0; margin: 0; font-size: var(--fs-pullquote);
  line-height: 1.2; font-weight: 500; letter-spacing: var(--tracking-tight); }
.pullquote cite { display: block; margin-top: 20px; font-size: var(--fs-caption);
  color: var(--fg-2); font-style: normal; }
.pullquote__doodle { position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: -1; object-fit: fill; }

/* --- Figure / image ------------------------------------------ */
figure { margin: var(--flow-block) 0; max-width: var(--w-wide); }
figure img { width: 100%; height: auto; border-radius: var(--radius-4); display: block;
  background: var(--paper-2); }
figure figcaption { font-size: var(--fs-caption); color: var(--fg-2); margin-top: 10px;
  line-height: 1.45; }
figure.full { max-width: none; }
figure.full img { border-radius: 0; }

/* --- Table ---------------------------------------------------- */
.table-wrap { overflow-x: auto; max-width: var(--w-wide); margin: var(--flow-block) 0; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-meta); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--paper-edge); }
th { font-weight: 600; background: var(--paper-2); border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule); text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 11px; color: var(--fg-2); }
td { font-variant-numeric: tabular-nums; }

/* --- Section divider ----------------------------------------- */
.divider { margin: var(--space-8) 0; max-width: var(--w-wide); text-align: center; }
.divider img { height: 42px; opacity: 0.85; }

/* --- FAQ ------------------------------------------------------ */
.faq { max-width: var(--w-wide); margin: var(--flow-block) 0; }
.faq details { border-top: 1px solid var(--rule); padding: 18px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  cursor: pointer; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { width: 28px; height: 28px; border-radius: 999px; background: var(--accent-violet);
  color: white; display: grid; place-items: center; font-size: 18px; font-weight: 600;
  flex-shrink: 0; transition: all var(--t-med) var(--ease-out); }
.faq details[open] .plus { background: var(--accent-green); color: var(--ink); transform: rotate(45deg); }
.faq .answer { padding-top: 12px; color: var(--fg-1); font-size: var(--fs-body); line-height: 1.6; }
.faq .answer p { margin: 0 0 0.7em; }

/* --- Sources -------------------------------------------------- */
.sources { margin: var(--flow-block) 0; max-width: var(--w-wide); }
.sources h2 { font-size: var(--fs-h3); margin: 0 0 16px; }
.sources h2::before { display: none; }
.sources ol { list-style: none; counter-reset: src; padding: 0; margin: 0; }
.sources li { counter-increment: src; padding: 10px 0; border-bottom: 1px solid var(--paper-edge);
  display: grid; grid-template-columns: 32px 1fr; gap: 8px; font-size: var(--fs-caption);
  line-height: 1.55; color: var(--fg-2); }
.sources li::before { content: "[" counter(src) "]"; color: var(--accent-green);
  font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.sources a { color: var(--fg-1); }

/* --- Author card ---------------------------------------------- */
.author { display: flex; gap: 18px; align-items: flex-start; padding: 24px;
  background: var(--paper-2); border: 1px solid var(--paper-edge); border-radius: var(--radius-2);
  max-width: var(--w-wide); margin: var(--flow-block) 0; }
.author__ava { width: 72px; height: 72px; border-radius: 999px; background: var(--ink);
  flex-shrink: 0; display: grid; place-items: center; overflow: hidden; }
.author__ava img { width: 90%; }
.author__name { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 2px; }
.author__role { font-size: 14px; color: var(--fg-2); margin: 0 0 8px; }
.author__bio { font-size: 15px; line-height: 1.5; color: var(--fg-1); margin: 0; max-width: 50ch; }

/* --- CTA block (inverse, end of article) ---------------------- */
.cta-block { background: var(--ink); color: var(--fg-on-ink-1); position: relative; overflow: hidden;
  border-top: 3px solid; border-image: var(--dabro-gradient) 1; margin-top: 80px; }
.cta-block__inner { max-width: var(--w-page); margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) 24px; display: grid; grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 5vw, 80px); align-items: center; }
@media (max-width: 760px) { .cta-block__inner { grid-template-columns: 1fr; } }
.cta-block__eyebrow { color: var(--accent-green); font-size: var(--fs-eyebrow);
  text-transform: uppercase; letter-spacing: var(--tracking-caps); font-weight: 700;
  margin: 0 0 18px; }
.cta-block__h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.02em;
  font-weight: 700; margin: 0 0 18px; color: var(--fg-on-ink-1); max-width: 14ch; }
.cta-block__h2::before { display: none; }
.cta-block__h2 mark { background: var(--accent-green); color: var(--ink); padding: 0 0.08em; }
.cta-block__dek { font-size: var(--fs-body-lg); line-height: 1.5; color: var(--fg-on-ink-2);
  margin: 0 0 32px; max-width: 40ch; }
.cta-block__btn { display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px; border-radius: 6px; border: 2px solid var(--accent-green);
  background: var(--accent-green); color: var(--ink); font-weight: 700; font-size: 17px;
  text-decoration: none; box-shadow: 4px 4px 0 0 var(--accent-green);
  transition: all var(--t-fast) var(--ease-out); }
.cta-block__btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 var(--accent-green);
  background: var(--accent-green); color: var(--ink); }
.cta-block__visual { position: relative; text-align: center; }
.cta-block__visual img { max-width: 100%; height: auto; max-height: 340px; }

/* --- Related articles ---------------------------------------- */
.related { max-width: var(--w-page); margin: 0 auto; padding: 80px 24px; }
.related__title { font-size: var(--fs-h2); font-weight: 700; letter-spacing: var(--tracking-tight);
  margin: 0 0 32px; }
.related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 800px) { .related__grid { grid-template-columns: 1fr; } }
.related__card { display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--paper-edge); border-radius: var(--radius-3); overflow: hidden;
  background: var(--paper-2); transition: all var(--t-med) var(--ease-out); }
.related__card:hover { transform: translateY(-2px); background: var(--paper); }
.related__card:hover { background: var(--paper); }
.related__card-img { aspect-ratio: 16/10; background: var(--ink); display: grid; place-items: center; overflow: hidden; }
.related__card-img img { width: 70%; }
.related__card-body { padding: 18px 20px 22px; }
.related__card-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-violet-ink); font-weight: 700; margin: 0 0 8px; }
.related__card h3 { font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 6px;
  font-weight: 600; }
.related__card p { font-size: 13px; color: var(--fg-2); margin: 0; max-width: none; }

/* --- Footer --------------------------------------------------- */
.footer { background: var(--ink); color: var(--fg-on-ink-2); padding: 56px 24px 32px; }
.footer__inner { max-width: var(--w-page); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
@media (max-width: 720px) { .footer__inner { grid-template-columns: 1fr 1fr; } }
.footer__brand img { height: 44px; margin-bottom: 14px; }
.footer__tag { font-size: 14px; line-height: 1.5; margin: 0; max-width: 32ch; }
.footer__col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-on-ink-1); font-weight: 700; margin: 6px 0 14px; }
.footer__col ul { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.footer__col li { margin-bottom: 8px; }
.footer__col a { color: var(--fg-on-ink-2); text-decoration: none; }
.footer__col a:hover { color: var(--accent-green); background: transparent; }
.footer__bottom { max-width: var(--w-page); margin: 40px auto 0; padding-top: 20px;
  border-top: 1px solid var(--ink-edge); display: flex; justify-content: space-between;
  font-size: 12px; flex-wrap: wrap; gap: 12px; }
.footer__bottom a { color: var(--fg-on-ink-2); text-decoration: underline; background: transparent; }
.footer__bottom a:hover { color: var(--accent-green); }

/* --- Tags row (above H1 meta already, and here for content) --- */
.tags-inline { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 var(--space-5); max-width: none; }
.tag { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: -0.005em; }
.tag--green { background: var(--accent-green); color: var(--ink); }
.tag--ink { background: var(--ink-3); color: var(--fg-on-ink-1); }

/* --- Helpers -------------------------------------------------- */
.section-title { position: relative; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
