/* ParkPulse public website — "Trailhead" visual identity, ported from
   lib/theme/app_theme.dart (same hex values, light AND dark, no invented
   colors). No per-visitor theme toggle exists on a plain server-rendered
   site, so prefers-color-scheme is the only mechanism — see the media
   query at the bottom. */

:root {
  --bg: #FAF8F2;
  --surface: #F4F1E8;
  --surface-tint: #EEF0E2;
  --border: #E2DDC9;
  --ink: #20321E;
  --ink-soft: #6B6A55;
  --accent: #3D5A3A;
  --on-accent: #FFFFFF;

  --wait-low: #3D5A3A;
  --wait-mid: #96661C;
  --wait-high: #A4402E;
  --wait-off: #A9A690;
  --error: #A4402E;
  --ok-bg: #E4F1E0;
  --ok-ink: #2B5D2A;
  --error-bg: #FBEEDB;

  --font-display: 'Fjalla One', 'Arial Narrow', sans-serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 1080px;
  --content-width: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17160F;
    --surface: #1C1B13;
    --surface-tint: #241F17;
    --border: #332F24;
    --ink: #EFECE2;
    --ink-soft: #B3AE9E;
    --accent: #4FB89B;
    --on-accent: #0B241D;

    --wait-low: #6FCBA8;
    --wait-mid: #D9A441;
    --wait-high: #E2695A;
    --wait-off: #6B6A55;
    --error: #E2695A;
    --ok-bg: #1E2E1C;
    --ok-ink: #8FDC9E;
    --error-bg: #2E2515;
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

/* Sticky footer: body is a full-viewport-height flex column of exactly
   header/main/footer, main grows to fill any leftover space so the footer
   sits at the bottom on short pages, but scrolls after the content like
   normal (never fixed in place) once content is taller than the viewport. */
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .2px;
  color: var(--ink);
  margin: 0 0 .4em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--ink-soft); font-size: .92rem; }

.tag {
  display: inline-block;
  font-size: .78rem;
  color: var(--ink-soft);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  margin: 0 0 .6em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  font-size: .95rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.active { color: var(--accent); }

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

.site-main {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 64px;
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
  color: var(--ink-soft);
  font-size: .85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer-inner nav { display: flex; gap: 16px; }
.site-footer-inner nav a { color: var(--ink-soft); }

.section-title { margin-top: 0; }

.page-header { max-width: var(--content-width); margin-bottom: 28px; }
.eyebrow { margin-bottom: 6px; }

.notice-block {
  max-width: var(--content-width);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

/* ---------- Hero ---------- */

.hero { max-width: var(--content-width); margin-bottom: 48px; }
.hero-eyebrow {
  font-family: var(--font-mono);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-size: .8rem;
  margin-bottom: 6px;
}
.hero h1 { font-size: 2.4rem; margin-bottom: .5em; }
.hero-lede { color: var(--ink-soft); font-size: 1.05rem; max-width: 620px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

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

.button {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
}
.button:hover { text-decoration: none; }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { opacity: .92; }
.button-outline { background: transparent; color: var(--ink); border-color: var(--border); }
.button-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Cards / grids ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--ink);
  overflow: hidden;
}
.card:hover { border-color: var(--accent); text-decoration: none; }

.park-card h3 { margin-bottom: .2em; }
.card-link { margin-top: auto; padding-top: 10px; font-size: .88rem; color: var(--accent); font-weight: 600; }

.ride-card { padding: 0; }
.ride-card-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: var(--surface);
}
.ride-card-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: var(--ink-soft);
}
.ride-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 2px; }
.ride-card-body h3 { margin-bottom: 0; font-size: 1.05rem; }
.ride-card-body .wait-badge { align-self: flex-start; margin-top: 8px; }

/* ---------- Wait badges ---------- */

.wait-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.wait-badge.wait-low  { color: var(--wait-low); }
.wait-badge.wait-mid  { color: var(--wait-mid); }
.wait-badge.wait-high { color: var(--wait-high); }
.wait-badge.wait-off  { color: var(--wait-off); }

/* ---------- Park attraction list ---------- */

.attraction-list { list-style: none; margin: 0; padding: 0; }
.attraction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
}
.attraction-row:last-child { border-bottom: none; }
.attraction-name { color: var(--ink); font-weight: 500; }
span.attraction-name { color: var(--ink); }

/* ---------- Ride detail ---------- */

.ride-detail { max-width: var(--content-width); }

.current-wait {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 20px;
}
.current-wait-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
}
.current-wait-value { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 500; }
.current-wait.wait-low  .current-wait-value { color: var(--wait-low); }
.current-wait.wait-mid  .current-wait-value { color: var(--wait-mid); }
.current-wait.wait-high .current-wait-value { color: var(--wait-high); }
.current-wait.wait-off  .current-wait-value { color: var(--wait-off); }

.gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}
.gallery img {
  height: 220px;
  width: 300px;
  flex: none;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-tint);
}

.stats-list, .requirements, .description { margin-top: 28px; }
.stats-list dl { margin: 0; }
.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.stats-row:last-child { border-bottom: none; }
.stats-row dt { color: var(--ink-soft); }
.stats-row dd { margin: 0; font-family: var(--font-mono); text-align: right; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.req-badge {
  display: inline-block;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .85rem;
}
.requirements-note { margin-top: 10px; }

.correction-link { margin-top: 32px; }

/* ---------- Search form ---------- */

.search-form { display: flex; gap: 10px; max-width: 520px; margin: 18px 0; flex-wrap: wrap; }
.search-form input[type=text] {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .95rem;
}
.search-form input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Messages ---------- */

.message { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-size: .92rem; }
.message-error { background: var(--error-bg); color: var(--error); }
.message-ok { background: var(--ok-bg); color: var(--ok-ink); }
.message-notice { background: var(--surface-tint); border: 1px solid var(--border); color: var(--ink-soft); }

/* ---------- Forms (submit.php) ---------- */

.form-grid { max-width: var(--content-width); }
fieldset {
  border: none;
  padding: 0;
  margin: 0 0 28px;
}
fieldset legend {
  font-family: var(--font-display);
  font-size: 1.15rem;
  padding: 0 0 12px;
  width: 100%;
}
.field { margin-bottom: 16px; position: relative; }
.field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input[type=text],
.field input[type=number],
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .95rem;
}
.field textarea { resize: vertical; min-height: 70px; font-family: var(--font-body); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

.autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
}
.autocomplete-item { padding: 9px 12px; font-size: .9rem; cursor: pointer; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--surface-tint); }
.autocomplete-item .tracked-tag { color: var(--ink-soft); font-size: .78rem; margin-left: 6px; }

.photo-input {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--surface);
}

.submit-actions { margin-top: 8px; }
.submit-hint { color: var(--ink-soft); font-size: .85rem; text-align: center; margin-top: 10px; }

.done-block {
  max-width: var(--content-width);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.done-block .done-icon { font-size: 2.4rem; margin-bottom: 6px; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .site-header-inner { flex-direction: column; align-items: flex-start; }
  .stats-row { flex-direction: column; gap: 2px; }
  .stats-row dd { text-align: left; }
  .gallery img { width: 240px; height: 180px; }
}
