/* ============================================================
   CONCORD SOFTWARE — /news
   Layers on css/styles.css: news hero, ledger index, article
   pages. Same monochrome editorial system, same motion rules.
   ============================================================ */

/* ---------- Reading progress (article pages) ---------- */
.read-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}

.read-progress span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- News hero ----------
   Reuses .hero (canvas field, meta row, wordmark) but stays
   compact: the featured dispatch must peek above the fold so
   people know there's a ledger to scroll into. */
.news-hero {
  min-height: auto;
  padding-top: clamp(5rem, 9vh, 6.5rem);
  padding-bottom: clamp(1.25rem, 2.5vh, 2rem);
}

/* Full-bleed on laptops, but capped on ultrawide screens — an
   unclamped 4-letter wordmark grows monstrous past ~1400px. The
   meta row and statement share the cap so their edges line up
   with the N and the S. Explicit width: auto inline margins on
   a flex child otherwise shrink it to fit its content. */
.news-hero .hero__meta,
.news-hero .hero__wordmark,
.news-hero__deck {
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
}

.news-hero .hero__wordmark { margin-top: clamp(0.6rem, 1.5vh, 1.25rem); }

/* The rest of the ledger follows the same column (cap includes
   the section's own gutter padding) */
.news-featured,
.news-index {
  width: 100%;
  max-width: calc(78rem + 2 * var(--gutter));
  margin-inline: auto;
}

/* The deck: newspaper front-page treatment under the masthead —
   an Oxford rule (thick over thin), the standfirst, a big serif
   issue marker, then a folio bar closing the hero. */
.news-hero__deck {
  position: relative;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 2px solid var(--ink);
  padding-top: clamp(1.4rem, 2.6vw, 2.2rem);
}

.news-hero__deck::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
  opacity: 0.35;
}

.news-hero__deck-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: clamp(2rem, 5vw, 6rem);
}

.news-hero__intro {
  font-size: clamp(1.35rem, 2.5vw, 2.35rem);
  line-height: 1.24;
  letter-spacing: -0.015em;
  font-weight: 500;
  max-width: 26em;
  text-wrap: balance;
}

/* Issue marker: magazine-style №, counts the dispatches */
.news-hero__issue {
  flex: none;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(3.2rem, 6.5vw, 6rem);
  line-height: 0.85;
  color: var(--ink-40);
  white-space: nowrap;
}

.news-hero__issue em { color: var(--ink); }

.news-hero__folio {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  padding-block: 0.9rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.news-hero__folio .meta-label { font-variant-numeric: tabular-nums; }

/* ---------- Featured dispatch ----------
   Tighter top margin than a full section gap: the "01 — Latest
   dispatch" head should already be visible on load. */
.news-featured { margin-top: clamp(2.5rem, 5vw, 4rem); }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 4.5rem);
  border: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(1.4rem, 3vw, 2.75rem);
  box-shadow: 0 -0.35rem 1.25rem rgba(20, 19, 16, 0.035);
}

.feature__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease-out);
}

.feature__media:hover img,
.feature__media:focus-visible img { transform: scale(1.045); }

.feature__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.2rem;
}

.feature__kicker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.feature__title {
  font-size: clamp(2rem, 3.6vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
  transition: transform 0.4s var(--ease-out);
}

@media (hover: hover) {
  .feature:hover .feature__title { transform: translateX(6px); }
}

.feature__desc {
  font-size: 0.95rem;
  color: var(--ink-60);
  max-width: 46ch;
}

.feature__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding-top: 1rem;
}

/* Featured card reveal: image wipes open, content staggers in */
.anim-ready [data-reveal-group] .feature__media {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.anim-ready [data-reveal-group].is-in .feature__media {
  clip-path: inset(0 0 0% 0);
}

.anim-ready [data-reveal-group] .feature__content > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.anim-ready [data-reveal-group].is-in .feature__content > * {
  opacity: 1;
  transform: none;
}

.anim-ready [data-reveal-group] .feature__content > *:nth-child(2) { transition-delay: 0.06s; }
.anim-ready [data-reveal-group] .feature__content > *:nth-child(3) { transition-delay: 0.12s; }
.anim-ready [data-reveal-group] .feature__content > *:nth-child(4) { transition-delay: 0.18s; }

/* ---------- The ledger: dispatch index rows ---------- */
.news-index { margin-top: var(--section-gap); }

.entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 6fr) minmax(0, 3fr);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: start;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
}

.entry-item:last-child .entry { border-bottom: 1px solid var(--line); }

/* Ink wipe on hover, same voice as the services list */
.entry::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.entry > * { position: relative; z-index: 1; }

.entry__index {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink-40);
  padding-top: 0.35rem;
  transition: color 0.4s var(--ease-out);
}

