/*
 * gallery.css
 * Styles specific to gallery.html.
 * Covers: page hero header, photo grid, hover effects,
 *         lightbox overlay, and call-to-action strip.
 *
 * Mobile-first: base styles target small screens.
 * Larger screens are handled with min-width media queries.
 */


/* =============================================================
   Gallery Hero
   Simple page-header section with a tinted background.
   ============================================================= */

.gallery-hero {
  background-color: var(--color-bg-alt);
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.gallery-hero__title {
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.gallery-hero__subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
  max-width: 560px;
  margin: 0 auto;
}


/* =============================================================
   Gallery Section
   Wraps the grid and provides top/bottom spacing.
   ============================================================= */

.gallery {
  padding: var(--space-xl) 0;
}


/* =============================================================
   Gallery Grid
   CSS Grid layout — single column on mobile.
   Columns are added via media queries below.
   ============================================================= */

.gallery__grid {
  display: grid;
  grid-template-columns: 1fr;          /* Mobile: 1 column */
  gap: var(--space-sm);
}


/* =============================================================
   Gallery Item & Figure
   Each list item contains a <figure> that constrains the image
   to a consistent square aspect ratio so the grid stays tidy.
   ============================================================= */

.gallery__item {
  border-radius: var(--radius-md);
  overflow: hidden;                    /* Clip the zoom effect within the radius */
}

/* <figure> fills its grid cell and establishes the square crop */
.gallery__figure {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;               /* Square thumbnail for a uniform grid */
  overflow: hidden;
  cursor: pointer;
  margin: 0;
  background-color: var(--color-bg-alt);  /* Visible while the image loads */
}

/* Keyboard-focusable items need a clear focus ring */
.gallery__figure:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/*
 * The photo fills its square container using object-fit: cover so
 * no image is squashed or distorted. Scale-up on hover gives a
 * subtle interactive feel without being distracting.
 */
.gallery__img {
  position: absolute;
  inset: 0;                            /* Stretch to all four edges */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease, opacity 0.35s ease;
  /* Slightly de-emphasise images at rest so the hover 'lights them up' */
  opacity: 0.9;
}

/* Hover / focus: zoom in and restore full opacity */
.gallery__figure:hover .gallery__img,
.gallery__figure:focus-visible .gallery__img {
  transform: scale(1.06);
  opacity: 1;
}

/* Overlay hint — 'zoom' icon fades in on hover to signal the lightbox */
.gallery__figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(212, 69, 122, 0.15);  /* Translucent brand-pink wash */
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.gallery__figure:hover::after,
.gallery__figure:focus-visible::after {
  opacity: 1;
}


/* =============================================================
   Call-to-Action Strip
   Sits below the grid to nudge visitors toward booking.
   ============================================================= */

.gallery-cta {
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
}

.gallery-cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.gallery-cta__text {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0;
}


/* =============================================================
   Lightbox Overlay
   Built and injected by gallery.js; these styles control its
   appearance and animation.

   Structure (created by JS):
     .lightbox                    — full-screen fixed container
       .lightbox__overlay         — dark semi-transparent backdrop
       .lightbox__close           — × close button (top-right)
       .lightbox__prev            — ‹ previous button (left edge)
       .lightbox__next            — › next button (right edge)
       .lightbox__figure          — centred image + caption wrapper
         .lightbox__img           — the full-size photo
         .lightbox__caption       — alt text used as caption
   ============================================================= */

/* Full-screen fixed overlay — hidden by default */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;                        /* Above everything, including the sticky header */
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
}

/* The .lightbox--open class is toggled by gallery.js */
.lightbox--open {
  display: flex;
}

/* Semi-transparent dark backdrop — clicking it closes the lightbox */
.lightbox__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

/* The image and caption, centred above the backdrop */
.lightbox__figure {
  position: relative;                  /* Stays above .lightbox__overlay */
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 1000px);
  max-height: 90vh;
  margin: 0;
}

/*
 * The full-size photo.
 * max dimensions prevent it from overflowing the viewport.
 * object-fit: contain ensures the whole image is always visible.
 */
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

/* Optional caption beneath the image — populated from the img alt text */
.lightbox__caption {
  color: #ccc;
  font-size: var(--font-size-sm);
  text-align: center;
  margin-top: var(--space-xs);
  font-style: italic;
}

/* --- Shared styles for all three control buttons --- */
.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: fixed;
  z-index: 2;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--color-white);
  cursor: pointer;
  border-radius: var(--radius-full);
  font-family: var(--font-base);
  font-weight: 700;
  line-height: 1;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.lightbox__close:hover,
.lightbox__close:focus-visible,
.lightbox__prev:hover,
.lightbox__prev:focus-visible,
.lightbox__next:hover,
.lightbox__next:focus-visible {
  background: rgba(212, 69, 122, 0.8);   /* Brand pink on interaction */
  border-color: var(--color-primary);
  outline: none;
}

/* × close button — top-right corner */
.lightbox__close {
  top: var(--space-sm);
  right: var(--space-sm);
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ‹ previous button — vertically centred, left edge */
.lightbox__prev {
  top: 50%;
  left: var(--space-sm);
  transform: translateY(-50%);
  width: 44px;
  height: 56px;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__prev:hover,
.lightbox__prev:focus-visible {
  transform: translateY(-50%) scale(1.05);
}

/* › next button — vertically centred, right edge */
.lightbox__next {
  top: 50%;
  right: var(--space-sm);
  transform: translateY(-50%);
  width: 44px;
  height: 56px;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__next:hover,
.lightbox__next:focus-visible {
  transform: translateY(-50%) scale(1.05);
}

/* Counter showing "3 / 10" beneath the close button */
.lightbox__counter {
  position: fixed;
  top: var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
  font-weight: 600;
  pointer-events: none;
}


/* =============================================================
   Tablet — min-width: 600px
   ============================================================= */

@media (min-width: 600px) {

  /* 2-column grid on tablet */
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  /* CTA row: text and button side-by-side */
  .gallery-cta__inner {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-lg);
  }

  /* Larger prev/next hit targets on wider screens */
  .lightbox__prev,
  .lightbox__next {
    width: 52px;
    height: 68px;
  }

}


/* =============================================================
   Desktop — min-width: 1024px
   ============================================================= */

@media (min-width: 1024px) {

  /* 3-column grid on desktop */
  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }

}
