/* =========================================================
   Section 07 – Videos (all YouTube videos in one swipeable row, play button on hover)
   Opens the shared video modal via data-video="YOUTUBE_ID"
   ========================================================= */
/* Section background – change --vid-bg / --vid-bg-2 to recolour the whole section */
.vid { --vid-bg: #F7F5EF; --vid-bg-2: #F7F5EF; position: relative; overflow: clip; padding: 88px 0 96px; color: var(--navy-dark); background: linear-gradient(160deg, var(--vid-bg) 0%, var(--vid-bg-2) 100%); }
.vid::before { content: none; }
.vid .container { position: relative; }
.vid-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.vid .section-title { color: var(--navy-dark); margin: 0 0 18px; }
.vid .section-title span { color: var(--gold); }
.vid-lead { margin: 0; color: #3d4a5c; font-size: var(--p-size); line-height: var(--p-line); max-width: 52ch; }

.vid-nav { display: flex; gap: 10px; flex-shrink: 0; }
.vid-arrow {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: var(--navy-dark); background: rgba(255,255,255,.6); border: 1px solid rgba(14,32,56,.3); transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.vid-arrow:hover:not(:disabled) { background: var(--navy-dark); color: #fff; border-color: var(--navy-dark); }
.vid-arrow:disabled { opacity: .35; cursor: default; }
.vid-arrow:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

.vid-viewport { margin: 0 -12px; }
.vid-track {
  list-style: none; margin: 0; padding: 12px 12px 22px; display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-left: 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.vid-track::-webkit-scrollbar { display: none; }
.vid-slide { flex: 0 0 calc((100% - 24px - 72px) / 4); scroll-snap-align: start; }

/* ---- Thumbnail card ---- */
.yt-card {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; overflow: hidden; isolation: isolate;
  aspect-ratio: 4 / 5; border-radius: 22px; background: linear-gradient(160deg, var(--navy), var(--navy-dark));
  transition: transform .3s ease, box-shadow .3s ease;
}
.yt-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.yt-card img.yt-hq { transform: scale(1.34); } /* crops the letterbox bars of hqdefault */
.yt-card::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(8,18,34,.05), rgba(8,18,34,.45)); opacity: 0; transition: opacity .3s; }
.yt-play {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%;
  color: #fff; background: #ff3d2e; box-shadow: 0 10px 28px rgba(255,61,46,.45);
  opacity: 0; transform: translate(-50%, -50%) scale(.6); transition: opacity .25s ease, transform .3s cubic-bezier(.22,1,.36,1);
}
.yt-play svg { margin-left: 3px; }
.yt-card:hover, .yt-card:focus-visible { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(14,32,56,.35); }
.yt-card:hover img { transform: scale(1.06); }
.yt-card:hover img.yt-hq { transform: scale(1.42); }
.yt-card:hover::after, .yt-card:focus-visible::after { opacity: 1; }
.yt-card:hover .yt-play, .yt-card:focus-visible .yt-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.yt-card:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

/* touch screens have no hover, so keep the play button visible */
@media (hover: none) { .yt-play { opacity: 1; transform: translate(-50%, -50%) scale(1); width: 56px; height: 56px; } }
@media (max-width: 1000px) { .vid-slide { flex-basis: calc((100% - 24px - 24px) / 2.3); } .vid-track { gap: 18px; } }
@media (max-width: 700px) { .vid-head { align-items: flex-start; } }
@media (max-width: 600px) { .vid { padding: 60px 0 68px; } .vid-head { margin-bottom: 28px; } .vid-arrow { width: 42px; height: 42px; } .vid-slide { flex-basis: 68%; } .vid-track { gap: 12px; } .yt-card { border-radius: 16px; } }
@media (prefers-reduced-motion: reduce) { .yt-card, .yt-card img, .yt-play, .vid-arrow { transition: none; } .yt-card:hover { transform: none; } .vid-track { scroll-behavior: auto; } }
