/* ==========================================================================
   Bryce Canyon Milky Way — "Night Field Notebook"
   Playfair Display (headings) + Lora (body). Light paper base, dark photo chapters.
   §4.3 spec: paper #f5f0e8 / photo chapters alternating / Lora italic annotations.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
  --bg: #f5f0e8;
  --surface: #ece5d5;
  --text: #2b2318;
  --muted: #6e5c42;
  --accent: #1a3a5c;       /* ink blue — links */
  --accent-2: #d97706;     /* amber — CTAs */
  --accent-2-text: #1a1207;
  --border: #c9b89a;
  --white: #ffffff;

  --col: 760px;
  --wide: 1100px;

  /* 4px base spacing */
  --sp-xs: 0.5rem;  /* 8px  */
  --sp-sm: 1rem;    /* 16px */
  --sp-md: 1.5rem;  /* 24px */
  --sp-lg: 3rem;    /* 48px */
  --sp-xl: 6rem;    /* 96px */
  --sp-2xl: 9rem;   /* 144px */
}

/* ---------- Reset & base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lora', Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-top: 0;
}

h1 {
  /* clamp: 2rem at small → 4.5rem (≥4:1 vs 18px body) at desktop per §2 */
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  font-style: italic;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  /* dashed amber underline per spec */
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-color: #d97706;
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
}

/* Hero H1: can be a bit larger due to full-bleed photo context */
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
}

/* Inner page paper H1: constrain so it wraps ≤3 lines at 375px */
.chapter h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.9rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

p, ul, ol { margin: 0 0 1.1rem; }
li { margin-bottom: 0.4rem; }

/* body column max 65ch */
p, ul, ol, .lede, .note {
  max-width: 65ch;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover { color: #0f2540; text-decoration-color: var(--accent-2); }

strong { font-weight: 600; color: var(--text); }
em { font-style: italic; }

.lede {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-style: italic;
  line-height: 1.65;
  color: var(--muted);
  max-width: 65ch;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: 0.85rem;
  font-style: italic;
}

/* ---------- Layout ---------- */

/* Narrow paper column */
.wrap {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Wide wrap for header / footer */
.wrap-wide {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

main { padding: var(--sp-xl) 0; }

/* alternating gap rhythm per §2 */
section {
  margin-bottom: var(--sp-xl);
  position: relative;
}

section:nth-of-type(even) {
  margin-bottom: var(--sp-lg);
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(245, 240, 232, 0.96);
  backdrop-filter: blur(6px);
}

.site-header .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  gap: 1rem;
}

.brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand span { color: var(--accent-2); }

/* Hamburger toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  align-items: center;
}

.nav-toggle:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.88rem;
  font-weight: 400;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.15rem 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-underline-offset: 3px;
}

/* Header booking link */
.nav-cta {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2-text);
  background: var(--accent-2);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-cta:hover {
  background: #b85f00;
  color: var(--white);
}

/* ---------- Hero (full-bleed photograph, Shelby Stock) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--sp-xl);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

/* gradient only bottom 60%, max 0.85 at edge per spec */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 38%,
    rgba(20, 10, 5, 0.55) 65%,
    rgba(15, 8, 2, 0.85) 100%
  );
}

.hero .wrap {
  position: relative;
  z-index: 2;
  padding-bottom: 0;
}

/* White H1 in hero only — override dark text */
.hero h1 {
  color: var(--white);
  text-decoration-color: var(--accent-2);
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  max-width: 18ch;
}

.hero .lede {
  color: rgba(255,255,255,0.88);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  max-width: 55ch;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.photo-credit {
  position: absolute;
  right: 1rem;
  bottom: 0.6rem;
  z-index: 3;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  font-style: italic;
}

/* ---------- Paper chapter sections ---------- */

.chapter {
  background: var(--bg);
  padding: var(--sp-xl) 0;
}

/* ---------- Dark photo chapters ---------- */

.chapter-photo {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0;
}

.chapter-photo img {
  display: block;
  width: 100%;
  height: 55vh;
  min-height: 320px;
  object-fit: cover;
  object-position: center;
}

.chapter-photo figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(15, 8, 2, 0.72));
  color: rgba(255, 255, 255, 0.82);
  font-family: 'Lora', Georgia, serif;
  font-size: 0.82rem;
  font-style: italic;
  padding: 2rem 1.5rem 1rem;
  text-align: right;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent-2);
  color: var(--accent-2-text);
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 28px;
  min-height: 44px;
  border-radius: 2px;
  border: none;
  transition: background 0.18s ease-out;
}

.btn:hover {
  background: #b85f00;
  color: var(--white);
}

.btn-ink {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 28px;
  min-height: 44px;
  border-radius: 2px;
  border: none;
  transition: background 0.18s ease-out;
}

.btn-ink:hover {
  background: #0f2540;
  color: var(--white);
}

/* ---------- Full-bleed CTA band ---------- */

.cta-band {
  width: 100%;
  background: var(--accent-2);
  padding: var(--sp-xl) 1.5rem;
  text-align: center;
}

.cta-band h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  color: var(--white);
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  margin-bottom: 0.75rem;
  text-decoration: none;
}

