/* ============================================
   Life's A Trip Foundation — Shared Styles
   Brand: Trip Red / Ink Black / Paper White / Warm Grey
   Type: Archivo (display) + Inter (body)
   ============================================ */

:root {
  --trip-red: #D42027;
  --trip-red-dark: #A9181D;
  --ink-black: #141414;
  --paper-white: #FAF8F5;
  --warm-grey: #8A8580;
  --warm-grey-light: #E9E5DF;

  /* Accessible text variants — same brand hues, adjusted lightness only,
     used wherever these colours render as small/normal text rather than
     backgrounds or borders, to reach WCAG AA (4.5:1).
     Verified via relative-luminance calculation, not estimated:
       --trip-red-a11y-dark  vs --ink-black:        4.71:1
       --trip-red-a11y-light vs --warm-grey-light:   4.77:1  (vs --paper-white: 5.64:1)
       --warm-grey-a11y      vs --warm-grey-light:   4.73:1  (vs --paper-white: 5.59:1) */
  --trip-red-a11y-dark: #E5484E;
  --trip-red-a11y-light: #C31C23;
  --warm-grey-a11y: #686360;

  --font-display: 'Archivo', Arial, sans-serif;
  --font-body: 'Inter', Arial, sans-serif;

  --max-width: 1160px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper-white);
  color: var(--ink-black);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Focus visibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ink-black);
  outline-offset: 3px;
}
/* On dark (Ink Black) backgrounds — hero sections and the footer — an
   ink-black outline would be invisible, so swap to paper-white. */
.hero a:focus-visible,
.hero button:focus-visible,
.site-footer a:focus-visible,
.site-footer button:focus-visible {
  outline-color: var(--paper-white);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ---------- Accessibility utilities ---------- */
.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;
  top: -60px;
  left: 12px;
  z-index: 1000;
  background: var(--ink-black);
  color: var(--paper-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: var(--radius);
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

/* Respect reduced-motion preference: only allow the button lift and other
   transitions when the user has not asked to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
  .skip-link {
    transition: top 0.15s ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn,
  .skip-link,
  html {
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .btn:hover {
    transform: none !important;
  }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--trip-red-a11y-light);
  margin-bottom: 0.9em;
  display: inline-block;
}
/* On the dark (Ink Black) hero background, the light-context red fails
   contrast — swap to the lighter, dark-context variant. */
.hero .eyebrow {
  color: var(--trip-red-a11y-dark);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 84px 0; }
@media (max-width: 640px) {
  section { padding: 56px 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 16px 30px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--trip-red);
  color: var(--paper-white);
}
.btn-primary:hover { background: var(--trip-red-dark); }

.btn-dark {
  background: var(--ink-black);
  color: var(--paper-white);
}
.btn-dark:hover { background: #000; }

.btn-outline {
  background: transparent;
  border-color: currentColor;
  color: var(--ink-black);
}
.btn-outline:hover { background: var(--ink-black); color: var(--paper-white); }

.btn-outline-light {
  background: transparent;
  border-color: var(--paper-white);
  color: var(--paper-white);
}
.btn-outline-light:hover { background: var(--paper-white); color: var(--ink-black); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper-white);
  border-bottom: 1px solid var(--warm-grey-light);
}

.nav-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark img { height: 48px; width: auto; }

/* Light backing chip for logos placed on dark (Ink Black) backgrounds —
   both the retro logo and wordmark include black linework that disappears
   without it. */
.logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-white);
  border-radius: var(--radius);
  padding: 14px 22px;
}
.logo-chip img { display: block; }

.hero-logo-panel {
  width: 100%;
  background: var(--paper-white);
  border-radius: 0;
  display: flex;
  justify-content: center;
  padding: 20px 0;
  margin-bottom: 44px;
}
.hero-logo-panel img {
  height: 46px;
  width: auto;
}
.hero-inner.text-center { max-width: 780px; margin: 0 auto; text-align: center; }

.footer-logo .logo-chip {
  padding: 12px 20px;
  margin-bottom: 14px;
}
.footer-logo .logo-chip img { height: 30px; width: auto; margin-bottom: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-black);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { border-color: var(--trip-red); }

