/* The news pages (news/render.mjs), built on the site's variables in styles.css: the
   site's navy, indigo and gold, borrowed structure from real news front pages (AP
   News, BBC News, 2026-10-18). Nothing here styles an item by its kind: there is no
   class for it. */

.news { background: var(--paper); padding: clamp(1.5rem, 4vw, 3rem) 0 4rem; }

/* The edition page's frame: on a wide screen a sticky list of sections down the left
   (Aaron, 2026-10-19), the stories beside it at their usual width; narrower, the list
   gives way to the links under the date. */
.news__wrap { width: min(1340px, calc(100% - 2.5rem)); margin-inline: auto; }
.news__side { display: none; }
.news__lead, .news__section { scroll-margin-top: 84px; }
@media (min-width: 1100px) {
  .news__wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 2.4rem; align-items: start; }
  .news__side { display: block; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: .4rem; }
  .news__wrap .news__jump { display: none; }
}
.news__side-title { margin: 0 0 .6rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--indigo); }
/* Each section is a button (Aaron, 2026-10-19), down the side on a wide screen and as
   pills under the date on a narrower one, both under "News sections". */
.news__side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.news__side a, .news__jump a { display: block; padding: .5rem .8rem; color: var(--navy); background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px; text-decoration: none; font-size: .9rem; font-weight: 600; line-height: 1.25; box-shadow: 0 1px 2px rgba(22, 20, 60, .06); }
.news__side a:hover, .news__side a:focus-visible, .news__jump a:hover, .news__jump a:focus-visible { background: var(--navy); color: var(--white); border-color: var(--navy); border-left-color: var(--gold); }
.news__side a.news__jobs-link, .news__jump a.news__jobs-link { background: var(--gold); border-color: var(--gold-2); border-left-color: var(--navy); color: var(--navy); }
.news__side a.news__jobs-link:hover, .news__side a.news__jobs-link:focus-visible, .news__jump a.news__jobs-link:hover, .news__jump a.news__jobs-link:focus-visible { background: var(--navy); color: var(--gold); border-color: var(--navy); }

/* Back to top, bottom right, once the page has moved (site/news.js). */
.news__to-top { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--navy); color: var(--gold); box-shadow: 0 6px 18px rgba(22, 20, 60, .3); cursor: pointer; }
.news__to-top[hidden] { display: none; }
.news__to-top svg { width: 24px; height: 24px; }
.news__to-top:hover, .news__to-top:focus-visible { background: var(--navy-2); }

/* Masthead */
.news__masthead { border-bottom: 3px solid var(--navy); padding-bottom: 1.2rem; margin-bottom: 2rem; }
/* The masthead (Aaron, 2026-10-19): the name as the header, what it covers under it,
   then the day. */
.news__brand { margin: 0 0 .3rem; font-size: clamp(2.1rem, 6.5vw, 3.4rem); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; line-height: 1.05; color: var(--navy); }
.news__kicker { margin: 0 0 .4rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; color: var(--indigo); }
.news__masthead .news__brand + .news__kicker { margin-bottom: .9rem; font-size: .82rem; line-height: 1.5; }
.news__kicker a { color: inherit; text-decoration: none; }
.news__date { margin: 0 0 .3rem; font-family: var(--font-head); font-size: clamp(1.5rem, 3.6vw, 2.3rem); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--navy); }
.news__masthead h1.news__date { font-size: clamp(1.9rem, 4.5vw, 3rem); }
/* The edition's date on the front page is a smaller line under the name (Aaron,
   2026-10-22: "move the edition release information to a smaller sub header below"). */
.news__masthead p.news__date { margin: 0 0 .35rem; font-size: clamp(1.05rem, 1.7vw, 1.25rem); font-weight: 700; letter-spacing: 0; }
.news__correction { margin: 0 0 1rem; padding: .7rem 1rem; border-left: 4px solid var(--gold-2); background: var(--white); color: var(--ink); }
.news__jump { display: flex; flex-wrap: wrap; gap: .45rem; }
.news__jump .news__side-title { flex-basis: 100%; margin: .2rem 0 .1rem; }
.news__jump a { display: inline-block; border-radius: 999px; padding: .45rem .85rem; }

