/* ============================================
   GALLERY PAGE — Melaay Barber
   ============================================ */

/* ============================================
   HERO GALLERY
   ============================================ */

.gallery-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-16) 0 var(--space-12);
  background: linear-gradient(to bottom, rgba(18, 17, 16, 0.95), rgba(13, 12, 11));
  overflow: hidden;
}

.gallery-hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 0 var(--space-6);
}

.gallery-hero__overline {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent-main);
  margin-bottom: var(--space-4);
}

.gallery-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-text-main);
  margin-bottom: var(--space-6);
}

.gallery-hero__title em {
  color: var(--color-accent-main);
  font-style: normal;
}

.gallery-hero__desc {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.gallery-hero__image {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.gallery-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4);
}

.gallery-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 12, 11, 0.95) 0%, transparent 50%);
}

/* ============================================
   FILTER BUTTONS
   ============================================ */

.gallery-filters {
  padding: var(--space-8) 0;
  background: var(--color-bg-main);
  border-bottom: 1px solid var(--color-border-normal);
}

.gallery-filters__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.gallery-filter {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border-normal);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-filter:hover {
  color: var(--color-text-main);
  border-color: var(--color-border-strong);
}

.gallery-filter--active {
  color: var(--color-bg-main);
  background: var(--color-accent-main);
  border-color: var(--color-accent-main);
}

.gallery-filter--active:hover {
  color: var(--color-bg-main);
  background: var(--color-accent-main);
  border-color: var(--color-accent-main);
}

/* ============================================
   GALLERY GRID — Editorial Layout
   ============================================ */

.gallery-section {
  padding: var(--space-12) 0 var(--space-20);
  background: var(--color-bg-main);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px;
    gap: var(--space-5);
  }
}

/* ============================================
   GALLERY ITEMS
   ============================================ */

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
}

.gallery-item__trigger {
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.gallery-item__image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
  overflow: hidden;
}

.gallery-item__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  transition: transform 0.5s ease;
}

.gallery-item__placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
}

/* Category-specific placeholder colors */
.gallery-item__placeholder--salon {
  background: linear-gradient(135deg, #1a1918 0%, #0d0c0b 100%);
}

.gallery-item__placeholder--coupes {
  background: linear-gradient(135deg, #221f1d 0%, #151312 100%);
}

.gallery-item__placeholder--ambiance {
  background: linear-gradient(135deg, #1d1b19 0%, #11100f 100%);
}

/* Real images and videos */
.gallery-item__image,
.gallery-item__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item__video {
  position: absolute;
  inset: 0;
}

/* Hover effect on images/videos */
.gallery-item:hover .gallery-item__image,
.gallery-item:hover .gallery-item__video {
  transform: scale(1.05);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-6);
  background: linear-gradient(to top, rgba(13, 12, 11, 0.9) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item:hover .gallery-item__placeholder {
  transform: scale(1.05);
}

.gallery-item__category {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent-main);
  margin-bottom: var(--space-2);
}

.gallery-item__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text-main);
  margin-bottom: var(--space-4);
}

.gallery-item__view {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.gallery-item__view svg {
  transition: transform 0.2s ease;
}

.gallery-item:hover .gallery-item__view {
  color: var(--color-text-main);
}

.gallery-item:hover .gallery-item__view svg {
  transform: scale(1.1);
}

/* Grid Item Variants */

@media (min-width: 1024px) {
  .gallery-item--featured {
    grid-column: span 2;
    grid-row: span 2;
  }

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

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

  .gallery-item--featured .gallery-item__image-wrapper,
  .gallery-item--tall .gallery-item__image-wrapper {
    min-height: auto;
  }
}

/* ============================================
   EMPTY STATE
   ============================================ */

.gallery-empty {
  text-align: center;
  padding: var(--space-20) var(--space-6);
  color: var(--color-text-secondary);
}

.gallery-empty p {
  font-size: var(--text-lg);
}

/* ============================================
   CTA SECTION
   ============================================ */

.gallery-cta {
  padding: var(--space-16) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-normal);
}

.gallery-cta__inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.gallery-cta__title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 400;
  color: var(--color-text-main);
  margin-bottom: var(--space-4);
}

