/* Shared photo gallery: ordinary links without JS, thumbnails and preview with JS. */
.photo-gallery { min-width: 0; padding: 16px; border: 1px solid #e4eef6; border-radius: 20px; background: #fff; box-shadow: 0 4px 15px #0b527514; }
.gallery-thumbnails { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.gallery-thumbnails a { display: block; min-width: 0; border-radius: 13px; overflow: hidden; border: 3px solid transparent; }
.gallery-thumbnails img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; }
.photo-gallery.is-enhanced { display: grid; grid-template-columns: clamp(100px, 11vw, 160px) minmax(0, 1fr); gap: 12px; height: clamp(450px, 38vw, 590px); }
.is-enhanced .gallery-thumbnails { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c6dce8 transparent; padding-right: 3px; }
.is-enhanced .gallery-thumbnails a { flex: none; }
.is-enhanced .gallery-thumbnails a[aria-current="true"] { border-color: #ffce15; }
.gallery-thumbnails a:focus-visible { outline-offset: -5px; outline-width: 3px; }
.gallery-view { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 14px; background: #eef5f8; }
.gallery-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; color: #fff; background: none; touch-action: pan-y pinch-zoom; }
.gallery-open:focus-visible { outline-offset: -6px; }
.gallery-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-expand { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; background: #10273199; }
.gallery-expand svg { width: 25px; height: 25px; }
.gallery-controls { position: absolute; bottom: 12px; right: 12px; display: flex; gap: 8px; align-items: center; color: #fff; }
.gallery-controls button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: #163442c9; }
.gallery-controls button:hover, .gallery-open:hover .gallery-expand { background: #00384deb; }
.gallery-controls button svg { width: 23px; height: 23px; }
.gallery-controls [data-photo-previous] svg { transform: rotate(180deg); }
.gallery-count { min-width: 63px; margin-left: 6px; padding: 9px 12px; border-radius: 20px; background: #102731c9; font-size: 14px; font-weight: 800; text-align: center; }
@media (max-width: 600px) {
  .photo-gallery { padding: 10px; border-radius: 16px; }
  .gallery-thumbnails { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-gallery.is-enhanced { display: flex; flex-direction: column-reverse; height: auto; gap: 10px; }
  .gallery-view { width: 100%; aspect-ratio: 1.2; flex: none; border-radius: 10px; }
  .is-enhanced .gallery-thumbnails { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 0 0 4px; scroll-snap-type: x mandatory; }
  .is-enhanced .gallery-thumbnails a { width: 78px; scroll-snap-align: center; border-radius: 9px; }
  .gallery-expand { top: 9px; right: 9px; }
  .gallery-controls { right: 8px; bottom: 8px; gap: 5px; }
  .gallery-count { margin-left: 0; min-width: 57px; padding-inline: 9px; }
}
