/* ==========================================================================
   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).
   ========================================================================== */

/* ── HERO ──────────────────────────────────────────────────────────────── */
.media-hero {
  position: relative;
  background: var(--brand);
  color: #fff;
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(4rem, 11vw, 8rem);
  overflow: hidden;
}
.media-hero--sub { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(3.5rem, 9vw, 6.5rem); }
.media-hero__inner { position: relative; z-index: 1; max-width: 680px; }

.media-hero__eyebrow {
  font-size: var(--fs-300);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--orange-300);
  margin-block-end: var(--sp-2);
}
.media-hero__heading {
  font-family: 'Archivo Expanded', var(--font-display, sans-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-block-end: var(--sp-3);
}
.media-hero__sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255,255,255,0.8);
  line-height: 1.65;
  max-width: 560px;
}
.media-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--fs-300);
  margin-block-end: var(--sp-3);
  color: rgba(255,255,255,0.6);
}
.media-breadcrumb a { color: var(--orange-300); text-decoration: none; font-weight: 600; }
.media-breadcrumb a:hover { text-decoration: underline; }

.media-hero__wave {
  position: absolute; bottom: -2px; left: 0; width: 100%;
  z-index: 2; pointer-events: none;
}

/* ── BODY ──────────────────────────────────────────────────────────────── */
.media-body {
  background: var(--surface, #f8f9f5);
  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: #fff;
  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), #064023);
  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: #fff; }
.media-card--muted .media-card__icon { color: var(--text-muted); background: #f0f0ec; }

.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: #fff; 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: #fff; background: rgba(255,255,255,0.18); }
.media-card__count--soon { color: var(--text-muted); background: #f0f0ec; }

/* ── 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: #fff;
  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: #fff;
  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: #fff;
  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: #fff;
  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 ───────────────────────────────────────────────── */
.media-empty {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(2.5rem, 7vw, 4rem) var(--sp-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}
.media-empty__icon { color: var(--text-muted); }
.media-empty__title {
  font-family: 'Archivo Expanded', var(--font-display, sans-serif);
  font-weight: 800;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  color: var(--ink);
}
.media-empty__text {
  font-size: var(--fs-400);
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 440px;
}
.media-empty__text a { color: var(--brand); font-weight: 600; }
.media-empty .btn { margin-block-start: var(--sp-2); }

/* ── 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; }
}
