/* Public gallery (static/js/gallery.js) */
.gal-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.gal-tile { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: var(--bg-soft, #f4f5f7); aspect-ratio: 1; animation: gal-pop .35s ease both; }
.gal-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gal-tile img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .4s ease, transform .6s ease; }
.gal-tile.is-in img { opacity: 1; transform: none; }
.gal-tile:hover img { transform: scale(1.05); }
.gal-tile.is-loading::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .7) 50%, transparent 80%) -150% 0 / 60% 100% no-repeat; animation: gal-shimmer 1.2s ease-in-out infinite; }
.gal-tile.is-broken { display: none; }
.gal-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; color: #fff; font-weight: 700; font-size: .95rem; background: linear-gradient(transparent, rgba(0, 0, 0, .62)); opacity: 0; transition: opacity .25s; pointer-events: none; }
.gal-tile:hover .gal-cap, .gal-open:focus-visible + .gal-cap { opacity: 1; }
.gal-open:focus-visible { outline: 4px solid var(--magenta, #e5188b); outline-offset: -4px; }
.gal-status { margin: 22px 0 0; text-align: center; color: var(--muted, #5b6270); font-weight: 600; }
.gal-more { margin-top: 18px; text-align: center; }
.gal-cta { margin-top: 44px; padding: 34px 20px; border-radius: 20px; background: var(--bg-soft, #f4f5f7); text-align: center; }
.gal-cta h2 { margin: 0 0 14px; font-size: 1.5rem; }
@keyframes gal-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes gal-shimmer { to { background-position: 250% 0; } }

/* viewer */
body.gv-lock { overflow: hidden; }
.gv-root { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; }
.gv-root[hidden] { display: none; }
.gv-backdrop { position: absolute; inset: 0; background: rgba(12, 13, 18, .88); animation: gv-fade .2s ease both; }
.gv-box { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; width: min(1100px, 100%); height: 100%; padding: 16px 8px; outline: none; }
.gv-fig { margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; height: 100%; min-width: 0; }
.gv-stage { display: grid; place-items: center; min-height: 0; }
.gv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; opacity: 0; transform: scale(.98); transition: opacity .25s ease, transform .3s ease; }
.gv-img.is-in { opacity: 1; transform: none; }
.gv-fig figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; color: #fff; text-align: center; }
.gv-title { font-size: 1.05rem; }
.gv-text { color: #c9ccd6; font-size: .92rem; }
.gv-count { color: #8a8f9b; font-size: .85rem; }
.gv-nav, .gv-close { display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; transition: background .2s; }
.gv-nav { width: 48px; height: 48px; }
.gv-nav:hover, .gv-close:hover { background: rgba(255, 255, 255, .28); }
.gv-nav[hidden] { visibility: hidden; display: grid; }
.gv-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; }
.gv-nav:focus-visible, .gv-close:focus-visible { outline: 3px solid #ffd25a; outline-offset: 2px; }
@keyframes gv-fade { from { opacity: 0; } }

@media (max-width: 760px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gal-tile { border-radius: 12px; }
  .gal-cap { display: none; }
  .gv-box { grid-template-columns: 1fr; padding: 56px 8px 12px; }
  .gv-nav { position: absolute; top: 50%; z-index: 2; width: 42px; height: 42px; transform: translateY(-50%); background: rgba(0, 0, 0, .45); }
  .gv-prev { left: 8px; } .gv-next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .gal-tile, .gv-backdrop { animation: none; }
  .gal-tile img, .gv-img { transition: none; transform: none; }
  .gal-tile.is-loading::before { animation: none; }
}
.gv-product[hidden] { display: none; }
