/**
 * =====================================================================
 * MEDIA GALLERY COMPONENT — STYLES
 * =====================================================================
 * Copied verbatim from the current static design system's
 * ".gallery-card"/".lb" (lightbox) rules (css/style.css). The shared
 * toolbar/pagination primitives live in assets/css/global.css instead
 * — see that file's own comment.
 * =====================================================================
 */

/* ---------- Gallery card grid (photos + videos) ---------- */
div.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { div.gallery-grid { grid-template-columns: 1fr; } }
@media (min-width: 640px) and (max-width: 900px) { div.gallery-grid { grid-template-columns: repeat(2, 1fr); } }

button.gallery-card {
  position: relative; display: block; width: 100%;
  padding: 0; border: 1px solid transparent; margin: 0; text-align: left; cursor: pointer;
  overflow: hidden; border-radius: var(--radius-lg);
  background: var(--sand);
  aspect-ratio: 3 / 2;
  transition: transform 0.35s var(--ease), border-color 0.3s var(--ease), box-shadow 0.35s var(--ease);
}
.gallery-card:hover { border-color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gallery-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.gallery-card__img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s var(--ease);
}
.gallery-card:hover .gallery-card__img,
.gallery-card:focus-visible .gallery-card__img { transform: scale(1.05); }

.gallery-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(27,27,27,0.82) 0%, rgba(27,27,27,0.2) 42%, rgba(27,27,27,0) 68%);
}

.gallery-card__body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 20px 22px; color: var(--white); }
.gallery-card__caption {
  font-family: var(--font-sans) !important; font-weight: 600;
  font-size: 12px; letter-spacing: 0.13em; text-transform: uppercase; line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}
.gallery-card__badge {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  --forced-font: var(--font-mono);
  font-family: var(--forced-font) !important; font-size: 11px; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.82);
}
.gallery-card__badge svg { width: 13px; height: 13px; }

/* Centred play button — video cards only */
.gallery-card__play {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
}
.gallery-card__play span {
  width: 60px; height: 60px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(27,27,27,0.35);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.gallery-card:hover .gallery-card__play span,
.gallery-card:focus-visible .gallery-card__play span { background: var(--red); border-color: var(--red); transform: scale(1.08); }
.gallery-card__play svg { width: 22px; height: 22px; margin-left: 3px; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 200; display: none; }
.lb.is-open { display: flex; align-items: center; justify-content: center; padding: 24px; }
.lb__overlay { position: absolute; inset: 0; background: rgba(27,27,27,0.96); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.lb__dialog {
  position: relative; z-index: 1;
  width: min(1120px, 100%); max-height: 92vh;
  display: flex; flex-direction: column; align-items: center;
}
.lb__stage { width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.lb__img {
  max-width: 100%; max-height: 76vh; object-fit: contain; display: block;
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); background: var(--ink);
}
.lb__video { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 76vh; }
.lb__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius-md); background: #000; }

p.lb__caption { margin: 16px 0 0; max-width: 72ch; text-align: center; color: rgba(255,255,255,0.9); font-size: 14px; line-height: 1.5; }
p.lb__counter { margin: 6px 0 0; --forced-font: var(--font-mono); font-family: var(--forced-font) !important; font-size: 12px; letter-spacing: 0.12em; color: rgba(255,255,255,0.62); }

button.lb__btn {
  position: absolute; z-index: 2;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white); background: rgba(27,27,27,0.35);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
button.lb__btn:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.lb__btn svg { width: 18px; height: 18px; }
.lb__close { top: -6px; right: -6px; }
.lb__prev { left: -66px; top: 50%; transform: translateY(-50%); }
.lb__next { right: -66px; top: 50%; transform: translateY(-50%); }
.lb__btn[hidden] { display: none; }

@media (max-width: 1100px) {
  .lb__prev { left: 4px; }
  .lb__next { right: 4px; }
  .lb__close { top: 4px; right: 4px; }
}
@media (max-width: 560px) {
  .lb.is-open { padding: 12px; }
  .lb__btn { width: 40px; height: 40px; }
}
