/* ==========================================================================
   Gallery page (templates/gallery.html)
   Same palette as header/footer/contact/attractions.
   ========================================================================== */

.gallery-page {
  --gl-ink: #171b24;
  --gl-muted: #676459;
  --gl-line: #e9e4d8;
  --gl-tint: #f7f5f0;
  --gl-primary: #1f2a44;
  --gl-primary-hover: #151d31;
  --gl-primary-soft: rgba(31, 42, 68, 0.08);
  --gl-gold: #b8903f;

  color: var(--gl-muted);
}

/* style.css removes the container's side padding site-wide; restore it here */
.gallery-page .container {
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  padding-right: calc(var(--bs-gutter-x) * 0.5);
}

.gallery-page h1,
.gallery-page h2 {
  color: var(--gl-ink);
}

/* ---------- Intro ---------- */

.gl-intro {
  padding: 3.5rem 0 2.5rem;
}

.gl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--gl-primary-soft);
  color: var(--gl-primary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gl-eyebrow::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.gl-intro h1 {
  margin-bottom: 0.9rem;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.gl-intro .lead {
  max-width: 36rem;
  margin: 0;
  color: var(--gl-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.gl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--gl-ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.gl-meta i {
  margin-right: 0.4rem;
  color: var(--gl-gold);
}

/* ---------- Bento grid ---------- */

.gallery-page .gl-grid-section {
  padding: 0;
}

.gl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: clamp(11rem, 19vw, 16rem);
  grid-auto-flow: dense;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* every 6 photos: one large feature tile, alternating left / right */
.gl-grid > li:nth-child(12n + 1) {
  grid-column: 1 / span 2;
  grid-row: span 2;
}

.gl-grid > li:nth-child(12n + 7) {
  grid-column: 2 / span 2;
  grid-row: span 2;
}

.gl-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 1.25rem;
  background: var(--gl-tint);
  text-decoration: none;
  isolation: isolate;
}

.gl-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gl-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 14, 23, 0.7) 0%, rgba(10, 14, 23, 0) 45%);
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.gl-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.9rem;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #fff;
}

.gl-caption span {
  font-weight: 600;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.gl-caption i {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 0.9rem;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gl-tile:hover img,
.gl-tile:focus-visible img {
  transform: scale(1.05);
}

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

.gl-tile:hover .gl-caption i,
.gl-tile:focus-visible .gl-caption i {
  opacity: 1;
  transform: none;
}

.gl-tile:focus-visible {
  outline: 3px solid var(--gl-primary);
  outline-offset: 3px;
}

/* touch screens have no hover: always show the expand icon */
@media (hover: none) {
  .gl-caption i {
    opacity: 1;
    transform: none;
  }
}

.gl-empty {
  padding: 3rem 1rem;
  border: 1px dashed var(--gl-line);
  border-radius: 1.25rem;
  text-align: center;
}

/* ---------- CTA ---------- */

.gl-cta {
  padding: 4rem 0 5rem;
}

.gl-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 1.5rem;
  background:
    radial-gradient(40rem 18rem at 100% 0%, rgba(31, 42, 68, 0.12), transparent 60%),
    var(--gl-tint);
}

.gl-cta h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.gl-cta p {
  max-width: 34rem;
  margin: 0;
}

.gl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.gallery-page .gl-btn-primary {
  background: var(--gl-primary);
  color: #fff;
  box-shadow: 0 12px 28px -12px rgba(31, 42, 68, 0.8);
}

.gallery-page .gl-btn-primary:hover {
  background: var(--gl-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

.gallery-page .gl-btn-ghost {
  border: 1px solid rgba(23, 27, 36, 0.15);
  color: var(--gl-ink);
}

.gallery-page .gl-btn-ghost:hover {
  border-color: var(--gl-primary);
  color: var(--gl-primary);
}

/* ---------- Lightbox caption (GLightbox) ---------- */

.glightbox-clean .gslide-title {
  margin: 0;
  font-family: var(--bs-heading-font-family, "Playfair Display", Georgia, serif);
  font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 767.98px) {
  .gl-intro {
    padding: 2.25rem 0 1.75rem;
  }

  .gl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 9.5rem;
    gap: 0.6rem;
  }

  /* 2 columns: feature tile full width, and every 6th tile full width so rows close */
  .gl-grid > li:nth-child(12n + 1),
  .gl-grid > li:nth-child(12n + 7),
  .gl-grid > li:nth-child(6n) {
    grid-column: 1 / -1;
    grid-row: span 1;
  }

  .gl-grid > li:nth-child(6n + 1) {
    grid-row: span 2;
  }

  .gl-tile {
    border-radius: 1rem;
  }

  .gl-caption {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.65rem;
    font-size: 0.88rem;
  }

  .gl-caption i {
    width: 1.9rem;
    height: 1.9rem;
  }

  .gl-actions,
  .gl-actions .gl-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page * {
    transition: none !important;
  }
}
