/* ==========================================================================
   Media Center — landing, gallery, album, lightbox, coming-soon
   Uses existing KNEST tokens (--brand, --orange-300, --green-050, --ink,
   --text-muted, --border, --r-*, --sp-*, --fs-*, --shadow-lg, --z-overlay).
   ========================================================================== */




/* ── BODY ──────────────────────────────────────────────────────────────── */
.media-body {
  background: var(--surface);
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
}
.media-body__narrow { max-width: 760px; }

/* ── LANDING CARD GRID ─────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--sp-4);
}
.media-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-decoration: none;
  transition: transform var(--dur-fast, .15s) var(--ease, ease),
              box-shadow var(--dur-fast, .15s) var(--ease, ease),
              border-color var(--dur-fast, .15s) var(--ease, ease);
}
.media-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.media-card--feature {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--brand), var(--green-800));
  border-color: transparent;
}
.media-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border-radius: var(--r-md, 10px);
  background: var(--green-050);
  color: var(--brand);
  margin-block-end: var(--sp-1);
}
.media-card--feature .media-card__icon { background: rgba(255,255,255,0.15); color: var(--on-brand); }
.media-card--muted .media-card__icon { color: var(--text-muted); background: var(--surface-3); }

.media-card__title {
  font-weight: 700;
  font-size: var(--fs-500, 1.05rem);
  color: var(--ink);
  line-height: 1.3;
}
.media-card--feature .media-card__title { color: var(--on-brand); font-size: 1.4rem; }
.media-card:not(.media-card--feature):hover .media-card__title { color: var(--brand); }

.media-card__desc {
  font-size: var(--fs-300);
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}
.media-card--feature .media-card__desc { color: rgba(255,255,255,0.82); font-size: var(--fs-400); }

.media-card__count {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  background: var(--green-050);
  padding: 4px 10px;
  border-radius: 100px;
  margin-block-start: var(--sp-1);
}
.media-card--feature .media-card__count { color: var(--on-brand); background: rgba(255,255,255,0.18); }
.media-card__count--soon { color: var(--text-muted); background: var(--surface-3); }

/* ── ALBUM GRID ────────────────────────────────────────────────────────── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}
.album-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--dur-fast, .15s) var(--ease, ease),
              box-shadow var(--dur-fast, .15s) var(--ease, ease);
}
.album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.album-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--green-050);
}
.album-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-mid, .3s) var(--ease, ease);
}
.album-card:hover .album-card__media img { transform: scale(1.05); }

.album-card__overlay {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7,84,43,0.0);
  color: var(--on-brand);
  opacity: 0;
  transition: opacity var(--dur-fast, .15s) var(--ease, ease),
              background var(--dur-fast, .15s) var(--ease, ease);
}
.album-card:hover .album-card__overlay {
  opacity: 1;
  background: rgba(7,84,43,0.35);
}

.album-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-4);
}
.album-card__title {
  font-weight: 700;
  font-size: var(--fs-500, 1.05rem);
  color: var(--ink);
  line-height: 1.3;
}
.album-card:hover .album-card__title { color: var(--brand); }
.album-card__date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-300, 0.8rem);
  color: var(--text-muted);
  font-weight: 500;
}
.album-card__count {
  align-self: flex-start;
  margin-block-start: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: var(--green-050);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ── PHOTO GRID ────────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-3);
}
.photo-tile {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  cursor: pointer;
  border-radius: var(--r-md, 10px);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--green-050);
}
.photo-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-mid, .3s) var(--ease, ease),
              opacity var(--dur-fast, .15s) var(--ease, ease);
}
.photo-tile:hover img { transform: scale(1.06); }
.photo-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(7,84,43,0);
  transition: background var(--dur-fast, .15s) var(--ease, ease);
}
.photo-tile:hover::after { background: rgba(7,84,43,0.18); }
.photo-tile:focus-visible { outline: 3px solid var(--orange-300); outline-offset: 2px; }

/* ── LIGHTBOX ──────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7,20,12,0.92);
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox[hidden] { display: none; }
.lightbox.is-animating { animation: lbFade 0.2s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.lightbox__figure {
  margin: 0;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}
.lightbox__figure img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: var(--r-md, 10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox__caption {
  color: rgba(255,255,255,0.8);
  font-size: var(--fs-300);
  letter-spacing: 0.04em;
}

.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--on-brand);
  cursor: pointer;
  transition: background var(--dur-fast, .15s) var(--ease, ease);
}
.lightbox__close:hover { background: rgba(255,255,255,0.24); }

.lightbox__nav {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--on-brand);
  cursor: pointer;
  transition: background var(--dur-fast, .15s) var(--ease, ease);
}
.lightbox__nav:hover { background: rgba(255,255,255,0.24); }
.lightbox__nav--prev { margin-inline-end: var(--sp-3); }
.lightbox__nav--next { margin-inline-start: var(--sp-3); }

.lightbox__close:focus-visible,
.lightbox__nav:focus-visible { outline: 3px solid var(--orange-300); outline-offset: 2px; }

/* ── EMPTY / COMING SOON ───────────────────────────────────────────────── */

/* ── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .media-card--feature { grid-column: span 1; }
  .media-card--feature .media-card__title { font-size: 1.2rem; }
}
@media (max-width: 575.98px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--sp-2); }
  .lightbox__nav { width: 42px; height: 42px; }
  .lightbox__nav--prev { margin-inline-end: var(--sp-2); }
  .lightbox__nav--next { margin-inline-start: var(--sp-2); }
}

@media (prefers-reduced-motion: reduce) {
  .album-card__media img, .photo-tile img { transition: none; }
  .lightbox.is-animating { animation: none; }
}

/* ── PRESS RELEASES (/press-release) ───────────────────────────────────────
   Latest release: a green feature card (same ground as the landing page's
   feature card). On desktop a paper "press release" sheet, built from the
   release's real date and title, fills the right side; with more releases,
   more sheets stack behind it, and they fan out on hover.
   More releases: equal-height cards in a responsive grid, grouped by year,
   so any number of them lines up evenly. */

.pr-feature {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--brand), var(--green-800));
  color: var(--on-brand);
  box-shadow: var(--shadow-lg);
  scroll-margin-top: calc(var(--header-height) + var(--sp-4));
}
.pr-feature__body {
  position: relative; z-index: 1;
  padding: clamp(1.75rem, 1rem + 3vw, 3rem) clamp(1.25rem, 0.75rem + 3vw, 3rem) 0;
}
.pr-feature__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-300); font-weight: 600;
}
.pr-feature__meta time { opacity: 0.85; }
.pr-badge {
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-pill);
  background: var(--orange-500);
  color: var(--green-900);              /* green on orange: the playbook pairing (never white) */
  font-size: var(--fs-200); font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.pr-feature__title {
  font-family: var(--font-display);
  font-size: var(--fs-700);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--on-brand);
  max-width: 24ch;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
/* Long headlines (55+ characters) step down a size so they stay at three lines */
.pr-feature__title--long { font-size: var(--fs-600); line-height: 1.15; max-width: 32ch; }
.pr-feature__summary {
  margin-top: var(--sp-4);
  font-size: var(--fs-400);
  line-height: 1.65;
  max-width: 58ch;
  opacity: 0.88;
}
.pr-feature__actions {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.pr-size { opacity: 0.8; font-weight: 600; }

/* Phones and tablets: the wave sits in flow under the actions, bleeding off
   the bottom-right corner, so it never runs behind text. */
.pr-feature__swoosh {
  align-self: flex-end;
  width: min(60%, 520px);
  margin: var(--sp-5) -2% -2px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
}

/* ── The paper sheet (desktop only) ── */
.pr-paper { display: none; }

@media (min-width: 960px) {
  .pr-feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 38%);
    grid-template-rows: 1fr auto;
    align-items: center;
  }
  .pr-feature__body { grid-column: 1; grid-row: 1 / span 2; padding-bottom: clamp(1.75rem, 1rem + 3vw, 3rem); }
  .pr-feature__swoosh {
    grid-column: 2; grid-row: 1 / span 2;
    align-self: end; justify-self: end;
    width: 125%;
    margin: 0 -6% -2px 0;
  }
  .pr-paper {
    display: block;
    grid-column: 2; grid-row: 1 / span 2;
    position: relative; z-index: 1;
    justify-self: center;
    width: min(250px, 72%);
    aspect-ratio: 1 / 1.3;
    margin-block: var(--sp-7);
    margin-right: var(--sp-5);
    font-size: var(--fs-300);
    text-decoration: none;
  }
}

.pr-paper__sheet {
  position: absolute; inset: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: rotate var(--dur-slow) var(--ease-out), translate var(--dur-slow) var(--ease-out);
}
.pr-paper__sheet--back-2 { rotate: 9deg;  translate: 20px 8px; background: var(--cream-2); }
.pr-paper__sheet--back-1 { rotate: 4deg;  translate: 10px 4px; background: var(--cream); }
.pr-paper__sheet--front {
  rotate: -3deg;
  display: flex; flex-direction: column; gap: 0.6em;
  padding: 1.35em 1.25em;
  color: var(--ink);
  overflow: hidden;
}
/* Hover or keyboard focus anywhere on the card: the stack fans out */
.pr-feature:is(:hover, :focus-within) .pr-paper__sheet--front  { rotate: -1deg; translate: 0 -8px; }
.pr-feature:is(:hover, :focus-within) .pr-paper__sheet--back-1 { rotate: 7deg;  translate: 18px 0; }
.pr-feature:is(:hover, :focus-within) .pr-paper__sheet--back-2 { rotate: 13deg; translate: 32px 4px; }