.news__label { margin: 0 0 .35rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--indigo); }
.news__label a { color: inherit; text-decoration: none; }

/* Cards. The headline is the link; its ::after covers the card so the whole card
   answers a click, and any other link in it (the earlier-edition note) sits above. */
.news__card { position: relative; display: flex; flex-direction: column; gap: .55rem; min-width: 0; }
.news__card-title { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.news__card-title a { color: var(--navy); text-decoration: none; }
.news__card-title a::after { content: ""; position: absolute; inset: 0; }
.news__card:hover .news__card-title a, .news__card-title a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.news__card-dek { margin: 0; color: var(--ink); line-height: 1.5; font-size: .95rem; }
.news__card-meta { margin: 0; font-size: .8rem; color: var(--muted); }
.news__card-meta a { position: relative; z-index: 1; color: var(--indigo); }
.news__more { position: relative; z-index: 1; color: var(--indigo); font-weight: 600; white-space: nowrap; }
.news__card-body { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.news__card-body > .news__label { margin: 0; }

/* One picture shape, 16:9, cropped here and never in the file. The credit always shows
   on the corner (the caption/metadata pair in news/images.mjs). */
.news__card-pic { position: relative; margin: 0; }
.news__card-media { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: var(--line); }
.news__card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news__card-credit { position: absolute; right: 0; bottom: 0; max-width: 100%; padding: .15rem .45rem; font-size: .65rem; line-height: 1.3; color: #fff; background: rgba(22, 20, 60, .72); border-top-left-radius: 6px; border-bottom-right-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A story without a picture is a text card: a gold rule, its standfirst, and room. */
.news__card--text { border-top: 3px solid var(--gold); padding-top: .7rem; }
.news__grid .news__card--text .news__card-dek { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* Top Stories (Aaron, 2026-10-22): its title as over every section, then the lead,
   its headline across the width over its picture and standfirst, then the other lead
   stories in a row under it. Nothing sits beside a column it cannot fill. */
.news__lead { display: grid; gap: 1.4rem; margin-bottom: 2.6rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.news__lead > .news__section-title { margin: 0; }
.news__card--lead .news__card-title { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; }
.news__card--lead .news__card-dek { font-size: 1.08rem; }
.news__rail { display: grid; gap: 1.2rem; align-content: start; }
.news__card--rail .news__card-title { font-size: 1.15rem; }
.news__card--rail .news__card-dek { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Narrower, the rail is a list under the lead: a story with a picture is a row,
   headline left, a small picture right, its credit under the picture. */
@media (max-width: 899px) {
  .news__card--rail.news__card--picture { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: .8rem; align-items: start; }
  .news__card--rail .news__card-pic { order: 2; }
  .news__card--rail .news__card-credit { position: static; padding: .2rem 0 0; background: none; color: var(--muted); white-space: normal; font-size: .6rem; border-radius: 0; }
  .news__rail > .news__card + .news__card { padding-top: 1.2rem; border-top: 1px solid var(--line); }
  .news__rail > .news__card--text + .news__card, .news__rail > .news__card + .news__card--text { border-top: 3px solid var(--gold); }
}
@media (min-width: 900px) {
  /* The lead: label and headline across the top, the picture under them on the left,
     the standfirst and date beside it. */
  .news__card--lead.news__card--picture { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr; gap: 0 1.4rem; align-items: start; }
  .news__card--lead.news__card--picture .news__card-body { display: contents; }
  .news__card--lead.news__card--picture .news__label { grid-column: 1 / -1; grid-row: 1; margin: 0 0 .55rem; }
  .news__card--lead.news__card--picture .news__card-title { grid-column: 1 / -1; grid-row: 2; margin-bottom: 1rem; }
  .news__card--lead.news__card--picture .news__card-pic { grid-column: 1; grid-row: 3 / -1; }
  .news__card--lead.news__card--picture .news__card-dek { grid-column: 2; grid-row: 3; }
  .news__card--lead.news__card--picture .news__card-meta { grid-column: 2; grid-row: 4; margin-top: .55rem; }
  /* The row under it: one story runs the width, its picture beside it; two or three
     share it as cards. */
  .news__rail { gap: 1.6rem 1.4rem; }
  .news__rail--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news__rail--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .news__rail--1 > .news__card--picture { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.4rem; align-items: start; }
  .news__lead:not(.news__lead--side) .news__rail--1 .news__card-dek { -webkit-line-clamp: unset; display: block; }
}
/* Wide enough, one other story sits beside the lead's picture, under its standfirst:
   the lead's rows are the section's (subgrid), so the picture spans that story too. The
   story sits above the lead's whole-card link. */
@media (min-width: 1300px) {
  .news__lead--side { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto auto 1fr; gap: 0 1.4rem; }
  .news__lead--side > .news__section-title { grid-column: 1 / -1; margin-bottom: 1.4rem; }
  .news__lead--side > .news__card--lead.news__card--picture { grid-column: 1 / -1; grid-row: 2 / -1; grid-template-columns: subgrid; grid-template-rows: subgrid; }
  .news__lead--side > .news__rail { grid-column: 2; grid-row: 6; position: relative; z-index: 1; margin-top: 1.4rem; }
  .news__lead--side .news__card--rail.news__card--picture { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: .8rem; align-items: start; }
  .news__lead--side .news__card--rail .news__card-pic { order: 2; }
  .news__lead--side .news__card--rail .news__card-credit { position: static; padding: .2rem 0 0; background: none; color: var(--muted); white-space: normal; font-size: .6rem; border-radius: 0; }
}

/* Sections: a short gold rule, the title, then the grid. */
.news__section { margin-bottom: 2.8rem; }
.news__section-title { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 0 0 1rem; padding-top: .55rem; position: relative; }
.news__section-title::before { content: ""; position: absolute; left: 0; top: 0; width: 3.2rem; height: 4px; background: var(--gold); }
.news__grid { display: grid; gap: 1.6rem 1.4rem; }
@media (min-width: 600px) { .news__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .news__card--wide { grid-column: 1 / -1; } }
@media (min-width: 900px) { .news__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .news__card--wide { grid-column: span 2; } }
@media (min-width: 1100px) { .news__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.news__card--wide .news__card-title { font-size: 1.3rem; }
/* The first story in a section sits beside its picture, not under it, so it stays as
   tall as the cards next to it. */
@media (min-width: 900px) {
  .news__card--wide.news__card--picture { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
}

/* On a phone a picture card is a row: headline left, a small picture right. */
@media (max-width: 599px) {
  .news__grid { gap: 0; }
  .news__grid > .news__card { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .news__grid > .news__card--text { border-top: 0; border-left: 3px solid var(--gold); padding-left: .8rem; margin: .5rem 0; border-bottom: 0; }
  .news__grid > .news__card--picture:not(.news__card--wide) { display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: .8rem; align-items: start; }
  .news__grid > .news__card--picture:not(.news__card--wide) .news__card-pic { order: 2; }
  /* The credit still shows beside the picture: under it, small, instead of on it. */
  .news__grid > .news__card--picture:not(.news__card--wide) .news__card-credit { position: static; padding: .2rem 0 0; background: none; color: var(--muted); white-space: normal; font-size: .6rem; border-radius: 0; }
}

/* The weather desk's daily briefing: first in Weather, across the width, set apart. */
.news__card--briefing { background: var(--white); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: .9rem; }
.news__card--briefing .news__card-title { font-size: 1.25rem; }
@media (min-width: 900px) { .news__card--briefing.news__card--picture { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.2rem; } }
.news__weather-link { margin: 0 0 1rem; font-weight: 600; }
.news__weather-link a { color: var(--indigo); position: relative; z-index: 1; }

/* "Weather updated daily" under the date, down to the Weather section. */
/* A partial update's line, under the date of the last full edition (Aaron, 2026-10-21). */
.news__update { margin: -.2rem 0 .8rem; font-size: .95rem; font-weight: 700; color: var(--ink); }
.news__weather-note { margin: -.6rem 0 1rem; font-size: .9rem; }
.news__weather-note a { color: var(--indigo); font-weight: 600; }

/* Weather (Aaron, 2026-10-19): the briefing, the radar thumbnail with its link under
   it, then Shepherd's forecast on the right once it is in place. */
.news__weather { display: grid; gap: 1.4rem; align-items: start; margin-bottom: 1.8rem; }
@media (min-width: 900px) {
  .news__weather { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .news__weather--three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
}
.news__weather .news__card--briefing { margin-bottom: 0; }
.news__weather .news__card--briefing.news__card--picture { display: flex; }
.news__weather-thumb { display: block; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); }
.news__weather-thumb img { display: block; width: 100%; height: auto; }
.news__weather-thumb:hover img, .news__weather-thumb:focus-visible img { opacity: .92; }
.news__weather-radar .news__weather-link { margin: .7rem 0 0; text-align: center; }
.news__weather-forecast iframe { display: block; width: 100%; height: 840px; border: 0; border-radius: 6px; background: #0f0e2b; }

/* The Nutter: fiction, at the far end. Its disclaimer is subtext, small and muted
   (Aaron's call), never a headline or a banner. */
.news__section--fiction { border-top: 3px double var(--line); padding-top: 1.2rem; }
.news__disclaimer { margin: -.5rem 0 1rem; font-size: .78rem; color: var(--muted); font-style: italic; }

/* A story's own page. */
.news__feature { max-width: 760px; }
.news__feature > .news__label { margin-top: .4rem; }
.news__feature-title { font-size: clamp(2rem, 4.8vw, 3rem); }
.news__standfirst { font-size: 1.2rem; line-height: 1.5; color: var(--ink); }
.news__feature > .news__meta { margin-bottom: 1.6rem; }
.news__feature > p { line-height: 1.7; }
.news__meta { margin: 0 0 .25rem; font-size: .85rem; color: var(--muted); }
.news__meta a { color: var(--indigo); }
.news__sources { margin: 1.2rem 0 0; font-size: .9rem; color: var(--muted); }
.news__sources a { color: var(--indigo); }
.news__paywall { font-size: .8rem; color: var(--muted); }

/* A story page's picture: the caption line always shows what the picture is, then its
   credit and licence. */
.news__figure { margin: 0 0 1.4rem; }
.news__figure img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--line); }
.news__caption { margin-top: .35rem; font-size: .78rem; line-height: 1.4; color: var(--muted); }
.news__credit { display: block; }
.news__credit a { color: var(--indigo); }

/* Statistics tables: scroll sideways inside their own box on a phone, never the page. */
.news__table { margin: 1rem 0; }
.news__table-scroll { overflow-x: auto; }
.news__table table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.news__table-title { margin: 0 0 .3rem; font-weight: 700; color: var(--navy); font-size: .92rem; }
.news__table th, .news__table td { padding: .3rem .55rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.news__table thead th { border-bottom: 2px solid var(--navy); }
.news__table-note { margin-top: .3rem; font-size: .78rem; color: var(--muted); }
.news__table-note a { color: var(--indigo); }

.news__archive { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.news__archive a { color: var(--navy-2); font-weight: 600; }
.news__rev { color: var(--muted); font-size: .85rem; }

/* Under each section's title, its past articles (Aaron, 2026-10-22). */
.news__past { margin: -.4rem 0 1rem; font-size: .88rem; }
.news__past a { color: var(--indigo); font-weight: 600; }
.news__archive--section li { display: flex; gap: .75rem; align-items: baseline; }
.news__past-date { flex: 0 0 9.5rem; color: var(--muted); font-size: .88rem; }
@media (max-width: 560px) { .news__archive--section li { flex-direction: column; gap: .1rem; } .news__past-date { flex-basis: auto; } }
