/* Homepage "See Greenhills in action" (server/render-home.js renderVideos,
   js/videos.js) and the Sports Day photo strip on School Life. */

.video-section {
  background: var(--navy-950, #081b31);
  color: #fff;
}
.video-section .section-head { max-width: 820px; margin-inline: auto; text-align: center; }
.video-section .section-head .section-kicker { color: var(--sage, #9ebba5) !important; }
.video-section .section-head h2 { color: #fff; }

.video-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}

.video-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.video-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video-facade { position: absolute; inset: 0; display: block; color: #fff; }
.video-facade img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s var(--legacy-ease, ease), filter .3s ease;
}
.video-facade::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 27, 49, 0) 55%, rgba(8, 27, 49, .45));
  pointer-events: none;
}
.video-play {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: clamp(64px, 8vw, 88px); transform: translate(-50%, -50%);
  transition: transform .25s ease;
}
.video-play svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.video-play-bg { fill: rgba(8, 27, 49, .82); transition: fill .2s ease; }
.video-play-tri { fill: #fff; }
.video-facade:hover img, .video-facade:focus-visible img { transform: scale(1.03); }
.video-facade:hover .video-play-bg, .video-facade:focus-visible .video-play-bg { fill: #c4302b; }
.video-facade:hover .video-play, .video-facade:focus-visible .video-play { transform: translate(-50%, -50%) scale(1.06); }
.video-facade:focus-visible { outline: 3px solid var(--sage, #9ebba5); outline-offset: 4px; }

.video-info { max-width: 30rem; }
.video-label {
  margin: 0 0 .8rem;
  font-family: var(--font-ui);
  font-size: .76rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage, #9ebba5);
}
.video-title {
  margin: 0;
  font-family: var(--font-display, serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  line-height: 1.12;
  color: #fff;
}
.video-desc { margin: 1rem 0 0; color: rgba(255, 255, 255, .78); line-height: 1.7; }

/* ── Two or more videos: controls, cross-fade and the reel ─────────────── */
.video-info-text { min-height: 9.5rem; }
.video-controls { display: flex; align-items: center; gap: .6rem; margin-top: 1.8rem; flex-wrap: wrap; }
.video-nav {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: transparent; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  color: #fff; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.video-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.video-nav:hover { background: #fff; color: var(--navy-950, #081b31); border-color: #fff; }
.video-nav:active { transform: scale(.94); }
.video-count { margin: 0 .3rem; font-family: var(--font-ui); font-size: .85rem; letter-spacing: .12em; color: rgba(255, 255, 255, .7); }
.video-count span { color: #fff; }
.video-pause {
  margin-left: auto; display: inline-flex; align-items: center; gap: .5rem;
  background: none; border: 0; padding: .4rem 0; color: rgba(255, 255, 255, .7);
  font-family: var(--font-ui); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
}
.video-pause:hover { color: #fff; }
.video-pause[hidden] { display: none; }
.video-pause-icon { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.video-pause[aria-pressed="true"] .video-pause-icon {
  border: 0; width: 0; height: 0; border-left: 10px solid currentColor;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.video-nav:focus-visible, .video-pause:focus-visible, .video-card:focus-visible { outline: 3px solid var(--sage, #9ebba5); outline-offset: 3px; }

/* Cross-fade when the showcase moves on */
.video-stage.is-leaving .video-facade img { opacity: 0; transform: scale(1.04); }
.video-stage.is-leaving .video-info-text { opacity: 0; transform: translateY(8px); }
.video-facade img, .video-info-text { transition: opacity .22s ease, transform .22s ease; }
.video-stage.is-entering .video-facade img { animation: video-in .9s var(--legacy-ease, ease) both; }
.video-stage.is-entering .video-info-text { animation: video-text-in .6s var(--legacy-ease, ease) both; }
@keyframes video-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
@keyframes video-text-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* The reel: a swipeable row of film cards */
.video-reel-wrap { position: relative; max-width: 1180px; margin: clamp(2rem, 4vw, 3rem) auto 0; }
.video-reel {
  list-style: none; margin: 0; padding: .4rem .2rem 1rem;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, calc((100% - 3 * 1.25rem) / 4)); gap: 1.25rem;
  justify-content: safe center;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.video-reel > li { scroll-snap-align: start; }
.video-card {
  display: block; color: #fff; text-decoration: none;
  transition: transform .35s var(--legacy-ease, ease);
}
.video-card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.video-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--legacy-ease, ease), filter .35s ease; filter: saturate(.85) brightness(.82); }
.video-card-media::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); transition: box-shadow .3s ease; }
.video-card-play {
  position: absolute; left: .7rem; bottom: .7rem; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(8, 27, 49, .78); backdrop-filter: blur(4px);
  transition: background-color .25s ease, transform .25s ease;
}
.video-card-play::before {
  content: ""; position: absolute; left: 13px; top: 10px;
  border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.video-card-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--sage, #9ebba5); transform-origin: left; transform: scaleX(var(--progress, 0));
}
.video-card-text { display: block; padding: .85rem .1rem 0; }
.video-card-text small {
  display: block; margin-bottom: .3rem; font-family: var(--font-ui);
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--sage, #9ebba5);
}
.video-card-text strong { display: block; font-weight: 500; font-size: 1rem; line-height: 1.35; color: rgba(255, 255, 255, .8); transition: color .25s ease; }
.video-card:hover { transform: translateY(-4px); }
.video-card:hover .video-card-media img, .video-card.is-current .video-card-media img { filter: none; }
.video-card:hover .video-card-media img { transform: scale(1.05); }
.video-card:hover .video-card-play { background: #c4302b; transform: scale(1.08); }
.video-card.is-current .video-card-media::after { box-shadow: inset 0 0 0 2px var(--sage, #9ebba5); }
.video-card.is-current .video-card-text strong, .video-card:hover .video-card-text strong { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .video-stage.is-entering .video-facade img, .video-stage.is-entering .video-info-text { animation: none; }
  .video-card, .video-card-media img, .video-facade img { transition: none; }
  .video-card:hover { transform: none; }
}

@media (max-width: 900px) {
  .video-stage { grid-template-columns: 1fr; }
  .video-info { max-width: none; text-align: center; margin-inline: auto; }
  .video-info-text { min-height: 0; }
  .video-controls { justify-content: center; }
  .video-pause { margin-left: 0; flex-basis: 100%; justify-content: center; }
  .video-reel { grid-auto-columns: 72%; }
}

/* School Life: Sports Day photo strip */
.photo-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
  margin: 2rem 0 0;
}
.photo-strip figure { margin: 0; }
.photo-strip img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.photo-strip figcaption { margin-top: .5rem; font-size: .9rem; color: var(--muted, #5b6577); }
.photo-strip-link { margin: 1rem 0 0; }
@media (max-width: 700px) {
  .photo-strip { grid-template-columns: 1fr 1fr; }
  .photo-strip figure:last-child { display: none; }
}
