/* ==========================================================================
   Costa del Sale: photograph viewer. Styles .gv and its children only.
   A dark room, a matted print with a hairline frame, a deep shadow.
   ========================================================================== */

.gv{
  position:fixed;inset:0;z-index:200;
  /* the wall: a deep neutral with a soft falloff, never flat black */
  background:
    radial-gradient(120% 95% at 50% 38%,#161b1e 0%,#0b0f11 58%,#060809 100%);
  visibility:hidden;opacity:0;pointer-events:none;
  transition:opacity .3s cubic-bezier(.22,1,.36,1),visibility 0s linear .3s;
  overscroll-behavior:contain;
  -webkit-tap-highlight-color:transparent;
}
.gv.on{
  visibility:visible;opacity:1;pointer-events:auto;
  transition:opacity .3s cubic-bezier(.22,1,.36,1),visibility 0s;
}

/* ---------- top strip --------------------------------------------------- */
.gv__bar{
  position:absolute;top:0;left:0;right:0;z-index:3;
  display:flex;align-items:center;gap:18px;
  height:84px;padding:0 clamp(18px,3vw,40px);
  background:linear-gradient(180deg,rgba(6,8,9,.88) 0%,rgba(6,8,9,.45) 55%,rgba(6,8,9,0) 100%);
}
.gv__brand{
  font-family:var(--serif,"Manrope"),"Figtree",system-ui,sans-serif;
  font-weight:300;font-size:clamp(1rem,.95vw + .72rem,1.15rem);
  letter-spacing:.3em;text-transform:uppercase;
  color:#fff;line-height:1.2;white-space:nowrap;
  /* the wordmark carries its own hairline underline, like a gallery label */
  padding-bottom:8px;border-bottom:1px solid rgba(255,255,255,.28);
}
/* the counter is pushed to the far side and given its own rule, so it reads as
   a separate instrument rather than a continuation of the brand */
.gv__count{
  margin-left:auto;
  display:inline-flex;align-items:center;gap:16px;
  font-family:var(--sans,"Figtree"),system-ui,sans-serif;
  font-size:1rem;font-weight:500;letter-spacing:.14em;
  font-variant-numeric:tabular-nums;
  color:rgba(255,255,255,.9);line-height:1;
}
.gv__count::before{
  content:"";display:block;width:1px;height:18px;
  background:rgba(255,255,255,.28);
}

/* ---------- controls ---------------------------------------------------- */
.gv__close,.gv__nav{
  -webkit-appearance:none;appearance:none;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.30);
  color:#fff;cursor:pointer;padding:0;
  border-radius:50%;
  transition:background .2s ease,border-color .2s ease,transform .2s ease,color .2s ease;
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
}
.gv__close:hover,.gv__nav:hover{
  background:rgba(255,255,255,.20);border-color:rgba(255,255,255,.55);
}
.gv__close:active,.gv__nav:active{transform:scale(.96)}
.gv__close:focus-visible,.gv__nav:focus-visible{
  outline:2px solid #fff;outline-offset:3px;
}

.gv__close{
  flex-shrink:0;width:48px;height:48px;
  font-family:var(--sans,"Figtree"),sans-serif;
  font-size:26px;line-height:1;
}

/* navigation: a real target on each side, always visible, never hover-only */
.gv__nav{
  position:absolute;top:50%;z-index:3;
  width:58px;height:58px;
  transform:translateY(-50%);
  font-family:var(--sans,"Figtree"),sans-serif;font-size:34px;line-height:1;
  padding-bottom:4px;                     /* optical centring of the glyph */
}
.gv__nav:hover{transform:translateY(-50%) scale(1.04)}
.gv__nav:active{transform:translateY(-50%) scale(.97)}
.gv__nav--prev{left:clamp(12px,2.4vw,36px)}
.gv__nav--next{right:clamp(12px,2.4vw,36px)}

/* ---------- the photograph: a print on the wall ------------------------- */
.gv__img{
  position:absolute;inset:0;margin:auto;   /* dead centre, whatever the bars */
  width:auto;height:auto;
  max-width:calc(100% - clamp(120px,17vw,240px));
  max-height:calc(100% - clamp(150px,19vh,190px));
  object-fit:contain;
  background:#0e1214;
  /* a hairline frame plus a deep, soft shadow: it reads as a mounted print */
  box-shadow:
    0 0 0 1px rgba(255,255,255,.20),
    0 0 0 10px rgba(255,255,255,.028),
    0 3px 8px rgba(0,0,0,.45),
    0 34px 70px -20px rgba(0,0,0,.92),
    0 70px 120px -40px rgba(0,0,0,.75);
  transition:opacity .34s cubic-bezier(.22,1,.36,1);
}
/* hook for the between-photo fade: gallery.js adds .is-swapping for one frame */
.gv__img.is-swapping{opacity:.25}

/* ---------- caption ----------------------------------------------------- */
.gv__cap{
  position:absolute;left:0;right:0;bottom:0;z-index:2;
  margin:0;padding:26px clamp(18px,3vw,40px);
  font-family:var(--sans,"Figtree"),system-ui,sans-serif;
  font-size:1rem;line-height:1.6;letter-spacing:.01em;
  color:rgba(255,255,255,.88);
  background:linear-gradient(0deg,rgba(6,8,9,.9) 0%,rgba(6,8,9,.5) 55%,rgba(6,8,9,0) 100%);
  max-width:none;
}
.gv__cap:empty{display:none}

/* ---------- phone: bigger targets, more of the frame -------------------- */
@media (max-width:760px){
  .gv__bar{height:72px;gap:12px}
  .gv__brand{letter-spacing:.24em;padding-bottom:6px}
  .gv__count{font-size:1rem;letter-spacing:.1em;gap:12px}
  .gv__close{width:44px;height:44px;font-size:24px}
  .gv__nav{width:46px;height:46px;font-size:28px}
  .gv__nav--prev{left:10px}
  .gv__nav--next{right:10px}
  .gv__img{
    max-width:calc(100% - 28px);
    max-height:calc(100% - 190px);
    box-shadow:
      0 0 0 1px rgba(255,255,255,.20),
      0 2px 6px rgba(0,0,0,.5),
      0 22px 44px -14px rgba(0,0,0,.9);
  }
  .gv__cap{font-size:1rem;padding:22px 18px}
}

/* ---------- motion: honour the preference ------------------------------- */
@media (prefers-reduced-motion:reduce){
  .gv,.gv.on,.gv__img,.gv__nav,.gv__close{transition:none !important}
  .gv__nav:hover,.gv__nav:active,.gv__close:active{transform:none}
  .gv__nav:hover{transform:translateY(-50%)}
  .gv__img.is-swapping{opacity:1}
}
