[data-photo-gallery].rfEventMedia {
  --navy:#13233e; --muted:#465973; --line:#dbe5f0; --soft:#f2f7fd;
  --action:#1554a2; --white:#fff;
  margin-top:var(--rf-section-gap);
  padding:clamp(16px,3vw,24px);
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--white);
}
[data-photo-gallery] *,
[data-photo-gallery] *::before,
[data-photo-gallery] *::after { box-sizing:border-box; }
[data-photo-gallery] [hidden] { display:none !important; }
[data-photo-gallery] > h2 { margin:0 0 16px; }
[data-photo-gallery] :is(a,button):focus-visible { outline:2px solid var(--action); outline-offset:3px; }
[data-photo-gallery] .rfEventLightbox button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  border:1px solid var(--action);
  border-radius:9px;
  background:var(--action);
  color:var(--white);
  cursor:pointer;
}
[data-photo-gallery] .rfEventGallery { display:flex; flex-wrap:wrap; gap:12px; }
[data-photo-gallery] .rfEventGallery figure { width:min(144px,calc((100% - 12px) / 2)); margin:0; }
[data-photo-gallery] .rfEventGallery a { position:relative; display:block; border-radius:10px; overflow:hidden; background:var(--soft); cursor:zoom-in; }
[data-photo-gallery] .rfEventGallery img { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:cover; }
[data-photo-gallery] .rfEventGallery figcaption { margin-top:8px; color:var(--muted); font-size:14px; overflow-wrap:anywhere; }
.rfEventGalleryZoom {
  position:absolute;
  inset:auto 8px 8px auto;
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border:1px solid #ffffff55;
  border-radius:10px;
  background:#13233ed9;
  color:#fff;
}
[data-photo-gallery] .rfEventGallery a:is(:hover,:focus-visible) .rfEventGalleryZoom { background:var(--action); }
.rfEventGalleryZoom > span { position:relative; width:14px; height:14px; border:2px solid currentColor; border-radius:50%; margin:-3px 3px 0 0; }
.rfEventGalleryZoom > span::after { content:""; position:absolute; width:7px; height:2px; background:currentColor; inset:9px auto auto 9px; transform:rotate(45deg); transform-origin:left center; }

