/* ============================================================
   AuraLens AI — Gallery Page
   Updated to match the "Judge the Quality" detailed slider
   ============================================================ */

.text-center { text-align: center; }

/* ===================================================
   HERO SECTION
   =================================================== */
.gallery-hero {
  position: relative;
  background: var(--bg-void);
  padding: 180px 0 30px; /* Reduced bottom padding */
  text-align: center;
  overflow: hidden;
}

.gallery-hero-glow {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 70vw;
  height: 70vw;
  background: radial-gradient(ellipse at center, rgba(212,168,85,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.gallery-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.gallery-hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  margin-bottom: var(--s-md);
  line-height: 1.15;
}

.hero-subtitle {
  color: var(--text-body);
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto; /* Removed bottom margin */
  line-height: 1.7;
}

/* ===================================================
   IMAGE COMPARISON SLIDER SECTION
   (Detailed comparison based on input image structure)
   =================================================== */
.gal-slider {
  background: var(--bg-void);
  padding: 0 0 var(--s-3xl);
  overflow: hidden;
}

.gal-slider-outer {
    max-width: 1200px; /* Ensure a large display but centered */
    margin: 0 auto;
    position: relative;
}

.gal-slider-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Ensure common aspect ratio, similar to images */
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-deep);
  cursor: ew-resize; /* Indicate horizontal scrolling */
}

.gal-slider-wrapper:active {
    cursor: grabbing;
}

/* Base images and their setup */
.gal-slider-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none; /* prevent drag ghosting */
}

/* Base images and their container setup */
.gal-slider-before,
.gal-slider-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* The 'Before' (Raw) is the base layer (z-index 1) */
.gal-slider-before {
  z-index: 1;
  background-color: #ffffff; 
}

/* The 'After' (AuraLens AI) is the top layer (z-index 2) */
.gal-slider-after {
  z-index: 2;
  overflow: hidden;
  background-color: transparent;
}

/* Constrain images tightly to their layers */
.gal-slider-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none; /* Crucial: stops image dragging interference */
}

/* =========================================
   Text & Branding Overlays inside the slider
   ========================================= */
.gal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    pointer-events: none; /* ensure image gets events */
    user-select: none;
}

/* Setup per side: before (left), after (right) */
.gal-overlay-before {
    justify-content: flex-start; /* Left side content */
    align-items: flex-start;
}

.gal-overlay-after {
    justify-content: flex-end; /* Right side content */
    align-items: center; /* Center-align prompt text blocks */
}

/* Content styling: Before Side (Raw) */
.gal-before-content {
    background-color: rgba(255, 255, 255, 0.85); /* Semi-transparent white box for contrast */
    padding: var(--s-xl);
    border-bottom-right-radius: var(--r-xl);
    color: #1a1a1a; /* Dark text on white */
}

.gal-before-content h3 {
    font-size: 1rem;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--s-xs);
    opacity: 0.7;
}

.gal-before-content h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #050811; /* Explicit black/dark color for "Raw Image" */
    line-height: 1;
    margin-bottom: var(--s-md);
    font-style: italic; /* Match italic header style from image example */
}

.gal-hand-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.1); /* light dark circle */
    color: #050811;
}

/* Content styling: After Side (AuraLens AI) */
.gal-after-content {
    width: 100%; /* Take full width of its clipped area to center align */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* left align within the column */
    padding: var(--s-3xl);
    max-width: 600px; /* Limit text width similar to image example */
    margin: 0 auto; /* center align the prompt column itself */
}

/* AuraLens AI logo specifically for inside the dark slider side */
.gal-logo-block {
    margin-bottom: var(--s-2xl);
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.gal-slider-logo.nav-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 1.5rem;
    color: var(--champagne); /* Use theme's primary color */
}

.gal-slider-logo.nav-logo .logo-gem {
    width: 48px;
    height: 48px;
}

/* Prompt details text styling on the dark side */
.gal-prompt-block {
    width: 100%;
}

.gal-prompt-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--s-lg);
    opacity: 0.8;
}

.gal-prompt-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns like image example */
    gap: var(--s-md) var(--s-xl);
}

.gal-prompt-list li {
    font-size: 1rem;
    color: var(--text-bright);
    line-height: 1.7;
    border-left: 2px solid var(--border-bright); /* thin vertical border per item */
    padding-left: 15px;
    grid-column: span 1;
}

.gal-prompt-list li strong {
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-right: 5px;
}

/* =========================================
   Slider Handle and Bar
   JavaScript will update the 'left' style dynamically
   ========================================= */
