.gallery-section { margin: 28px 0; }
.gallery-section-heading { border-bottom: 2px solid #0ea5e9; margin-bottom: 18px; padding-bottom: 12px; }
.gallery-section-heading h2 { font-size: 24px; line-height: 1.25; margin: 0; }
.gallery-page-heading { margin: 22px 0 26px; }
.gallery-page-heading h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.15; margin: 10px 0 16px; overflow-wrap: anywhere; }
.gallery-page-heading p { max-width: 820px; line-height: 1.65; }
.gallery-albums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gallery-album-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid #0ea5e9; border-radius: 8px; background: var(--card); }
.gallery-album-card:hover { border-color: #0ea5e9; }
.gallery-album-card:focus-visible, .gallery-photo:focus-visible { outline: 3px solid #b7ff2a; outline-offset: 3px; }
.gallery-album-card > img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.gallery-album-copy { padding: 18px; display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.gallery-album-copy h2, .gallery-album-copy h3 { margin: 10px 0; font-size: 21px; line-height: 1.3; overflow-wrap: anywhere; }
.gallery-date, .gallery-album-copy time, .gallery-credit { color: var(--muted); font-size: 14px; }
.gallery-counts { color: var(--muted); font-size: 14px; }
.gallery-open { display: inline-block; margin-top: auto; padding-top: 12px; color: #b7ff2a; font-weight: 700; }
body[data-theme="light"] .gallery-open { color: #426500; }
.gallery-all { margin-top: 20px; }
.gallery-back { display: inline-block; color: #0ea5e9; font-weight: 700; padding: 12px 0; }
.gallery-photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gallery-photo { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.gallery-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.gallery-video { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.gallery-video video { display: block; width: 100%; height: auto; max-height: 80dvh; background: #000; object-fit: contain; }
.gallery-video figcaption { padding: 14px 16px; font-weight: 700; line-height: 1.4; }
.gallery-viewer { position: fixed; inset: 0; box-sizing: border-box; margin: 0; padding: 0; border: 0; border-radius: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; overflow: hidden; background: #000; color: #fff; }
.gallery-viewer::backdrop { background: #000; }
.gallery-viewer-toolbar { position: absolute; z-index: 2; top: 0; left: 0; right: 0; display: flex; justify-content: flex-end; padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left)); pointer-events: none; }
.gallery-viewer-toolbar p { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gallery-viewer-toolbar form { margin: 0; pointer-events: auto; }
.gallery-viewer-image { position: absolute; inset: 0; background: #000; }
.gallery-viewer-image img { display: block; width: 100%; height: 100%; object-fit: contain; touch-action: pan-y pinch-zoom; }
.gallery-viewer-navigation { position: absolute; z-index: 1; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); pointer-events: none; }
.gallery-viewer-navigation [data-gallery-counter] { position: absolute; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 6px 12px; border-radius: 20px; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; white-space: nowrap; }
.gallery-control { display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font: 700 24px/1 Arial, sans-serif; width: 44px; height: 44px; padding: 0; cursor: pointer; pointer-events: auto; }
.gallery-control:focus-visible { outline: 3px solid #b7ff2a; outline-offset: 2px; }
body.gallery-viewer-open { overflow: hidden; }
@media (max-width: 1000px) {
  .gallery-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .gallery-albums, .gallery-videos { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .gallery-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gallery-album-copy { padding: 16px; }
  .gallery-section-heading h2 { font-size: 22px; }
}
