/* Gallery page -- ported from new-3d's app/gallery/ (GalleryGrid.tsx + Gallery.module.css).
   Class names are kebab-case translations of the original CSS-module names,
   namespaced under gal- to avoid collisions.
   2026-10-01: recolored. Originally kept new-3d's own gold/forest-green palette;
   user flagged it looked different from about.html/certification.html, so it now
   uses this site's shared palette instead (ink #2c2c28, muted #59574f, olive
   accent #71684f / hover #59513e, paper #f8f6f2, alt bg #eeece3, line #d8d3c4 --
   same tokens as about.css/certification.css/product-detail.css/contact.css).
   The lightbox dialog keeps a dark backdrop (needed for photo viewing contrast)
   but now built from the ink token rather than new-3d's forest-green/gold. */

.gal-page {
  --gal-ink: #2c2c28; --gal-muted: #59574f; --gal-olive: #71684f; --gal-olive-dark: #59513e;
  --gal-paper: #f8f6f2; --gal-alt: #eeece3; --gal-line: #d8d3c4;
  background: var(--gal-paper); color: var(--gal-ink); padding-top: 10px; font-family: 'Open Sans', sans-serif;
}
.gal-page h1, .gal-page h2 { font-family: 'Open Sans', sans-serif; font-weight: 650; letter-spacing: -.055em; margin: 0; }
.gal-page a:focus-visible, .gal-page button:focus-visible, .gal-dialog button:focus-visible { outline: 2px solid var(--gal-olive); outline-offset: 5px; }

.gal-hero { padding: 36px 7% 65px; }
.gal-kicker { font-size: 10px; letter-spacing: .15em; line-height: 1.7; font-weight: 600; color: var(--gal-olive); margin-bottom: 22px; }
.gal-hero-grid { display: grid; grid-template-columns: 1fr .6fr; align-items: end; gap: 12%; }
.gal-hero h1 { font-size: clamp(60px, 9vw, 150px); line-height: .95; }
.gal-hero h1 span { color: var(--gal-olive); }
.gal-hero-grid > div { padding-bottom: 10px; }
.gal-hero-grid > div > p { font-size: 14px; line-height: 1.9; color: var(--gal-muted); margin-bottom: 28px; }
.gal-text-link { display: inline-flex; align-items: center; gap: 24px; font-size: 12px; border-bottom: 1px solid currentColor; padding-bottom: 8px; color: inherit; text-decoration: none; }
.gal-text-link:hover { color: var(--gal-olive-dark); }

