/* ==========================================================================
   Gallery & Videos page
   Builds on the shared design system in style.css (tokens, .gallery,
   .video-frame, .card, .soon-pill, .cta-band).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero: a fan of three temple arches
   -------------------------------------------------------------------------- */
.gallery-hero .page-hero__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.gallery-hero .page-hero__art { max-width: 480px; }

.gallery-hero__notes {
  display: flex; flex-wrap: wrap; gap: 0.7rem 1.6rem;
  list-style: none; margin: 2rem 0 0; padding: 0;
}
.gallery-hero__notes li {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.92rem; font-weight: 500; color: var(--maroon-800);
}
.gallery-hero__notes .icon { width: 1.3rem; height: 1.3rem; color: var(--gold-600); }

.triptych { position: relative; width: 100%; aspect-ratio: 6 / 5; }
.triptych .arch { margin: 14px; }
.triptych .arch::before { inset: -13px; }
.triptych__main {
  position: absolute; z-index: 2; left: 50%; top: 0; width: 58%;
  transform: translateX(-50%);
}
/* 635/740 trims the pale scan line along the bottom edge of hero-dancer */
.triptych__main .arch { aspect-ratio: 635 / 740; }
.triptych__main .arch img { object-position: center top; }
.triptych__main .arch img { border-radius: 50% 50% 18px 18px / 42% 42% 18px 18px; }
.triptych__main .arch::before { border-radius: 50% 50% 28px 28px / 42% 42% 28px 28px; }
.triptych__side { position: absolute; z-index: 1; top: 34%; width: 42%; }
.triptych__side--left { left: -3%; transform: rotate(-8deg); }
.triptych__side--right { right: -3%; transform: rotate(8deg); }
.triptych__side .arch img {
  box-shadow: 0 0 0 4px var(--ivory), 0 0 0 5px var(--gold-500), var(--shadow-md);
}
.triptych__side--right .arch img { object-position: 30% center; }

.triptych__petal { position: absolute; z-index: 3; animation: float 7s ease-in-out infinite; }
.triptych__petal--1 { width: 46px; height: 46px; top: 2%; left: 8%; color: var(--lotus); opacity: 0.85; animation-delay: -2s; }
.triptych__petal--2 { width: 30px; height: 30px; top: 8%; right: 8%; color: var(--gold-500); animation-delay: -4s; }
.triptych__petal--3 { width: 18px; height: 18px; bottom: 2%; left: 49%; color: var(--gold-600); animation-delay: -1s; }

@media (max-width: 900px) {
  .gallery-hero .page-hero__inner { grid-template-columns: 1fr; }
  .gallery-hero .page-hero__art { max-width: 360px; margin-top: 0.5rem; }
}
/* phones: the tilted side arches (and their outer gold ring) must keep clear of the screen edge */
@media (max-width: 480px) {
  .gallery-hero .page-hero__art { max-width: 326px; }
}

/* --------------------------------------------------------------------------
   Photo gallery (masonry columns)
   -------------------------------------------------------------------------- */
/* narrower column basis keeps every low-res tile under ~400px wide */
.photo-gallery .gallery { columns: 3 250px; column-gap: 1.25rem; }

/* trim the pale scan line along the bottom edge of hero-dancer */
.gallery__img--dancer { aspect-ratio: 635 / 740; object-fit: cover; object-position: center top; }
.gallery__item::after {
  content: ""; position: absolute; inset: 10px; z-index: 1; pointer-events: none;
  border: 1px solid rgba(232, 207, 148, 0); border-radius: calc(var(--radius) - 8px);
  transition: border-color 0.5s var(--ease), inset 0.5s var(--ease);
}
.gallery__item:hover::after,
.gallery__item:focus-visible::after { border-color: rgba(232, 207, 148, 0.75); inset: 12px; }
.gallery__item figcaption { z-index: 2; line-height: 1.25; }
.gallery__kicker {
  display: block; margin-bottom: 0.3rem;
  font-family: var(--font-caps); font-style: normal; font-weight: 600; font-size: 0.66rem;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-300);
}
.gallery__item:focus-visible { outline-offset: 4px; }

