/* fl718-peru.css — Peru desktop styles
   Version: 1.0.0
   Last updated: 2026-05-15
   Body class: fl718-peru-page
   Prototype source: Photo Pages/Location Pages/Peru/peru-index.html
*/

/* ============================================================
   ALL CSS SCOPED TO: body.fl718-peru-page
   Every rule uses this body class as scope prefix.
   Never write unscoped rules — they bleed into other pages.
   ============================================================ */

/* ------------------------------------------------------------
   BASE RESET & BODY
   GeneratePress article/content wrappers stripped — our template
   renders outside the GP article flow; these prevent the white
   box + padding that GP's separate-containers layout injects.
   ------------------------------------------------------------ */
body.fl718-peru-page {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background-color: #f0f0ed;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

body.fl718-peru-page .inside-article,
body.fl718-peru-page .site-main,
body.fl718-peru-page .content-area {
  padding: 0;
  margin: 0;
  background: transparent;
}

/* Box-sizing via :where() — zero specificity, never fights other rules */
:where(body.fl718-peru-page) *,
:where(body.fl718-peru-page) *::before,
:where(body.fl718-peru-page) *::after {
  box-sizing: border-box;
}

body.fl718-peru-page img {
  max-width: 100%;
  display: block;
}

/* ------------------------------------------------------------
   VISUALLY HIDDEN — accessible text, not visible on screen.
   ------------------------------------------------------------ */
body.fl718-peru-page .fl718-peru-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;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

body.fl718-peru-page .fl718-peru-hero {
  position: relative;
  width: 100%;
  height: calc(100vh + 56px); /* compensates margin-top so bottom doesn't gap */
  margin-top: -56px; /* pull hero under the fixed nav — eliminates the gap when nav retracts */
  overflow: clip;
  background-color: #e8e8e4;
}

body.fl718-peru-page .fl718-peru-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  opacity: 0;
  transform-origin: center center;
}

/* ============================================================
   HERO GRADIENT — upper-left corner atmosphere.
   ============================================================ */
body.fl718-peru-page .fl718-peru-hero__gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  height: 52%;
  background: radial-gradient(ellipse at 0% 0%, rgba(18, 20, 22, 0.42) 0%, transparent 75%);
  z-index: 5;
  pointer-events: none;
}

/* ============================================================
   HERO TITLE BLOCK
   ============================================================ */
body.fl718-peru-page .fl718-peru-hero__title-block {
  position: absolute;
  top: clamp(32px, 9vh, 72px);
  left: 0;
  padding: 0 clamp(28px, 4vw, 52px);
  z-index: 10;
  pointer-events: none;
}

body.fl718-peru-page .fl718-peru-hero__eyebrow {
  display: block;
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(9px, 0.82vw, 11px);
  font-weight: 200;
  font-style: italic;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: rgba(248, 246, 240, 0.42);
  margin-bottom: clamp(12px, 1.8vh, 22px);
  opacity: 0;
}

body.fl718-peru-page .fl718-peru-hero__title {
  display: block;
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(62px, 8.5vw, 128px);
  font-weight: 200;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: none;
  color: rgba(248, 246, 240, 0.90);
  line-height: 0.9;
  margin: 0;
  opacity: 0;
}

body.fl718-peru-page .fl718-peru-hero__year-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(14px, 2.2vh, 28px);
  opacity: 0;
}

body.fl718-peru-page .fl718-peru-hero__year-rule {
  display: block;
  width: 1px;
  height: 38px;
  background: rgba(248, 246, 240, 0.28);
  flex-shrink: 0;
}

body.fl718-peru-page .fl718-peru-hero__year {
  display: block;
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(12px, 1.2vw, 16px);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.28em;
  color: rgba(248, 246, 240, 0.50);
}

