/* ==========================================================================
   Inkwire — front-end design system
   Editorial newsroom aesthetic: strong hierarchy, generous whitespace,
   one accent colour, light and dark modes, no external dependencies.
   ========================================================================== */

:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --ink-3: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --paper: #ffffff;
  --paper-2: #f8fafc;
  --paper-3: #f1f5f9;
  --brand: #c8102e;
  --brand-dark: #9f0c24;
  --accent: #f59e0b;
  --ok: #047857;
  --warn: #b45309;
  --bad: #b91c1c;

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
  --font-serif: Georgia, "Times New Roman", serif;

  --wrap: 1240px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-2: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-3: 0 18px 40px rgba(15, 23, 42, .12);
  --t: 180ms cubic-bezier(.4, 0, .2, 1);
}

html[data-theme="dark"] {
  --ink: #f1f5f9;
  --ink-2: #e2e8f0;
  --ink-3: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --line: #1e293b;
  --line-soft: #172033;
  --paper: #0b1120;
  --paper-2: #0f172a;
  --paper-3: #16213a;
  --brand: #ff4d6d;
  --brand-dark: #e11d48;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-3: 0 24px 50px rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.16; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.15em; }
img { background: var(--paper-3); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 560px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* The skip link is parked outside of the viewport. It uses a vertical offset
   on purpose: a horizontal one (left: -999px) overflows to the left in RTL
   and grows the scroll width of the whole page. */
.skip-link {
  position: absolute; inset-inline-start: 0; top: 0; z-index: 100;
  transform: translateY(-200%);
  background: var(--brand); color: #fff; padding: .7rem 1.1rem;
  border-end-end-radius: var(--radius-sm);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* --- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: 600 .875rem/1 var(--font-body); letter-spacing: .01em;
  padding: .68rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--quiet { background: var(--paper-3); color: var(--ink-3); }
.btn--quiet:hover { background: var(--line); color: var(--ink); }
.btn--danger { background: transparent; color: var(--bad); border-color: transparent; }
.btn--danger:hover { background: rgba(185, 28, 28, .1); }
.btn--sm { padding: .5rem .85rem; font-size: .8125rem; }
.btn--xs { padding: .3rem .55rem; font-size: .75rem; }
.btn--block { width: 100%; }
.inline-form { display: inline-flex; margin: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink-3); cursor: pointer;
  transition: background var(--t), color var(--t);
}
.icon-btn:hover { background: var(--paper-3); color: var(--ink); }

/* --- Top bar --------------------------------------------------------- */
.topbar { background: var(--ink); color: #cbd5e1; font-size: .8125rem; }
html[data-theme="dark"] .topbar { background: #060b16; }
.topbar__inner { display: flex; align-items: center; gap: 1.2rem; min-height: 42px; }
.topbar__date { margin: 0; color: #94a3b8; white-space: nowrap; }
.topbar__ticker { display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 1; }
.topbar__label {
  background: var(--brand); color: #fff; padding: .18rem .5rem; border-radius: 4px;
  font-weight: 700; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em;
}
.ticker { overflow: hidden; flex: 1; min-width: 0; }
.ticker__track { display: flex; gap: 1.5rem; white-space: nowrap; }
.ticker__item { color: #cbd5e1; }
.ticker__item:hover { color: #fff; }
.topbar__tools { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.topbar__search input {
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .12);
  color: #e2e8f0; border-radius: 999px; padding: .35rem .8rem; font-size: .8125rem; width: 170px;
}
.topbar__search input::placeholder { color: #94a3b8; }
.lang-switch select {
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .12);
  color: #e2e8f0; border-radius: 999px; padding: .33rem .55rem; font-size: .75rem;
}
.lang-switch option { color: #0f172a; }

/* --- Masthead -------------------------------------------------------- */
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead__inner { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 0; }
.masthead__brand img { height: 38px; width: auto; }
.masthead__wordmark { font-family: var(--font-head); font-size: 1.9rem; font-weight: 800; letter-spacing: -.04em; }
.masthead__tagline { margin: 0; color: var(--muted); font-size: .875rem; }
.masthead__actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

/* --- Navigation ------------------------------------------------------ */
.navbar { border-bottom: 1px solid var(--line); background: var(--paper); position: relative; z-index: 40; }
.navbar__inner { display: flex; align-items: center; gap: 1rem; }
.navbar__toggle { display: none; background: none; border: 0; cursor: pointer; padding: .6rem; }
.burger { display: grid; gap: 4px; }
.burger i { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }
.navbar__list { display: flex; list-style: none; margin: 0; padding: 0; gap: .25rem; }
.navbar__item { position: relative; }
.navbar__item > a {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .85rem .8rem; font-weight: 600; font-size: .9rem; color: var(--ink);
}
.navbar__item > a:hover { color: var(--brand); }
.caret { transition: transform var(--t); }
.navbar__item:hover .caret { transform: rotate(180deg); }
.navbar__utility { display: flex; list-style: none; margin: 0 0 0 auto; padding: 0; gap: .9rem; }
.navbar__utility a { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.navbar__utility a:hover { color: var(--brand); }

.dropdown {
  position: absolute; left: 0; top: 100%; min-width: 220px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-2);
  list-style: none; margin: 0; padding: .4rem; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.navbar__item:hover .dropdown, .navbar__item:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: .45rem .6rem; border-radius: 6px; font-size: .875rem; }
.dropdown a:hover { background: var(--paper-3); }

.mega {
  position: absolute; left: 0; top: 100%; width: min(980px, 92vw); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-3);
  padding: 1.4rem; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.navbar__item:hover .mega, .navbar__item:focus-within .mega { opacity: 1; visibility: visible; transform: translateY(0); }
.mega__grid { display: grid; grid-template-columns: repeat(var(--mega-cols, 4), 1fr); gap: 1.2rem; }
.mega__title { font-family: var(--font-head); font-weight: 700; font-size: .8125rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); margin: 0 0 .5rem; }
.mega__grid ul { list-style: none; margin: 0; padding: 0; }
.mega__grid li { padding: .16rem 0; font-size: .875rem; color: var(--ink-3); }
.mega__col--cta { background: var(--paper-2); border-radius: var(--radius-sm); padding: 1rem; }
.mega__text { font-size: .8125rem; color: var(--muted); margin: 0 0 .8rem; }

/* --- Flash ----------------------------------------------------------- */
.flash { margin: 1rem auto; padding: .8rem 1.1rem; border-radius: var(--radius-sm); font-weight: 500; border: 1px solid; }
.flash--success { background: rgba(4, 120, 87, .1); border-color: rgba(4, 120, 87, .3); color: var(--ok); }
.flash--error { background: rgba(185, 28, 28, .1); border-color: rgba(185, 28, 28, .3); color: var(--bad); }
.flash--info { background: rgba(2, 132, 199, .1); border-color: rgba(2, 132, 199, .3); color: #0369a1; }

/* --- Layout ---------------------------------------------------------- */
.main { padding: 2rem 0 3.5rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: start; }
.layout--home { grid-template-columns: minmax(0, 1fr) 320px; }
.layout__main { min-width: 0; }
.layout__aside { position: sticky; top: 1.2rem; }
@media (max-width: 1023px) { .layout, .layout--home { grid-template-columns: minmax(0, 1fr); } .layout__aside { position: static; } }

.page-head { margin-bottom: 1.6rem; }
.page-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.page-head--center { text-align: center; }
.page-head__title { font-size: clamp(1.75rem, 4vw, 2.6rem); margin: 0 0 .3rem; }
.page-head__lede { color: var(--muted); max-width: 62ch; margin: 0; }
.section { margin: 2.6rem 0; }
.section--dark { background: var(--ink); color: #e2e8f0; padding: 2rem; border-radius: var(--radius); }
html[data-theme="dark"] .section--dark { background: var(--paper-3); }
.section--dark .section__title { color: #fff; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: 1.2rem; }
.section--dark .section__head { border-color: rgba(255, 255, 255, .25); }
.section__title { font-size: 1.3rem; margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.section__more { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.section__more:hover { color: var(--brand); }

/* --- Hero ------------------------------------------------------------ */
.hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.6rem; margin-bottom: 1.8rem; }
@media (max-width: 899px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--paper-3); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.hero__media:hover img { transform: scale(1.03); }
.hero__body { padding-top: .9rem; }
.hero__title { font-size: clamp(1.6rem, 3.4vw, 2.5rem); margin: .3rem 0 .5rem; }
.hero__title a:hover { color: var(--brand); }
.hero__excerpt { color: var(--ink-3); font-size: 1.02rem; max-width: 60ch; }
.hero__meta { color: var(--muted); font-size: .8125rem; margin: 0; }
.hero__rail { display: grid; gap: 1rem; align-content: start; }
.rail { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.rail:last-child { border-bottom: 0; }
.rail__media { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-3); }
.rail__media img { width: 100%; height: 100%; object-fit: cover; }
.rail__title { font-size: 1rem; margin: .5rem 0 .2rem; }
.rail__meta { font-size: .75rem; color: var(--muted); margin: 0; }

/* --- Cards ----------------------------------------------------------- */
.grid { display: grid; gap: 1.6rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); transition: transform var(--t), box-shadow var(--t); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card__media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--paper-3); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__placeholder {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--paper-3), var(--line)); color: var(--muted-2);
  font-family: var(--font-head); font-size: 2.5rem; font-weight: 800;
}
.card__placeholder--hero { min-height: 260px; }
.card__placeholder--tall { aspect-ratio: 4 / 5; }
.card__badge {
  position: absolute; left: .6rem; top: .6rem; background: rgba(15, 23, 42, .82); color: #fff;
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .22rem .5rem; border-radius: 4px;
}
.card__badge--premium { background: var(--brand); }
.card__body { padding: 1rem 1.05rem 1.15rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card__kicker { margin: 0; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); display: flex; gap: .5rem; flex-wrap: wrap; }
.card__title { font-size: 1.0625rem; margin: .15rem 0 .3rem; }
.card__title a:hover { color: var(--brand); }
.card__excerpt { color: var(--ink-3); font-size: .875rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin: auto 0 0; padding-top: .6rem; font-size: .75rem; color: var(--muted); display: flex; gap: .4rem; flex-wrap: wrap; }
.card__author a { font-weight: 600; color: var(--ink-3); }
.card__dot { opacity: .5; }

.mini { border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.mini:last-child { border-bottom: 0; }
.mini__title { font-size: .95rem; margin: 0 0 .25rem; }
.mini__meta { font-size: .75rem; color: var(--muted); margin: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.mini__views { margin-left: auto; }

/* --- Breaking -------------------------------------------------------- */
.breaking { display: flex; align-items: center; gap: 1rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem 1rem; margin-bottom: 1.6rem; }
.breaking__label { background: var(--brand); color: #fff; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .2rem .5rem; border-radius: 4px; }
.breaking__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; overflow-x: auto; }
.breaking__list a { font-weight: 600; font-size: .9rem; white-space: nowrap; }

/* --- Sidebar --------------------------------------------------------- */
.sidebar { display: grid; gap: 1.4rem; }
.widget { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.widget__title { font-size: .8125rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 .8rem; }
.widget__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.widget__list li { font-size: .9rem; line-height: 1.4; }
.widget__list time { display: block; font-size: .72rem; color: var(--muted); margin-top: .15rem; }
.widget__list--ranked { counter-reset: rank; }
.widget__list--ranked li { display: grid; grid-template-columns: 26px 1fr; gap: .6rem; align-items: start; }
.rank { font-family: var(--font-head); font-weight: 800; color: var(--brand); font-size: .95rem; }
.widget__text { font-size: .875rem; color: var(--muted); }
.widget__html { font-size: .875rem; color: var(--ink-3); }

/* --- Ad zones -------------------------------------------------------- */
.ad-zone { background: var(--paper-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 1.4rem; text-align: center; color: var(--muted-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; margin: 1.4rem 0; }
.ad-zone--tall { min-height: 260px; display: grid; place-items: center; }

/* --- Article --------------------------------------------------------- */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: start; }
.article--wide { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1023px) { .article { grid-template-columns: minmax(0, 1fr); } }
.breadcrumbs ol { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.2rem; font-size: .8125rem; color: var(--muted); flex-wrap: wrap; }
.breadcrumbs li + li::before { content: "/"; margin-right: .5rem; opacity: .5; }
.story { background: var(--paper); }
.story__head { margin-bottom: 1.4rem; }
.story__kicker { display: flex; gap: .8rem; align-items: center; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin: 0 0 .5rem; }
.story__title { font-size: clamp(1.9rem, 4.6vw, 3rem); margin: 0 0 .5rem; }
.story__subtitle { font-size: 1.15rem; color: var(--ink-3); font-family: var(--font-serif); font-style: italic; margin: 0 0 1rem; }
.story__meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.story__author { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; }
.story__author img { width: 40px; height: 40px; border-radius: 50%; }
.story__facts { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .8125rem; color: var(--muted); }
.story__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .9rem 0; }
.reactions { display: inline-flex; gap: .4rem; margin-left: auto; }
.reaction { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: .35rem .7rem; font-size: .8125rem; cursor: pointer; transition: background var(--t); }
.reaction:hover, .reaction--on { background: var(--paper-3); }
.story__hero { margin: 1.6rem 0; }
.story__hero img { width: 100%; border-radius: var(--radius); }
.story__embed { margin: 1.4rem 0; }
.story__embed video, .story__embed iframe { width: 100%; border-radius: var(--radius); }
.story__body { font-size: 1.0625rem; line-height: 1.75; color: var(--ink-2); }
.story__body h2 { font-size: 1.5rem; margin: 2rem 0 .7rem; }
.story__body h3 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; }
.story__body p { margin: 0 0 1.15rem; }
.story__body blockquote { margin: 1.6rem 0; padding: .4rem 0 .4rem 1.3rem; border-left: 3px solid var(--brand); font-family: var(--font-serif); font-size: 1.15rem; color: var(--ink); }
.story__body img { border-radius: var(--radius-sm); margin: 1.4rem 0; }
.story__body ul, .story__body ol { padding-left: 1.3rem; }
.story__body li { margin-bottom: .4rem; }
.story__body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.story__body--locked { position: relative; max-height: 320px; overflow: hidden; }
.story__body--locked::after { content: ""; position: absolute; inset: auto 0 0 0; height: 220px; background: linear-gradient(transparent, var(--paper)); }
.story__locked-text { font-family: var(--font-serif); font-size: 1.15rem; color: var(--ink-2); }
.paywall { position: relative; z-index: 2; text-align: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.5rem; margin-top: -6rem; }
.paywall__title { font-size: 1.35rem; margin: 0 0 .4rem; }
.paywall__text { color: var(--muted); max-width: 46ch; margin-inline: auto; }
.paywall__actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.paywall__single { margin-top: .8rem; }
.recipe-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .8rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1.4rem 0; }
.recipe-meta__label { display: block; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.recipe-meta__value { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.event-box { background: var(--paper-2); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); padding: 1.2rem; margin: 1.4rem 0; }
.event-box__title { font-size: 1.05rem; margin: 0 0 .6rem; }
.media-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1rem; margin: 1.6rem 0; }
.media-strip__item { margin: 0; }
.media-strip__item img { border-radius: var(--radius-sm); aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.media-strip__item figcaption { font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.toc { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1.6rem 0; }
.toc__title { font-size: .75rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 .5rem; }
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc li { margin-bottom: .3rem; font-size: .9rem; }
.toc__level-2 { padding-left: 1rem; }
.toc__level-3 { padding-left: 2rem; }
.faqs { margin: 2rem 0; }
.faqs__title { font-size: 1.3rem; }
.faq { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .6rem; background: var(--paper-2); }
.faq summary { cursor: pointer; font-weight: 600; padding: .85rem 1rem; }
.faq__answer { padding: 0 1rem .9rem; color: var(--ink-3); }
.quiz { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin: 2rem 0; }
.quiz__title { font-size: 1.2rem; }
.quiz__question { border: 0; padding: .8rem 0; margin: 0; }
.quiz__question legend { font-weight: 600; margin-bottom: .4rem; }
.quiz__option { display: block; padding: .3rem 0; font-size: .9375rem; }
.quiz__result { margin-top: 1rem; padding: 1rem; background: var(--paper); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.poll { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.poll--card { padding: 1.4rem; }
.poll--inline { margin: 1.6rem 0; }
.poll__question { font-family: var(--font-head); font-weight: 700; margin: 0 0 .8rem; }
.poll__options { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .45rem; }
.poll__options label { display: flex; gap: .5rem; align-items: center; font-size: .9375rem; cursor: pointer; }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .8125rem; color: var(--muted); margin-top: 1.6rem; }
.tag { background: var(--paper-3); border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; color: var(--ink-3); }
.tag:hover { background: var(--brand); color: #fff; }
.pill { display: inline-block; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .18rem .45rem; border-radius: 4px; background: var(--paper-3); color: var(--ink-3); }
.pill--premium { background: var(--brand); color: #fff; }
.pill--on { background: rgba(4, 120, 87, .12); color: var(--ok); }

/* --- Comments -------------------------------------------------------- */
.comments { margin-top: 3rem; }
.comments__title { font-size: 1.35rem; display: flex; align-items: center; gap: .6rem; }
.comments__count { background: var(--paper-3); color: var(--muted); font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; }
.comment-form { margin-bottom: 1.4rem; display: grid; gap: .6rem; }
.comment-form textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .85rem; font: inherit; background: var(--paper); color: var(--ink); resize: vertical; }
.comment-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.comment-form__note { font-size: .8125rem; color: var(--muted); margin: 0; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.comment { display: grid; grid-template-columns: 36px 1fr; gap: .8rem; }
.comment__avatar { width: 36px; height: 36px; border-radius: 50%; }
.comment__head { margin: 0 0 .2rem; font-size: .875rem; }
.comment__head time { color: var(--muted); font-weight: 400; margin-left: .4rem; font-size: .78rem; }
.comment__text { margin: 0; font-size: .9375rem; color: var(--ink-2); }
.comment--empty { color: var(--muted); }
.comments__login { color: var(--muted); }

/* --- Panels & forms -------------------------------------------------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.panel--center { text-align: center; }
.panel--flush { padding: 0; overflow: hidden; }
.panel__title { font-size: 1.1rem; margin: 0 0 .6rem; }
.panel__lede { color: var(--muted); }
.panel__note { font-size: .8125rem; color: var(--muted); }
.panel__lead { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; margin: 0 0 .2rem; }
.panel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .9rem; }
.panel__list--rows li { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; border-bottom: 1px solid var(--line-soft); padding-bottom: .4rem; }
.panel__actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.panel__foot { margin: 1rem 0 0; font-size: .875rem; color: var(--muted); }
.panel__foot--muted { font-size: .78rem; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.panel__more { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.panel__head .panel__title { margin: 0; }

.form { display: grid; gap: .9rem; }
.form__row { display: grid; gap: .3rem; }
.form__row--split { grid-template-columns: 1fr 1fr; gap: .8rem; }
.form__row--inline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.form__label { font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.form__input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem;
  font: inherit; font-size: .9375rem; background: var(--paper); color: var(--ink);
}
.form__input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.form__input--title { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; }
.form__input--code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; line-height: 1.6; }
.form__input--color { padding: .2rem; height: 40px; }
.form__input--sm { width: auto; min-width: 160px; }
.form__hint { font-size: .75rem; color: var(--muted); margin: 0; }
.form__check { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--ink-3); cursor: pointer; }
.form__link { font-size: .8125rem; color: var(--brand); }
.form__actions { display: flex; gap: .6rem; margin-top: 1.2rem; }
.form--inline { grid-auto-flow: column; grid-auto-columns: max-content; align-items: center; }

.notice { padding: .8rem 1rem; border-radius: var(--radius-sm); font-weight: 500; border: 1px solid; margin-bottom: 1rem; }
.notice--success { background: rgba(4, 120, 87, .1); border-color: rgba(4, 120, 87, .3); color: var(--ok); }
.notice--error { background: rgba(185, 28, 28, .1); border-color: rgba(185, 28, 28, .3); color: var(--bad); }
.notice--info { background: rgba(2, 132, 199, .1); border-color: rgba(2, 132, 199, .3); color: #0369a1; }

.chips { list-style: none; display: flex; gap: .45rem; padding: 0; margin: 1rem 0 0; flex-wrap: wrap; }
.chip { display: inline-block; background: var(--paper-3); border-radius: 999px; padding: .3rem .8rem; font-size: .8125rem; font-weight: 500; }
.chip:hover { background: var(--brand); color: #fff; }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }
.code-block { background: var(--paper-3); border-radius: var(--radius-sm); padding: 1rem; font-size: .75rem; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* --- Membership ------------------------------------------------------ */
.membership { padding-bottom: 3rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 1.4rem; margin: 2rem 0; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.4rem; position: relative; display: flex; flex-direction: column; }
.plan--popular { border-color: var(--brand); box-shadow: var(--shadow-2); }
.plan__ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: .25rem .7rem; border-radius: 999px; }
.plan__name { font-size: 1.15rem; margin: 0 0 .2rem; }
.plan__price { margin: 0 0 1rem; display: flex; align-items: baseline; gap: .3rem; }
.plan__amount { font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; }
.plan__period { color: var(--muted); font-size: .875rem; }
.plan__features { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .5rem; font-size: .9rem; flex: 1; }
.plan__features li { padding-left: 1.4rem; position: relative; }
.plan__features li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.promo { margin: 28px 0; }
.promo__form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.promo__form .form__input { flex: 1 1 220px; min-height: 44px; }
.promo__note { color: var(--muted); font-size: .88rem; margin: 8px 0 0; }

.pay-methods { margin: 2.5rem 0; }
.pay-methods__list { list-style: none; display: flex; gap: .6rem; flex-wrap: wrap; padding: 0; margin: 0 0 .6rem; }
.pay-method { background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; font-size: .8125rem; font-weight: 500; display: inline-flex; gap: .4rem; align-items: center; }
.pay-method__icon { color: var(--brand); }
.pay-methods__note { font-size: .8125rem; color: var(--muted); }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1.2rem; margin-top: 2rem; }
.success-mark { color: var(--ok); margin-bottom: .6rem; }

/* --- Profile / lists ------------------------------------------------- */
.profile { display: flex; gap: 1.4rem; align-items: flex-start; margin-bottom: 2rem; }
.profile__avatar { width: 96px; height: 96px; border-radius: 50%; }
.profile__name { font-size: 1.8rem; margin: 0; }
.profile__handle { color: var(--muted); margin: 0 0 .6rem; }
.profile__bio { max-width: 60ch; }
.profile__stats { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .875rem; color: var(--muted); margin: .6rem 0; }
.profile__stats strong { color: var(--ink); font-family: var(--font-head); }
.profile__actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.profile__note { color: var(--muted); font-size: .9rem; }

.badges { list-style: none; display: flex; gap: .4rem; padding: 0; margin: .6rem 0; flex-wrap: wrap; }
.badge { background: color-mix(in srgb, var(--badge-color) 14%, transparent); color: var(--badge-color); border: 1px solid color-mix(in srgb, var(--badge-color) 30%, transparent); border-radius: 999px; padding: .2rem .6rem; font-size: .75rem; font-weight: 600; }
.account-nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.account-nav a { padding: .4rem .7rem; border-radius: 999px; font-size: .8125rem; color: var(--muted); font-weight: 500; }
.account-nav a:hover, .account-nav a[aria-current] { background: var(--ink); color: var(--paper); }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.person { display: flex; align-items: center; gap: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; }
.person img { border-radius: 50%; }
.person__name { font-weight: 600; }
.person__meta { margin: 0; font-size: .8125rem; color: var(--muted); }
.notification-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.notification { display: grid; grid-template-columns: 20px 1fr; gap: .6rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; }
.notification--unread { border-left: 3px solid var(--brand); }
.notification__icon { color: var(--brand); }
.notification__title { font-weight: 600; margin: 0 0 .2rem; }
.notification__body { margin: 0; font-size: .875rem; color: var(--ink-3); }
.notification__time { margin: 0; font-size: .75rem; color: var(--muted); }
.filters { display: flex; gap: .5rem; }
.filters input { border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1rem; font: inherit; font-size: .875rem; background: var(--paper); color: var(--ink); min-width: 220px; }
.filters--wide { margin: 1rem 0; }
.chips-list { display: flex; gap: .4rem; flex-wrap: wrap; }

/* --- Gallery --------------------------------------------------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 1.2rem; }
.gallery-item { margin: 0; }
.gallery-item img { border-radius: var(--radius-sm); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery-item figcaption { font-size: .875rem; margin-top: .4rem; }

/* --- Pagination ------------------------------------------------------ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 2rem 0; }
.pagination__link { font-weight: 600; font-size: .875rem; }
.pagination__status { font-size: .8125rem; color: var(--muted); }

/* --- Newsletter ------------------------------------------------------ */
.newsletter { display: flex; gap: .5rem; }
.newsletter--stack { flex-direction: column; }
.newsletter input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: .55rem 1rem; font: inherit; font-size: .875rem; background: var(--paper); color: var(--ink); min-width: 0; }
.newsletter__note { font-size: .8125rem; color: var(--ok); margin: .4rem 0 0; }

/* --- Footer ---------------------------------------------------------- */
.footer { background: var(--ink); color: #cbd5e1; padding: 3rem 0 1.5rem; margin-top: 2rem; }
html[data-theme="dark"] .footer { background: #060b16; }
.footer__grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr 1.4fr; gap: 2rem; }
@media (max-width: 899px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 559px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand { color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; display: inline-block; margin-bottom: .6rem; }
.footer__title { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: #94a3b8; margin: 0 0 .8rem; }
.footer__text { font-size: .875rem; color: #94a3b8; max-width: 38ch; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .875rem; }
.footer__list a { color: #cbd5e1; }
.footer__list a:hover { color: #fff; }
.footer__social { display: flex; gap: .5rem; margin-top: 1rem; }
.footer__social a { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); font-size: .75rem; font-weight: 700; color: #cbd5e1; }
.footer__social a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.footer__bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2rem; padding-top: 1.2rem; font-size: .8125rem; color: #94a3b8; }
.footer__bar p { margin: 0; }
.footer__meta a { color: #cbd5e1; }

/* --- Cookie banner --------------------------------------------------- */
.cookie { position: fixed; left: 1rem; bottom: 1rem; z-index: 60; max-width: 380px; }
.cookie[hidden] { display: none; }
.cookie__box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-3); padding: 1.2rem 1.3rem; }
.cookie__title { font-family: var(--font-head); font-weight: 700; margin: 0 0 .3rem; }
.cookie__text { font-size: .8125rem; color: var(--muted); margin: 0 0 .9rem; }
.cookie__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* --- RTL ------------------------------------------------------------- */
html[dir="rtl"] .navbar__utility { margin: 0 auto 0 0; }
html[dir="rtl"] .mini__views { margin: 0 auto 0 0; }
html[dir="rtl"] .reactions { margin: 0 auto 0 0; }
html[dir="rtl"] .card__kicker, html[dir="rtl"] .story__kicker { flex-direction: row-reverse; }
html[dir="rtl"] .mega, html[dir="rtl"] .dropdown { left: auto; right: 0; }
html[dir="rtl"] .topbar__tools { margin: 0 auto 0 0; }
html[dir="rtl"] .page-head--row { flex-direction: row-reverse; }

/* --- Motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* --- Mobile navigation and small-screen layout -------------------------- */
@media (max-width: 1023px) {
  .navbar__utility { display: none; }
  .navbar__list {
    flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .navbar__list::-webkit-scrollbar { display: none; }
  .navbar__item { flex: 0 0 auto; }
}

@media (max-width: 767px) {
  .topbar__inner { gap: .6rem; }
  .topbar__date { display: none; }
  .topbar__search { display: none; }
  .topbar__ticker { min-width: 0; }

  .navbar__inner { position: relative; }
  .navbar__toggle { display: inline-flex; }
  .navbar__list {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; overflow-x: visible;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-3); padding: .4rem; z-index: 50;
  }
  body.nav-open .navbar__list { display: flex; }
  .navbar__item > a { display: flex; justify-content: space-between; width: 100%; padding: .7rem .6rem; }
  .navbar__utility { display: none; }
  .mega {
    position: static; width: auto; box-shadow: none; border: 0; border-top: 1px solid var(--line);
    border-radius: 0; padding: .8rem 0; opacity: 1; visibility: visible; transform: none;
  }
  .mega__grid { grid-template-columns: repeat(2, 1fr); gap: .9rem; }
  .dropdown { position: static; box-shadow: none; border: 0; opacity: 1; visibility: visible; transform: none; padding-left: .8rem; }

  .masthead__inner { flex-wrap: wrap; gap: .6rem; }
  .masthead__tagline { display: none; }
  .masthead__actions { width: 100%; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; }
  .masthead__actions .btn { flex: 1; min-width: 120px; }

  .hero__rail { grid-template-columns: repeat(2, 1fr); }
  .story__meta { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .story__actions { gap: .4rem; }
  .reactions { margin-left: 0; width: 100%; }
  .plan__amount { font-size: 1.9rem; }
  .footer__bar { flex-direction: column; gap: .4rem; }
  .pagination { flex-wrap: wrap; }
}

@media (max-width: 479px) {
  .wrap { width: min(100% - 1.75rem, var(--wrap)); }
  .hero__rail { grid-template-columns: 1fr; }
  .mega__grid { grid-template-columns: 1fr; }
  .form__row--split { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}


/* The audio player of a story fills the column it sits in. */
.audio-player { width: 100%; }