/* touch screens: a quiet caption strip below each photograph instead of an overlay */
@media (hover: none) {
  .gallery__item figcaption {
    position: relative; inset: auto; padding: 0.75rem 1rem 0.85rem;
    font-size: 1.05rem; color: var(--gold-100);
    background: linear-gradient(180deg, var(--maroon-800), var(--maroon-900));
  }
  .gallery__item::after { display: none; }
}

/* decorative quote tiles woven into the masonry */
.gallery-quote {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; justify-items: center; align-content: center;
  margin: 0 0 1.25rem; padding: clamp(2.4rem, 4vw, 3rem) 1.8rem;
  break-inside: avoid; border-radius: var(--radius); text-align: center;
  box-shadow: var(--shadow-md);
}
.gallery-quote::after {
  content: ""; position: absolute; inset: 10px; z-index: -1; pointer-events: none;
  border: 1px solid rgba(232, 207, 148, 0.35); border-radius: calc(var(--radius) - 8px);
}
.gallery-quote blockquote { margin: 0; }
.gallery-quote__cite {
  margin-top: 1.4rem; max-width: 34em;
  font-family: var(--font-caps); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; line-height: 1.7;
}

.gallery-quote--maroon {
  min-height: 420px; color: var(--gold-200);
  background:
    radial-gradient(circle at 50% 0%, rgba(197, 154, 69, 0.32), transparent 62%),
    linear-gradient(165deg, var(--maroon-700) 0%, var(--maroon-900) 60%, var(--maroon-950) 100%);
}
.gallery-quote__wheel {
  position: absolute; z-index: -2; left: 50%; top: 50%; width: 150%; height: auto; aspect-ratio: 1;
  color: var(--gold-400); opacity: 0.09; transform: translate(-50%, -50%);
  animation: spin-centered-xy 180s linear infinite;
}
.gallery-quote__lotus { width: 3rem; height: 3rem; color: var(--gold-400); margin-bottom: 1rem; }
.gallery-quote__script p {
  margin: 0; font-family: var(--font-script); font-size: clamp(2.5rem, 3.4vw, 3rem); line-height: 1.1; color: var(--gold-200);
}
.gallery-quote__script span { display: block; }
.gallery-quote__script span + span::before {
  content: "✦"; display: block; margin: 0.35rem 0 0.3rem;
  font-family: var(--font-body); font-size: 0.7rem; line-height: 1; color: var(--gold-500);
}
.gallery-quote--maroon .gallery-quote__cite { color: var(--gold-400); }

.gallery-quote--gold {
  border: 1px solid var(--line-gold);
  background:
    radial-gradient(circle at 50% 115%, rgba(240, 168, 72, 0.38), transparent 62%),
    linear-gradient(180deg, var(--gold-100), var(--sand));
}
.gallery-quote--gold::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: url("../../img/pattern-lotus.svg") center / 110px repeat; opacity: 0.14;
}
.gallery-quote--gold::after { border-color: rgba(197, 154, 69, 0.4); }
.gallery-quote__mark { width: 2.6rem; height: 2.6rem; color: var(--gold-500); margin-bottom: 0.9rem; }
.gallery-quote__motto p {
  margin: 0; font-family: var(--font-serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.6rem, 2.3vw, 1.95rem); line-height: 1.25; color: var(--maroon-800);
}
/* gold-700 measured ~3.8:1 on the warm glow behind this line; maroon-600 gives ~6.5:1 */
.gallery-quote--gold .gallery-quote__cite { color: var(--maroon-600); }

/* coming-soon note */
.gallery-note {
  display: flex; align-items: center; gap: 1rem;
  width: fit-content; max-width: 680px; margin: clamp(2rem, 4vw, 3rem) auto 0;
  padding: 0.85rem 1.6rem 0.85rem 0.85rem;
  border: 1px dashed var(--gold-500); border-radius: 999px; background: var(--cream);
}
.gallery-note__icon {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
  color: var(--maroon-700); background: var(--gold-100); box-shadow: inset 0 0 0 1px var(--line-gold);
}
.gallery-note__icon .icon { width: 1.35rem; height: 1.35rem; }
.gallery-note p { margin: 0; font-size: 0.98rem; line-height: 1.55; color: var(--ink-soft); }
@media (max-width: 640px) {
  .gallery-note { border-radius: var(--radius); align-items: flex-start; padding: 1rem 1.1rem; }
}

