/* .gallery-page {
  background: #f8fafc;
  color: #111827;
} */

.gallery-page {
  width: 100%;
}

/* .gallery-container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
} */

/* HERO */
.gallery-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: clamp(420px, 62vh, 720px);
  overflow: hidden;
  border-radius: 0;
  background: #0f172a;
}

.gallery-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(0, 0, 0) scale(1.08);
  transform-origin: center center;
  will-change: transform;
}

.gallery-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(to bottom, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.74));
  animation: heroOverlayPulse 9s ease-in-out infinite alternate;
}

.gallery-hero__content {
  position: absolute;
  display: flex;
  flex-direction: column;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: clamp(20px, 7vh, 56px);
  color: #ffffff;
  animation: heroContentRise 700ms ease both;
}

.gallery-hero__content h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
}

.gallery-hero__content p {
  margin: 0;
  max-width: 64ch;
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
}

/* INTRO */
/* .gallery-intro {
  padding: clamp(44px, 7vw, 40px) 0 clamp(24px, 4vw, 40px);
} */

/* .gallery-intro p {
  margin: 0 auto;
  max-width: 76ch;
  text-align: center;

.gallery-effects-ready .gallery-intro p {
  opacity: 0;
  transform: translateY(16px);
  transition: transform 500ms ease, opacity 500ms ease;
}

.gallery-intro p.is-visible {
  opacity: 1;
  transform: translateY(0);
}
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.8;
  color: #475569;
} */

/* MUSEUM MEDIA */
.gallery-editorial {
  border-top: 2px solid #1da2a9;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(40px, 8vw, 100px) 0;
  background: #f5f2eb url('/wp-content/themes/astra-child/assets/media/ar.jpeg') center center / cover no-repeat;
}

.gallery-editorial-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.gallery-item {
  position: relative;
  grid-column: span 4;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #e5e7eb;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-effects-ready .gallery-item {
  opacity: 0;
  transform: translateY(20px) scale(0.99);
}

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: transform 550ms ease, box-shadow 350ms ease, opacity 550ms ease;
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.32) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 650ms ease;
  pointer-events: none;
}

.gallery-item:nth-child(5n + 1) {
  grid-column: span 8;
}

.gallery-item:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.13);
}

.gallery-item:hover::after {
  transform: translateX(130%);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-item video {
  background: #111827;
}

/* PAST EVENTS */
.gallery-events {
  padding: clamp(40px, 8vw, 100px) 0 0;
}

.gallery-events h2 {
  margin: 0 0 40px;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.1;
  color: #0f172a;
}

.gallery-events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.gallery-event-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-effects-ready .gallery-event-card {
  opacity: 0;
  transform: translateY(22px);
}

.gallery-event-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: transform 550ms ease, box-shadow 350ms ease, opacity 550ms ease;
}

.gallery-event-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}

.gallery-event-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.gallery-event-card__img img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 450ms ease;
}

.gallery-event-card:hover .gallery-event-card__img img {
  transform: scale(1.06);
}

.gallery-event-card__body {
  padding: 18px;
}

.gallery-event-card__body h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  line-height: 1.35;
  color: #0f172a;
}

.gallery-event-card__body p {
  margin: 0;
  font-size: 0.92rem;
  color: #64748b;
}

/* ACCESSIBILITY */
.gallery-page :focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-hero__overlay,
  .gallery-hero__content,
  .gallery-item,
  .gallery-event-card,
  .gallery-event-card__img img,
  .gallery-intro p {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .gallery-item,
  .gallery-item:nth-child(5n + 1) {
    grid-column: span 6;
  }

  .gallery-events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .gallery-container {
    width: min(1200px, calc(100% - 28px));
  }

  .gallery-hero {
    min-height: 54vh;
    border-radius: 0 0 14px 14px;
  }

  .gallery-item,
  .gallery-item:nth-child(5n + 1) {
    grid-column: span 12;
  }

  .gallery-events-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes heroContentRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroOverlayPulse {
  from {
    opacity: 0.88;
  }
  to {
    opacity: 1;
  }
}

/* ==========================================================================
   GALLERY LAYOUT: TWO-COLUMN (COMMENTS + CAROUSEL)
   ========================================================================== */

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* REFLECTIONS CAROUSEL */
.gallery-reflections {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(40px, 3vw, 40px) 0 clamp(40px, 3vw, 100px);
}

.gallery-reflections__viewport {
  overflow: hidden;
  width: 100vw;
}

.gallery-reflections__track {
  display: flex;
  width: max-content;
  gap: 16px;
  will-change: transform;
  animation: galleryReflectionsMarquee 46s linear infinite;
  padding: 4px 24px;
}

.gallery-reflections__viewport:hover .gallery-reflections__track {
  animation-play-state: paused;
}

.gallery-reflection-card {
  width: min(360px, 78vw);
  flex: 0 0 auto;
  padding: 18px 20px;
  background: #efefef;
  border: 0;
  border-radius: 10px;
}

.gallery-reflection-card__text {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
  color: #1f1d19;
}

.gallery-reflection-card__badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5d5851;
}

