/* ==========================================================================
   MEDIA PAGE — extends styles.css (palette, type, nav, footer already defined there)
   ========================================================================== */

/* ---------- Hero ---------- */
.media-hero {
  position: relative;
  padding-top: clamp(8rem, 16vh, 11rem);
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
  overflow: hidden;
}
.media-hero__atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 75% at 14% 8%, rgba(57, 102, 217, 0.22), transparent 60%),
    radial-gradient(50% 60% at 85% 110%, rgba(168, 133, 75, 0.14), transparent 65%);
  pointer-events: none;
}
.media-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}
.media-hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  line-height: 1.08;
  color: var(--ivory);
}
.media-hero__copy {
  color: var(--mist);
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.8;
  max-width: 42ch;
}

/* ---------- Section head ---------- */
.section-media { padding-block: 0 var(--pad-y); }
.section-media__head { margin-bottom: clamp(2.2rem, 4vw, 3rem); }
.section-media .section-title { max-width: 32ch; }

/* ==========================================================================
   CAROUSEL
   ========================================================================== */
.media-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.media-track {
  display: flex;
  gap: clamp(1rem, 2vw, 1.4rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 var(--pad-x, 0) 0.5rem;
  margin: 0 calc(-1 * var(--pad-x, 0px));

  /* hide scrollbar visually, scrolling still works via drag/trackpad/arrows */
  scrollbar-width: none;
}
.media-track::-webkit-scrollbar { display: none; }

.media-card {
  position: relative;
  flex: 0 0 clamp(280px, 32vw, 420px);
  overflow: hidden;
  background: var(--midnight-2);
  border: 1px solid var(--hairline-dark);
  cursor: pointer;
  outline-offset: 4px;
  scroll-snap-align: start;
  transition: transform 0.5s var(--ease);
}
.media-card:hover { transform: translateY(-3px); }
.media-card:focus-visible { outline: 1px solid var(--bronze); }
.media-card img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
  filter: saturate(0.94);
}
.media-card:hover img { transform: scale(1.05); }

/* caption overlay — hidden */
.media-card__overlay { display: none; }
.media-card__title {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ivory);
}

/* ---------- Placeholder tiles ---------- */
.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--midnight-2) 0%, var(--ink) 100%);
}
.media-placeholder::before {
  content: "";
  width: clamp(34px, 5vw, 46px);
  height: clamp(34px, 5vw, 46px);
  opacity: 0.85;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.media-placeholder[data-icon="camera"]::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23a8854b' stroke-width='1.4'><rect x='5' y='14' width='38' height='26' rx='2'/><path d='M17 14l3-5h8l3 5'/><circle cx='24' cy='27' r='8'/></svg>");
}
.media-placeholder[data-icon="mic"]::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23a8854b' stroke-width='1.4'><rect x='17' y='5' width='14' height='24' rx='7'/><path d='M10 23a14 14 0 0 0 28 0'/><line x1='24' y1='37' x2='24' y2='43'/><line x1='16' y1='43' x2='32' y2='43'/></svg>");
}
.media-placeholder[data-icon="podcast"]::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23a8854b' stroke-width='1.4'><circle cx='24' cy='20' r='9'/><path d='M24 29v9'/><path d='M14 41h20'/><path d='M11 17a13 13 0 0 1 26 0'/></svg>");
}
.media-placeholder[data-icon="press"]::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23a8854b' stroke-width='1.4'><rect x='6' y='10' width='30' height='28' rx='1'/><path d='M36 16h6v18a4 4 0 0 1-4 4H10'/><line x1='12' y1='17' x2='24' y2='17'/><line x1='12' y1='23' x2='30' y2='23'/><line x1='12' y1='29' x2='30' y2='29'/></svg>");
}
.media-placeholder[data-icon="handshake"]::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23a8854b' stroke-width='1.4'><path d='M4 22l9-8 8 5 5-4 9 1 9 9-7 7-5-3-6 6-9-1-6-5z'/><path d='M21 19l6 6'/><path d='M27 25l5 5'/></svg>");
}

/* ---------- Arrow buttons ---------- */
.carousel-arrow {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--hairline-dark);
  background: rgba(8, 13, 21, 0.6);
  color: var(--ivory);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.carousel-arrow:hover { border-color: var(--gold); color: var(--gold); }
.carousel-arrow:disabled { opacity: 0.3; pointer-events: none; }

/* ---------- Dots ---------- */
.media-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: clamp(1.4rem, 3vw, 2rem);
}
.media-dots__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hairline-dark);
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.media-dots__dot.is-active {
  background: var(--gold);
  transform: scale(1.3);
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.2rem, 4vw, 3rem);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.lightbox.is-open { visibility: visible; opacity: 1; }
.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 14, 0.92);
  backdrop-filter: blur(6px);
}
.lightbox__panel {
  position: relative;
  z-index: 1;
  max-width: min(900px, 92vw);
  width: 100%;
  background: var(--midnight);
  border: 1px solid var(--hairline-dark);
  padding: clamp(1.2rem, 3vw, 1.8rem);
  transform: translateY(16px);
  opacity: 0;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.lightbox.is-open .lightbox__panel { transform: none; opacity: 1; }
.lightbox__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--midnight-2);
}
.lightbox__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.lightbox__media .media-placeholder { position: absolute; }
.lightbox__title {
  margin-top: 1.2rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ivory);
}
.lightbox__close {
  position: absolute;
  top: -2.6rem;
  right: 0;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--platinum);
  transition: color 0.3s var(--ease);
}
.lightbox__close:hover { color: var(--gold); }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border: 1px solid var(--hairline-dark);
  border-radius: 50%;
  color: var(--ivory);
  font-size: 1.1rem;
  background: rgba(8, 13, 21, 0.55);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.lightbox__nav:hover { border-color: var(--gold); color: var(--gold); }
.lightbox__nav--prev { left: -1.4rem; }
.lightbox__nav--next { right: -1.4rem; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .media-hero__grid { grid-template-columns: 1fr; align-items: start; gap: 1.6rem; }
  .media-card { flex: 0 0 70vw; }
  .carousel-arrow { width: 38px; height: 38px; font-size: 1.1rem; }
}
@media (max-width: 600px) {
  .media-card { flex: 0 0 82vw; }
  .carousel-arrow { display: none; } /* swipe/scroll on touch instead */
  .lightbox__nav--prev { left: 0.4rem; }
  .lightbox__nav--next { right: 0.4rem; }
  .lightbox__nav { background: rgba(8, 13, 21, 0.78); }
}