/* --------------------------------------------------------------------------
   Videos (maroon "screening room")
   -------------------------------------------------------------------------- */
.gallery-videos { overflow: hidden; }
.gallery-videos__wheel {
  position: absolute; z-index: -1; left: -320px; bottom: -360px; width: 860px; height: auto; aspect-ratio: 1;
  color: var(--gold-400); opacity: 0.07; animation: spin 220s linear infinite;
}

/* featured slot: the channel banner shown whole, play button on the Konark wheel hub */
.featured-video { position: relative; max-width: 1000px; margin-inline: auto; }
.featured-video::before {
  content: ""; position: absolute; inset: -14% -6%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(240, 168, 72, 0.26), transparent);
}
.gallery-videos .video-frame {
  box-shadow: 0 0 0 6px rgba(42, 8, 17, 0.9), 0 0 0 7.5px var(--gold-500), 0 40px 80px -30px rgba(0, 0, 0, 0.75);
}
.video-frame--banner:hover img { filter: brightness(0.92); }
/* no channel or videos configured yet (set by gallery.js): show the banner as a still, not a fake player */
.video-frame--banner.is-soon { cursor: default; }
.video-frame--banner.is-soon .video-frame__play,
.video-frame--banner.is-soon .video-frame__label { display: none; }
.video-frame--banner.is-soon:hover img { transform: none; filter: none; }
.featured-video__actions { margin-top: clamp(1.8rem, 3.5vw, 2.4rem); }

/* filled by main.js when SITE.youtubeVideos has more than one id;
   flex + centre so a short last row (e.g. 2 videos) sits balanced under the featured one */
