/* ==========================================================================
   Litopius Beach Hotel — Design System
   Coastal luxury: sand/ivory base, deep sea-blue + warm terracotta accents.
   Layer order: tokens -> base -> hero -> reveal -> components -> a11y
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --sand-50:  #FDFBF7;
  --sand-100: #F7F1E8;
  --sand-200: #EDE3D5;
  --sand-300: #DECFBB;

  /* Deep sea blue */
  --sea-900: #082430;
  --sea-800: #0C3243;
  --sea-700: #114457;
  --sea-600: #1A5E77;
  --sea-400: #4E93A9;

  /* Warm terracotta */
  --terra-700: #9C4529;
  --terra-600: #B4573A;
  --terra-500: #C86B47;
  --terra-200: #EAC3B0;

  /* Text — verified AA on --sand-50/100 */
  --ink:       #14212A;  /* 14.8:1 on sand-50 */
  --ink-muted: #4E5F69;  /*  6.4:1 on sand-50 */
  --ink-faint: #6B7B84;  /*  4.6:1 on sand-50 */

  /* Spacious density scale (dial 3/10) */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 7.5rem;

  /* Elevation — soft, single consistent scale */
  --shadow-sm: 0 1px 2px rgba(8, 36, 48, .06), 0 2px 6px rgba(8, 36, 48, .05);
  --shadow-md: 0 4px 10px rgba(8, 36, 48, .07), 0 12px 28px rgba(8, 36, 48, .07);
  --shadow-lg: 0 10px 24px rgba(8, 36, 48, .10), 0 28px 60px rgba(8, 36, 48, .12);

  --radius: 4px;
  --ease-out: cubic-bezier(.22, .8, .36, 1);

  /* z-index scale */
  --z-nav: 40;
  --z-overlay: 90;
  --z-modal: 100;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* clears the sticky nav on anchor jumps */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--sand-50);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Small-caps eyebrow label used above every section heading */
.eyebrow {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terra-700);
}

.measure { max-width: 68ch; }

::selection { background: var(--terra-200); color: var(--sea-900); }

/* Focus ring — never removed, only restyled */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--terra-600);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Images fall back to a coastal gradient if a remote photo fails to load */
img.img-failed {
  background: linear-gradient(135deg, var(--sea-700), var(--sea-400) 55%, var(--sand-300));
}

/* ==========================================================================
   HERO SLIDESHOW
   Each slide: horizontal drift (left -> right) + Ken Burns zoom, 6s per slide.
   Crossfade is handled on the slide wrapper, motion on the inner <img>.
   ========================================================================== */
.hero-slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: translate3d(-3.5%, 0, 0) scale(1.18);
  will-change: transform;
  /* ONE Ken Burns motion for the whole image group. Because a single element is
     animated, every photo shares the exact same zoom/pan at all times, so the
     opacity crossfade between slides can never reveal a scale jump. The zoom eases
     at each extreme (alternate) rather than hard-resetting between slides. */
  animation: kenburns-drift 16s ease-in-out infinite alternate;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 2000ms ease-in-out;
  will-change: opacity;
}

.hero-slide[data-active="true"] { opacity: 1; }

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* No transform here — the Ken Burns zoom lives on the .hero-slides container so
     all photos move together. Images just fill their slide. */
}

@keyframes kenburns-drift {
  from { transform: translate3d(-3.5%, 0, 0) scale(1.18); }
  to   { transform: translate3d( 3.5%, 0, 0) scale(1.07); }
}

/* Dark gradient overlay — keeps headline text above 4.5:1 on every photo */
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,36,48,.72) 0%, rgba(8,36,48,.28) 38%, rgba(8,36,48,.52) 72%, rgba(8,36,48,.86) 100%),
    linear-gradient(90deg, rgba(8,36,48,.55) 0%, rgba(8,36,48,0) 65%);
}

.hero-dot {
  width: 44px;   /* 44px touch target; the visible bar is the inner span */
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: none;
  border: 0;
}
.hero-dot span {
  display: block;
  width: 28px;
  height: 3px;
  background: rgba(255, 255, 255, .38);
  transition: background 250ms var(--ease-out), width 250ms var(--ease-out);
}
.hero-dot[aria-selected="true"] span { background: #fff; width: 44px; }
.hero-dot:hover span { background: rgba(255, 255, 255, .75); }

/* ---------- Scroll reveal (IntersectionObserver adds .is-visible) ---------- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;
  padding: 0 1.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 220ms var(--ease-out), color 220ms var(--ease-out),
              border-color 220ms var(--ease-out), transform 220ms var(--ease-out),
              box-shadow 220ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--terra-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--terra-700); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.btn-sea { background: var(--sea-800); color: #fff; box-shadow: var(--shadow-sm); }
.btn-sea:hover { background: var(--sea-900); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

.btn-outline { background: transparent; color: var(--sea-800); border-color: var(--sand-300); }
.btn-outline:hover { background: var(--sea-800); color: #fff; border-color: var(--sea-800); }

.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Cards ---------- */
.card-media { overflow: hidden; }
.card-media img { transition: transform 600ms var(--ease-out); }
.room-card:hover .card-media img,
.amenity-card:hover .card-media img { transform: scale(1.06); }

.room-card {
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
.room-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

/* Gallery tiles */
.gallery-tile img { transition: transform 600ms var(--ease-out), filter 400ms var(--ease-out); }
.gallery-tile:hover img { transform: scale(1.07); filter: brightness(1.06); }

/* ---------- Nav: transparent -> solid ---------- */
#site-nav {
  transition: background-color 350ms var(--ease-out), box-shadow 350ms var(--ease-out),
              border-color 350ms var(--ease-out), padding 350ms var(--ease-out);
  background: transparent;
  border-bottom: 1px solid transparent;
}
#site-nav.is-solid {
  background: rgba(253, 251, 247, .94);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom-color: var(--sand-200);
  box-shadow: var(--shadow-sm);
}

