/* ==========================================================================
   videos.css – Videos page (Figma frame "videos" 1:4565, 1920 × 2738)
   1 Figma px = var(--u). Shared hero lives in pages.css.
   ========================================================================== */

.videos { position: relative; padding-top: calc(96 * var(--u)); }
.videos__triangles { position: absolute; width: calc(224 * var(--u)); height: calc(588 * var(--u)); max-width: none; pointer-events: none; }
/* Figma 1:4566 (x -72, y 360) and 1:4592 (x 1699, y 1375) */
.videos__triangles--left { left: calc(-2 * var(--u)); top: calc(-228 * var(--u)); }
.videos__triangles--right { right: 0; top: calc(787 * var(--u)); width: calc(221 * var(--u)); z-index: -1; }
.videos__head { position: relative; width: calc(1600 * var(--u)); margin-inline: auto; }
.videos__sub {
  width: calc(1054 * var(--u));
  margin: calc(16 * var(--u)) auto 0;
  color: var(--c-text);
  font-size: calc(24 * var(--u));
  line-height: calc(36 * var(--u));
  text-align: center;
}

/* ---------- Video thumbnails (Figma 1:4633… – 512 × 288, 64px play-circle centred) ---------- */
.video-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(32 * var(--u));
  margin-top: calc(80 * var(--u));
}
.video-card {
  position: relative; display: block; overflow: hidden;
  width: 100%; aspect-ratio: 512 / 288;
  padding: 0; border: 0; background: #000; cursor: pointer;
}
.video-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-out); }
.video-card::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0); transition: background-color 0.4s; }
.video-card__play {
  position: absolute; z-index: 1; left: 50%; top: 50%;
  width: calc(64 * var(--u)); height: calc(64 * var(--u));
  margin: calc(-32 * var(--u)) 0 0 calc(-32 * var(--u));
  background: url("../assets/icons/play-circle.svg") center / contain no-repeat;
  transition: transform 0.5s var(--ease-out);
}
.video-card:hover img, .video-card:focus-visible img { transform: scale(1.05); }
.video-card:hover::after, .video-card:focus-visible::after { background: rgba(0, 0, 0, 0.2); }
.video-card:hover .video-card__play, .video-card:focus-visible .video-card__play { transform: scale(1.12); }

/* ---------- Player modal ---------- */
.video-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.video-modal[hidden] { display: none; }
.video-modal__backdrop { position: absolute; inset: 0; background: rgba(2, 16, 36, 0.86); cursor: pointer; }
.video-modal__box { position: relative; width: min(1280px, 100%, (100vh - 136px) * 16 / 9); }
.video-modal__frame { position: relative; aspect-ratio: 16 / 9; background: #000; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45); }
.video-modal__frame video, .video-modal__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video-modal__msg { margin-top: 16px; color: #fff; font-size: 17px; line-height: 1.5; text-align: center; }
.video-modal__msg:empty { display: none; }
/* close (X) – white circle at the player's top-right corner, blue on hover */
.video-modal__close {
  position: absolute; z-index: 2; right: 0; bottom: calc(100% + 14px);
  width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%;
  background: #fff; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s, transform 0.3s var(--ease-out);
}
.video-modal__close span, .video-modal__close span::after {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 2px; margin: -1px 0 0 -10px;
  background: var(--c-navy); transform: rotate(45deg); content: ""; transition: background-color 0.3s;
}
.video-modal__close span::after { left: 0; top: 0; margin: 0; transform: rotate(90deg); }
.video-modal__close:hover, .video-modal__close:focus-visible { background: var(--c-blue); transform: rotate(90deg); }
.video-modal__close:hover span, .video-modal__close:hover span::after,
.video-modal__close:focus-visible span, .video-modal__close:focus-visible span::after { background: #fff; }
.video-modal__close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
html.has-modal { overflow: hidden; }

/* ==========================================================================
   TABLET + MOBILE (< 1200px)
   ========================================================================== */
@media (max-width: 1199.98px) {
  .videos { padding-top: 64px; }
  .videos__triangles { display: none; }
  .videos__head { width: auto; padding-inline: var(--gutter); }
  .videos .section-title { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.25; }
  .videos__sub { width: auto; max-width: 640px; margin-top: 12px; font-size: 17px; line-height: 1.6; }
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 36px; }
  .video-card__play { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
}

@media (max-width: 767.98px) {
  .video-grid { grid-template-columns: 1fr; gap: 16px; }
}