.entry__main {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.entry__title {
  font-size: clamp(1.7rem, 2.8vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  transition: color 0.4s var(--ease-out);
}

.entry__desc {
  font-size: 0.95rem;
  color: var(--ink-60);
  max-width: 52ch;
  transition: color 0.4s var(--ease-out);
}

.entry__meta {
  justify-self: end;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-60);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s var(--ease-out);
}

.entry__arrow {
  position: absolute;
  right: clamp(1rem, 2.5vw, 2.5rem);
  bottom: clamp(1.2rem, 2.5vw, 2.2rem);
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  line-height: 1;
  color: var(--paper);
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  pointer-events: none;
}

@media (hover: hover) {
  .entry { transition: padding 0.4s var(--ease-out); }
  .entry:hover { padding-left: 1.2rem; padding-right: 1.2rem; }
  .entry:hover::before { transform: scaleY(1); }
  .entry:hover .entry__title { color: var(--paper); }
  .entry:hover .entry__desc,
  .entry:hover .entry__index,
  .entry:hover .entry__meta { color: var(--paper-60); }
  .entry:hover .svc-roll > span,
  .entry:hover .svc-roll::after { transform: translateY(-100%); }
  .entry:hover .entry__arrow { opacity: 1; transform: translateX(0); }
}

/* Rows stagger in as the ledger reveals */
.anim-ready .news-index .entry-item:nth-child(2) { transition-delay: 0.08s; }
.anim-ready .news-index .entry-item:nth-child(3) { transition-delay: 0.16s; }
.anim-ready .news-index .entry-item:nth-child(4) { transition-delay: 0.24s; }
.anim-ready .news-index .entry-item:nth-child(5) { transition-delay: 0.32s; }

/* ---------- Article page ---------- */
/* Same ultrawide cap as the ledger: without it the 21/10 head
   image balloons past any reasonable size. */
.post,
.post-next {
  width: 100%;
  max-width: calc(78rem + 2 * var(--gutter));
  margin-inline: auto;
}

.post {
  padding: clamp(6.5rem, 13vh, 8.5rem) var(--gutter) 0;
}

.post__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}

.post__crumbs a { transition: color 0.3s var(--ease-out); }
.post__crumbs a:hover { color: var(--ink); }
.post__crumbs [aria-current] { color: var(--ink); }

.post__head {
  margin-top: clamp(2rem, 5vh, 3.5rem);
  max-width: 64rem;
}

.post__title {
  font-size: clamp(2.7rem, 7vw, 6.4rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.post__standfirst {
  margin-top: clamp(1.5rem, 3vw, 2.2rem);
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: rgba(20, 19, 16, 0.8);
  max-width: 44ch;
  text-wrap: balance;
}

.post__media { margin-top: clamp(2.5rem, 6vw, 4.5rem); }

/* No fixed ratio: the frame respects the image's own height and
   never crops. Very tall (portrait) images are capped and centered
   via contain instead of cropped. overflow stays for the clip reveal. */
.post__media-frame {
  overflow: hidden;
}

.post__media-frame img {
  width: 100%;
  height: auto;
  max-height: min(78vh, 44rem);
  object-fit: contain;
}

.post__media figcaption { margin-top: 0.8rem; }

/* Image wipes open on scroll (group class piggybacks the observer) */
.anim-ready [data-reveal-group] .post__media-frame {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}

.anim-ready [data-reveal-group].is-in .post__media-frame {
  clip-path: inset(0 0 0% 0);
}

/* ---------- Article body ---------- */
.post__body {
  max-width: 46rem;
  margin: clamp(3.5rem, 7vw, 5.5rem) auto 0;
  font-size: 1.02rem;
  line-height: 1.75;
  color: rgba(20, 19, 16, 0.82);
}

.post__body > * + * { margin-top: 1.35em; }

.post__body a {
  border-bottom: 1px solid var(--ink-40);
  transition: border-color 0.3s var(--ease-out);
}

.post__body a:hover { border-color: var(--ink); }

.post__body h2 {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-top: 2.4em;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.post__body h2::before {
  content: attr(data-index);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink-40);
}

.post__lede::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 3.3em;
  line-height: 0.82;
  padding: 0.05em 0.14em 0 0;
  color: var(--ink);
}

.post__pull {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(1.6rem, 3vw, 2.2rem) 0;
  margin-top: 2em;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  color: var(--ink);
}

.post__pull cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-sans);
  font-style: normal;
}

/* ---------- Article foot: tags + share ---------- */
.post__foot {
  max-width: 46rem;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
}

.post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post__tags li {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45em 1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-60);
  transition: border-color 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

.post__tags li:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Next dispatch ---------- */
.post-next { margin-top: var(--section-gap); }

.post-next__link {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}

.post-next__kicker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-next__title {
  font-size: clamp(2.4rem, 7vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  transition: transform 0.45s var(--ease-out);
}

.post-next__arrow {
  display: inline-block;
  transition: transform 0.45s var(--ease-out);
}

.post-next__link:hover .post-next__title { transform: translateX(10px); }
.post-next__link:hover .post-next__arrow { transform: translateX(12px); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .news-hero__folio-mid { display: none; }

  .feature { grid-template-columns: 1fr; }
  /* Full card width: a capped image next to full-width rows reads broken */
  .feature__media { aspect-ratio: 16 / 10; }

  .entry { grid-template-columns: 1fr; gap: 0.9rem; }
  .entry__index { padding-top: 0; }
  .entry__meta {
    justify-self: start;
    text-align: left;
    flex-direction: row;
    gap: 1.1rem;
    padding-top: 0;
    order: -1;
  }
  .entry__arrow { display: none; }

}

@media (max-width: 560px) {
  .news-hero__issue { display: none; }

  .post__meta { flex-direction: column; gap: 0.5rem; }
  .post__foot { flex-direction: column; align-items: flex-start; }
}