body.fl718-peru-page .fl718-peru-hero__caption {
  position: absolute;
  top: calc(55% - 155px);
  left: clamp(28px, 4vw, 52px);
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(13px, 1.45vw, 19px);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.04em;
  color: rgba(248, 246, 240, 0.86);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  max-width: 44ch;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

/* Reduced motion: show all hero text immediately at final state */
@media (prefers-reduced-motion: reduce) {
  body.fl718-peru-page .fl718-peru-hero__image {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  body.fl718-peru-page .fl718-peru-hero__eyebrow,
  body.fl718-peru-page .fl718-peru-hero__title,
  body.fl718-peru-page .fl718-peru-hero__year-block,
  body.fl718-peru-page .fl718-peru-hero__caption {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   GALLERY GRID — 3-column masonry layout
   ============================================================ */

body.fl718-peru-page .fl718-peru-grid {
  columns: 3;
  column-gap: 8px;
  padding: 8px;
  padding-top: 14vh;
  padding-bottom: 12vh;
}

@media (max-width: 768px) {
  body.fl718-peru-page .fl718-peru-grid {
    columns: 2;
    padding-top: 10vh;
  }
}

@media (max-width: 480px) {
  body.fl718-peru-page .fl718-peru-grid {
    columns: 1;
    padding: 8px;
    padding-top: 8vh;
    padding-bottom: 8vh;
  }
}

/* ------------------------------------------------------------
   GALLERY ITEMS — shared base
   ------------------------------------------------------------ */

body.fl718-peru-page .fl718-peru-item {
  break-inside: avoid;
  margin: 0 0 8px 0;
  overflow: clip;
  cursor: pointer;
  position: relative;
  display: block;
  opacity: 0;
}

body.fl718-peru-page .fl718-peru-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   HOVER EFFECT — warm mountain veil
   ============================================================ */

body.fl718-peru-page .fl718-peru-item__veil {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 12, 0.18);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  will-change: opacity;
}

@media (prefers-reduced-motion: reduce) {
  body.fl718-peru-page .fl718-peru-item__veil {
    display: none !important;
  }
}

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

body.fl718-peru-page .fl718-peru-lb-dark {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(12, 11, 8, 0.0);
  pointer-events: none;
  filter: blur(0px);
}

body.fl718-peru-page .fl718-peru-lb-dark--active {
  pointer-events: auto;
}

body.fl718-peru-page .fl718-peru-lb-stage {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(12, 11, 8, 0.0);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}

body.fl718-peru-page .fl718-peru-lb-stage--active {
  pointer-events: auto;
}

body.fl718-peru-page .fl718-peru-lb-image-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  max-width: calc(100vw - 120px);
  max-height: calc(100dvh - 120px);
  opacity: 0;
  transform-origin: center center;
}

body.fl718-peru-page .fl718-peru-lb-image {
  max-width: 100%;
  max-height: calc(100dvh - 180px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.09),
    0 12px 40px rgba(0, 0, 0, 0.07);
}

body.fl718-peru-page .fl718-peru-lb-caption {
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.10em;
  color: rgba(220, 216, 208, 0.65);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.5;
  opacity: 0;
  min-height: 1.4em;
}

body.fl718-peru-page .fl718-peru-lb-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: default;
}

body.fl718-peru-page .fl718-peru-lb-ui {
  position: fixed;
  inset: 0;
  z-index: 9200;
  pointer-events: none;
  opacity: 0;
}

/* Rule 1 of the BUG-047 lightbox contract. This sheet is position:fixed
   inset:0 above the backdrop, so pointer-events:auto on the whole sheet
   swallows every tap-outside-to-close. Only the interactive children take
   pointers; the sheet itself stays transparent to them. */
body.fl718-peru-page .fl718-peru-lb-ui--active {
  pointer-events: none;
}

body.fl718-peru-page .fl718-peru-lb-ui--active .fl718-peru-lb-close-btn,
body.fl718-peru-page .fl718-peru-lb-ui--active .fl718-peru-lb-nav {
  pointer-events: auto;
}

body.fl718-peru-page .fl718-peru-lb-close-btn {
  position: absolute;
  top: clamp(1rem, 2vh, 1.6rem);
  right: clamp(1rem, 2vw, 1.6rem);
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: rgba(220, 216, 208, 0.65);
  transition: color 0.2s ease;
}

/* Brighten on hover ONLY where a real hovering pointer exists. On touch,
   Safari latches :hover on tap and holds it until you tap elsewhere,
   leaving the control stuck bright after the tap ends (BUG-050 family). */
@media (hover: hover) and (pointer: fine) {
  body.fl718-peru-page .fl718-peru-lb-close-btn:hover {
    color: rgba(220, 216, 208, 1);
  }
}

/* Belt and braces: even if a UA reports (hover: hover) on a touch device,
   pin the color back to rest while the finger is down and after the tap. */
@media (hover: none), (pointer: coarse) {
  body.fl718-peru-page .fl718-peru-lb-close-btn:hover,
  body.fl718-peru-page .fl718-peru-lb-close-btn:focus,
  body.fl718-peru-page .fl718-peru-lb-close-btn:active {
    color: rgba(220, 216, 208, 0.65);
  }
  /* The JS leaves focus on the close button after interaction; without
     this the focus ring persists for the rest of the session. */
  body.fl718-peru-page .fl718-peru-lb-close-btn:focus {
    outline: none;
  }
}

body.fl718-peru-page .fl718-peru-lb-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  fill: none;
}

