﻿.gallery { background: #fff; }
.gallery-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.gallery-heading > p { max-width: 330px; margin-bottom: 38px; color: #6c6b68; line-height: 1.7; }
.gallery h2 em { color: #fff; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 20px; border-top: 1px solid #d4d2cd; padding-top: 25px; }
.gallery-empty { grid-column: 1 / -1; color: #6c6b68; line-height: 1.7; }
.gallery-grid figure { margin: 0; min-width: 0; }
.gallery-open { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: #eeece8; cursor: zoom-in; }
.gallery-open img { display: block; width: 100%; height: 100%; object-fit: contain; filter: brightness(1.06) contrast(1.02); }
.gallery-open img[src$="galeria-dojo-01.jpg"],
.gallery-open img[src$="galeria-dojo-05.jpg"],
.gallery-open img[src$="galeria-dojo-09.jpg"],
.gallery-open img[src$="galeria-dojo-10.jpg"],
.gallery-open img[src$="galeria-dojo-15.jpg"],
.gallery-open img[src$="galeria-dojo-16.jpg"],
.gallery-open img[src$="galeria-dojo-17.jpg"] { filter: brightness(1.12) contrast(1.01); }
.gallery-open img[src$="galeria-dojo-04.jpg"],
.gallery-open img[src$="galeria-dojo-06.jpg"],
.gallery-open img[src$="galeria-dojo-11.jpg"],
.gallery-open img[src$="galeria-dojo-12.jpg"],
.gallery-open img[src$="galeria-dojo-14.jpg"] { filter: brightness(1.02) contrast(1.01); }
.gallery-open:focus-visible, .gallery-close:focus-visible { outline: 3px solid #f4af28; outline-offset: 4px; }
.gallery-grid figcaption { padding-top: 12px; color: #555; font-size: 14px; line-height: 1.6; }
.gallery-grid.gallery-carousel { display: block; }
.gallery-carousel figure { max-width: 820px; margin: 0 auto; animation: gallery-appear .8s cubic-bezier(.2, .7, .2, 1) both; }
.gallery-carousel figure[hidden] { display: none; }
.gallery-carousel .gallery-open img { animation: gallery-zoom .9s cubic-bezier(.2, .7, .2, 1) both; }
.gallery-carousel figcaption { text-align: center; animation: gallery-caption .7s .1s ease both; }
.gallery-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }
.gallery-controls button { min-width: 44px; min-height: 44px; padding: 8px 14px; border: 1px solid #c5c2bd; background: #fff; color: #171718; cursor: pointer; font: inherit; }
.gallery-controls button:hover { border-color: #c7192d; color: #c7192d; }
.gallery-controls button:focus-visible { outline: 3px solid #f4af28; outline-offset: 3px; }
.gallery-counter { min-width: 60px; text-align: center; color: #555; font-size: 14px; }
@keyframes gallery-appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gallery-zoom { from { transform: scale(.97); } to { transform: scale(1); } }
@keyframes gallery-caption { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .gallery-carousel figure, .gallery-carousel .gallery-open img, .gallery-carousel figcaption { animation: none; } }
.gallery-dialog { width: min(960px, 94vw); max-height: 92vh; padding: 20px; border: 0; background: #fff; color: #171718; }
.gallery-dialog::backdrop { background: rgba(0, 0, 0, .82); }
.gallery-close { display: block; margin-left: auto; border: 0; background: transparent; color: #171718; font-size: 32px; line-height: 1; cursor: pointer; }
.gallery-dialog figure { margin: 10px 0 0; }
.gallery-dialog img { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; margin: 0 auto; object-fit: contain; }
.gallery-dialog figcaption { margin-top: 14px; font-size: 14px; line-height: 1.6; }
@media (max-width: 750px) {
  .gallery-heading { display: block; }
  .gallery-heading > p { margin-bottom: 30px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .gallery-dialog { padding: 15px; }
}
