@font-face {
  font-family: FEHero;
  src: url('../../fonts/fehero-regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --gallery-bg: #111110;
  --gallery-accent: #f8a813;
  --gallery-gutter: 20px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--gallery-bg); color: #fff; font-family: Montserrat, Arial, sans-serif; }
body.has-lightbox { overflow: hidden; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button, .icon-link { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gallery-accent); outline-offset: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.gallery-page { padding: 20px; }

.gallery-hero { position: relative; isolation: isolate; height: calc(100vh - 40px); height: calc(100svh - 40px); min-height: 480px; overflow: hidden; background: #29251f; }
.hero-photo { display: block; width: 100%; height: 100%; }
.hero-photo img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 42%; }
.gallery-hero::after { content: ''; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgb(0 0 0 / 24%), transparent 28%, transparent 48%, rgb(0 0 0 / 57%)); pointer-events: none; }
.gallery-back { position: absolute; top: 32px; left: 40px; z-index: 1; display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; color: #fff; text-decoration: none; font-size: 12px; font-weight: 500; letter-spacing: .07em; text-shadow: 0 1px 10px #000; }
.gallery-back:hover { color: var(--gallery-accent); }
.gallery-back .icon { width: 21px; height: 21px; }
.gallery-title { position: absolute; z-index: 1; left: 40px; bottom: 30px; right: 30px; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em; margin: 0; font-family: FEHero, Impact, sans-serif; font-size: clamp(100px, 12vw, 220px); line-height: .95; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.gallery-title__event { color: var(--gallery-accent); }
.gallery-title__day { color: #fff; font-size: .65em; white-space: nowrap; }

/* The download icon sits inside the requested 20px gap after the hero. */
.gallery-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 20px; }
.gallery-count { color: #a39f98; font-size: 11px; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; }
.archive-download { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 12px; color: #fff; text-decoration: none; }
.archive-download::before { content: ''; position: absolute; inset: -10px -4px; }
.archive-download .icon { width: 20px; height: 20px; }
.archive-download:hover, .archive-download:focus-visible { color: var(--gallery-accent); }
.archive-download__text { font-size: 11px; line-height: 1.4; letter-spacing: .025em; }
.archive-download__size { color: #a39f98; margin-left: 6px; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gallery-gutter); align-items: start; }
.gallery-grid.is-justified { display: flex; flex-wrap: wrap; align-items: start; }
.gallery-item { position: relative; margin: 0; min-width: 0; overflow: hidden; background: #211f1b; }
.is-justified .gallery-item { flex: 0 0 auto; }
.photo-open { display: block; width: 100%; height: 100%; }
.gallery-item img { display: block; width: 100%; height: auto; }
.is-justified .gallery-item img { height: 100%; object-fit: cover; }
.photo-download { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: rgb(15 15 15 / 40%); backdrop-filter: blur(7px); text-decoration: none; opacity: 0; transform: translateY(-4px); transition: opacity .18s ease, transform .18s ease, background .18s ease; }
.gallery-item:hover .photo-download, .gallery-item:focus-within .photo-download, .gallery-hero:hover .photo-download, .gallery-hero:focus-within .photo-download { opacity: 1; transform: none; }
.gallery-hero .photo-download { z-index: 2; top: 28px; right: 32px; }
.photo-download:hover { background: rgb(15 15 15 / 75%); color: var(--gallery-accent); }
.photo-download .icon { width: 23px; height: 23px; }
.gallery-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 44px 0 20px; color: #a39f98; font-size: 11px; }
.gallery-footer a { text-decoration: none; }
.gallery-footer a:hover { color: var(--gallery-accent); }
.gallery-days { display: flex; gap: 20px; }
.gallery-days [aria-current='page'] { color: var(--gallery-accent); }

.photo-viewer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; padding: 0; border: 0; background: #111; color: #fff; }
.photo-viewer::backdrop { background: #111; }
.viewer-toolbar { position: absolute; inset: 0 0 auto; z-index: 2; height: 72px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 20px; background: linear-gradient(#111, rgb(17 17 17 / 85%), transparent); }
.viewer-counter { margin-right: auto; font-size: 12px; color: #bcb8b0; }
.viewer-button { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #fff; text-decoration: none; cursor: pointer; }
.viewer-button:hover { color: var(--gallery-accent); }
.viewer-image { display: block; width: 100%; height: 100%; padding: 76px 72px 24px; object-fit: contain; }
.viewer-prev, .viewer-next { position: absolute; z-index: 1; top: calc(50% - 22px); background: rgb(17 17 17 / 48%); border-radius: 50%; }
.viewer-prev { left: 16px; }
.viewer-next { right: 16px; }

@media (min-width: 1800px) { .gallery-title { bottom: 40px; left: 50px; } }
@media (max-width: 1000px) { .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  :root { --gallery-gutter: 10px; }
  .gallery-page { padding: 20px; }
  .gallery-hero { height: calc(85svh - 20px); min-height: 390px; max-height: 700px; }
  .hero-photo img { object-position: 43% center; }
  .gallery-hero .photo-download { top: 12px; right: 12px; }
  .gallery-back { top: 14px; left: 18px; font-size: 10px; gap: 7px; }
  .gallery-title { left: 18px; right: 18px; bottom: 23px; font-size: clamp(70px, 18vw, 108px); gap: .16em; }
  .gallery-title__day { font-size: .68em; }
  .gallery-toolbar { gap: 8px; }
  .gallery-count { font-size: 9px; letter-spacing: .04em; }
  .archive-download__text { font-size: 10px; }
  .archive-download__size { display: none; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-download { top: 4px; right: 4px; width: 36px; height: 36px; }
  .photo-download .icon { width: 20px; height: 20px; }
  .gallery-footer { padding-top: 30px; font-size: 10px; }
  .viewer-image { padding: 72px 0 48px; }
  .viewer-toolbar { padding: 10px 12px; }
  .viewer-prev { left: 6px; }
  .viewer-next { right: 6px; }
}
@media (hover: none), (pointer: coarse) { .photo-download { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