body.fl718-peru-page .fl718-peru-lb-counter {
  position: absolute;
  bottom: clamp(1.2rem, 2.5vh, 2rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Spectral', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: 0.78rem;
  color: rgba(220, 216, 208, 0.45);
  letter-spacing: 0.22em;
  white-space: nowrap;
  pointer-events: none;
}

body.fl718-peru-page .fl718-peru-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: rgba(220, 216, 208, 0.45);
  transition: color 0.2s ease;
}

/* Brighten on hover ONLY where a real hovering pointer exists — same
   latch-on-tap issue as the close control above. */
@media (hover: hover) and (pointer: fine) {
  body.fl718-peru-page .fl718-peru-lb-nav:hover {
    color: rgba(220, 216, 208, 0.85);
  }
}

@media (hover: none), (pointer: coarse) {
  body.fl718-peru-page .fl718-peru-lb-nav:hover,
  body.fl718-peru-page .fl718-peru-lb-nav:focus,
  body.fl718-peru-page .fl718-peru-lb-nav:active {
    color: rgba(220, 216, 208, 0.45);
  }
  body.fl718-peru-page .fl718-peru-lb-nav:focus {
    outline: none;
  }
}

body.fl718-peru-page .fl718-peru-lb-prev { left: clamp(0.8rem, 2vw, 1.6rem); }
body.fl718-peru-page .fl718-peru-lb-next { right: clamp(0.8rem, 2vw, 1.6rem); }

body.fl718-peru-page .fl718-peru-lb-nav svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

body.fl718-peru-page .fl718-peru-lb-close-btn:focus-visible,
body.fl718-peru-page .fl718-peru-lb-nav:focus-visible {
  outline: 2px solid rgba(220, 216, 208, 0.45);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  body.fl718-peru-page .fl718-peru-lb-image-wrap {
    max-width: 100vw;
    max-height: 100svh;
  }
  body.fl718-peru-page .fl718-peru-lb-image {
    max-height: calc(100svh - 120px);
  }
  body.fl718-peru-page .fl718-peru-lb-prev { left: 0.25rem; }
  body.fl718-peru-page .fl718-peru-lb-next { right: 0.25rem; }
}

/* Reduced motion — lightbox appears at final state immediately */
@media (prefers-reduced-motion: reduce) {
  /* Must carry .fl718-peru-lb-stage--active. The stage is a permanent
     position:fixed inset:0 element hidden only by opacity:0 — without the
     active qualifier this !important rule paints a 94% black scrim over the
     whole page from first load for any reduced-motion visitor. Rule 3 of the
     BUG-047 lightbox contract; the child rules below are safe unqualified
     precisely because the parent is hidden. */
  body.fl718-peru-page .fl718-peru-lb-stage.fl718-peru-lb-stage--active {
    opacity: 1 !important;
    background: rgba(12, 11, 8, 0.94) !important;
  }
  body.fl718-peru-page .fl718-peru-lb-image-wrap {
    opacity: 1 !important;
  }
  body.fl718-peru-page .fl718-peru-lb-ui {
    opacity: 1 !important;
  }
}

/* ── AFTER-CONTENT ──────────────────────────────────────────────
   Deleted 2026-08-20 (BUG-061). The section is universal now: its styles live
   in css/fl718-after-content.css scoped to body.fl718-after-content, and the
   cards in css/fl718-ws-city-system.css. Redeclaring either here would win the
   cascade over the shared file for no reason.
   ──────────────────────────────────────────────────────────────── */

/* ============================================================
   PREFERS-REDUCED-MOTION + NO-JS FALLBACKS
   ============================================================ */

/* Reduced motion: show all grid photos immediately */
@media (prefers-reduced-motion: reduce) {
  body.fl718-peru-page .fl718-peru-item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* No-JS: show everything immediately */
body.fl718-peru-page:not(.fl718-js-loaded) .fl718-peru-item {
  opacity: 1;
}
body.fl718-peru-page:not(.fl718-js-loaded) .fl718-peru-hero__image {
  opacity: 1;
}
body.fl718-peru-page:not(.fl718-js-loaded) .fl718-peru-hero__eyebrow,
body.fl718-peru-page:not(.fl718-js-loaded) .fl718-peru-hero__title,
body.fl718-peru-page:not(.fl718-js-loaded) .fl718-peru-hero__year-block,
body.fl718-peru-page:not(.fl718-js-loaded) .fl718-peru-hero__caption {
  opacity: 1;
}