.nav-links .nav-donate {
  background: var(--trip-red);
  color: var(--paper-white);
  padding: 10px 20px;
  border-radius: var(--radius);
  border-bottom: none;
}
.nav-links .nav-donate:hover { background: var(--trip-red-dark); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--ink-black);
  border-radius: 2px;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper-white);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 24px 20px;
    border-bottom: 1px solid var(--warm-grey-light);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; width: 100%; padding: 10px 0; }
  .nav-links .nav-donate { display: inline-block; margin-top: 6px; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--ink-black);
  color: var(--paper-white);
  padding: 100px 0 90px;
}
.hero-inner {
  max-width: 780px;
}
.hero p.lede {
  font-size: 1.2rem;
  color: var(--warm-grey-light);
  max-width: 560px;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ---------- Route line signature motif ---------- */
.route-line {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 48px 0;
  padding: 6px 4px;
  overflow-x: auto;
}
.route-line .stop {
  flex: 1 1 0;
  min-width: 150px;
  text-align: center;
  position: relative;
  padding-top: 26px;
}
.route-line .stop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--trip-red);
  border: 3px solid var(--paper-white);
  box-shadow: 0 0 0 2px var(--trip-red);
}
.route-line .stop::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 2px;
  background-image: linear-gradient(to right, var(--warm-grey) 50%, transparent 50%);
  background-size: 12px 2px;
  z-index: -1;
}
.route-line .stop:first-child::after { left: 50%; }
.route-line .stop:last-child::after { right: 50%; }
.route-line .stop .stat-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.1rem;
  color: var(--trip-red);
  display: block;
}
.route-line .stop .stat-label {
  font-size: 0.85rem;
  color: var(--warm-grey-a11y);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.route-line.on-dark .stat-label { color: var(--warm-grey-light); }
.route-line.on-dark .stop::after { background-image: linear-gradient(to right, var(--warm-grey) 50%, transparent 50%); }

@media (max-width: 700px) {
  .route-line {
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
    gap: 22px;
  }
  .route-line .stop {
    min-width: 0;
    text-align: left;
    padding-top: 0;
    padding-left: 26px;
  }
  .route-line .stop::before {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }
  .route-line .stop::after {
    content: none;
  }
}

/* ---------- Generic section helpers ---------- */
.section-alt { background: var(--warm-grey-light); }
.section-dark { background: var(--ink-black); color: var(--paper-white); }
.section-dark .warm-grey-text { color: var(--warm-grey-light); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
/* Tablet: two columns for grid-3 instead of collapsing straight to one —
   on the Events page especially, a single column made the page ~8,000px tall. */
@media (max-width: 899px) and (min-width: 640px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 639px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper-white);
  border: 1px solid var(--warm-grey-light);
  border-radius: var(--radius);
  padding: 30px;
}
.section-dark .card {
  background: #1f1f1f;
  border-color: #333;
}

/* Photo placeholder — brand-pattern block used until family-approved photos are supplied */
.photo-placeholder {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, var(--trip-red) 0px, var(--trip-red) 2px, transparent 2px, transparent 18px),
    var(--ink-black);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-grey-light);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 20px;
}
.photo-placeholder span {
  background: rgba(20,20,20,0.75);
  padding: 8px 14px;
  border-radius: 4px;
}

.photo-real {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
}
.photo-real img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-real.portrait {
  aspect-ratio: 3 / 4;
}

.pull-quote {
  border-left: 3px solid var(--trip-red);
  padding: 4px 0 4px 24px;
  margin: 28px 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-black);
}
.section-dark .pull-quote,
.hero .pull-quote {
  color: var(--paper-white);
  border-left-color: var(--trip-red);
}
.photo-caption {
  font-size: 0.82rem;
  color: var(--warm-grey-a11y);
  margin-top: 10px;
}
/* The disclosure line reused in the footer sits on Ink Black, where the
   original --warm-grey already clears 4.5:1 (5.04:1) — the darker
   accessible variant above is tuned for light backgrounds and would fail here. */
.site-footer .photo-caption {
  color: var(--warm-grey);
}

.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--trip-red);
  color: var(--paper-white);
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--trip-red);
  color: var(--paper-white);
  text-align: center;
}
.cta-band h2 { color: var(--paper-white); }

/* ---------- Forms ---------- */
form.stack { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input, .field textarea, .field select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 14px;
  border: 1.5px solid var(--warm-grey);
  border-radius: var(--radius);
  background: var(--paper-white);
  color: var(--ink-black);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 3px solid var(--trip-red);
  outline-offset: 1px;
  border-color: var(--trip-red);
}
.form-note { font-size: 0.85rem; color: var(--warm-grey-a11y); }
.form-status { font-weight: 700; margin-top: 10px; }
.form-status.success { color: #1a7a34; }
.form-status.error { color: var(--trip-red); }

/* ---------- Disclosure box ---------- */
.disclosure {
  border-left: 4px solid var(--warm-grey);
  background: var(--warm-grey-light);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.92rem;
  color: var(--ink-black);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-black);
  color: var(--warm-grey-light);
  padding: 60px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-logo { text-align: center; }
  .footer-logo p { text-align: center; margin-left: auto; margin-right: auto; }
}
.footer-grid .footer-heading {
  font-family: var(--font-display);
  color: var(--paper-white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a:hover { color: var(--trip-red-a11y-dark); }
.footer-bottom {
  border-top: 1px solid #2a2a2a;
  padding-top: 24px;
  font-size: 0.82rem;
  color: var(--warm-grey);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-logo img { height: 34px; margin-bottom: 14px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.narrow { max-width: 640px; }
