.gallery-toolbar { display: flex; flex-wrap: wrap; gap: 9px; margin: -26px 0 34px; }
.gallery-filter { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); color: #62594d; background: transparent; font: 700 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: .2s ease; }
.gallery-filter:hover, .gallery-filter:focus-visible { color: var(--ink); border-color: var(--ink); }
.gallery-filter.active { color: var(--white); background: var(--ink); border-color: var(--ink); }

.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 250px; gap: 12px; }
.gallery-card { position: relative; min-width: 0; overflow: hidden; background: #d5c8b8; }
.gallery-card:nth-child(12n + 1), .gallery-card:nth-child(12n + 8) { grid-column: span 2; grid-row: span 2; }
.gallery-card:nth-child(12n + 4), .gallery-card:nth-child(12n + 10) { grid-column: span 2; }
.gallery-card button { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; color: var(--white); background: #2b241c; text-align: left; cursor: zoom-in; }
.gallery-card figure { position: absolute; inset: 0; margin: 0; }
.gallery-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .35s ease; }
.gallery-card button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 44%, rgba(17,13,10,.82)); opacity: .78; transition: opacity .3s ease; }
.gallery-card figcaption { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 17px; display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.gallery-card figcaption span { display: block; color: #dbb382; font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.gallery-card figcaption strong { display: block; margin-top: 4px; font: 400 18px/1.15 var(--display); }
.gallery-card figcaption i { flex: 0 0 auto; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; font: normal 16px/1 var(--sans); }
.gallery-card button:hover img, .gallery-card button:focus-visible img { transform: scale(1.035); filter: saturate(1.04) contrast(1.03); }
.gallery-card button:hover::after, .gallery-card button:focus-visible::after { opacity: 1; }
.gallery-card button:focus-visible { outline: 3px solid var(--wood); outline-offset: -3px; }
.gallery-more-wrap { display: flex; justify-content: center; margin-top: 34px; }
.gallery-more { min-width: 205px; min-height: 50px; border: 1px solid var(--ink); color: var(--ink); background: transparent; font: 800 10px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: .2s ease; }
.gallery-more:hover, .gallery-more:focus-visible { color: var(--white); background: var(--ink); }

.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox { position: fixed; z-index: 200; inset: 0; display: grid; grid-template-columns: 70px minmax(0, 1fr) 70px; place-items: center; padding: 42px 18px 24px; color: var(--white); background: rgba(10,8,6,.96); backdrop-filter: blur(16px); }
body.gallery-open { overflow: hidden; }
.lightbox-close { position: absolute; z-index: 3; top: 18px; right: 22px; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: var(--white); background: transparent; font-size: 23px; cursor: pointer; }
.lightbox-nav { width: 48px; height: 62px; border: 1px solid rgba(255,255,255,.27); color: var(--white); background: rgba(255,255,255,.05); font-size: 25px; cursor: pointer; transition: .2s ease; }
.lightbox-nav:hover, .lightbox-nav:focus-visible, .lightbox-close:hover, .lightbox-close:focus-visible { border-color: var(--white); background: rgba(255,255,255,.13); }
.lightbox-stage { width: min(1120px, 100%); height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 15px; }
.lightbox-image-wrap { min-height: 0; display: grid; place-items: center; }
.lightbox-image { max-width: 100%; max-height: calc(100vh - 145px); display: block; object-fit: contain; box-shadow: 0 18px 70px rgba(0,0,0,.38); }
.lightbox-caption { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.lightbox-caption span { display: block; color: #d6a36d; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.lightbox-caption strong { display: block; margin-top: 4px; font: 400 22px var(--display); }
.lightbox-count { color: #a99d8e; font: 400 15px var(--display); }

@media (max-width: 980px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 220px; }
  .gallery-card:nth-child(12n + 1), .gallery-card:nth-child(12n + 8) { grid-column: span 2; grid-row: span 2; }
  .gallery-card:nth-child(12n + 4), .gallery-card:nth-child(12n + 10) { grid-column: span 1; }
}

@media (max-width: 680px) {
  .gallery-toolbar { margin-top: -10px; }
  .gallery-filter { min-height: 38px; padding: 0 12px; font-size: 9px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 190px; gap: 7px; }
  .gallery-card:nth-child(12n + 1), .gallery-card:nth-child(12n + 8) { grid-column: span 2; grid-row: span 2; }
  .gallery-card figcaption { left: 13px; right: 13px; bottom: 12px; }
  .gallery-card figcaption strong { font-size: 15px; }
  .gallery-card figcaption i { display: none; }
  .gallery-lightbox { grid-template-columns: 48px minmax(0, 1fr) 48px; padding: 62px 6px 18px; }
  .lightbox-nav { width: 40px; height: 54px; }
  .lightbox-caption strong { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card img { transition: none; }
}

