@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

.gallery__carousel, .lightbox {
  --ink: #26312b;
  --line: #ded9cf;
  --petrol: #0b2545;
  --petrol-deep: #07192e;
  --mist: #e3ded4;
  --sand: #f6f3ed;
  --brass-soft: #d7c1a2;
  --muted: #73746d;
  --radius-lg: 2px;
  font-family: 'Manrope', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}
body.lightbox-open { overflow: hidden; }
.gallery__carousel { width: 100%; position: relative; }
.gallery__viewport { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--mist); }
.gallery__track { position: relative; width: 100%; height: 100%; }
.gallery__item {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  grid-column: auto !important;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--mist);
  cursor: zoom-in;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.gallery__item.is-previous {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transition: none;
}
.gallery__item.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
  transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}
.gallery__item img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover !important;
  transition: transform 1.2s cubic-bezier(.2,.7,.15,1);
}
.gallery__item:hover img, .gallery__item:focus-visible img { transform: scale(1.025); }
.gallery__item::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(7,25,46,.70)); opacity: 1; pointer-events: none; }
.gallery__caption { position: absolute; z-index: 1; left: clamp(1rem, 4vw, 3rem); bottom: clamp(1rem, 4vw, 3rem); color: white; font: 500 clamp(1.25rem, 2.5vw, 2.5rem)/1.1 var(--font-display); letter-spacing: -.02em; }
.gallery__controls { display: flex; align-items: center; gap: 1rem; margin-top: 1.1rem; }
.gallery__arrow { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; transition: color .25s, background .25s, border-color .25s; }
.gallery__arrow:hover { color: white; background: var(--petrol); border-color: var(--petrol); }
.gallery__arrow .icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.gallery__dots { display: flex; align-items: center; justify-content: center; gap: .55rem; margin-inline: auto; }
.gallery__dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: #C9C3B8; cursor: pointer; transition: width .3s, background .3s; }
.gallery__dot.is-active { width: 26px; border-radius: 8px; background: var(--petrol); }
.gallery__count { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.lightbox {
  width: fit-content;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--petrol-deep);
  color: var(--sand);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.7);
}
.lightbox::backdrop {
  background: rgba(6, 20, 24, 0.86);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lightbox__figure { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; width: fit-content; max-width: 100%; max-height: calc(100dvh - 4.5rem); margin: 0; }
.lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 4.5rem);
  max-height: calc(100dvh - 7rem);
  margin-inline: auto;
  border-radius: 12px;
  background: #041324;
  object-fit: contain;
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
}
.lightbox__caption { line-height: 1.4; }
.lightbox__close {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.lightbox__close:hover { border-color: var(--brass-soft); background: rgba(255, 255, 255, 0.08); }
.lightbox__close .icon { width: 16px; height: 16px; stroke: currentColor; fill: none; }

.gallery__dots { flex-wrap: wrap; }
.gallery__arrow { flex-shrink: 0; }
.gallery__caption { opacity: 0; transition: opacity .3s; }
.gallery__item:hover .gallery__caption, .gallery__item:focus-visible .gallery__caption { opacity: 1; }
@media (hover: none), (max-width: 600px) { .gallery__caption { opacity: 1; } }
@media (max-width: 900px) { .gallery__viewport { aspect-ratio: 4 / 3; } }
@media (max-width: 600px) {
  .gallery__arrow { width: 42px; height: 42px; }
  .lightbox { max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); padding: .5rem; }
  .lightbox__img { max-width: calc(100vw - 2rem); max-height: calc(100dvh - 5rem); }
}
@media (prefers-reduced-motion: reduce) { .gallery__item, .gallery__item img { transition: none; } }