.gal-slider-bar {
  position: absolute;
  top: 0;
  height: 100%;
  width: 3px; /* thicker line than default */
  background-color: var(--champagne); /* Use primary color */
  box-shadow: 0 0 10px rgba(212,168,85, 0.5); /* subtle glow */
  z-index: 20;
  pointer-events: none; /* ensure events go through */
}

.gal-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px; /* much larger handle */
  height: 70px;
  background-color: #050811; /* Use deep obsidian for handle */
  border: 4px solid var(--champagne); /* Gold border */
  border-radius: 50%;
  box-shadow: var(--shadow-deep);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--champagne);
  cursor: grab;
  pointer-events: auto; /* Handle itself can be grabbed */
}

.gal-slider-handle:active {
  cursor: grabbing;
}

/* Double arrow style from image example */
.gal-slider-handle svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.gal-slider-handle svg:first-child {
  margin-right: -4px; /* classic studio feel overlap */
}

/* ===================================================
   ELEVATES SECTION
   =================================================== */
.gallery-elevates {
  background: var(--bg-void);
  padding: 20px 0 80px;
}

.elevates-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--s-sm);
}

.elevate-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--text-muted);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.6;
}

.elevate-subtitle {
  font-size: clamp(3rem, 6vw, 5.5rem);
  color: var(--champagne);
  line-height: 1.1;
  font-style: italic;
  font-family: var(--f-display);
}

.elevate-subtitle span {
  color: var(--text-bright);
}

/* ===================================================
   GALLERY SHOWCASE (MASONRY GRID)
   =================================================== */
.gallery-showcase {
  background: var(--bg-void);
  padding: 0 0 var(--s-3xl);
}

.gal-masonry {
  display: column;
  column-count: 4;
  column-gap: 20px;
  width: 100%;
}

.gal-masonry-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  background-color: var(--bg-surface); 
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform var(--t-bounce), border-color var(--t-base), box-shadow var(--t-base), opacity 0.3s ease;
  cursor: pointer;
  display: block !important; 
  opacity: 1 !important;
  transform: scale(1) !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden; /* Forces hardware acceleration on mobile Safari */
}

.gal-masonry-item:hover {
  transform: translateY(-5px);
  border-color: var(--border-bright);
  box-shadow: var(--shadow-champ);
}

.gal-masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gal-masonry-item:hover img {
  transform: scale(1.05);
}

/* ===================================================
   GALLERY HOOK SECTION
   =================================================== */
.gallery-hook {
  background: var(--bg-deep);
  text-align: center;
  padding: 120px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.hook-container {
  max-width: 900px;
  margin: 0 auto;
}

.hook-content h2 {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  margin-bottom: var(--s-lg);
  line-height: 1.25;
}

.hook-content p {
  color: var(--text-body);
  font-size: 1.15rem;
  max-width: 750px;
  margin: 0 auto;
  line-height: 1.7;
}

.hook-btn {
  padding: 0.9rem 3rem;
  font-size: 0.95rem;
}

/* ===================================================
   FINAL CTA SECTION
   =================================================== */
.gallery-final-cta {
  position: relative;
  overflow: hidden;
  background: var(--bg-mid);
  text-align: center;
  padding: 120px 0;
}

.final-cta-glow {
  position: absolute;
  bottom: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 400px;
  background: radial-gradient(ellipse, rgba(62,201,148,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.final-cta-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.final-cta-content h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  margin-bottom: var(--s-md);
  line-height: 1.2;
}

.final-cta-content p {
  color: var(--text-body);
  font-size: 1.1rem;
  margin-bottom: var(--s-xl);
  line-height: 1.7;
}

.final-cta-btns {
  display: flex;
  gap: var(--s-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ===================================================
   RESPONSIVE OVERRIDES
   =================================================== */
@media (max-width: 1200px) {
  .gal-masonry { column-count: 3; }
  .gal-after-content { padding: var(--s-xl); max-width: 500px;}
  .gal-prompt-list { gap: var(--s-sm) var(--s-lg); }
}

@media (max-width: 850px) {
  .gallery-hero { padding: 160px 0 30px; }
  .gal-masonry { column-count: 2; }
  .gal-slider-wrapper { aspect-ratio: 3 / 2; }
  .gal-before-content { padding: var(--s-lg); }
  .gal-after-content { padding: var(--s-lg); }
  .gal-logo-block { margin-bottom: var(--s-lg); }
  .gal-slider-logo.nav-logo { font-size: 1.2rem; }
  .gal-slider-logo.nav-logo .logo-gem { width: 36px; height: 36px;}
  .gal-prompt-list { grid-template-columns: 1fr; } /* single column on tablets */
  .gal-slider-handle { width: 60px; height: 60px; }
}

@media (max-width: 480px) {
  .gallery-hero { padding: 140px 0 20px; }
  .gal-slider { padding: 0 0 var(--s-2xl); }
  .gal-slider-wrapper { aspect-ratio: 1 / 1; border-radius: var(--r-lg); }
  .gal-masonry { column-count: 1; }
  .elevate-title { font-size: 2rem; }
  .elevate-subtitle { font-size: 2.8rem; }
  .gal-before-content h2 { font-size: 2.2rem; }
  .gal-hand-icon { width: 40px; height: 40px; }
  .gal-slider-logo.nav-logo { font-size: 1rem; }
  .gal-prompt-list li { font-size: 0.8rem; }
  .gal-slider-handle { width: 50px; height: 50px; border-width: 3px;}
  .hook-content h2 { font-size: 1.8rem; }
  .final-cta-content h2 { font-size: 1.8rem; }
}

/* Instagram Grid Layout */
.hook-instagram-grids {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px; /* Space between the "phones" */
  margin: 60px auto 0; /* Top margin, centered */
  
  /* FORCE INCREASE HERE */
  width: 80%; 
  max-width: 1450px; /* Much larger than the default 1180px */
  
  padding: 0 20px;
  align-items: start;
}

.insta-grid-column {
  width: 100%; /* Force column to fill its 1/3rd of the 1450px */
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform var(--t-base);
}

.insta-grid-column img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-lg);
}

/* Responsive adjustment for mobile */
@media (max-width: 768px) {
  .hook-instagram-grids {
    grid-template-columns: 1fr; /* Stack them vertically on small screens */
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Lightbox Container */
.lightbox {
  display: none; 
  position: fixed;
  z-index: 2000;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 8, 17, 0.95);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

/* Lightbox Image */
.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-card);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

/* Close Button */
.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: var(--champagne);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: var(--text-bright);
}

/* Tab Navigation Styles */
.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--f-display);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--t-base);
    position: relative;
}