.nav-link {
  position: relative;
  color: rgba(255, 255, 255, .92);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .5rem 0;
  transition: color 220ms var(--ease-out);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 1.5px;
  width: 0;
  background: var(--terra-500);
  transition: width 280ms var(--ease-out);
}
.nav-link:hover::after, .nav-link[aria-current="true"]::after { width: 100%; }
#site-nav.is-solid .nav-link { color: var(--sea-800); }
#site-nav.is-solid .nav-link:hover { color: var(--terra-700); }

.nav-brand { color: #fff; transition: color 350ms var(--ease-out); }
#site-nav.is-solid .nav-brand { color: var(--sea-900); }

.nav-burger-bar { background: #fff; transition: background 350ms var(--ease-out), transform 300ms var(--ease-out), opacity 200ms; }
#site-nav.is-solid .nav-burger-bar { background: var(--sea-900); }

/* Mobile drawer */
#mobile-menu {
  transition: opacity 280ms var(--ease-out), visibility 280ms;
  opacity: 0;
  visibility: hidden;
}
#mobile-menu.is-open { opacity: 1; visibility: visible; }
#mobile-menu .panel {
  transform: translateX(100%);
  transition: transform 320ms var(--ease-out);
}
#mobile-menu.is-open .panel { transform: none; }

/* ---------- Modal / Lightbox ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms var(--ease-out), visibility 260ms;
}
.overlay.is-open { opacity: 1; visibility: visible; }
.overlay .scrim { position: absolute; inset: 0; background: rgba(8, 36, 48, .78); backdrop-filter: blur(4px); }
.overlay .dialog {
  position: relative;
  transform: scale(.96) translateY(12px);
  transition: transform 300ms var(--ease-out);
}
.overlay.is-open .dialog { transform: none; }

body.no-scroll { overflow: hidden; }

/* Room modal thumbnail strip */
.thumb {
  border: 2px solid transparent;
  opacity: .62;
  transition: opacity 220ms var(--ease-out), border-color 220ms var(--ease-out);
  cursor: pointer;
}
.thumb:hover { opacity: .9; }
.thumb[aria-current="true"] { opacity: 1; border-color: var(--terra-600); }

/* ---------- Forms ---------- */
.field {
  width: 100%;
  min-height: 48px;              /* touch-friendly */
  padding: .75rem .95rem;
  font-size: 1rem;               /* 16px: prevents iOS zoom-on-focus */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--sand-300);
  border-radius: var(--radius);
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.field::placeholder { color: var(--ink-faint); }
.field:hover { border-color: var(--sand-300); }
.field:focus {
  outline: none;
  border-color: var(--sea-600);
  box-shadow: 0 0 0 3px rgba(26, 94, 119, .18);
}
.field[aria-invalid="true"] {
  border-color: #B3261E;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, .14);
}
.field-label {
  display: block;
  margin-bottom: .4rem;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--sea-800);
}
.field-error {
  display: none;
  align-items: center;
  gap: .35rem;
  margin-top: .4rem;
  font-size: .8125rem;
  color: #8C1D18;               /* 5.9:1 on white */
}
.field-error.is-shown { display: flex; }
.field-hint { margin-top: .35rem; font-size: .8125rem; color: var(--ink-muted); }

/* Prices & numeric data use tabular figures so columns don't jitter */
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: .85rem 1.4rem;
  background: var(--sea-900);
  color: #fff;
  border-radius: var(--radius);
  transition: top 200ms var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.hairline { border-top: 1px solid var(--sand-200); }

/* ==========================================================================
   REDUCED MOTION
   Kill drift/zoom/reveal/parallax. Content stays fully visible and usable;
   the slideshow still advances, it just crossfades instead of moving.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  /* Keep the crossfade readable rather than snapping */
  .hero-slide { transition: opacity 400ms linear !important; }
  .hero-slides {
    animation: none !important;
    transform: scale(1.02) !important;
  }
  .hero-slide img { transform: none !important; }

  .reveal { opacity: 1 !important; transform: none !important; }
  .btn:hover, .room-card:hover { transform: none !important; }
}
