/* ==========================================================================
   Grillsons · product photo gallery (owner-approved look, 20 Oct 2026;
   exports/mockups/product-gallery). Markup: inc/gallery.php. Script:
   assets/js/gallery.js. Additions on top of the design system: the same
   tokens, the theme's own thumbnails (.gs-pdp__thumb) and card, and the
   pills rule of the Fresh / Frozen tags (solid colours, no blur, no glow).
   ========================================================================== */

/* ---- Chips on photos ----
   Caption ("Raw" / "Cooked" / "Marbling close-up"): solid charcoal, cream text.
   Version ("Black Angus · MB3+"): solid charcoal, gold text, gold hairline. */
.gs-phchip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; border: 1px solid rgba(244, 238, 226, 0.18); background: #141210; color: #F4EEE2;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; line-height: 1; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
}
.gs-phchip--ver { color: #E7B24E; border-color: rgba(212, 162, 78, 0.55); }
.gs-phchip--ver::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #D4A24E; flex: none; }
.gs-rtl .gs-phchip { font-family: var(--font-body); font-size: 12px; letter-spacing: 0; text-transform: none; }
.gs-rtl .gs-phchip bdi { font-family: var(--font-mono); font-size: 11px; }

/* ==========================================================================
   1 · Product page
   ========================================================================== */
.gs-gal { display: block; }
.gs-gal__main { cursor: zoom-in; }
.gs-gal__track {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  transition: opacity .28s ease;
}
.gs-gal__track::-webkit-scrollbar { display: none; }
.gs-gal__track:focus-visible { outline: 2px solid var(--gold-bright, #E7B24E); outline-offset: -4px; }
.gs-gal__slide { position: relative; flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; background: var(--surface-2); }
.gs-gal__slide picture { display: block; width: 100%; height: 100%; }
.gs-gal__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-gal__slide .gs-phchip { position: absolute; left: 14px; bottom: 14px; z-index: 2; }
[dir="rtl"] .gs-gal__slide .gs-phchip { left: auto; right: 14px; }
.gs-gal__ver { position: absolute; top: 14px; left: 14px; z-index: 3; pointer-events: none; }
[dir="rtl"] .gs-gal__ver { left: auto; right: 14px; }
.gs-gal__ver[hidden] { display: none; }
.gs-gal__zoom {
  position: absolute; right: 14px; bottom: 14px; z-index: 3; width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: #141210; color: #F4EEE2; border: 1px solid rgba(244, 238, 226, 0.18); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.gs-gal__zoom:hover, .gs-gal__zoom:focus-visible { color: #E7B24E; border-color: rgba(212, 162, 78, 0.65); }
[dir="rtl"] .gs-gal__zoom { right: auto; left: 14px; }
.gs-gal__dots { position: absolute; left: 50%; bottom: 23px; transform: translateX(-50%); z-index: 3; display: none; gap: 6px; align-items: center; pointer-events: none; }
.gs-gal__dots i { display: block; width: 6px; height: 6px; border-radius: 999px; background: #F4EEE2; opacity: .55; transition: width .3s var(--ease-out), background .3s, opacity .3s; }
.gs-gal__dots i.is-on { width: 18px; background: #D4A24E; opacity: 1; }
/* A version switch: the new set fades in. */
.gs-gal__main.is-swapping .gs-gal__track { opacity: 0; }
/* The product's own badge (a cut sold neither fresh nor frozen) stays above the photos. */
.gs-gal__main .gs-card__badge { z-index: 3; }

/* Thumbnails: the theme's own .gs-pdp__thumbs / .gs-pdp__thumb, plus a quiet label. */
.gs-gal__th { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.gs-gal__th .gs-pdp__thumb { width: 100%; }
.gs-gal__th .gs-pdp__thumb picture { display: block; width: 100%; height: 100%; }
.gs-gal__thl { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.gs-gal__th.is-active .gs-gal__thl { color: var(--gold-bright); }
.gs-rtl .gs-gal__thl { font-family: var(--font-body); font-size: 12px; letter-spacing: 0; text-transform: none; }

/* Phones and tablets (the page stacks at 900px): swipe + dots, no thumbnails. */
@media (max-width: 900px) {
  .gs-gal__thumbs { display: none !important; }
  .gs-gal__dots { display: flex; }
  .gs-gal__slide .gs-phchip { left: 12px; bottom: 12px; }
  [dir="rtl"] .gs-gal__slide .gs-phchip { right: 12px; }
  .gs-gal__ver { top: 12px; left: 12px; }
  [dir="rtl"] .gs-gal__ver { right: 12px; }
  .gs-gal__zoom { right: 12px; bottom: 12px; width: 34px; height: 34px; }
  [dir="rtl"] .gs-gal__zoom { left: 12px; }
  .gs-gal__dots { bottom: 26px; }
}

/* ---- Zoom (tap the photo). Same dark ground as the site, no blur. ---- */
.gs-zoom { position: fixed; inset: 0; z-index: 9999; background: #0E0C0A; display: grid; grid-template-rows: auto 1fr auto; color: var(--text); }
.gs-zoom[hidden] { display: none; }
.gs-zoom__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); }
.gs-zoom__count { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--text-dim); }
.gs-zoom__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text-bright); margin-inline-end: auto; margin-inline-start: 14px; }
.gs-zoom__x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hairline-3); background: #141210; color: var(--text-bright); font-size: 22px; line-height: 1; cursor: pointer; }
/* gallery.js handles the gestures here: double-tap and pinch zoom, one-finger pan and swipe. */
.gs-zoom__stage { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; min-height: 0; }
.gs-zoom__stage picture { display: contents; }
.gs-zoom__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; transform-origin: 50% 50%; transition: transform .35s var(--ease-out); cursor: zoom-in; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.gs-zoom__stage.is-zoomed img { cursor: zoom-out; }
.gs-zoom__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--hairline-3); background: #141210; color: var(--text-bright); font-size: 20px; cursor: pointer; }
.gs-zoom__nav--prev { left: 18px; } .gs-zoom__nav--next { right: 18px; }
[dir="rtl"] .gs-zoom__nav--prev { left: auto; right: 18px; } [dir="rtl"] .gs-zoom__nav--next { right: auto; left: 18px; }
.gs-zoom__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 18px 18px; border-top: 1px solid var(--hairline); }
.gs-zoom__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.gs-zoom__hint { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.gs-rtl .gs-zoom__hint, .gs-rtl .gs-zoom__count { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: 13px; }
.gs-zoom__dots { display: flex; gap: 6px; }
.gs-zoom__dots i { display: block; width: 6px; height: 6px; border-radius: 999px; background: #F4EEE2; opacity: .45; }
.gs-zoom__dots i.is-on { width: 18px; background: #D4A24E; opacity: 1; }
@media (max-width: 900px) { .gs-zoom__nav { display: none; } .gs-zoom__name { display: none; } }
html.gs-zoom-open { overflow: hidden; }

/* ==========================================================================
   2 · Product cards: 2–3 photos
   Hover devices: hover shows the next photo (cross-fade); moving across the
   photo picks photo 1 / 2 / 3; small dots appear on hover.
   Touch devices: swipe inside the photo, dots always shown.
   Rails that already swipe sideways (home "Shop by cut", "Pairs well") never
   swipe inside the photo: one photo on a phone.
   ========================================================================== */
.gs-cg { position: absolute; inset: 0; }
.gs-cg__track { position: absolute; inset: 0; }
.gs-cg__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease-out); }
.gs-cg__slide.is-on { opacity: 1; }
.gs-cg__slide picture { display: block; width: 100%; height: 100%; }
.gs-cg__dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; display: flex; gap: 5px; align-items: center; pointer-events: none; opacity: 0; transition: opacity .3s; }
.gs-cg__dots i { display: block; width: 5px; height: 5px; border-radius: 999px; background: #F4EEE2; opacity: .6; transition: width .3s var(--ease-out), background .3s, opacity .3s; }
.gs-cg__dots i.is-on { width: 14px; background: #D4A24E; opacity: 1; }
.gs-card:hover .gs-cg__dots, .gs-card.is-cg-hover .gs-cg__dots { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .gs-grid:not(.gs-grid--rail) .gs-cg__track {
    display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .gs-grid:not(.gs-grid--rail) .gs-cg__track::-webkit-scrollbar { display: none; }
  .gs-grid:not(.gs-grid--rail) .gs-cg__slide { position: relative; flex: 0 0 100%; height: 100%; opacity: 1; scroll-snap-align: start; scroll-snap-stop: always; transition: none; }
  .gs-grid:not(.gs-grid--rail) .gs-cg__dots { opacity: 1; bottom: 9px; }
  /* A rail on a phone: photo 1 only, no dots (owner, 20 Oct 2026). */
  .gs-grid--rail .gs-cg__dots { display: none; }
}

/* ==========================================================================
   3 · Category header strip: 4 photos of the category's best cuts
   ========================================================================== */
.gs-catphotos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 26px 0 30px; }
.gs-catphotos__tile {
  position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--r-img); overflow: hidden;
  border: 1px solid rgba(237, 230, 216, 0.09); background: var(--surface-2); text-decoration: none;
  transition: border-color .35s, transform .4s var(--ease-out);
}
.gs-catphotos__tile picture { display: block; width: 100%; height: 100%; }
.gs-catphotos__tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .65s var(--ease-out); }
.gs-catphotos__tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 52%, rgba(16, 12, 8, 0.78)); pointer-events: none; }
.gs-catphotos__tile:hover { border-color: rgba(212, 162, 78, 0.55); transform: translateY(-4px); }
.gs-catphotos__tile:hover img { transform: scale(1.05); }
.gs-catphotos__name { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-bright); }
.gs-catphotos__name svg { color: var(--gold-bright); flex: none; }
[dir="rtl"] .gs-catphotos__name svg { transform: scaleX(-1); }
.gs-rtl .gs-catphotos__name { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: 13px; }
@media (max-width: 860px) {
  .gs-catphotos {
    display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 16px calc(-1 * var(--pad-x)) 18px; padding: 0 var(--pad-x);
  }
  .gs-catphotos::-webkit-scrollbar { display: none; }
  .gs-catphotos__tile { flex: 0 0 42%; aspect-ratio: 4 / 3; scroll-snap-align: start; border-radius: 12px; }
  .gs-catphotos__name { left: 10px; right: 10px; bottom: 9px; font-size: 9px; letter-spacing: 0.1em; }
  .gs-catphotos__name svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gs-gal__track, .gs-cg__slide, .gs-zoom__stage img, .gs-catphotos__tile, .gs-catphotos__tile img { transition: none; }
}
