/* Gallery hero: carousel is full-bleed background, text on top */
.page-hero--gallery {
  position: relative;
  height: calc(100vh - var(--header-height));
  min-height: 520px;
  overflow: hidden;
  display: block;
  padding: 0;
}

.gallery-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  margin: 0;
  padding: 0;
}

.gallery-hero-bg .gallery-carousel,
.gallery-hero-bg .gallery-carousel-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.gallery-hero-bg .gallery-carousel-slide,
.gallery-hero-bg .gallery-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0, 40, 55, 0.6) 0%, rgba(0, 55, 65, 0.85) 100%);
  pointer-events: none;
}

.gallery-hero-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  padding: calc(var(--header-height) + 1rem) var(--space-md) 3rem;
  pointer-events: none;
}

.gallery-hero-content * {
  pointer-events: auto;
}

.page-hero--gallery .section-label { color: var(--color-accent); }
.page-hero--gallery h1 { color: var(--color-white); }
.page-hero--gallery .page-hero-desc { color: rgba(255, 255, 255, 0.9); }

.gallery-scroll-hint {
  margin-top: 1.5rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
}

.gallery-scroll-text {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-size: 0.7rem;
}

.gallery-scroll-arrow {
  font-size: 1.35rem;
  animation: gallery-scroll-bounce 1.1s ease-in-out infinite;
}

@keyframes gallery-scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* Carousel controls and counter on hero */
.page-hero--gallery .gallery-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
.page-hero--gallery .gallery-carousel-prev { left: 1rem; }
.page-hero--gallery .gallery-carousel-next { right: 1rem; }
.page-hero--gallery .gallery-carousel-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

/* Gallery carousel — track and slides */
.gallery-carousel-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: transparent;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.gallery-carousel {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 280px;
  overflow: hidden;
}

.gallery-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

.gallery-carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.gallery-carousel-slide.active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

.gallery-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery-carousel-controls {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.gallery-carousel-btn {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s ease;
}

.gallery-carousel-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-carousel-btn svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.gallery-carousel-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  z-index: 10;
}

.gallery-grid-label {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-gallery .gallery .gallery-item img {
  opacity: 1;
}

/* Lightbox — click to enlarge */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gallery-lightbox[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10002;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox-inner {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
  z-index: 10001;
}

.gallery-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.gallery-lightbox-video {
  display: none;
  max-width: 95vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  background: #000;
  border-radius: 4px;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gallery-lightbox-prev { left: -4rem; }
.gallery-lightbox-next { right: -4rem; }

@media (max-width: 768px) {
  .gallery-lightbox-prev { left: 0.5rem; }
  .gallery-lightbox-next { right: 0.5rem; }
  .gallery-lightbox-prev,
  .gallery-lightbox-next { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
}

@media (max-width: 768px) {
  .page-hero--gallery { height: calc(100vh - var(--header-height)); min-height: 420px; }
  .gallery-carousel-wrap { height: 100%; min-height: 100%; }
  .gallery-carousel { height: 100%; min-height: 100%; }
  .gallery-carousel-btn { padding: 0.5rem 0.75rem; }
  .gallery-carousel-btn svg { width: 1.25rem; height: 1.25rem; }
}

/* ----- Gallery page: compact mosaic + video row ----- */
.page-gallery-grid-section {
  background: var(--color-light);
}
.gallery-page-container {
  max-width: 1120px;
}
.gallery-page-head {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto var(--space-lg);
}
.gallery-page-title {
  font-family: var(--font-body);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--color-deep);
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.02em;
}
.gallery-page-lead {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-muted);
}
.gallery-mosaic-wrap {
  margin-top: var(--space-md);
}
.gallery-block-title {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-teal);
  margin: var(--space-lg) 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(10, 44, 58, 0.1);
}
.gallery-mosaic-wrap .gallery-block-title:first-of-type {
  margin-top: 0;
}
.gallery-grid--video-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 960px;
  margin: 0 auto var(--space-md);
}
.gallery-grid--mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 4px;
  margin-bottom: var(--space-md);
}
@media (min-width: 900px) {
  .gallery-grid--mosaic {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }
}
.page-gallery .gallery-grid--mosaic .gallery-item,
.page-gallery .gallery-grid--video-row .gallery-item {
  border-radius: 0;
  box-shadow: none;
}
.page-gallery .gallery-grid--mosaic .gallery-item:hover,
.page-gallery .gallery-grid--video-row .gallery-item:hover {
  transform: none;
  z-index: 1;
  box-shadow: 0 0 0 2px rgba(20, 125, 125, 0.35);
}
.gallery-item--video {
  position: relative;
  aspect-ratio: 16 / 10;
}
.gallery-item--video .gallery-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--color-deep);
}
.gallery-video-badge {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(10, 44, 58, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  pointer-events: none;
}
.gallery-video-play {
  font-size: 0.55rem;
  opacity: 0.95;
}
@media (max-width: 600px) {
  .gallery-grid--video-row {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  .gallery-item--video {
    aspect-ratio: 16 / 11;
  }
}
@media (max-width: 768px) and (min-width: 601px) {
  .gallery-grid--video-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
