/* ==============================================================================
   IVY CENTRAL - PHỐI CẢNH NỘI THẤT CĂN MẪU (Interior Magazine Gallery)
   Specifications:
   - Background Ivory: #F6F3EC
   - Primary Navy: #0B1D49
   - Subtitle Slate: #687080
   - Accent Champagne: #C6A468
   - Fonts: Playfair Display SemiBold 600, Montserrat Regular 400 & Medium 500
   - Main slide: 75% width (desktop), 90% (mobile), gap: 16px, peeking next slide
   - Slide height: clamp(360px, 32vw, 560px), mobile clamp(280px, 60vw, 360px)
   - Synchronized caption, counter (01 / 06), circular prev/next buttons (min 44px)
   - 3:2 interactive thumbnail strip, active ring in champagne
   - Full-featured accessible Lightbox (Esc, arrow keys, focus trap, body scroll lock)
   ============================================================================== */

/* Section Container */
#gallery {
  background-color: #11254D !important;
  background-image: radial-gradient(
    ellipse at 20% 0%,
    rgba(8, 68, 181, 0.65) 0%,
    rgba(8, 68, 181, 0.25) 35%,
    rgba(8, 68, 181, 0) 75%
  ) !important;
  background-repeat: no-repeat !important;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* Header Spacing & Alignment */
.gallery-header-wrap {
  padding-left: clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 4vw, 64px);
  margin-bottom: clamp(28px, 2.5vw, 36px);
}

.gallery-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #FAD68A;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.gallery-eyebrow-line {
  width: 28px;
  height: 1.5px;
  background-color: #FAD68A;
}

.gallery-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 3.2vw, 50px);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.15;
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
}

.gallery-desc {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: clamp(14px, 1.05vw, 16px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin: 0;
}

/* ==================== MAGAZINE VIEWPORT & TRACK ==================== */
.gallery-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding-left: clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 4vw, 64px);
  box-sizing: border-box;
}

.gallery-track {
  display: flex;
  gap: 16px;
  width: 100%;
  transition: transform 450ms cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  user-select: none;
  touch-action: pan-y;
}

.gallery-slide {
  flex: 0 0 calc(75% - 12px);
  height: clamp(360px, 32vw, 560px);
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-color: #0b1a3d;
  cursor: zoom-in;
  box-sizing: border-box;
  transform: translateZ(0);
}

@media (max-width: 1023px) {
  .gallery-slide {
    flex: 0 0 calc(90% - 12px);
    height: clamp(280px, 60vw, 360px);
  }
}

.gallery-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 600ms cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}

.gallery-slide-img.is-contain {
  object-fit: contain;
  background-color: #0b1a3d;
}

.gallery-slide:hover .gallery-slide-img {
  transform: scale(1.02);
}

/* Sublte zoom badge overlay */
.gallery-slide-zoom-hint {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(11, 29, 73, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
}

.gallery-slide:hover .gallery-slide-zoom-hint {
  opacity: 1;
  transform: scale(1);
}

/* ==================== FLOATING NAVIGATION ARROW BUTTONS OVER SLIDES ==================== */
/* Pure borderless arrows positioned at the edges, no circular background */
.gallery-peek-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 80px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 35;
  padding: 0;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  opacity: 0.92;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), color 200ms ease, opacity 200ms ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.95));
}

.gallery-peek-next {
  right: clamp(10px, 1.8vw, 24px);
  left: auto;
}

.gallery-peek-prev {
  left: clamp(10px, 1.8vw, 24px);
  right: auto;
}

.gallery-peek-btn svg {
  width: 38px;
  height: 38px;
  stroke: currentColor;
  stroke-width: 2.6;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  display: block;
}

.gallery-peek-btn:hover {
  opacity: 1;
  color: #F3DC9D; /* Warm glowing Ivy Gold on hover */
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 10px rgba(198, 164, 104, 0.85));
}

.gallery-peek-prev:hover svg {
  transform: translateX(-4px) scale(1.12);
}

.gallery-peek-next:hover svg {
  transform: translateX(4px) scale(1.12);
}

.gallery-peek-btn:active {
  transform: translateY(-50%) scale(0.92);
}

.gallery-peek-btn:focus-visible {
  outline: 2px solid #C6A468;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Tablet & Mobile responsive */
@media (max-width: 1023px) {
  .gallery-peek-btn {
    width: 44px;
    height: 70px;
  }
  .gallery-peek-next {
    right: 8px;
  }
  .gallery-peek-prev {
    left: 8px;
  }
  .gallery-peek-btn svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.6;
  }
}

/* ==================== CAPTION & CONTROLS ==================== */
.gallery-meta-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-left: clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 4vw, 64px);
  margin-top: clamp(20px, 2vw, 28px);
  min-height: 84px;
  box-sizing: border-box;
}

.gallery-caption {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 74px;
}

.gallery-space-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.25;
  margin: 0;
  word-wrap: break-word;
  white-space: normal;
  transition: opacity 200ms ease;
}

