/* ==========================================================
   Shared styles — loaded on every page.
   Site-specific/page-specific rules live in css/<page>.css.
   ========================================================== */

:root {
  --cream: #F5F0E8;
  --cream-muted: rgba(245, 240, 232, 0.62);
  --night: #0B1626;      /* deep navy, near-black */
  --amber: #D9A441;      /* golden-hour accent */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--cream);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ---------- Site nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(rgba(11, 22, 38, 0.85), rgba(11, 22, 38, 0));
}
.nav-mark {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-decoration: none;
}
.site-nav a:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}
.nav-back {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(245, 240, 232, 0.62);
  transition: color 0.3s ease;
}
.nav-back:hover { color: var(--amber); }

/* ---------- Gallery page header (cycling/running/hiking) ---------- */
.page-head {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 150px 24px 30px;
}
.page-head::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 120px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0 64 L160 28 L300 56 L470 16 L640 62 L800 34 L980 66 L1150 24 L1320 54 L1440 40' fill='none' stroke='%23F5F0E8' stroke-opacity='0.06' stroke-width='1.5'/><path d='M0 74 L200 48 L380 70 L560 40 L750 72 L940 50 L1130 71 L1310 52 L1440 66' fill='none' stroke='%23D9A441' stroke-opacity='0.1' stroke-width='1.5'/></svg>") bottom center / 100% 80px no-repeat;
  pointer-events: none;
}
.eyebrow {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(217, 164, 65, 0.78);
}
.page-head h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: 0.005em;
  margin-top: 14px;
}
.lede {
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  color: var(--cream-muted);
  margin-top: 18px;
  max-width: 560px;
}

/* ---------- Featured expeditions (cycling) ---------- */
.featured {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 0;
}
.featured-eyebrow {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(217, 164, 65, 0.78);
  margin-bottom: 20px;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.expedition {
  position: relative; /* anchors the hover particle-trail canvas */
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(245, 240, 232, 0.12);
  transition: border-color 0.35s ease;
}
/* hover comet trail (js/card-trail.js) — amber light tracing the card border */
.expedition-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* hover/focus affordances are scoped to the anchor form: a card that isn't a
   link yet (Savannah–LA) shouldn't glow as though it goes somewhere */
a.expedition:hover { border-color: rgba(217, 164, 65, 0.55); }
@media (prefers-reduced-motion: reduce) {
  a.expedition:hover {
    box-shadow: 0 0 0 1px rgba(217, 164, 65, 0.55), 0 0 18px rgba(217, 164, 65, 0.32);
  }
}
a.expedition:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}
.ph-wide { aspect-ratio: 16 / 9; }
.expedition-cap { padding: 22px 24px 24px; }
.expedition h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0.01em;
}
.expedition .meta {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-muted);
  margin-top: 10px;
}

/* ---------- Gallery grid + event cards ---------- */
.gallery {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.event {
  border: 1px solid rgba(245, 240, 232, 0.12);
  transition: border-color 0.35s ease;
}
.event:hover { border-color: rgba(217, 164, 65, 0.45); }
.ph {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300' preserveAspectRatio='none'><path d='M0 210 L70 140 L130 190 L210 110 L290 205 L340 160 L400 200' fill='none' stroke='%23F5F0E8' stroke-opacity='0.08' stroke-width='1.5'/></svg>") center / cover no-repeat,
    linear-gradient(160deg, #0e1a2d, #0a1424);
  color: rgba(245, 240, 232, 0.32);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
}
.event img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.event figcaption { padding: 18px 20px 20px; }
.event h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.event .meta {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--cream-muted);
  margin-top: 8px;
  line-height: 1.6;
}

/* ---------- Gallery thumbnail (photo present) ----------
   gallery.js swaps the .ph placeholder for a <button.event-thumb> when an
   event has photos. The existing .event img rule handles the 4/3 crop. */
.event-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  position: relative;
}
.event-thumb:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}
.event-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(11, 22, 38, 0.72);
  border: 1px solid rgba(245, 240, 232, 0.2);
  padding: 4px 8px;
}
@media (hover: hover) {
  .event-thumb img { transition: opacity 0.35s ease; }
  .event-thumb:hover img { opacity: 0.82; }
}

/* ---------- Lightbox (js/lightbox.js) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vmin;
}
.lightbox[hidden] { display: none; }
.lightbox-open { overflow: hidden; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 11, 20, 0.94);
}
.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--cream);
  background: var(--night);
}
.lightbox-cap {
  display: flex;
  gap: 14px;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--cream-muted);
  text-align: center;
}
.lightbox-counter {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(217, 164, 65, 0.85);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  font-size: 26px;
  line-height: 1;
  background: none;
  border: 1px solid rgba(217, 164, 65, 0.5);
  color: var(--amber);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.lightbox-close:hover {
  background: rgba(217, 164, 65, 0.12);
  border-color: var(--amber);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  font-size: 30px;
  line-height: 1;
  background: none;
  border: 1px solid rgba(245, 240, 232, 0.28);
  color: var(--cream);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.lightbox-nav:hover { border-color: var(--amber); color: var(--amber); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-nav[hidden] { display: none; }
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox { opacity: 0; transition: opacity 0.28s ease; }
  .lightbox.is-in { opacity: 1; }
}

/* ---------- Colophon ----------
   Shared typography here; layout differs by context:
   - on index.html, .colophon sits inside <footer class="contact"> (see css/index.css)
   - on gallery pages, it's a direct child of <body> — scoped via the
     child combinator below so the two contexts can't leak into each other. */
.colophon {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.28);
}
body > .colophon {
  padding: 0 24px 48px;
  text-align: center;
}

/* ---------- Media queries ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 768px) {
  .hero-name { font-size: 44px; }
  .scroll-cue { bottom: 22px; }
  .scroll-cue i { height: 34px; }
  .section { padding: 90px 24px; }
  .hobby-grid { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .contact { padding: 90px 24px 48px; }
  .page-head { padding-top: 120px; }
  .gallery-page .site-nav { padding: 16px 20px; }
}

@media (hover: none) {
  .contact-link:active { transform: scale(0.97); }
}