.video-grid {
  --cols: 3; --gap: clamp(1.5rem, 3vw, 2.25rem);
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap);
  margin-top: clamp(3rem, 6vw, 4rem);
}
.video-grid > * { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
.video-grid .video-frame { border-radius: var(--radius); }

/* television + channel cards */
.videos-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: clamp(3.5rem, 7vw, 5rem);
}
.tv-card {
  position: relative; padding: clamp(1.6rem, 3vw, 2.4rem);
  border: 1px solid rgba(232, 207, 148, 0.28); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.07), rgba(255, 252, 245, 0.02));
}
.tv-card::after {
  content: ""; position: absolute; inset: 7px; pointer-events: none;
  border: 1px solid rgba(232, 207, 148, 0.1); border-radius: calc(var(--radius-lg) - 6px);
}
.tv-card__kicker {
  display: inline-flex; align-items: center; gap: 0.55rem; margin-bottom: 0.6rem;
  font-family: var(--font-caps); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--gold-400);
}
.tv-card__kicker .icon { width: 1.2rem; height: 1.2rem; }
.tv-card__title { font-size: clamp(1.7rem, 2.6vw, 2.1rem); margin-bottom: 0; }
.tv-card__honour {
  display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0 1.5rem; padding: 1rem 1.1rem;
  border: 1px solid rgba(232, 207, 148, 0.24); border-radius: var(--radius);
  background: rgba(232, 207, 148, 0.08);
}
.tv-card__medal {
  display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%;
  color: var(--maroon-800);
  background: radial-gradient(circle at 35% 30%, var(--gold-200), var(--gold-500));
  box-shadow: 0 0 0 3px var(--maroon-900), 0 0 0 4px var(--gold-400);
}
.tv-card__medal .icon { width: 1.7rem; height: 1.7rem; }
.tv-card__honour p { margin: 0; line-height: 1.35; }
.tv-card__honour strong { display: block; font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; color: var(--gold-200); }
.tv-card__honour span { display: block; margin-top: 0.15rem; font-size: 0.92rem; color: rgba(255, 252, 245, 0.74); }
.tv-card__text { margin-bottom: 0.75rem; font-size: 0.95rem; color: rgba(255, 252, 245, 0.78); }
.tv-card__channels { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.tv-card__channels li {
  padding: 0.38rem 0.9rem; border-radius: 999px; font-size: 0.88rem; line-height: 1.4;
  color: var(--gold-100); background: rgba(42, 8, 17, 0.4); border: 1px solid rgba(232, 207, 148, 0.32);
}

.channel-list { display: grid; gap: 1.35rem; list-style: none; margin: 1.5rem 0 0; padding: 0; }
.channel-list li { display: flex; align-items: flex-start; gap: 1rem; }
.channel-list__icon {
  display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%;
  color: var(--gold-300); background: rgba(232, 207, 148, 0.08);
  box-shadow: inset 0 0 0 1px rgba(232, 207, 148, 0.35), 0 0 0 5px rgba(232, 207, 148, 0.05);
}
.channel-list__icon .icon { width: 26px; height: 26px; }
.channel-list h4 { margin: 0.1rem 0 0.2rem; font-size: 1.3rem; color: var(--gold-200); }
.channel-list p { margin: 0; font-size: 0.95rem; line-height: 1.6; color: rgba(255, 252, 245, 0.74); }

@media (max-width: 1000px) {
  .video-grid { --cols: 2; }
}
@media (max-width: 900px) {
  .videos-meta { grid-template-columns: 1fr; max-width: 640px; margin-inline: auto; }
}
@media (max-width: 560px) {
  .video-grid { --cols: 1; }
  .gallery-videos .video-frame { box-shadow: 0 0 0 4px rgba(42, 8, 17, 0.9), 0 0 0 5px var(--gold-500), 0 30px 60px -24px rgba(0, 0, 0, 0.75); }
  .video-frame--banner { border-radius: var(--radius); }
  .video-frame--banner .video-frame__label { display: none; }
  .video-frame--banner .video-frame__play { box-shadow: 0 0 0 5px rgba(255, 252, 245, 0.25), 0 12px 24px rgba(0, 0, 0, 0.4); }
}

/* --------------------------------------------------------------------------
   Follow & share
   -------------------------------------------------------------------------- */
.connect-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem); max-width: 1060px; margin-inline: auto;
}
.connect-card .card__text { margin-bottom: 1.5rem; }
.connect-links { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.connect-link {
  display: inline-flex; align-items: center; gap: 0.7rem; min-width: 0; max-width: 100%; min-height: 50px;
  padding: 0.4rem 1.2rem 0.4rem 0.4rem; border: 1px solid var(--line-gold); border-radius: 999px;
  background: #fff; color: var(--maroon-800); font-weight: 500; text-decoration: none; line-height: 1.3;
  overflow-wrap: break-word; font-size: 0.98rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.connect-link:hover { color: var(--maroon-700); border-color: var(--maroon-700); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.connect-link__icon {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  color: var(--maroon-700); background: var(--gold-100); box-shadow: inset 0 0 0 1px var(--line-gold);
}
.connect-link__icon .icon { width: 1.15rem; height: 1.15rem; }
.connect-link__icon--youtube { color: #d93a32; }
.connect-link__icon--instagram { color: var(--lotus); }
.connect-link__icon--facebook { color: #1f5fbf; }
.connect-link__icon--whatsapp { color: var(--whatsapp); }
.connect-card__soon { margin: 1.1rem 0 0; }
.connect-card__share { gap: 0.7rem; }
.connect-card__status { margin: 0.9rem 0 0; min-height: 1.5em; font-size: 0.92rem; color: var(--leaf-700); }
.connect-card__status:empty { margin: 0; min-height: 0; }

@media (max-width: 800px) {
  .connect-grid { grid-template-columns: 1fr; max-width: 560px; }
}
@media (max-width: 420px) {
  .connect-card__share .btn { width: 100%; }
  .connect-link { font-size: 0.9rem; gap: 0.55rem; padding-right: 0.95rem; }
  .connect-link__icon { width: 36px; height: 36px; }
}

/* CTA lead: balance the centred lines so no short fragment is left alone on the last line */
.cta-band .lead { text-wrap: balance; }

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .triptych__petal, .gallery-quote__wheel, .gallery-videos__wheel { animation: none; }
  .gallery__item::after { transition: none; }
}