.gal-collection { padding: 0 7% 85px; scroll-margin-top: 110px; }
.gal-bar { border-top: 1px solid var(--gal-line); border-bottom: 1px solid var(--gal-line); padding: 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.gal-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.gal-filter { display: flex; gap: 10px; align-items: center; border: 1px solid transparent; background: transparent; padding: 10px 14px; font-size: 12px; cursor: pointer; transition: background .2s; font-family: inherit; color: inherit; }
.gal-filter span { font-size: 9px; color: var(--gal-muted); }
.gal-filter[aria-pressed="true"] { background: var(--gal-ink); color: var(--gal-paper); }
.gal-filter[aria-pressed="true"] span { color: var(--gal-line); }
.gal-filter:hover:not([aria-pressed="true"]) { border-color: var(--gal-line); }
.gal-count { font-size: 9px; letter-spacing: .1em; color: var(--gal-muted); white-space: nowrap; margin: 0; }
.gal-notice { font-size: 10px; line-height: 1.8; color: var(--gal-muted); margin: 20px 0 32px; max-width: 620px; }

.gal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px 38px; align-items: start; }
.gal-item { margin: 0; scroll-margin-top: 110px; }
.gal-item:nth-child(even) { padding-top: 80px; }
.gal-item.gal-hidden { display: none; }
.gal-image-btn { display: block; position: relative; width: 100%; aspect-ratio: 1.12; background: var(--gal-alt); overflow: hidden; cursor: zoom-in; text-align: left; border: 0; padding: 0; }
.gal-item:nth-child(3n) .gal-image-btn { aspect-ratio: 1.42; }
.gal-image-btn img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s; filter: saturate(.8); display: block; }
.gal-image-btn:hover img { transform: scale(1.035); filter: saturate(1); }
.gal-sample { position: absolute; top: 18px; left: 18px; padding: 7px 9px; background: rgba(44, 44, 40, .72); color: #fff; font-size: 8px; letter-spacing: .1em; }
.gal-expand { position: absolute; bottom: 20px; right: 20px; display: grid; place-items: center; width: 44px; height: 44px; background: var(--gal-paper); border-radius: 50%; font-size: 16px; }
.gal-item figcaption { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-top: 20px; }
.gal-item figcaption span { font-size: 10px; color: var(--gal-muted); letter-spacing: .08em; }
.gal-item figcaption h2 { font-size: 25px; line-height: 1.2; margin-top: 8px; letter-spacing: -.04em; font-weight: 600; }

.gal-dialog { border: 1px solid var(--gal-line); background: var(--gal-ink); color: var(--gal-paper); width: min(1120px, 94vw); max-width: 94vw; max-height: 94dvh; padding: 0; margin: auto; overflow: auto; font-family: 'Open Sans', sans-serif; }
.gal-dialog::backdrop { background: rgba(23, 23, 20, .92); backdrop-filter: blur(8px); }
.gal-viewer { padding: 20px 24px; }
.gal-viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.gal-viewer-top > span { font-size: 10px; letter-spacing: .1em; color: var(--gal-line); }
.gal-viewer-top button, .gal-viewer-controls button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(248, 246, 242, .25); background: transparent; color: inherit; cursor: pointer; }
.gal-viewer-top button:hover, .gal-viewer-controls button:hover { background: var(--gal-olive); color: var(--gal-paper); }
.gal-viewer-controls button:disabled { opacity: .3; cursor: default; }
.gal-full-image { position: relative; height: min(62dvh, 700px); background: #17140f; display: flex; align-items: center; justify-content: center; }
.gal-full-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gal-viewer-bottom { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding-top: 22px; flex-wrap: wrap; }
.gal-viewer-bottom h2 { font-size: 24px; letter-spacing: -.04em; }
.gal-viewer-bottom p { font-size: 10px; line-height: 1.8; color: var(--gal-line); margin-top: 8px; }
.gal-viewer-bottom p a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.gal-viewer-controls { display: flex; gap: 10px; flex-shrink: 0; }

@media (max-width: 767px) {
  .gal-hero { padding-top: 25px; padding-bottom: 40px; }
  .gal-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .gal-hero h1 { font-size: clamp(60px, 17vw, 110px); }
  .gal-hero-grid > div > p { font-size: 13px; }
  .gal-kicker { font-size: 9px; }
  .gal-bar { align-items: flex-start; flex-direction: column; gap: 15px; }
  .gal-filters { gap: 5px; }
  .gal-filter { padding: 8px 10px; font-size: 11px; gap: 7px; }
  .gal-count { font-size: 8px; }
  .gal-notice { font-size: 10px; margin-bottom: 25px; }
  .gal-grid { grid-template-columns: 1fr; gap: 35px; }
  .gal-item:nth-child(even) { padding-top: 0; }
  .gal-image-btn, .gal-item:nth-child(3n) .gal-image-btn { aspect-ratio: 1.2; }
  .gal-item figcaption h2 { font-size: 24px; }
  .gal-collection { padding-bottom: 60px; }
  .gal-viewer { padding: 14px; }
  .gal-full-image { height: 55dvh; }
  .gal-viewer-bottom h2 { font-size: 20px; }
  .gal-viewer-bottom { gap: 10px; align-items: flex-start; }
  .gal-viewer-controls { gap: 6px; }
  .gal-viewer-controls button { width: 35px; height: 35px; }
  .gal-viewer-top > span { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .gal-image-btn img { transition: none; }
  .gal-image-btn:hover img { transform: none; }
}
