/* ────────────────────────────────────────────────────────────
   RAPTURE Photography — Gallery Pages (gallery-page.css)
   Shared by: Nature, Behind Glass, City gallery pages.

   Design tokens match the main site exactly:
   - Background: #EDF5FD
   - Font: Century Gothic → Futura → Nunito → sans-serif
   - Text: #1e2329 headings / #5a6472 body / #8e99a6 muted
   - Accent: #4a7fb5
   - Divider: #d6e4f0
──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }


/* ── Page fade-in on load ── */

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

body {
  font-family: 'Century Gothic', 'Futura', 'Gill Sans', 'Gill Sans MT', 'Nunito', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.75;
  color: #1e2329;

  background: #EDF5FD;
  min-height: 100vh;
  background-attachment: fixed;

  /* Smooth entrance on page load */
  animation: pageFadeIn 0.55s ease both;

  /* Fade-out class added by JS before navigating away */
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}


/* ── Top navigation bar ── */

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 2.5rem;
  border-bottom: 1px solid #d6e4f0;
}

/* RAPTURE wordmark */
.gallery-nav__brand {
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #1e2329;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.gallery-nav__brand:hover { opacity: 1; }

/* Back link — quiet, uppercase */
.gallery-nav__back {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1e2329;
  text-decoration: none;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.gallery-nav__back:hover { opacity: 0.85; }


/* ── Page header ── */

.gallery-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
}

/* Category title — large, thin, widely spaced */
.gallery-hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.1;
  color: #1e2329;
  margin-bottom: 1.75rem;
}

/* Thin rule separating title from subtitle */
.gallery-hero__rule {
  width: 40px;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin-bottom: 1.75rem;
}

/* Subtitle — quiet, italic */
.gallery-hero__subtitle {
  font-size: clamp(0.825rem, 1.4vw, 0.9375rem);
  letter-spacing: 0.06em;
  font-style: italic;
  color: #5a6472;
  line-height: 1.75;
  max-width: 420px;
}


/* ── Section divider ── */

.gallery-divider {
  border: none;
  border-top: 1px solid #d6e4f0;
  max-width: 1200px;
  margin-inline: auto;
}


/* ── Photo grid ── */

.gallery-section {
  max-width: 1200px;
  margin-inline: auto;

  /* Matches the section padding used on the main site */
  padding: 5rem 2rem 8rem;
}

/* Four-column grid — identical to the main site galleries */
.gallery-section__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* Individual photo wrapper — portrait aspect ratio, soft corners */
.gallery-section__item {
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4 / 5;
}

/* The photo — subtle zoom on hover (desktop only) */
.gallery-section__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

/* Quiet, non-breaking state for an Airtable gallery with no matching photos. */
.catalog-empty {
  grid-column: 1 / -1;
  min-height: 12rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5a6472;
  opacity: 0.55;
  text-align: center;
}

.gallery-section__grid[data-catalog-rotation] {
  transition: opacity 0.45s ease;
}

.gallery-section__grid[data-catalog-rotation].catalog-is-fading {
  opacity: 0;
}

@media (hover: hover) {
  .gallery-section__item:hover img {
    transform: scale(1.03);
  }
}


/* ── Scroll fade-in animation ──
   JavaScript adds .is-visible when the element enters the viewport. */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.75s ease,
    transform 0.75s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ── Footer ── */

.gallery-footer {
  border-top: 1px solid #d6e4f0;
  padding-block: 2.5rem;
  text-align: center;
}

.gallery-footer p {
  font-size: 0.8125rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #8e99a6;
}

/* Footer links — Digital Download License, Privacy Policy, Contact */
.gallery-footer__links {
  margin-top: 0.9rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}

.gallery-footer__links a {
  font-size: 0.8125rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #8e99a6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.gallery-footer__links a:hover { color: #4a7fb5; }

.footer-verse {
  max-width: 48rem;
  margin: 1.75rem auto 0;
  padding-inline: 1.5rem;
}

.footer-verse p {
  font-size: 0.75rem;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: #8e99a6;
}

.footer-verse p + p {
  margin-top: 0.35rem;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  font-style: normal;
}


/* ── Responsive — mobile ── */

@media (max-width: 768px) {

  .gallery-nav {
    padding: 1.2rem 1.5rem;
  }

  .gallery-hero {
    padding: 4rem 1.5rem 3rem;
  }

  .gallery-section {
    padding: 3.5rem 1.5rem 5rem;
  }

  /* Two columns on mobile — same as the main site */
  .gallery-section__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }
}


/* ── IMAGE PROTECTION ─────────────────────────────────────────
   Discourages casual copying of the photographs without changing
   how they look: blocks drag-to-desktop and long-press saving on
   mobile. Right-click and drag events are also handled by
   /image-protection.js. */
img {
  -webkit-user-drag: none;      /* Safari/Chrome: no dragging   */
  user-select: none;            /* no accidental selection      */
  -webkit-user-select: none;
  -webkit-touch-callout: none;  /* iOS: no long-press save menu */
}


/* ── Catalog photo links ──
   Items added from photo-catalog.js are links (<a>) to each
   photograph's own purchase page — visually identical tiles. */

a.gallery-section__item {
  display: block;
  text-decoration: none;
  cursor: pointer;
}