.tab-btn.active {
    color: var(--champagne);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -21px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--g-champ);
}

/* Tab Content Visibility */
.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.tab-pane.active {
    display: block;
}

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

/* Video Item Specifics */
.video-item .video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-bright);
    gap: 10px;
}

.video-item .lucide {
    width: 48px;
    height: 48px;
    stroke: var(--champagne);
}

/* Ensure the video tab uses the same masonry layout as the image tab */
#videos .gal-masonry {
    display: column;
    column-count: 4; /* Matches original .gal-masonry */
    column-gap: 20px;
    width: 100%;
}

/* Ensure video containers match photo item behavior */
.video-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--r-lg); /* Matches .gal-masonry-item */
}

/* This forces the container to take the height of the thumbnail image */
.video-container img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Play button overlay centered exactly like your other UI elements */
.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 17, 0.3); /* Subtle dark tint */
    transition: background var(--t-base);
}

.video-container:hover .video-overlay {
    background: rgba(5, 8, 17, 0.1); /* Lighten on hover */
}

/* Center the Play Icon using your existing variable styles */
.video-overlay .lucide {
    width: 50px !important;
    height: 50px !important;
    color: var(--champagne) !important;
    background: rgba(18, 27, 48, 0.8) !important; /* Matches your icon circles */
    padding: 12px !important;
    border-radius: 50% !important;
    border: 1px solid var(--border-bright) !important;
    box-shadow: var(--shadow-champ) !important;
}

/* Responsive: Match the photo grid columns on mobile */
@media (max-width: 850px) {
    #videos .gal-masonry { column-count: 2; }
}

@media (max-width: 480px) {
    #videos .gal-masonry { column-count: 1; }
}

/* Force the video player to be visible and correctly sized */
#lightboxVideo.lightbox-content {
    display: none; /* Managed by JS */
    width: 90vw;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    background: #000;
    border-radius: var(--r-lg);
    border: 1px solid var(--border-bright);
}

@media (max-width: 850px) {
  #images .gal-masonry { 
      column-count: 2 !important; 
      display: block !important; /* Forces block execution over inline splits */
  }
  
  .gal-masonry-item {
      break-inside: avoid !important;
      -webkit-column-break-inside: avoid !important; /* Safari support */
      page-break-inside: avoid !important;
      transform: translateZ(0); /* Triggers GPU acceleration to paint instantly */
      height: auto !important;
  }
}

@media (max-width: 480px) {
  #images .gal-masonry { 
      column-count: 1 !important; 
  }
}