.gallery-content .gallery-count { margin: 0 0 28px; color: #526171; }
.gallery-content .restored-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-content [hidden] { display: none !important; }
.gallery-content [data-gallery-item] { scroll-margin-top: 140px; }
.gallery-content .restored-gallery a { display: block; overflow: hidden; border-radius: 12px; background: #f6f6f7; }
.gallery-content .restored-gallery img { display: block; height: auto; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 0; }
.gallery-content .restored-gallery figcaption { font-size: 16px; line-height: 1.5; padding: 14px 0; }
.gallery-content .restored-gallery a:focus-visible,
.gallery-show-all:focus-visible,
.gallery-close:focus-visible { outline: 3px solid #2e658a; outline-offset: 4px; }
.gallery-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px 28px; margin-top: 36px; }
.gallery-show-all { border: 0; background: transparent; color: #2e658a; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 12px; }
.gallery-lightbox { box-sizing: border-box; width: min(1100px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 20px; border: 0; border-radius: 14px; background: #f6f6f7; color: #1f2335; }
.gallery-lightbox::backdrop { background: rgba(15, 19, 35, .86); }
body:has(.gallery-lightbox[open]) { overflow: hidden; }
.gallery-lightbox figure { margin: 0; }
.gallery-lightbox img { display: block; width: 100%; height: auto; max-height: calc(100dvh - 170px); object-fit: contain; }
.gallery-lightbox figcaption { padding-top: 16px; font-weight: 700; text-align: center; }
.gallery-close { display: flex; align-items: center; gap: 10px; margin: 0 0 12px auto; padding: 8px 14px; border: 1px solid #cdd5dc; border-radius: 8px; background: white; color: #1f2335; font: inherit; font-weight: 700; cursor: pointer; }
.gallery-close span { font-size: 24px; line-height: 1; }
@media (max-width: 1000px) { .gallery-content .restored-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .gallery-content .restored-gallery { grid-template-columns: minmax(0, 1fr); gap: 20px; } .gallery-lightbox { padding: 14px; } }