/* Two-Column Layout */
.gallery-layout {
  display: block;
  /* padding: clamp(40px, 5vw, 80px) 0; */
}

/* LEFT COLUMN: Comments */
.gallery-comments-column {
  display: flex;
  flex-direction: column;
}

.gallery-comments-column h3 {
  margin: 0 0 30px;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1f1d19;
}

.gallery-comments-list {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 24px);
  max-height: 600px;
  overflow-y: auto;
  padding-right: 12px;
}

.gallery-comments-list::-webkit-scrollbar {
  width: 6px;
}

.gallery-comments-list::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-comments-list::-webkit-scrollbar-thumb {
  background: #d0ccc2;
  border-radius: 3px;
}

.gallery-comments-list::-webkit-scrollbar-thumb:hover {
  background: #b8b1a0;
}

.gallery-comment-card {
  padding: clamp(16px, 2vw, 20px);
  background: #fcfaf6;
  border: 1px solid #e8e2d5;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.gallery-comment-card:hover {
  background: #ffffff;
  border-color: #d0ccc2;
  box-shadow: 0 4px 12px rgba(28, 23, 16, 0.06);
}

.gallery-comment-text {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
  color: #1f1d19;
}

.gallery-visitor-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5d5851;
}

/* RIGHT COLUMN: Carousel */
.gallery-carousel-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
  margin: 0;
}

.gallery-carousel-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

.gallery-carousel-container {
  display: flex;
  overflow: hidden;
  aspect-ratio: 1;
  background: transparent;
  position: relative;
  border-radius: 10px;
}

.gallery-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

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

.gallery-carousel-image {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
}

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

/* Carousel Pagination Dots */
.gallery-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px 6px;
  background: transparent;
  border-radius: 0 0 12px 12px;
}

.gallery-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #d0ccc2;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  font-size: 0;
}

.gallery-carousel-dot:hover {
  border-color: #1f1d19;
  transform: scale(1.2);
}

.gallery-carousel-dot.active {
  background: #1f1d19;
  border-color: #1f1d19;
}

/* LIGHTBOX */
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.gallery-lightbox__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1001;
}

.gallery-lightbox__dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 900px;
  height: auto;
  max-height: 90vh;
  background: #1f1d19;
  border-radius: 8px;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-lightbox__content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 80vh;
}

.gallery-lightbox__content img,
.gallery-lightbox__content video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1003;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background 0.2s ease;
  padding: 0;
  line-height: 1;
}

.gallery-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.gallery-lightbox__nav--prev {
  left: 14px;
}

.gallery-lightbox__nav--next {
  right: 14px;
}

.gallery-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1003;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
  padding: 0;
  line-height: 1;
}

.gallery-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-lightbox__close:active {
  background: rgba(255, 255, 255, 0.3);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
  .gallery-layout {
    padding: clamp(30px, 4vw, 48px) 0;
  }

  .gallery-comments-list {
    max-height: 400px;
  }

  .gallery-carousel-container {
    aspect-ratio: 4 / 3;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .gallery-container {
    padding: 0 16px;
  }

  .gallery-layout {
    padding: 24px 0;
  }

  .gallery-reflections__track {
    gap: 12px;
    animation-duration: 38s;
  }

  .gallery-reflection-card {
    width: min(320px, 84vw);
    padding: 16px;
  }

  .gallery-comments-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .gallery-comments-list {
    max-height: 300px;
    gap: 12px;
  }

  .gallery-comment-card {
    padding: 12px 14px;
  }

  .gallery-comment-text {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .gallery-carousel-container {
    aspect-ratio: 1;
  }

  .gallery-carousel-dots {
    padding: 12px;
    gap: 6px;
  }

  .gallery-carousel-dot {
    width: 8px;
    height: 8px;
  }
}

@keyframes galleryReflectionsMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 480px) {
  .gallery-carousel-container {
    aspect-ratio: 1;
  }

  .gallery-lightbox__dialog {
    width: 95%;
  }

  .gallery-lightbox__nav {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .gallery-lightbox__nav--prev {
    left: 10px;
  }

  .gallery-lightbox__nav--next {
    right: 10px;
  }

  .gallery-lightbox__close {
    width: 36px;
    height: 36px;
    font-size: 28px;
    top: 12px;
    right: 12px;
  }
}
