/* ==========================================================================
   AMBytz — editorial front-page layer.
   Loaded after site.css, only on the front page and the archive.

   These are standard newspaper layout conventions — a sparse centred masthead,
   a topic strip, a dark full-bleed lead, a kicker/headline/byline card, a story
   river, and ruled section blocks. Brand tokens, type and content stay AMBytz's
   own; only the editorial grammar is modelled on how news front pages work.

   No photography exists for this outlet, so every image slot degrades to a
   typographic "record" panel rather than a placeholder or a stock photo. If real
   art arrives, drop it into .lead-art / .card-art and the layout absorbs it.
   ========================================================================== */

/* ------------------------------------------------------------- masthead */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.masthead-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 1rem; min-height: 4.25rem;
}
.mh-left, .mh-right { display: flex; align-items: center; gap: .35rem; }
.mh-right { justify-content: flex-end; }
.mh-left a, .mh-right a.mh-link {
  font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg); text-decoration: none; padding: .5rem .55rem; border-radius: var(--r-sm);
}
.mh-left a:hover, .mh-right a.mh-link:hover { color: var(--accent); background: var(--accent-tint); }

.wordmark {
  display: block; text-align: center; text-decoration: none; color: var(--fg);
  font-family: var(--serif); font-weight: 500; letter-spacing: -.02em;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1;
}
.wordmark span { display: block; font-family: var(--sans); font-size: .55rem; font-weight: 800;
  letter-spacing: .3em; text-transform: uppercase; color: var(--fg-muted); margin-top: .3rem; }