.gallery-cta__desc {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

.gallery-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-bg-main);
  background: var(--color-accent-main);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.3s ease;
}

.gallery-cta__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 169, 106, 0.25);
}

.melaay-booking__overline {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--melaay-copper);
  margin-bottom: var(--space-4);
}

/* ============================================
   LIGHTBOX
   ============================================ */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 12, 11, 0.95);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

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

.gallery-lightbox__image-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-lightbox__image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

.gallery-lightbox__video {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
  background: #000;
  outline: none;
}

.gallery-lightbox__info {
  text-align: center;
  padding: var(--space-6) 0;
  color: var(--color-text-main);
}

.gallery-lightbox__category {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent-main);
  margin-bottom: var(--space-2);
}

.gallery-lightbox__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 400;
  margin-bottom: var(--space-2);
}

.gallery-lightbox__counter {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* Lightbox Controls */

.gallery-lightbox__close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 3;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--color-text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--color-text-main);
  cursor: pointer;
  transform: translateY(-50%);
  transition: all 0.2s ease;
}

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

.gallery-lightbox__nav--prev {
  left: var(--space-6);
}

.gallery-lightbox__nav--next {
  right: var(--space-6);
}

/* Hide nav buttons on mobile */
@media (max-width: 768px) {
  .gallery-lightbox__nav {
    display: none;
  }
  
  .gallery-lightbox {
    padding: var(--space-4);
  }
  
  .gallery-lightbox__close {
    top: var(--space-4);
    right: var(--space-4);
  }
}

/* ============================================
   VISUALLY HIDDEN (Accessibility)
   ============================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .gallery-hero {
    min-height: 50vh;
    padding: var(--space-12) 0 var(--space-8);
  }
  
  .gallery-hero__title {
    font-size: var(--text-3xl);
  }
  
  .gallery-hero__desc {
    font-size: var(--text-base);
  }
  
  .gallery-filters {
    padding: var(--space-6) 0;
  }
  
  .gallery-filters__inner {
    gap: var(--space-2);
  }
  
  .gallery-filter {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
  }
  
  .gallery-section {
    padding: var(--space-8) 0 var(--space-12);
  }
  
  .gallery-item__image-wrapper {
    min-height: 240px;
  }
  
  .gallery-item__overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(13, 12, 11, 0.8) 0%, transparent 50%);
  }
  
  .gallery-item__title {
    font-size: var(--text-lg);
  }
  
  .gallery-cta {
    padding: var(--space-12) 0;
  }
  
  .gallery-cta__title {
    font-size: var(--text-2xl);
  }
  
  .gallery-cta__btn {
    width: 100%;
    justify-content: center;
  }
  
  .gallery-lightbox__title {
    font-size: var(--text-xl);
  }
}

/* ============================================
   ANIMATIONS — same system as services page
   ============================================ */

@media (prefers-reduced-motion: no-preference) {
  [data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  [data-animate].animated {
    opacity: 1;
    transform: translateY(0);
  }

  [data-animate="fade-right"] {
    transform: translateX(-20px);
  }

  [data-animate="fade-right"].animated {
    transform: translateX(0);
  }

  [data-animate="fade-in"] {
    transform: scale(0.95);
    opacity: 0;
  }

  [data-animate="fade-in"].animated {
    transform: scale(1);
    opacity: 1;
  }

  [data-animate="scale-in"] {
    transform: scale(0.95);
    opacity: 0;
  }

  [data-animate="scale-in"].animated {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .gallery-item__placeholder,
  .gallery-item__overlay,
  .gallery-filter,
  .gallery-lightbox__close,
  .gallery-lightbox__nav {
    transition: none;
  }
  
  .gallery-item:hover .gallery-item__placeholder {
    transform: none;
  }
}
