/* Photo and video gallery shared by every event page (markup from
   scripts/event_gallery.py, behaviour in assets/js/event-gallery.js).
   Mixed mosaic (Option D, chosen 2026-11-15): seven tiles of different sizes on a white
   background (six on phones), the first one big (the video, if there is one), and a
   "See all N photos" button. Photos open full screen. Same on every event: event
   stylesheets must not override it. */

.evgal {
  --evgal-bg: #fff;
  --evgal-fg: var(--navy, #242a56);
  --evgal-muted: #5b6078;
  padding: clamp(64px, 8vw, 110px) 0;
  background: var(--evgal-bg);
  color: var(--evgal-fg);
  scroll-margin-top: 70px;
}
.evgal .evgal-head { display: block; text-align: center; max-width: 680px; margin: 0 auto 32px; }
.evgal .evgal-head h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; margin: 0 0 8px; color: var(--evgal-fg); }
.evgal .evgal-head p { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--evgal-muted); }

.evgal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 15vw, 210px); grid-auto-flow: dense; gap: 12px; }
.evgal-item {
  position: relative; display: block; overflow: hidden; margin: 0; padding: 0; border: 0;
  border-radius: 14px; background: #dfe2ec; color: #fff; cursor: zoom-in; text-decoration: none !important;
}
.evgal-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.evgal-item:hover img { transform: scale(1.05); }
.evgal-item:focus-visible { outline: 3px solid var(--pink, #e52665); outline-offset: 3px; }
.evgal-item:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.evgal-item:nth-child(4) { grid-row: span 2; }
.evgal-item:nth-child(6) { grid-column: span 2; }
.evgal-item:nth-child(n+8) { display: none; }

/* Video tile: poster + play button; swaps to the player on click */
.evgal-video { cursor: pointer; }
.evgal-play {
  position: absolute; left: 50%; top: 50%; width: 86px; height: 86px; margin: -43px 0 0 -43px; border-radius: 50%;
  display: grid; place-items: center; background: var(--pink, #e52665); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); transition: transform .2s ease;
}
.evgal-play::before { content: ""; margin-left: 7px; border-left: 26px solid #fff; border-top: 16px solid transparent; border-bottom: 16px solid transparent; }
.evgal-video:hover .evgal-play { transform: scale(1.08); }
.evgal-tag { position: absolute; left: 16px; bottom: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .62); font-size: 13px; font-weight: 600; }
.evgal-video.is-playing { cursor: default; }
.evgal-video iframe, .evgal-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

.evgal-foot { text-align: center; margin-top: 26px; }
.evgal-all { display: inline-flex; }

@media (max-width: 760px) {
  .evgal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 130px; gap: 8px; }
  .evgal-item:nth-child(6) { grid-column: span 1; }
  .evgal-item:nth-child(n+7) { display: none; }
}

/* ---------- Full-screen viewer ---------- */
.evlb { position: fixed; inset: 0; z-index: 1000; display: none; flex-direction: column; background: rgba(8, 8, 12, .97); color: #fff; font-family: var(--font-body); }
.evlb.open { display: flex; }
.evlb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 14px; color: rgba(255, 255, 255, .8); }
.evlb-btn { border: 0; background: rgba(255, 255, 255, .1); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.evlb-btn:hover { background: rgba(255, 255, 255, .2); }
.evlb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 76px; touch-action: pan-y; }
.evlb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; }
.evlb-prev, .evlb-next { position: absolute; top: 50%; margin-top: -23px; }
.evlb-prev { left: 16px; }
.evlb-next { right: 16px; }
.evlb-cap { text-align: center; padding: 12px 18px 4px; font-size: 15px; color: rgba(255, 255, 255, .85); min-height: 22px; }
.evlb-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px 18px; justify-content: center; scrollbar-width: none; }
.evlb-thumbs::-webkit-scrollbar { display: none; }
.evlb-thumbs button { flex: none; width: 74px; height: 50px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; cursor: pointer; opacity: .55; }
.evlb-thumbs button.on { border-color: #fff; opacity: 1; }
.evlb-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 760px) {
  .evlb-stage { padding: 0 8px; }
  .evlb-prev, .evlb-next { display: none; }
  .evlb-thumbs { justify-content: flex-start; }
}
