/* ============================================================
   ARTICLE PAGE
   ------------------------------------------------------------
   Loaded after news.css and overrides its article rules. The page
   fills the screen: an edge-to-edge hero with the headline on the
   picture, then the story beside a sticky rail (contents, key
   facts, share), then "keep reading". Motion is on load and on
   scroll only, and all of it stops under reduced motion.
   ============================================================ */

/* The hero breaks out of the page column, so the page itself clips the
   overflow; clipping the column would cut the hero back to its width. */
html:has(.article-view), body:has(.article-view) { overflow-x: clip; }
.article-view { max-width: none; }
.article-view > .news-back { margin-bottom: var(--s-4, 16px); }

/* ---- hero: full bleed ------------------------------------------ */
.article-view .news-hero,
.article-view .news-hero-band {
  margin-inline: calc(50% - 50vw);
  border-radius: 0;
}

.article-view .news-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(440px, 74vh, 780px);
  background: var(--midnight, #071b33);
}
.article-view .news-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.article-view .news-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(3, 16, 32, .94) 0%, rgba(3, 16, 32, .6) 38%, rgba(3, 16, 32, .08) 72%),
    linear-gradient(100deg, rgba(37, 99, 235, .28), transparent 45%);
}
.news-hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 0 max(20px, calc(50vw - 640px)) clamp(36px, 6vh, 72px);
  color: var(--white, #fff);
}
.news-hero-overlay > * { max-width: 52rem; }
.news-hero-overlay .news-kicker {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--electric, #2563eb);
  color: var(--white, #fff);
}
.news-hero-overlay .news-title {
  margin: 0 0 16px;
  color: var(--white, #fff);
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  text-shadow: 0 14px 40px rgba(3, 16, 32, .45);
}
.news-hero-overlay .news-standfirst {
  margin: 0 0 16px;
  color: var(--on-dark-mid, #cdddf3);
  font-size: clamp(1.05rem, 1rem + .45vw, 1.32rem);
  max-width: 44rem;
}
.news-hero-overlay .news-byline { color: rgba(255, 255, 255, .78); }
.news-hero-overlay .news-byline-author { color: var(--white, #fff); }
.article-view .news-hero figcaption {
  position: absolute;
  right: max(16px, calc(50vw - 640px));
  bottom: 12px;
  z-index: 2;
  margin: 0;
  font-size: .75rem;
  color: rgba(255, 255, 255, .62);
}

.article-view .news-hero-band {
  padding-inline: max(24px, calc(50vw - 640px));
  min-height: clamp(320px, 46vh, 520px);
}

/* A tall or small photo is framed beside the headline on the navy band,
   tilted like a print on a desk, rather than cropped into a full-bleed hero. */
.article-view .news-hero-band--photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: clamp(380px, 56vh, 600px);
}
.news-hero-inset {
  position: relative;
  z-index: 1;
  margin: 0;
  justify-self: end;
  transform: rotate(2.5deg);
}
.news-hero-inset img {
  display: block;
  width: 100%;
  max-height: min(52vh, 480px);
  object-fit: cover;
  border: 6px solid var(--white, #fff);
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(3, 16, 32, .45);
}
.news-hero-inset figcaption {
  margin-top: 10px;
  font-size: .72rem;
  color: rgba(255, 255, 255, .6);
  transform: rotate(-2.5deg);
}

/* ---- story + rail ---------------------------------------------- */
.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 46rem) 19rem;
  justify-content: center;
  align-items: start;
  gap: clamp(28px, 4vw, 56px);
  max-width: 1320px;
  margin: clamp(28px, 4vw, 52px) auto 0;
}
.news-hero-band + .news-layout { margin-top: clamp(-72px, -6vw, -44px); }
.news-layout .news-reading {
  width: 100%;
  margin: 0;
}

.news-aside {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 16px;
}
.news-aside-card {
  padding: 18px 20px;
  border: 1px solid var(--surface-line, #e2e8f0);
  border-radius: var(--r-lg, 16px);
  background: var(--surface, #fff);
  box-shadow: 0 14px 34px rgba(3, 16, 32, .08);
}
.news-aside-title {
  margin: 0 0 10px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--art-accent, #1d4ed8);
}
.news-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: 2px; }
.news-toc li { counter-increment: toc; }
.news-toc a {
  display: grid;
  grid-template-columns: 1.6em minmax(0, 1fr);
  padding: 7px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--ink-mid, #475569);
  font-size: .9rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.news-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--ink-faint, #94a3b8); font-variant-numeric: tabular-nums; }
.news-toc a:hover { color: var(--ink, #0b1b30); background: var(--surface-sunk, #eef2f7); }
.news-toc a[aria-current] {
  color: var(--ink, #0b1b30);
  font-weight: 700;
  border-left-color: var(--art-accent, #1d4ed8);
  background: color-mix(in srgb, var(--art-accent, #1d4ed8) 9%, transparent);
}
.news-facts { margin: 0; display: grid; gap: 8px; }
.news-facts > div { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.news-facts dt { color: var(--ink-soft, #64748b); }
.news-facts dd { margin: 0; font-weight: 700; color: var(--ink, #0b1b30); text-align: right; }
.news-share { display: flex; flex-wrap: wrap; gap: 8px; }
.news-share-btn {
  padding: 7px 12px;
  border: 1px solid var(--surface-line, #e2e8f0);
  border-radius: 999px;
  background: var(--surface-sunk, #eef2f7);
  color: var(--ink, #0b1b30);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.news-share-btn:hover { transform: translateY(-2px); border-color: var(--art-accent, #1d4ed8); }

/* On a narrow screen the rail drops below the story, so its contents list
   gives way to a collapsed one at the top of the story. */
.news-toc-mobile { display: none; }
@media (max-width: 1080px) {
  .news-layout { grid-template-columns: minmax(0, 46rem); }
  .news-aside { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .news-toc { display: none; }
  .news-toc-mobile {
    display: block;
    margin: 0 0 18px;
    border: 1px solid var(--surface-line, #e2e8f0);
    border-radius: 14px;
    background: var(--surface-sunk, #f4f7fb);
  }
  .news-toc-mobile summary {
    padding: 12px 16px;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--art-accent, #1d4ed8);
    cursor: pointer;
  }
  .news-toc-mobile ol { margin: 0; padding: 0 16px 12px 36px; display: grid; gap: 4px; }
  .news-toc-mobile a { display: block; padding: 6px 0; color: var(--ink-mid, #475569); text-decoration: none; font-size: .95rem; }
  .news-toc-mobile a[aria-current] { color: var(--ink, #0b1b30); font-weight: 700; }
}

/* ---- the body -------------------------------------------------- */
.news-body > p:first-of-type::first-letter {
  float: left;
  margin: .08em .1em 0 0;
  font-family: var(--font-display, inherit);
  font-size: 3.4em;
  font-weight: 700;
  line-height: .82;
  color: var(--art-accent, #1d4ed8);
}
.news-body h2 {
  position: relative;
  padding-left: 18px;
  font-family: var(--font-display, inherit);
  letter-spacing: -.01em;
}
.news-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .12em;
  bottom: .12em;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--art-accent, #1d4ed8), var(--blue-300, #7fa5f8));
  transform-origin: top;
  transition: transform .7s var(--ease-out, ease-out) .15s;
}
.news-body h2.news-reveal:not(.is-visible)::before { transform: scaleY(0); }
.news-body strong {
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--art-accent, #1d4ed8) 18%, transparent) 62%);
}
.news-body blockquote {
  position: relative;
  margin-block: 1.6em;
  padding: 20px 24px 20px 28px;
  border-left: 5px solid var(--art-accent, #1d4ed8);
  border-radius: 0 14px 14px 0;
  background: color-mix(in srgb, var(--art-accent, #1d4ed8) 7%, var(--surface, #fff));
  color: var(--ink, #0b1b30);
  font-size: 1.3rem;
  font-style: normal;
  line-height: 1.5;
}

/* Stats tables: a navy header, striped rows, numbers that line up. */
.news-body table {
  margin-block: 1.6em;
  border: 1px solid var(--surface-line, #e2e8f0);
  border-radius: 14px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 16px 36px rgba(3, 16, 32, .08);
}
.news-body th, .news-body td { border: 0; border-bottom: 1px solid var(--surface-line, #e2e8f0); padding: 11px 14px; }
.news-body thead th {
  background: var(--midnight, #071b33);
  color: var(--white, #fff);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.news-body tbody tr:nth-child(even) td { background: var(--surface-sunk, #f4f7fb); }
.news-body tbody tr:last-child td { border-bottom: 0; }
.news-body tbody tr { transition: background .15s ease; }
.news-body tbody tr:hover td { background: color-mix(in srgb, var(--art-accent, #1d4ed8) 8%, transparent); }

.news-body .news-sources-title {
  margin-top: 2.4em;
  padding-top: 1.2em;
  border-top: 1px solid var(--surface-line, #e2e8f0);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft, #64748b);
}
.news-body .news-sources-title::before { display: none; }
.news-body .news-sources-list { font-size: .88rem; color: var(--ink-soft, #64748b); }

/* ---- keep reading ---------------------------------------------- */
.news-next {
  max-width: 1320px;
  margin: clamp(56px, 7vw, 96px) auto 0;
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--surface-line, #e2e8f0);
}
.news-next-head h2 {
  margin: 4px 0 20px;
  font-family: var(--font-display, inherit);
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
}
.news-next-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* ---- motion ---------------------------------------------------- */
@keyframes newsKenBurns { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes newsRise { from { opacity: 0; transform: translateY(22px); } }
@keyframes newsInsetIn { from { opacity: 0; transform: translateY(30px) rotate(8deg) scale(.94); } }
@keyframes newsInsetFloat {
  from { transform: rotate(2.5deg) translateY(0); }
  to { transform: rotate(1deg) translateY(-8px); }
}

.news-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease-out, ease-out), transform .7s var(--ease-out, ease-out);
}
.news-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="off"]) .article-view .news-hero img {
    animation: newsKenBurns 2.4s cubic-bezier(.2, .7, .2, 1) both;
  }
  :root:not([data-motion="off"]) .news-hero-overlay > *,
  :root:not([data-motion="off"]) .news-hero-band-inner > * {
    animation: newsRise .8s var(--ease-out, ease-out) both;
  }
  :root:not([data-motion="off"]) .news-hero-overlay > :nth-child(2),
  :root:not([data-motion="off"]) .news-hero-band-inner > :nth-child(2) { animation-delay: .12s; }
  :root:not([data-motion="off"]) .news-hero-overlay > :nth-child(3),
  :root:not([data-motion="off"]) .news-hero-band-inner > :nth-child(3) { animation-delay: .24s; }
  :root:not([data-motion="off"]) .news-hero-overlay > :nth-child(4),
  :root:not([data-motion="off"]) .news-hero-band-inner > :nth-child(4) { animation-delay: .36s; }
  :root:not([data-motion="off"]) .news-aside { animation: newsRise .8s .45s var(--ease-out, ease-out) both; }
  :root:not([data-motion="off"]) .news-hero-inset {
    animation: newsInsetIn 1s .2s cubic-bezier(.2, .8, .2, 1) both,
               newsInsetFloat 7s 1.2s ease-in-out infinite alternate;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-reveal { opacity: 1; transform: none; transition: none; }
  .news-body h2.news-reveal:not(.is-visible)::before { transform: none; }
}
[data-motion="off"] .news-reveal { opacity: 1; transform: none; transition: none; }
[data-motion="off"] .news-body h2.news-reveal:not(.is-visible)::before { transform: none; }

@media (max-width: 760px) {
  .article-view .news-hero-band--photo { grid-template-columns: minmax(0, 1fr); }
  .news-hero-inset { order: -1; justify-self: start; width: min(70%, 260px); }
  .news-hero-inset img { max-height: 300px; }
}

@media (max-width: 640px) {
  .article-view .news-hero { height: clamp(420px, 78vh, 640px); }
  .news-body > p:first-of-type::first-letter { font-size: 2.8em; }
  .news-body blockquote { font-size: 1.12rem; }
}