.mh-tip {
  padding: .5rem .95rem; border-radius: var(--r-sm);
  background: var(--accent); color: var(--on-accent);
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.mh-tip:hover { background: var(--accent-hover); color: var(--on-accent); }

/* Masthead menu. Deliberately a drawer at EVERY width, not just mobile: the
   masthead stays sparse (the stories are the design), so the full section list
   lives behind the button the way a newspaper front page does.
   This overrides site.css's .nav-links rules, which assume the other header. */
.masthead { position: relative; }
.masthead .nav-links {
  display: none;
  position: absolute; inset: 100% 0 auto; z-index: 90;
  flex-direction: column; align-items: stretch; gap: 0;
  padding: .5rem var(--gut) 1.25rem;
  background: var(--bg); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.masthead .nav-links.is-open { display: flex; }
.masthead .nav-links a {
  padding: .8rem .25rem; border-bottom: 1px solid var(--line); border-radius: 0;
  font-size: .95rem; font-weight: 600; color: var(--fg); text-decoration: none;
}
.masthead .nav-links a:hover { color: var(--accent); background: transparent; }
.masthead .nav-links a:last-child { border-bottom: 0; }
.masthead .nav-links .nav-cta { color: var(--accent); font-weight: 800; }
.mh-menu { border-color: transparent; }

/* topic strip */
.beatstrip { border-top: 1px solid var(--line); background: var(--bg); }
.beatstrip .wrap {
  display: flex; align-items: center; gap: .35rem 1.35rem; flex-wrap: wrap;
  padding-block: .6rem; overflow-x: auto;
}
.beatstrip a {
  font-size: .68rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase;
  color: var(--fg-muted); text-decoration: none; white-space: nowrap;
}
.beatstrip a:hover { color: var(--accent); }
.beatstrip .bs-label { color: var(--accent); display: inline-flex; align-items: center; gap: .4rem; }
.beatstrip .bs-label svg { width: .85rem; height: .85rem; }

@media (max-width: 800px) {
  .masthead-row { grid-template-columns: auto 1fr auto; }
  .mh-left a:not(.mh-menu) { display: none; }
  .wordmark { text-align: left; }
}

/* ----------------------------------------------------------- lead story */
.lead {
  background: var(--navy-deep);
  color: #fff;
  border-bottom: 1px solid var(--line);
}
.lead-grid {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; min-height: 30rem;
}
.lead-body {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 4vw, 4rem);
  max-width: 46rem; margin-left: auto; width: 100%;
}
.kicker {
  font-family: var(--sans); font-size: .68rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; margin: 0 0 1.1rem;
  color: var(--accent-hover);
}
.kicker .sep { opacity: .5; margin: 0 .45rem; }
.lead h1 {
  font-family: var(--serif); font-weight: 500; color: #fff;
  font-size: clamp(1.9rem, 3.6vw, 3.15rem); line-height: 1.08;
  letter-spacing: -.02em; margin: 0 0 1.1rem; text-wrap: balance;
}
.lead-dek {
  font-family: var(--serif); font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.5; color: #c9d0ee; margin: 0 0 1.5rem; max-width: 46ch;
}
.byline {
  font-family: var(--sans); font-size: .74rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #96a0c9; margin: 0;
}
.readlink {
  display: inline-flex; align-items: center; gap: .65rem; margin-top: 1.75rem;
  color: #fff; text-decoration: none;
  font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.readlink i {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.45);
  display: grid; place-items: center; font-style: normal; font-size: .9rem;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.readlink:hover { color: #fff; }
.readlink:hover i { background: var(--accent); border-color: var(--accent); transform: translateX(3px); }

/* the art slot — typographic record panel until real art exists */
.lead-art { position: relative; overflow: hidden; background: #070a19; }
.lead-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.record {
  height: 100%; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 4vw, 3.5rem);
  background:
    radial-gradient(30rem 20rem at 70% 20%, rgba(43,89,255,.22), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.045) 0 1px, transparent 1px 2.4rem);
  border-left: 1px solid rgba(255,255,255,.09);
}
.record-label {
  font-family: var(--sans); font-size: .62rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: #7f8cc4; margin: 0 0 1.25rem;
}
.record dl { margin: 0; display: grid; gap: .9rem; }
.record dt {
  /* #8b97cf, not #6f7cb4: the darker value measured 4.89:1 — over AA, but the
     weakest thing on the page, and these are 9.6px uppercase labels. */
  font-family: var(--sans); font-size: .6rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: #8b97cf;
}
.record dd {
  margin: .15rem 0 0; font-family: var(--mono); font-size: .95rem; color: #dfe4ff;
  word-break: break-word;
}
.record .stamp {
  margin-top: 1.75rem; align-self: flex-start;
  border: 1px solid rgba(107,140,255,.55); color: #9db0ff;
  padding: .4rem .8rem; border-radius: 4px;
  font-family: var(--sans); font-size: .62rem; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
}

@media (max-width: 900px) {
  .lead-grid { grid-template-columns: 1fr; }
  .lead-body { max-width: none; margin-left: 0; }
  .lead-art { min-height: 14rem; }
  .record { border-left: 0; border-top: 1px solid rgba(255,255,255,.09); }
}

/* ------------------------------------------------------------- sections */
.sec-rule {
  display: flex; align-items: baseline; gap: 1rem;
  border-bottom: 2px solid var(--fg); padding-bottom: .6rem; margin-bottom: 1.75rem;
}
.sec-rule h2 {
  font-family: var(--sans); font-size: .8rem; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; margin: 0; color: var(--fg);
}
.sec-rule a {
  margin-left: auto; font-size: .7rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
}

/* ---------------------------------------------------------- story river */
/* 218px min, not 255: with the 20rem sidebar taking its share of a 1180px wrap,
   the main column is ~800px — at 255 the third card wrapped to a second row and
   the front page lost its three-across rhythm. */
.river { display: grid; gap: clamp(1.5rem, 2.5vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.story { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.card-art {
  aspect-ratio: 16 / 9; margin-bottom: 1rem; overflow: hidden;
  background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 2px;
  display: grid; place-items: center; position: relative;
}
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-art .doc {
  font-family: var(--mono); font-size: .7rem; color: var(--fg-muted);
  letter-spacing: .06em; text-align: center; padding: 1rem; line-height: 1.6;
}
.card-art .doc b { display: block; font-family: var(--sans); font-size: .6rem; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; }
.story:hover .card-art { border-color: var(--accent); }
.story .kicker { color: var(--accent); margin-bottom: .55rem; }
.story h3 {
  font-family: var(--serif); font-weight: 500; letter-spacing: -.012em;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.22; margin: 0 0 .5rem;
  color: var(--fg); transition: color .18s var(--ease);
}
.story:hover h3 { color: var(--accent); }
.story p { font-size: .92rem; color: var(--fg-muted); margin: 0 0 .7rem; line-height: 1.55; }
.story .byline { color: var(--fg-muted); font-size: .68rem; margin-top: auto; }

/* compact list variant, for section blocks and the sidebar */
.stack { display: grid; gap: 1.25rem; }
.stack .story { border-bottom: 1px solid var(--line); padding-bottom: 1.25rem; }
.stack .story:last-child { border-bottom: 0; padding-bottom: 0; }
.stack .story h3 { font-size: 1.02rem; }

/* ------------------------------------------------------- front layout */
.front { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
/* 18rem sidebar, not 20rem. The .wrap padding costs 96px that is easy to forget:
   a 1180px wrap is really 1084px of content, and at 20rem the main column fell to
   ~710px — just under the ~726px three story cards need, so the river silently
   dropped to two columns and the front page lost its three-across rhythm. */
@media (min-width: 1000px) { .front { grid-template-columns: minmax(0, 1fr) 18rem; } }

.aside { display: grid; gap: 2rem; position: sticky; top: 6rem; }
.aside-box {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.4rem; background: var(--bg);
}
.aside-box h3 {
  font-family: var(--sans); font-size: .72rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; margin: 0 0 1rem; color: var(--fg);
}
.aside-box.accent { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rk; display: grid; gap: .95rem; }
.ranked li { counter-increment: rk; display: grid; grid-template-columns: 1.6rem 1fr; gap: .65rem; }
.ranked li::before {
  content: counter(rk); font-family: var(--serif); font-size: 1.15rem; color: var(--accent);
  line-height: 1.1;
}
.ranked a { font-family: var(--serif); font-size: .96rem; line-height: 1.3; color: var(--fg); text-decoration: none; }
.ranked a:hover { color: var(--accent); }

@media (max-width: 999px) { .aside { position: static; } }