html:has(.rfEventLightbox[open]) { overflow:hidden; }
[data-photo-gallery] .rfEventLightbox {
  width:min(1080px,calc(100% - 36px));
  height:min(780px,calc(100dvh - 36px));
  max-width:none;
  max-height:none;
  padding:0;
  margin:auto;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:18px;
  color:var(--navy);
  background:var(--white);
  box-shadow:0 30px 100px #030a1c66;
}
[data-photo-gallery] .rfEventLightbox[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.rfEventLightbox::backdrop { background:rgba(10,21,40,.86); backdrop-filter:blur(6px); }
.rfEventLightboxHeader {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto auto;
  align-items:center;
  gap:14px;
  padding:12px 16px;
  background:linear-gradient(110deg,#f2f7fd,#fff);
}
.rfEventLightboxHeader > img { display:block; width:26px; height:auto; }
[data-photo-gallery] .rfEventLightboxHeader h2 { margin:0; font-size:clamp(15px,2.3vw,21px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rfEventLightboxCount { color:var(--muted); font-weight:700; font-size:13px; white-space:nowrap; }
[data-photo-gallery] .rfEventLightbox button.rfEventLightboxClose {
  width:44px;
  padding:0;
  border-color:var(--line);
  background:var(--white);
  color:var(--navy);
}
[data-photo-gallery] .rfEventLightbox button.rfEventLightboxClose:hover { color:var(--white); border-color:var(--action); background:var(--action); }
.rfEventLightboxClose > span { display:grid; place-items:center; width:18px; height:18px; }
.rfEventLightboxClose > span::before,.rfEventLightboxClose > span::after { content:""; grid-area:1/1; width:17px; height:2px; border-radius:2px; background:currentColor; transform:rotate(45deg); }
.rfEventLightboxClose > span::after { transform:rotate(-45deg); }
.rfEventLightboxStage {
  position:relative;
  display:grid;
  place-items:center;
  min-height:0;
  padding:12px 66px;
  overflow:hidden;
  background:radial-gradient(ellipse at center,#203855,#0f1c32);
  touch-action:pan-y pinch-zoom;
}
.rfEventLightboxImage { grid-area:1/1; display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
.rfEventLightboxStage[aria-busy=true] .rfEventLightboxImage { visibility:hidden; }
.rfEventLightboxLoading { display:none; grid-area:1/1; color:#e2edfa; }
.rfEventLightboxStage[aria-busy=true] .rfEventLightboxLoading { display:block; }
[data-photo-gallery] .rfEventLightboxStage [data-gallery-error] { grid-area:1/1; margin:0; color:white; }
[data-photo-gallery] .rfEventLightbox button[data-gallery-step] {
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:44px;
  padding:0;
  border-color:#ffffff66;
  background:#13233ee8;
  font-size:25px;
}
[data-photo-gallery] .rfEventLightbox button[data-gallery-step="-1"] { inset-inline-start:12px; }
[data-photo-gallery] .rfEventLightbox button[data-gallery-step="1"] { inset-inline-end:12px; }
[data-photo-gallery] .rfEventLightbox button[data-gallery-step]:hover { border-color:#a5d1ff; background:var(--action); }
[data-photo-gallery] .rfEventLightbox button[data-gallery-step]:focus-visible { outline-color:#c4e0ff; }
.rfEventLightbox button[data-gallery-step] > span { width:10px; height:10px; border-top:2px solid currentColor; border-right:2px solid currentColor; }
.rfEventLightbox button[data-gallery-step="-1"] > span { transform:translateX(2px) rotate(-135deg); }
.rfEventLightbox button[data-gallery-step="1"] > span { transform:translateX(-2px) rotate(45deg); }
.rfEventLightboxFooter { padding:10px 16px; background:var(--soft); }
[data-photo-gallery] .rfEventLightboxFooter p { max-height:4.4em; overflow:auto; margin:0 0 8px; }
.rfEventLightboxThumbs {
  display:flex;
  align-items:center;
  gap:8px;
  width:max-content;
  max-width:100%;
  margin-inline:auto;
  padding:5px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#eaf1fa;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-padding-inline:5px;
  scrollbar-width:none;
}
.rfEventLightboxThumbs::-webkit-scrollbar { display:none; }
[data-photo-gallery] .rfEventLightboxThumbs button {
  flex:0 0 auto;
  display:block;
  width:56px;
  height:56px;
  padding:2px;
  border:2px solid var(--line);
  border-radius:8px;
  background:var(--white);
  overflow:hidden;
}
[data-photo-gallery] .rfEventLightboxThumbs button:is(:hover,[aria-current=true]) { border-color:var(--action); }
[data-photo-gallery] .rfEventLightboxThumbs button:focus-visible { outline-offset:1px; }
[data-photo-gallery] .rfEventLightboxThumbs button > img { display:block; width:100%; height:100%; object-fit:cover; border-radius:4px; }
@media (prefers-reduced-motion:no-preference) {
  [data-photo-gallery] .rfEventGallery img { transition:transform .28s ease; }
  [data-photo-gallery] .rfEventGallery a:is(:hover,:focus-visible) img { transform:scale(1.035); }
  [data-photo-gallery] .rfEventLightbox[open] { animation:rfEventLightboxEnter .24s ease-out both; }
  .rfEventLightbox[open]::backdrop { animation:rfEventBackdropEnter .24s ease-out both; }
  [data-photo-gallery] .rfEventLightbox[open][data-gallery-closing] { animation:rfEventLightboxExit .18s ease-in both; }
  .rfEventLightbox[open][data-gallery-closing]::backdrop { animation:rfEventBackdropExit .18s ease-in both; }
}
@keyframes rfEventLightboxEnter {
  from { opacity:0; transform:translateY(8px) scale(.985); }
  to { opacity:1; transform:none; }
}
@keyframes rfEventBackdropEnter { from { opacity:0; } to { opacity:1; } }
@keyframes rfEventLightboxExit { to { opacity:0; transform:translateY(8px) scale(.985); } }
@keyframes rfEventBackdropExit { to { opacity:0; } }
@media (max-width:600px) {
  [data-photo-gallery] .rfEventLightbox { width:calc(100% - 16px); height:fit-content; max-height:calc(100dvh - 16px); overflow:auto; border-radius:14px; }
  [data-photo-gallery] .rfEventLightbox[open] { display:flex; flex-direction:column; }
  .rfEventLightboxHeader { gap:8px; padding:8px 10px; }
  .rfEventLightboxStage {
    flex:none;
    width:100%;
    max-height:max(100px,calc(100dvh - 205px));
    padding:0;
    aspect-ratio:var(--gallery-photo-ratio,3/2);
  }
  [data-photo-gallery] .rfEventLightbox button[data-gallery-step="-1"] { inset-inline-start:6px; }
  [data-photo-gallery] .rfEventLightbox button[data-gallery-step="1"] { inset-inline-end:6px; }
  .rfEventLightboxFooter { padding:8px 10px; }
}
