/* Gallery component - modern, responsive, minimal */
:root {
  --gallery-accent: #d6b36a;
  --gallery-text: #f5ead2;
  --gallery-bg: rgba(0, 0, 0, 0.45);
  --gallery-radius: 12px;
  --gallery-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Container */
.gr-gallery {
  max-width: 1100px;
  margin: 1.8rem auto;
  padding: 1rem;
}

/* Hero */
.gr-hero {
  position: relative;
  border-radius: var(--gallery-radius);
  overflow: hidden;
  box-shadow: var(--gallery-shadow);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.28));
}
.gr-hero .gr-main {
  width: 100%;
  height: 62vh;
  max-height: 820px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}
.gr-hero img,
.gr-hero video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* preserve aspect */
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
  display: block;
}
.gr-hero .gr-main > * {
  border-radius: var(--gallery-radius);
}
.gr-fade-enter {
  opacity: 0;
  transform: scale(0.995);
}
.gr-fade-enter-active {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

/* Controls overlay */
.gr-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.25);
  color: var(--gallery-text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  backdrop-filter: blur(2px);
}
.gr-control:hover {
  background: rgba(0, 0, 0, 0.32);
}
.gr-prev {
  left: 14px;
}
.gr-next {
  right: 14px;
}

/* Thumbnails strip */
.gr-thumbs {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.gr-thumb {
  flex: 0 0 auto;
  width: 140px;
  height: 200px;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  position: relative;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.gr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gr-thumb:hover {
  transform: scale(1.03);
}
.gr-thumb.is-active {
  outline: 3px solid var(--gallery-accent);
  transform: scale(1.02);
}

/* Counter */
.gr-counter {
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: var(--gallery-text);
  background: rgba(0, 0, 0, 0.28);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Lightbox */
.gr-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.86);
  z-index: 99999;
  padding: 28px;
}
.gr-lightbox.show {
  display: flex;
}
.gr-lightbox .lb-inner {
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.gr-lightbox img,
.gr-lightbox video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.gr-lightbox .lb-close,
.gr-lightbox .lb-prev,
.gr-lightbox .lb-next {
  position: absolute;
  background: transparent;
  color: var(--gallery-text);
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gr-lightbox .lb-close {
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
}
.gr-lightbox .lb-prev {
  left: 14px;
}
.gr-lightbox .lb-next {
  right: 14px;
}
.gr-lightbox .lb-counter {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  color: var(--gallery-text);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .gr-hero .gr-main {
    height: 52vh;
  }
  .gr-thumb {
    width: 110px;
    height: 150px;
  }
}
@media (max-width: 520px) {
  .gr-hero .gr-main {
    height: 46vh;
  }
  .gr-thumb {
    width: 86px;
    height: 120px;
  }
  .gr-control {
    width: 38px;
    height: 38px;
  }
}

/* Accessibility: focus */
.gr-control:focus,
.gr-thumb:focus,
.gr-lightbox .lb-close:focus {
  outline: 2px solid rgba(214, 179, 106, 0.95);
  outline-offset: 2px;
}

/* small helper for hidden accessible text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
