/* A photographic constellation: one stage, three ways to explore. */
.gallery-page {
  --gallery-paper: var(--cream);
  --gallery-muted: var(--cream);
  --gallery-line: rgba(245, 240, 223, .3);
  background: var(--green); color: var(--gallery-paper); overflow: hidden;
}
.gallery-page::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 48% 42%, #84855f 0, #6E6F4E 46%, #55563b 100%);
}
.gallery-page::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 80; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.65' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
.gallery-nav { position: fixed; z-index: 30; top: 0; left: 0; width: 100%; height: 94px; padding: 0 3.4vw; display: flex; justify-content: space-between; align-items: center; }
.gallery-brand { display: flex; align-items: center; gap: .1em; text-decoration: none; font: 500 27px var(--serif); }
.gallery-brand__seal { display: block; width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .25)); }
.gallery-brand .gallery-brand__note { margin-left: 24px; padding-left: 24px; border-left: 1px solid var(--gallery-line); font: 9px var(--sans); text-transform: uppercase; letter-spacing: .18em; }
.gallery-nav__right { display: flex; align-items: center; gap: 35px; }
.gallery-return { text-decoration: none; font-size: 12px; }
.gallery-page .lang--nav { color: var(--gallery-paper); gap: 4px; }
.gallery-page .lang button { min-width: 30px; min-height: 44px; font-size: 9px; opacity: .6; }
.gallery-page .lang button.is-on { color: var(--gallery-paper); opacity: 1; border-bottom-color: var(--gallery-paper); }
.gallery-experience { position: relative; height: 100svh; min-height: 560px; isolation: isolate; overflow: hidden; }
.gallery-toolbar { position: absolute; z-index: 25; top: 94px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 17px; }
.album__folders { display: flex; align-items: center; border: 1px solid var(--gallery-line); padding: 4px; border-radius: 40px; backdrop-filter: blur(12px); background: rgba(68, 86, 59, .2); }
.album__folders button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 20px; border: 0; border-radius: 30px; background: transparent; color: var(--gallery-paper); font: 12px var(--sans); white-space: nowrap; cursor: pointer; transition: color .3s, background .3s; }
.album__folders button[aria-pressed="true"] { color: #45503a; background: var(--gallery-paper); }
.album__total { font: 8px var(--sans); opacity: .7; align-self: start; margin-top: 1px; }
.gallery-modes { display: flex; gap: 5px; }
.gallery-modes button { display: grid; place-items: center; width: 35px; height: 35px; padding: 8px; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--gallery-paper); cursor: pointer; opacity: .6; transition: opacity .25s, border .25s; }
.gallery-modes button[aria-pressed="true"] { opacity: 1; border-color: var(--gallery-line); }
.gallery-modes button:hover { opacity: 1; }
.gallery-modes { border-radius: 30px; background: rgba(77, 94, 64, .18); backdrop-filter: blur(12px); }
.gallery-modes svg { width: 19px; height: 19px; stroke-width: 1.2; }
.carousel { position: absolute; inset: 0; outline-offset: -5px; }
.carousel__slides { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; perspective: 1600px; touch-action: pan-y pinch-zoom; }
.carousel__slide {
  position: absolute; left: 50%; top: 50%; width: var(--card-w, 200px); height: var(--card-h, 270px);
  transform: translate(-50%, -50%) translate3d(var(--x, 0px), var(--y, 0px), 0) rotateY(var(--ry, 0deg)) rotate(var(--r, 0deg)) scale(var(--scale, .3));
  opacity: 0; visibility: hidden; pointer-events: none; filter: blur(var(--blur, 0px));
  transition: transform 1s cubic-bezier(.22, .8, .2, 1), opacity .6s, filter .8s, visibility 0s .8s;
  will-change: transform;
}
.carousel__slide.is-visible { visibility: visible; opacity: var(--opacity, 1); pointer-events: auto; transition-delay: 0s; }
.photo { display: block; position: relative; width: 100%; height: 100%; text-decoration: none; outline-offset: 7px; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; box-shadow: 0 24px 45px -12px rgba(22, 32, 19, .45); user-select: none; -webkit-user-drag: none; }
.photo::after { content: '↗'; position: absolute; bottom: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: rgba(0,0,0,.2); color: white; opacity: 0; transform: translateY(5px); transition: opacity .3s, transform .3s; }
.photo:hover::after, .photo:focus-visible::after { opacity: 1; transform: none; }
.gallery-intro { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -41%); z-index: 15; text-align: center; width: max-content; max-width: 94%; transition: opacity .4s, transform .7s, visibility .4s; }
.gallery-kicker { font: 10px var(--sans); letter-spacing: .28em; text-transform: uppercase; margin: 0 0 14px; }
.gallery-title { font: 400 clamp(90px, 11.6vw, 190px)/1.08 var(--serif); letter-spacing: -.055em; white-space: nowrap; margin: 0; }
.gallery-title em { font-weight: 400; font-size: .85em; }
.gallery-enter { display: inline-flex; align-items: center; gap: 28px; min-height: 44px; margin-top: 20px; padding: 11px 20px; border: 1px solid var(--gallery-line); border-radius: 30px; color: var(--gallery-paper); background: rgba(78, 97, 66, .28); backdrop-filter: blur(10px); font: 9px var(--sans); letter-spacing: .15em; text-transform: uppercase; cursor: pointer; transition: background .25s; }
.gallery-enter:hover { background: rgba(245, 240, 223, .15); }
.gallery-enter span:last-child { font-size: 17px; line-height: 1; }
[data-mode="carousel"] .gallery-intro, [data-mode="index"] .gallery-intro { opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, -30%); }
[data-mode="carousel"] .carousel__slides { cursor: grab; }
[data-mode="carousel"] .carousel__slides.is-dragging { cursor: grabbing; }
[data-mode="carousel"] .carousel__slide.is-current .photo { cursor: zoom-in; }
[data-mode="carousel"] .carousel__slide.is-current img { object-fit: contain; box-shadow: none; }
.gallery-bottom { position: absolute; z-index: 20; bottom: 27px; left: 3.4vw; right: 3.4vw; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px; pointer-events: none; }
.gallery-label { max-width: 320px; }
.gallery-counter { font: 10px ui-monospace, monospace; letter-spacing: .14em; margin: 0 0 8px; }
.gallery-album-name { font: 400 27px/1.1 var(--serif); margin: 0; }
.gallery-hint { font: 9px var(--sans); letter-spacing: .19em; text-transform: uppercase; margin: 0 0 13px; color: var(--gallery-muted); }
.carousel__controls { display: flex; justify-content: flex-end; align-items: center; gap: 14px; pointer-events: auto; }
.carousel__controls button { width: 45px; height: 45px; border: 1px solid var(--gallery-line); border-radius: 50%; background: transparent; color: var(--gallery-paper); font: 22px var(--serif); cursor: pointer; transition: background .25s; }
.carousel__controls button:hover { background: rgba(245,240,223,.15); }
.gallery-control-line { width: 45px; height: 1px; background: var(--gallery-line); }
.gallery-index { position: absolute; inset: 225px 5vw 115px; overflow-y: auto; display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); align-content: start; gap: 28px 20px; padding: 6px 15px 20px; scrollbar-width: thin; scrollbar-color: var(--gallery-line) transparent; }
.gallery-index button { padding: 0; text-align: left; color: var(--gallery-paper); border: none; background: none; cursor: pointer; }
.gallery-index img { width: 100%; height: 190px; object-fit: cover; transition: transform .5s; }
.gallery-index button:hover img { transform: translateY(-5px); }
.gallery-index span { display: block; padding-top: 9px; font: 9px ui-monospace, monospace; letter-spacing: .12em; }
[data-mode="index"] .carousel__slides { visibility: hidden; pointer-events: none; }
[data-mode="index"] .carousel__controls { visibility: hidden; }
.gallery-page button:focus-visible, .gallery-page a:focus-visible, .carousel:focus-visible { outline: 1px solid var(--gallery-paper); outline-offset: 5px; }
#viewer { border: 0; padding: 0; background: transparent; max-width: none; color: var(--gallery-paper); }
#viewer::backdrop { background: rgba(21, 30, 20, .96); backdrop-filter: blur(16px); }
.viewer { width: min(1250px, 96vw); height: 94dvh; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.viewer__top { display: flex; justify-content: space-between; align-items: center; }
.viewer__count { font: 11px ui-monospace, monospace; }
.viewer__close, .viewer__nav { color: inherit; min-height: 44px; min-width: 44px; background: transparent; border: 1px solid var(--gallery-line); border-radius: 30px; cursor: pointer; }
.viewer__close { padding: 0 20px; font: 12px var(--sans); }
.viewer__frame { flex: 1; min-height: 0; position: relative; display: flex; justify-content: center; align-items: center; touch-action: pan-y pinch-zoom; }
.viewer__img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(21,30,20,.5); font-size: 24px; }
.viewer__nav--prev { left: 0; } .viewer__nav--next { right: 0; }
@media (min-width: 1700px) { .gallery-toolbar { top: 105px; } }
@media (max-width: 800px) {
  .gallery-nav { height: 75px; padding: 0 22px; }
  .gallery-brand .gallery-brand__note { display: none; }
  .gallery-nav__right { gap: 18px; }
  .gallery-toolbar { top: 80px; gap: 12px; }
  .gallery-title { font-size: 12vw; }
  .gallery-kicker { font-size: 8px; letter-spacing: .2em; }
  .gallery-bottom { bottom: 25px; left: 22px; right: 22px; grid-template-columns: 1fr auto; }
  .gallery-hint { position: absolute; bottom: 77px; width: 100%; text-align: center; margin: 0; font-size: 8px; }
  .gallery-album-name { font-size: 23px; max-width: 210px; }
  .gallery-index { inset: 200px 15px 140px; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px 12px; }
  .gallery-index img { height: 170px; }
}
@media (max-width: 500px) {
  .gallery-title { white-space: normal; font-size: 22vw; line-height: .84; max-width: 96vw; }
  .gallery-title em { display: block; font-size: .6em; line-height: .8; margin: 10px 0; }
  .gallery-intro { transform: translate(-50%, -44%); }
  .gallery-kicker { max-width: 200px; line-height: 1.8; margin: 0 auto 18px; }
  .gallery-enter { margin-top: 24px; font-size: 8px; padding: 9px 17px; }
  .album__folders button { padding: 8px 16px; font-size: 11px; }
  .gallery-return { font-size: 10px; }
  .gallery-brand { font-size: 25px; }
  .gallery-control-line { width: 15px; }
  .carousel__controls { gap: 9px; }
  .carousel__controls button { width: 40px; height: 40px; }
  .gallery-label { max-width: 185px; }
  .gallery-album-name { font-size: 20px; }
  .gallery-index img { height: 140px; }
}
@media (max-height: 680px) and (min-width: 801px) {
  .gallery-nav { height: 65px; }
  .gallery-toolbar { top: 20px; flex-direction: row; gap: 20px; }
  .gallery-index { top: 100px; }
  .gallery-title { font-size: 10vw; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-page *, .gallery-page *::after { transition: none !important; animation: none !important; }
}
.no-js.gallery-page { overflow: auto; }
.no-js .gallery-experience { height: auto; }
.no-js .gallery-toolbar, .no-js .gallery-intro, .no-js .gallery-bottom { display: none; }
.no-js .carousel { position: relative; padding: 100px 20px 30px; }
.no-js .carousel__slides { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.no-js .carousel__slide { position: static; width: auto; height: 300px; visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
