/**
 * Editorial Asymmetric Gallery & Lightbox Modal
 * Cinematic watercolor artwork display with varied aspect ratios
 */

.gallery-section {
  background-color: var(--section-bg-even);
  border-top: 1px solid var(--line-subtle);
  overflow: hidden;
}

.gallery-header-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  text-align: left;
  max-width: none;
  margin-bottom: 4rem;
}

.gallery-header-split .header-left {
  max-width: 600px;
}

.gallery-header-split .header-right {
  max-width: 380px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--muted);
}

/* Asymmetric Grid */
.editorial-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 380px;
  gap: 1.8rem;
}

.gallery-figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  background-color: #d6c6b4;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.6s var(--ease-cinematic), box-shadow 0.6s ease;
}

.gallery-figure:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 45px -10px rgba(36, 26, 21, 0.2);
}

.gallery-figure.tall {
  grid-row: span 2;
}

.gallery-figure.wide {
  grid-column: span 2;
}

.gallery-figure.square {
  grid-row: span 1;
}

.gallery-img-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s var(--ease-cinematic), filter 0.8s ease;
}

.gallery-figure:hover .gallery-img {
  transform: scale(1.04);
  filter: brightness(1.02);
}

/* Editorial Floating Caption */
.gallery-caption {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(18, 12, 10, 0.75) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 1.8rem;
  color: var(--ivory);
  opacity: 0.9;
  transition: opacity 0.4s ease;
}

.gallery-figure:hover .gallery-caption {
  opacity: 1;
}

.gallery-caption-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fffaf2;
  margin-bottom: 0.25rem;
}

.gallery-caption-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--gold-light);
  line-height: 1.35;
}

/* ==================================================
   LIGHTBOX MODAL
   ================================================== */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-cinematic), visibility 0.4s;
}

.gallery-modal.modal-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(14, 10, 8, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.modal-content-wrapper {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-image-holder {
  max-width: 100%;
  max-height: 72vh;
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--dark-border);
  overflow: hidden;
}

.modal-image-holder img {
  max-width: 100%;
  max-height: 72vh;
  display: block;
  object-fit: contain;
}

.modal-meta {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--ivory);
  max-width: 600px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: #fffaf2;
  margin-bottom: 0.4rem;
}

.modal-caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--champagne);
  line-height: 1.4;
}

.modal-counter {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 0.25em;
  color: var(--gold-light);
  margin-top: 0.6rem;
  display: block;
}

/* Modal Controls */
.modal-btn-close {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--dark-border);
  color: var(--ivory);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 17, 14, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn-close:hover {
  background-color: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--dark-border);
  color: var(--ivory);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 17, 14, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-nav-btn:hover {
  background-color: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.modal-nav-btn.prev {
  left: 2rem;
}

.modal-nav-btn.next {
  right: 2rem;
}