.gallery-space-desc {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: clamp(13.5px, 0.95vw, 15px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.55;
  margin: 6px 0 0 0;
  word-wrap: break-word;
  white-space: normal;
  transition: opacity 200ms ease;
}

.gallery-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}

@media (max-width: 1023px) {
  .gallery-meta-wrap {
    min-height: 96px;
    gap: 16px;
  }
  .gallery-caption {
    min-height: 86px;
  }
  .gallery-space-name {
    font-size: clamp(18px, 4.8vw, 22px);
    line-height: 1.3;
  }
  .gallery-space-desc {
    font-size: 13.5px;
    line-height: 1.5;
  }
}

.gallery-counter {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: #FFFFFF;
  letter-spacing: 0.08em;
  min-width: 58px;
  text-align: right;
  user-select: none;
}

.gallery-counter-cur {
  font-weight: 700;
  color: #FFFFFF;
}

.gallery-counter-sep {
  color: #FAD68A;
  margin: 0 3px;
}

.gallery-counter-total {
  color: rgba(255, 255, 255, 0.65);
}

.gallery-nav-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 220ms ease;
  outline: none;
  padding: 0;
  box-sizing: border-box;
}

.gallery-nav-btn:hover:not(:disabled) {
  background-color: #FAD68A;
  color: #071536;
  border-color: #FAD68A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(250, 214, 138, 0.3);
}

.gallery-nav-btn:focus-visible {
  outline: 2px solid #FAD68A;
  outline-offset: 3px;
}

.gallery-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

/* ==================== THUMBNAIL STRIP ==================== */
.gallery-thumbs-wrap {
  padding-left: clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 4vw, 64px);
  margin-top: 22px;
}

.gallery-thumbs-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.gallery-thumbs-track::-webkit-scrollbar {
  display: none;
}

.gallery-thumb-btn {
  flex: 0 0 clamp(118px, 11vw, 172px);
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  overflow: hidden;
  padding: 0;
  border: 1.5px solid rgba(11, 29, 73, 0.2);
  background-color: #E2E8F0;
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 220ms ease;
  box-sizing: border-box;
}

.gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 200ms ease, transform 300ms ease;
  opacity: 0.72;
}

.gallery-thumb-btn:hover img {
  opacity: 0.95;
  transform: scale(1.05);
}

.gallery-thumb-btn.is-active {
  border-color: #0549CE;
  box-shadow: 0 0 0 2px #0549CE, 0 4px 12px rgba(5, 73, 206, 0.3);
}

.gallery-thumb-btn.is-active img {
  opacity: 1;
}

.gallery-thumb-btn:focus-visible {
  outline: 2px solid #0549CE;
  outline-offset: 2px;
}

/* Disclaimer Footer */
.gallery-disclaimer-wrap {
  padding-left: clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 4vw, 64px);
  margin-top: 14px;
}

.gallery-disclaimer-text {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
  margin: 0;
}

/* ==================== LIGHTBOX MODAL ==================== */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: rgba(7, 19, 41, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms ease, visibility 280ms ease;
  padding: clamp(16px, 2.5vw, 32px);
  box-sizing: border-box;
}

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

/* Lightbox Top Bar */
.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: #FFFFFF;
  z-index: 10;
}

.lightbox-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lightbox-space-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  color: #FFFFFF;
  margin: 0;
}

.lightbox-space-desc {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(246, 243, 236, 0.75);
  margin: 0;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lightbox-counter {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(246, 243, 236, 0.85);
  letter-spacing: 0.08em;
}

.lightbox-close-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(198, 164, 104, 0.5);
  background: rgba(11, 29, 73, 0.5);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 200ms ease;
  outline: none;
}

.lightbox-close-btn:hover {
  background: #C6A468;
  border-color: #C6A468;
  transform: rotate(90deg);
}

.lightbox-close-btn:focus-visible {
  outline: 2px solid #C6A468;
  outline-offset: 3px;
}

/* Lightbox Stage */
.lightbox-stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  margin: 12px 0;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 78vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  user-select: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Lightbox Floating Nav Buttons */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(11, 29, 73, 0.75);
  border: 1px solid rgba(198, 164, 104, 0.65);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 220ms ease;
  outline: none;
  z-index: 20;
}

.lightbox-nav-prev {
  left: 12px;
}

.lightbox-nav-next {
  right: 12px;
}

.lightbox-nav-btn:hover:not(:disabled) {
  background: #C6A468;
  border-color: #C6A468;
  transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.lightbox-nav-btn:focus-visible {
  outline: 2px solid #C6A468;
  outline-offset: 3px;
}

/* Lightbox Bottom Info */
.lightbox-bottombar {
  text-align: center;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 12px;
  color: rgba(246, 243, 236, 0.6);
  letter-spacing: 0.05em;
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
  .gallery-track,
  .gallery-slide-img,
  .gallery-nav-btn,
  .gallery-thumb-btn,
  .gallery-lightbox,
  .lightbox-img,
  .lightbox-nav-btn {
    transition: none !important;
  }
}