.pr-paper__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5em;
  padding-bottom: 0.6em;
  border-bottom: 1px solid var(--border);
}
.pr-paper__head img { width: auto; height: 2.6em; }
.pr-paper__kind {
  font-size: 0.66em; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--brand);
}
.pr-paper__date { font-size: 0.72em; font-weight: 600; color: var(--muted); }
.pr-paper__title {
  font-family: var(--font-display);
  font-size: 1em; font-weight: 800; line-height: 1.2;
  color: var(--brand);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.pr-paper__rule { display: block; width: 42%; height: 3px; border-radius: var(--r-pill); background: var(--grad-sunrise); }
.pr-paper__lines { display: flex; flex-direction: column; gap: 0.5em; margin-top: 0.2em; }
.pr-paper__lines span { display: block; height: 0.36em; border-radius: var(--r-pill); background: var(--surface-3); }
.pr-paper__lines span:nth-child(1) { width: 96%; }
.pr-paper__lines span:nth-child(2) { width: 88%; }
.pr-paper__lines span:nth-child(3) { width: 93%; }
.pr-paper__lines span:nth-child(4) { width: 62%; }
.pr-paper__lines span:nth-child(5) { width: 90%; }
.pr-paper__lines span:nth-child(6) { width: 74%; }
.pr-paper__pdf {
  margin-top: auto; align-self: flex-end;
  padding: 0.25em 0.55em;
  border-radius: var(--r-sm);
  background: var(--brand); color: var(--on-brand);
  font-size: 0.62em; font-weight: 800; letter-spacing: 0.1em;
}

/* ── More releases ── */
.pr-archive { margin-top: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.pr-archive__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-3) var(--sp-5);
  margin-bottom: var(--sp-4);
}
.pr-archive__title {
  font-family: var(--font-display);
  font-size: var(--fs-600);
  font-weight: 800;
  color: var(--brand);
}
.pr-years { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pr-years a {
  display: inline-flex; align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  color: var(--brand);
  font-size: var(--fs-300); font-weight: 700;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.pr-years a:hover { background: var(--green-050); border-color: var(--green-100); }

.pr-year {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-height) + var(--sp-4));
}
.pr-year + .pr-year { margin-top: var(--sp-7); }
.pr-year__label {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  font-family: var(--font-display);
  font-size: var(--fs-500);
  font-weight: 800;
  color: var(--ink);
}
.pr-year__count {
  font-family: var(--font-sans);
  font-size: var(--fs-200); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}

/* Equal-height cards: every card in a row matches the tallest, titles and
   summaries clamp to three lines, and the footer always sits at the bottom. */
.pr-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: var(--sp-4);
}
.pr-card {
  position: relative;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  scroll-margin-top: calc(var(--header-height) + var(--sp-4));
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-mid) var(--ease), transform var(--dur-mid) var(--ease-out);
}
/* A folded page corner: the outer half matches the page, the inner half is the fold */
.pr-card::before {
  content: "";
  position: absolute; top: -1px; right: -1px;
  width: 30px; height: 30px;
  border-top-right-radius: var(--r-lg);
  border-bottom-left-radius: var(--r-sm);
  background: linear-gradient(225deg, var(--bg) 50%, var(--cream-2) 50%);
  transition: background var(--dur-fast) var(--ease);
}
.pr-card:hover { border-color: var(--green-100); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.pr-card:hover::before { background: linear-gradient(225deg, var(--bg) 50%, var(--orange-100) 50%); }
/* Arriving from a shared link (#slug): the card is marked */
.pr-card:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--green-100); }

.pr-card__top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-2);
  padding-right: var(--sp-5);            /* clear of the folded corner */
}
.pr-card__date {
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: var(--r-pill);
  background: var(--cream);
  color: var(--brand);
  font-size: var(--fs-200); font-weight: 700;
}
.pr-card__type {
  font-size: var(--fs-200); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}
.pr-card__title {
  font-size: var(--fs-450); font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pr-card__title a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.pr-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pr-card:hover .pr-card__title a { color: var(--brand); }
.pr-card__summary {
  font-size: var(--fs-300); line-height: 1.6; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pr-card__foot {
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.pr-card__read {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: var(--fs-300); font-weight: 700;
  color: var(--brand);
}
.pr-card__read svg { transition: translate var(--dur-fast) var(--ease); }
.pr-card:hover .pr-card__read svg { translate: 4px 0; }
.pr-card__download {
  position: relative; z-index: 1;        /* above the stretched title link */
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap-min); height: var(--tap-min);
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--brand);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.pr-card__download:hover { background: var(--green-050); border-color: var(--green-100); }
