/* ==========================================================================
   gallery.html — Gallery page specific styles
   ========================================================================== */

/* ========================================
   1. HERO SECTION
======================================== */
.gallery-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 64px;
}

.gallery-hero__content h1 {
  font-size: clamp(38px, 4.4vw, 62px);
  line-height: 1.08;
  margin-bottom: 20px;
}

.gallery-hero__content .eyebrow { margin-bottom: 18px; }
.gallery-hero__content .lead { margin-bottom: 0; max-width: 48ch; font-size: clamp(15px, 1.2vw, 17px); }

/* Animated Floating Cards */
.gallery-hero__visual {
  position: relative;
  height: 400px;
  display: none;
  justify-content: center;
  align-items: center;
}

.floating-cards {
  position: relative;
  width: 100%;
  height: 100%;
}

.float-card {
  position: absolute;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  background: var(--bg-elevated);
  transition: transform 0.6s var(--ease);
}
.float-card img { width: 100%; height: 100%; object-fit: cover; }

.fc-1 {
  width: 240px; height: 320px;
  top: 40px; left: 0;
  z-index: 1;
  animation: float1 8s ease-in-out infinite;
}
.fc-2 {
  width: 280px; height: 340px;
  top: 10px; right: 0;
  z-index: 3;
  animation: float2 9s ease-in-out infinite alternate;
}
.fc-3 {
  width: 220px; height: 280px;
  bottom: 10px; left: 40%;
  z-index: 2;
  animation: float3 7s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-15px) rotate(-6deg); }
}
@keyframes float2 {
  0%, 100% { transform: translateY(0) rotate(3deg); }
  50% { transform: translateY(12px) rotate(5deg); }
}
@keyframes float3 {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .float-card { animation: none !important; }
}

/* ========================================
   2. PAGE COMPONENTS — filter pills
======================================== */
.filter-wrapper { display: flex; justify-content: center; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.filter-pills button {
  border-radius: var(--r-pill); border: 1px solid var(--border-editorial);
  background: var(--surface-editorial-card); color: var(--text-secondary-inverse);
  padding: 11px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.25s var(--ease);
}
.filter-pills button:hover { border-color: var(--accent); }
.filter-pills button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast-text); border-color: var(--accent); }
.is-hidden-filter { display: none !important; }

/* ========================================
   3. GALLERY SQUARE GRID
======================================== */
.gallery-square-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.tile--square { display: block; border-color: var(--border-editorial); }

.tile--square {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.tile--square.is-hidden-more {
  display: none !important;
}

/* Entrance state applied briefly to freshly-revealed tiles (JS toggles this) */
.tile--square.tile--enter {
  opacity: 0;
  transform: translateY(22px) scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .tile--square,
  .tile--square.tile--enter {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ---- Load More button ---- */
.gallery-load-more-wrap {
  display: flex;
  justify-content: center;
}

.load-more-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), color 0.25s var(--ease);
  animation: loadMorePulse 2.6s ease-in-out infinite;
}

/* Gentle ambient pulse so the button draws the eye while idle */
@keyframes loadMorePulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25); }
  50% { box-shadow: 0 8px 26px rgba(37, 99, 235, 0.5); }
}

/* Soft shimmer sweeping across the button */
.load-more-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: loadMoreShimmer 3.2s ease-in-out infinite;
}

@keyframes loadMoreShimmer {
  0% { left: -60%; }
  55%, 100% { left: 130%; }
}

/* Expanding ring on click */
.load-more-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.6);
  opacity: 0;
  transform: scale(1);
}

.load-more-btn.is-clicked::after {
  animation: loadMoreRing 0.55s var(--ease);
}

@keyframes loadMoreRing {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}

.load-more-btn:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
  transform: translateY(-3px) scale(1.03);
  animation-play-state: paused;
}

.load-more-btn:active {
  transform: translateY(-1px) scale(0.97);
}

.load-more-btn__icon {
  position: relative;
  z-index: 1;
  transition: transform 0.3s var(--ease);
  animation: loadMoreArrowBounce 1.8s ease-in-out infinite;
}

@keyframes loadMoreArrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.load-more-btn__label {
  position: relative;
  z-index: 1;
}

.load-more-btn:hover .load-more-btn__icon {
  animation-play-state: paused;
  transform: translateY(4px);
}