.cta-band p {
  color: rgba(255,255,255,0.88);
  font-family: 'Lora', Georgia, serif;
  font-size: 1.05rem;
  margin: 0 auto 1.5rem;
  max-width: 55ch;
}

/* Dark square button inside amber band */
.cta-band .btn-dark {
  display: inline-block;
  background: var(--accent-2-text);
  color: var(--white);
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 32px;
  min-height: 44px;
  border-radius: 2px;
  transition: background 0.18s ease-out;
}

.cta-band .btn-dark:hover {
  background: #000;
  color: var(--white);
}

/* Inline mid-page CTA box */
.cta-box {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--sp-md) var(--sp-lg);
  border-radius: 2px;
  margin: var(--sp-lg) 0;
}

.cta-box h3 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.2rem;
}

.cta-box p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ---------- Margin annotations (signature detail) ---------- */

/*
  These are 180px-wide blocks rotated -1.5deg, Lora italic, ink-blue,
  3px solid left rule. Positioned in the margin on large screens.
  Hidden below 600px per spec.
*/

.page-body {
  position: relative;
}

.margin-note {
  display: none; /* hidden < 600px, shown via media query */
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  width: 160px;
  transform: rotate(-1.5deg);
}

@media (min-width: 600px) {
  .margin-note {
    display: block;
  }
}

@media (min-width: 1080px) {
  /* Float margin notes to the right of the column */
  .margin-note {
    position: absolute;
    right: -200px;
    width: 172px;
  }
}

/* ---------- Photo figures (inside paper chapters) ---------- */

.site-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 1px;
  object-fit: cover;
}

figure { margin: 1.75rem 0; }

figcaption {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.5;
  max-width: 65ch;
}

/* Full-bleed photo break inside wrap — breaks out of column */
.photo-divider {
  width: 100vw;
  margin: var(--sp-xl) 0 var(--sp-xl) calc(50% - 50vw);
}

.photo-divider img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

/* ---------- Cards (season, viewpoints) ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.5rem;
  margin: 0 0 1.1rem;
}

.card h3 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.05rem;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .card-grid .card { margin-bottom: 0; }
}

/* ---------- Moon phase cards (signature component) ---------- */

.moon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (min-width: 640px) {
  .moon-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.moon-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.25rem 1rem;
  text-align: center;
}

/* Unicode moon glyph as card header */
.moon-glyph {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 2.5rem;
  line-height: 1.1;
  color: var(--text);
  display: block;
  margin-bottom: 0.6rem;
}

.moon-card h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.moon-card p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin: 1.25rem 0; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.9rem;
  line-height: 1.55;
}

caption {
  caption-side: bottom;
  text-align: left;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 0.6rem;
  max-width: 65ch;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
}

tbody tr:nth-child(odd) { background: rgba(201, 184, 154, 0.1); }

/* ---------- Breadcrumb ---------- */

.breadcrumb {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 2rem;
  font-style: italic;
}

.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- FAQ ---------- */

.faq-list { margin-top: 1.5rem; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 0;
}

/* Lora 600 question, — glyph toggle, #c9b89a separators per spec */
.faq-item summary {
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  line-height: 1.4;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-toggle {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform 0.18s ease-out;
  font-style: normal;
}

.faq-item[open] .faq-toggle {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 0 1.25rem;
  color: var(--text);
}

.faq-answer p { margin-bottom: 0.75rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 2px solid var(--border);
  background: var(--surface);
  padding: 4rem 0 5rem;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .wrap-wide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .site-footer .wrap-wide {
    grid-template-columns: 1.3fr 1fr 1fr;
  }
}

.site-footer h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.75rem;
  text-decoration: none;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li { margin-bottom: 0.45rem; }

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.footer-logo {
  display: block;
  width: 72px;
  height: auto;
  margin-bottom: 1rem;
}

.footnote {
  font-size: 0.78rem;
  color: #9c8870;
  margin: 0.75rem 0 0;
  font-style: italic;
}

.operated-by {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

/* ---------- Mobile overrides ---------- */

@media (max-width: 640px) {
  main { padding: 3rem 0; }

  .hero { min-height: 80vh; padding-bottom: 3rem; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
  }

  .site-nav.is-open { display: flex; }

  .site-header .wrap-wide { flex-wrap: wrap; }

  .site-nav a {
    padding: 0.5rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .btn, .btn-ink {
    display: block;
    width: 100%;
    text-align: center;
  }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn,
  .hero-actions .btn-ink { width: 100%; text-align: center; }

  .cta-box { padding: 1.25rem 1rem; }

  .chapter-photo img { height: 40vh; }

  .margin-note { display: none !important; }
}

/* ---------- Desktop / wide ---------- */

@media (min-width: 720px) {
  body { font-size: 18px; }
  main { padding: 5rem 0; }
  .chapter-photo img { height: 60vh; }
}

/* ---------- Motion safety ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Scroll-driven reveal (optional, supported only) ---------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      opacity: 0;
      transform: translateY(16px);
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 25%;
    }

    @keyframes reveal-up {
      to { opacity: 1; transform: none; }
    }
  }
}
