/* News index (/news). Scoped so article pages stay as shipped.
   Page hero is the shared .stage.is-wide system; the newest recap is a
   large Featured card below. Recent recaps, optional archive, subscribe band. */

body[data-page="news"] {
  overflow-x: clip;
}

body[data-page="news"] main {
  width: 100%;
  max-width: none;
  margin: 0;
}

/* Article pages keep a solid nav. The News index lets the stage tuck under the tabs. */
body.article-page .nav-fade {
  background: var(--bg);
}
body.article-page .nav-frost {
  bottom: 0;
  background: var(--bg);
}
body.article-page .nav-frost::before,
body.article-page .nav-frost::after {
  display: none;
}

body.news-page .nav-fade {
  background: transparent;
}
html.theme-light body.news-page .nav-fade {
  background: transparent;
}
body.news-page .nav a:not([aria-current="page"]) {
  color: rgba(242, 242, 247, 0.82);
  color: color-mix(in srgb, var(--tab) calc(var(--hero-mix, 0) * 100%), rgba(242, 242, 247, 0.82));
}
body.news-page .theme-toggle {
  background: rgba(255, 255, 255, 0.16);
  background: color-mix(in srgb, var(--pill) calc(var(--hero-mix, 0) * 100%), rgba(255, 255, 255, 0.16));
  color: #f2f2f7;
  color: color-mix(in srgb, var(--tile-text) calc(var(--hero-mix, 0) * 100%), #f2f2f7);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}

body[data-page="news"] .btn-solid {
  background: var(--strong);
  color: var(--bg);
}
body[data-page="news"] .btn-solid:hover { filter: brightness(1.06); }
body[data-page="news"] .btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* Hero height, padding, and type placement come from the shared
   .stage.is-wide rules in presence.css (same as Drive-in / Optimus).
   Do not override min-height or .stage-inner here — a News-only
   flex-end / 64px pad put the title at the bottom of the stage and
   could cut the subtitle off in mid-width windows. */

/* ----- FEATURED: latest recap, full grid width, clearly larger than Recent cards ----- */
.featured {
  width: var(--col);
  margin: 56px auto 0;
}
.featured h2 {
  margin: 0 0 18px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--strong);
}
.featured-card {
  display: grid;
  align-content: start;
  gap: 0;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  cursor: pointer;
}
.featured-cover {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0a0c;
  aspect-ratio: 5 / 2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.featured-cover picture {
  display: block;
  width: 100%;
  height: 100%;
}
.featured-cover img {
  display: block;
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.featured-card:hover .featured-cover { filter: brightness(1.06); }
.featured-caption {
  display: block;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.featured-copy {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 16px;
  max-width: 720px;
  min-width: 0;
}
.featured-headline {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--strong);
  text-wrap: pretty;
}
.featured-dek {
  font-size: 19px;
  line-height: 1.45;
  color: var(--text);
  text-wrap: pretty;
}
.featured-read {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--strong);
  color: var(--bg);
  font-size: 15px;
  font-weight: 500;
  width: fit-content;
}
.featured-card:hover .featured-read { filter: brightness(1.06); }
@media (min-width: 701px) {
  .featured-headline .headline-rest { display: block; }
}

/* ----- RECENT RECAPS ----- */
.recent {
  width: var(--col);
  margin: 80px auto 0;
}
.recent h2 {
  margin: 0 0 22px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--strong);
}
.recap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.recap-card {
  display: grid;
  align-content: start;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  cursor: pointer;
}
.recap-cover {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #161618;
  aspect-ratio: 5 / 2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
html.theme-light .recap-cover {
  background: #e8e8ea;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.recap-cover picture {
  display: block;
  width: 100%;
  height: 100%;
}
.recap-cover img {
  display: block;
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.recap-card:hover .recap-cover { filter: brightness(1.06); }
.recap-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.recap-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.recap-headline {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.22;
  color: var(--strong);
  text-wrap: pretty;
}
.recap-dek {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  text-wrap: pretty;
}
.recap-credit {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}
.recap-read {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.recap-card:hover .recap-read { color: #fff; }
html.theme-light .recap-card:hover .recap-read { color: var(--strong); }

/* ----- ARCHIVE (hidden until recaps overflow the six card slots) ----- */
.archive {
  width: var(--col);
  margin: 80px auto 0;
}
.archive h2 {
  margin: 0 0 22px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--strong);
}
.archive-month { margin: 0 0 28px; }
.archive-month:last-child { margin-bottom: 0; }
.archive-month h3 {
  margin: 0;
  padding: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--strong);
  border-bottom: 1px solid var(--line);
}
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.archive-row {
  display: grid;
  grid-template-columns: 13.25em minmax(0, 1fr) 18px;
  gap: 16px;
  align-items: center;
  min-height: 52px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.archive-row:hover .archive-headline { color: #fff; }
html.theme-light .archive-row:hover .archive-headline { color: var(--strong); }
.archive-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.archive-headline {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--strong);
  min-width: 0;
  text-wrap: pretty;
}
.archive-chevron {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.archive-chevron svg { width: 14px; height: 14px; display: block; }

/* ----- SUBSCRIBE: full-width band, not paired with a card ----- */
.subscribe-band {
  width: 100%;
  margin-top: 72px;
  padding: 40px 0;
  background: var(--card);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
html.theme-light .subscribe-band {
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.06);
}
.subscribe-inner {
  width: var(--col);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
body[data-page="news"] .subscribe-band .subscribe-block {
  display: contents;
}
body[data-page="news"] .subscribe-band .subscribe-line {
  margin: 0;
  max-width: 36em;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--strong);
  text-wrap: pretty;
}
body[data-page="news"] .subscribe-band .subscribe-embed {
  width: auto;
  min-width: 0;
  max-width: 100%;
}

/* Occasional short posts from news.json; ships empty. */
.news-updates {
  width: var(--col);
  margin: 56px auto 0;
}

@media (max-width: 700px) {
  .featured { margin-top: 36px; }
  .featured h2 { font-size: 22px; margin-bottom: 14px; }
  .featured-headline { font-size: 26px; }
  .featured-dek { font-size: 17px; }
  .featured-copy { margin-top: 14px; }
  .recent { margin-top: 56px; }
  .recent h2 { font-size: 22px; margin-bottom: 16px; }
  .recap-grid { grid-template-columns: 1fr; gap: 32px; }
  .recap-headline { font-size: 20px; }
  .recap-dek { font-size: 16px; }
  .subscribe-band { margin-top: 56px; padding: 28px 0; }
  .subscribe-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  body[data-page="news"] .subscribe-band .subscribe-line { font-size: 17px; }
  .archive { margin-top: 56px; }
  .archive h2 { font-size: 22px; }
  .archive-month { margin-bottom: 22px; }
  .archive-row {
    grid-template-columns: minmax(0, 1fr) 16px;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    min-height: 0;
    padding: 12px 0;
  }
  .archive-date {
    grid-column: 1;
    grid-row: 1;
    white-space: normal;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .archive-headline {
    grid-column: 1;
    grid-row: 2;
    font-size: 16px;
  }
  .archive-chevron {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* News hero 720px + compact subscribe card (2026-11-18). */
/* News hero + subscribe band — additive mock CSS.
   Load after presence.css, hero-heights.css, and news-index.css.
   Does not change the official Tesla photo, the Photo: Tesla credit,
   or the title size.
   Scoped: hero rules are .news-page only (article pages share
   data-page="news" but have no stage). Subscribe rules apply to
   .subscribe-band on both /news and recap article pages. */

/* ---------- News hero (desktop / tablet) ----------
   Cause: .stage-inner always uses align-items:center and
   padding-bottom: calc(var(--lift) + 40px) (=172px) to reserve
   room for a lifted card. News has no lift, so the short
   title + lede + credit block is centered in the remaining
   ~288px of the 540px is-wide stage and sits just under the
   nav. The unused 172px pad plus the 56px .featured margin
   leave a ~306px faded dead band between the credit and
   "Latest". The 540px cap is also shorter than the other
   main is-wide heroes (Home / Optimus 720, Drive-in 620).

   Fix: raise the News stage to 720px, matching Home and
   Optimus; vertically center the title block in the padded
   hero (the shared pattern — see NOTES); and pull "Latest"
   up so the credit-to-"Latest" gap stays 75px.
   Phone already uses the stacked is-wide pattern with type
   under the still, so its hero height is left alone. */
@media (min-width: 701px) {
  body.news-page .stage.is-wide,
  .news-page .stage.is-wide {
    aspect-ratio: auto;
    height: 720px;
    min-height: 720px;
    max-height: 740px;
  }

  /* Home, Optimus, Past Items, and Drive-in all use
     align-items:center. The title block is exactly centered
     in the padded content box (top pad clears the nav, bottom
     pad reserves the lift). It is not flex-end, and it is not
     centered in the full hero-excluding-nav band (the lift
     pad is larger than the top pad, so the block sits slightly
     above that mid).
     Bottom pad matches Home / Optimus (--lift + 56px = 188px).
     With News's 80px top pad and -8px stage offset, the copy
     mid lands at 298px — the same absolute position as Home. */
  body.news-page .stage.is-wide .stage-inner,
  .news-page .stage.is-wide .stage-inner {
    align-items: center;
    padding-bottom: calc(var(--lift) + 56px);
  }

  /* Keep the 75px credit-to-Latest gap after centering.
     At 1440 the type block is 132.5px, so the credit sits at
     364.25 and Latest at 439.25. Stage bottom is 712.
     margin-top = 439.25 - 712 = -272.75px
     = -(--lift) - 140.75px. */
  body.news-page .featured,
  .news-page .featured {
    position: relative;
    z-index: 5;
    margin-top: calc(-1 * var(--lift) - 140.75px);
  }

  /* Light-mode safety for white type over the mid-fade. */
  html.theme-light body.news-page .stage.is-wide h1,
  html.theme-light body.news-page .stage.is-wide .lede,
  html.theme-light body.news-page .stage.is-wide .meta {
    text-shadow: 0 1px 2px rgba(0,0,0,.5), 0 2px 16px rgba(0,0,0,.72);
  }
}

/* ---------- Subscribe band: compact content-width card ----------
   The band is a full-viewport --card slab (1440×124 at 1440,
   40px padding; 390×164 on phone, 28px padding) with the
   line and pill stretched to the far edges of --col, so most
   of the band is empty. It appears on /news and on recap
   article pages (both load news-index.css; article pages
   also have data-page="news").

   Fix: drop the full-bleed background and turn .subscribe-inner
   into a 14px-radius card in the same --col as the recap cards,
   with 22px vertical padding (20px on phone). Copy, colors,
   and the white Subscribe pill are unchanged. */
.subscribe-band {
  width: var(--col);
  max-width: 100%;
  margin-top: 72px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
html.theme-light .subscribe-band {
  box-shadow: none;
}

.subscribe-band .subscribe-inner {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
html.theme-light .subscribe-band .subscribe-inner {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), var(--card-shadow);
}

/* Flatten the inner .subscribe-block (already display:contents
   on these pages) so the line and button are flex children of
   the card, on both /news and article pages. */
.subscribe-band .subscribe-block {
  display: contents;
}
.subscribe-band .subscribe-line {
  margin: 0;
  max-width: 36em;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--strong);
  text-wrap: pretty;
}
.subscribe-band .subscribe-embed {
  width: auto;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
}
.subscribe-band .btn,
.subscribe-band a.btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .subscribe-band {
    margin-top: 56px;
    padding: 0;
  }
  .subscribe-band .subscribe-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
  }
  .subscribe-band .subscribe-line {
    font-size: 17px;
  }
  .subscribe-band .btn,
  .subscribe-band a.btn,
  .subscribe-band .subscribe-embed {
    width: 100%;
  }
  .subscribe-band .btn,
  .subscribe-band a.btn {
    display: inline-flex;
    justify-content: center;
    box-sizing: border-box;
  }
}