/* "Load Less" state — icon flips to point up */
.load-more-btn--less .load-more-btn__icon {
  animation: none;
  transform: rotate(180deg);
}

.load-more-btn--less:hover .load-more-btn__icon {
  transform: rotate(180deg) translateY(-3px);
}

.load-more-btn.is-loading {
  pointer-events: none;
  opacity: 0.8;
}

.load-more-btn.is-loading .load-more-btn__icon {
  animation: loadMoreSpin 0.7s linear infinite;
}

@keyframes loadMoreSpin {
  to { transform: rotate(360deg); }
}

/* Only hide the control entirely when there's nothing to page through at all */
.gallery-load-more-wrap.is-done {
  display: none;
}

/* Tiles fading out when "Load Less" collapses the grid */
.tile--square.tile--exit {
  opacity: 0;
  transform: translateY(14px) scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .load-more-btn,
  .load-more-btn::before,
  .load-more-btn::after,
  .load-more-btn__icon,
  .load-more-btn.is-loading .load-more-btn__icon,
  .load-more-btn--less .load-more-btn__icon,
  .load-more-btn:hover .load-more-btn__icon,
  .load-more-btn:hover {
    animation: none !important;
    transform: none !important;
  }
}

/* ========================================
   4. STUDIO EXPERIENCE (Layered Editorial)
======================================== */
.sle-section { padding-block: var(--section-y); overflow: hidden; }
.sle-container { position: relative; }
.sle-wrapper { position: relative; min-height: 640px; display: flex; align-items: center; }

.sle-main-visual {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 75%; border-radius: var(--r-xl); overflow: hidden;
}
.sle-main-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.sle-wrapper:hover .sle-main-visual img { transform: scale(1.03); }
.sle-main-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg-default) 0%, transparent 40%);
}

.sle-content-card {
  position: relative; z-index: 2;
  width: 45%; background: rgba(11, 15, 20, 0.75);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 48px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.sle-content-card h2 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 20px; }
.sle-content-card .lead { font-size: 16px; margin-bottom: 32px; opacity: 0.9; }

.sle-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  width: 100%;
  margin-top: 8px;
}

.sle-stat-item {
  position: relative;
  padding: 20px 18px 0 18px;
  border-left: 1px solid var(--border);
  transition: transform 0.3s var(--ease);
}
.sle-stat-item:first-child {
  border-left: none;
  padding-left: 0;
}

.sle-stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 18px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s var(--ease);
}
.sle-stat-item:first-child::before { left: 0; }

.sle-stat-item strong {
  display: block;
  font-size: clamp(22px, 2.3vw, 32px);
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  transition: transform 0.3s var(--ease);
  transform-origin: left;
}
.sle-stat-item span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  font-weight: 600;
}

.sle-stat-item:hover { transform: translateY(-4px); }
.sle-stat-item:hover::before { width: 30px; }
.sle-stat-item:hover strong { transform: scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  .sle-stat-item,
  .sle-stat-item::before,
  .sle-stat-item strong {
    transition: none !important;
  }
}

.sle-accent {
  position: absolute; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border-strong); box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  z-index: 3; transition: transform 0.6s var(--ease);
}
.sle-accent img { width: 100%; height: 100%; object-fit: cover; }
.sle-accent--1 { width: 220px; height: 260px; right: 60px; bottom: -40px; }
.sle-accent--2 { width: 180px; height: 200px; right: 60%; top: -30px; }
.sle-wrapper:hover .sle-accent--1 { transform: translateY(-10px); }
.sle-wrapper:hover .sle-accent--2 { transform: translateY(10px); }

/* ========================================
   5. BEFORE & AFTER SLIDER
======================================== */
.ba-section { padding-block: var(--section-y); }
.ba-slider-container { max-width: 1024px; margin: 0 auto; position: relative; }
.ba-slider {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: var(--r-lg); overflow: hidden;
  user-select: none; border: 1px solid var(--border-editorial);
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}

.ba-image { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ba-image img { width: 100%; height: 100%; object-fit: cover; }
.ba-image--after { z-index: 1; }
.ba-image--before {
  z-index: 2;
  clip-path: polygon(0 0, var(--exposure, 50%) 0, var(--exposure, 50%) 100%, 0 100%);
}

.ba-label {
  position: absolute; top: 24px; padding: 6px 16px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(0,0,0,0.6); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ba-label--before { left: 24px; z-index: 3; }
.ba-label--after { right: 24px; z-index: 3; }

.ba-divider {
  position: absolute; top: 0; bottom: 0;
  left: var(--exposure, 50%); width: 2px;
  background: #fff; z-index: 4;
  transform: translateX(-50%); pointer-events: none;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.ba-handle {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #111; cursor: grab; pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ba-handle:active { cursor: grabbing; transform: translate(-50%, -50%) scale(0.95); }

/* ========================================
   5. PAGE COMPONENTS — lightbox
======================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(5, 7, 10, 0.95);
  display: none; align-items: center; justify-content: center; padding: 40px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-height: 82vh; width: auto; border-radius: 8px; }
.lightbox__controls { position: absolute; inset-inline: 32px; top: 50%; display: flex; justify-content: space-between; }
.lightbox .m-close { position: absolute; top: 28px; right: 28px; }

/* ========================================
   6. IMMERSIVE SHOWCASE
======================================== */
.showcase-immersive {
  padding-block: var(--section-y);
}

.showcase-immersive__inner {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  padding: clamp(60px, 8vw, 100px) clamp(30px, 5vw, 80px);
  display: flex;
  align-items: center;
  min-height: 540px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  border: 1px solid var(--border-strong);
}

.showcase-immersive__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.showcase-immersive__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.showcase-immersive__inner:hover .showcase-immersive__bg img {
  transform: scale(1.04);
}
.showcase-immersive__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 15, 20, 0.95) 0%, rgba(11, 15, 20, 0.7) 50%, transparent 100%);
}

.showcase-immersive__content {
  position: relative;
  z-index: 2;
  max-width: 500px;
}
.showcase-immersive__content h2 {
  font-size: clamp(34px, 4vw, 54px);
  margin-bottom: 24px;
}
.showcase-immersive__content .lead {
  opacity: 0.9;
}

.showcase-immersive__float {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%) rotate(3deg);
  width: clamp(260px, 30vw, 340px);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid rgba(41, 121, 255, 0.4);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  z-index: 2;
  transition: transform 0.6s var(--ease);
}
.showcase-immersive__inner:hover .showcase-immersive__float {
  transform: translateY(-50%) rotate(0deg) scale(1.05);
}
.showcase-immersive__float img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

/* ========================================
   7. RESPONSIVE
======================================== */
@media (max-width: 1023px) {
  .gallery-hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .gallery-hero__content .btn-row { justify-content: center; }
  .gallery-hero__visual { height: 320px; }
  .fc-1 { width: 180px; height: 240px; }
  .fc-2 { width: 200px; height: 260px; }
  .fc-3 { width: 160px; height: 220px; }

  .gallery-square-grid { grid-template-columns: repeat(2, 1fr); }
  
  .showcase-immersive__overlay {
    background: linear-gradient(180deg, rgba(11, 15, 20, 0.95) 0%, rgba(11, 15, 20, 0.8) 60%, rgba(11,15,20,0.4) 100%);
  }
  .showcase-immersive__float {
    display: none;
  }

  /* SLE Section */
  .sle-main-visual { width: 100%; border-radius: var(--r-md); }
  .sle-content-card { width: 80%; margin: 40px auto 0; backdrop-filter: none; background: var(--bg-elevated); }
  .sle-accent { display: none; }
}

@media (max-width: 767px) {
  .gallery-hero__visual { height: 260px; }
  .fc-1 { width: 140px; height: 180px; top: 20px; }
  .fc-2 { width: 160px; height: 200px; top: 0; }
  .fc-3 { width: 120px; height: 160px; bottom: 0; }

  .showcase-immersive__content .btn {
    gap: 8px;
    padding: 14px 20px;
    font-size: 14px;
    white-space: nowrap;
  }
  
  .gallery-square-grid { grid-template-columns: 1fr; }

  /* SLE Section */
  .sle-content-card { width: 100%; padding: 32px 24px; border-radius: var(--r-sm); margin-top: 24px; box-shadow: none; border: none; border-top: 1px solid var(--border); background: transparent; }
  .sle-stats { flex-wrap: wrap; row-gap: 24px; }
  .sle-stat-item:nth-child(3) { border-left: none; padding-left: 0; }
  .sle-stat-item:nth-child(3)::before { left: 0; }
  .sle-main-visual { position: relative; height: 360px; }
  .sle-wrapper { display: block; min-height: auto; }
}