/* ============================================================
   Trail Conditions — Shared Stylesheet
   Applies to: index.html, /trail/dte/, /trail/poto/,
               /contact/, /admin/ and all future pages.
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --forest:      #1a3d2b;
  --green:       #2d8c4e;
  --green-lt:    #e6f4ec;
  --amber:       #d4850a;
  --amber-lt:    #fff8e6;
  --orange:      #c06020;
  --orange-lt:   #fdf0e6;
  --red:         #c0392b;
  --blue:        #1a6b9a;
  --blue-lt:     #e8f4fb;
  --dirt:        #f5f0e8;
  --override-bg: #1a3d2b;
  --text:        #1a1a1a;
  --muted:       #5a5a5a;
  --border:      rgba(0,0,0,0.10);
}

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

/* ── Base ───────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dirt);
  color: var(--text);
  padding: 1.5rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────── */
header { margin-bottom: 2rem; }

header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  color: var(--forest);
  margin-bottom: 0.25rem;
}

header p {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Trail grid ──────────────────────────────────────────────── */
.trail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .trail-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Trail card ──────────────────────────────────────────────── */
.trail-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.trail-card.primary {
  border-width: 2px;
  border-color: var(--forest);
}

/* ── Card header ─────────────────────────────────────────────── */
.card-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--forest);
}

.card-header .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Status banner ───────────────────────────────────────────── */
.status-banner {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-open    { background: var(--green-lt);  color: var(--green); }
.status-caution { background: var(--amber-lt);  color: var(--amber); }
.status-wet     { background: var(--orange-lt); color: var(--orange); }
.status-rain    { background: var(--blue-lt);   color: var(--blue); }
.status-loading { background: #f0f0f0;          color: var(--muted); }

.dot-open    { background: var(--green); }
.dot-caution { background: var(--amber); }
.dot-wet     { background: var(--orange); }
.dot-rain    { background: var(--blue); }
.dot-loading { background: #ccc; }

/* ── Card body ───────────────────────────────────────────────── */
.card-body { padding: 0.75rem 1.25rem 1rem; }

/* ── Stat rows ───────────────────────────────────────────────── */
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child { border-bottom: none; }

.stat-label { color: var(--muted); }
.stat-value { font-weight: 500; color: var(--text); }

/* ── Rain bar mini-chart ─────────────────────────────────────── */
.rain-bar-wrap  { margin-top: 0.75rem; }

.rain-bar-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.rain-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
}

.rain-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
}

.rain-bar-fill {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: height 0.4s ease;
  min-height: 2px;
}

.rain-bar-day { font-size: 9px; color: var(--muted); }

/* ── Note box ────────────────────────────────────────────────── */
.note-box {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Forecast strip ──────────────────────────────────────────── */
.forecast-strip {
  display: flex;
  gap: 4px;
  margin-top: 0.75rem;
}

.fc-day {
  flex: 1;
  background: var(--dirt);
  border-radius: 6px;
  padding: 4px 2px;
  text-align: center;
}

.fc-day .fc-label { font-size: 9px;  color: var(--muted); }
.fc-day .fc-mm    { font-size: 11px; font-weight: 500; color: var(--text); }
.fc-day .fc-prob  { font-size: 9px;  color: var(--blue); }
.fc-day.has-rain  { background: var(--blue-lt); }

/* ── Misc ────────────────────────────────────────────────────── */
.coords {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

.error-state {
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  color: var(--red);
  background: #fef5f5;
}

/* ── Dashboard controls ──────────────────────────────────────── */
.all-trails-toggle { margin-bottom: 1.25rem; }

.all-trails-toggle button {
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}

.all-trails-toggle button:hover { opacity: 0.88; }

#all-trails { display: none; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.25rem 0 0.6rem;
}

.refresh-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1.25rem;
  text-align: center;
}

/* ── Ride window summary strip ───────────────────────────────── */
.ride-window-summary {
  padding: 0.55rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.ride-window-summary.good { background: var(--green-lt); color: #1a5c30; }
.ride-window-summary.warn { background: var(--amber-lt); color: #7a5000; }
.ride-window-summary.bad  { background: var(--blue-lt);  color: #0f4060; }

/* ── Drying conditions note ──────────────────────────────────── */
.drying-note {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.drying-note.warn { color: #7a5000; }
.drying-note.good { color: #1a5c30; }

/* ── Detail page link ────────────────────────────────────────── */
.detail-link-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.detail-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--forest);
  text-decoration: none;
}

.detail-link:hover { text-decoration: underline; }

/* ── Animation ───────────────────────────────────────────────── */
.pulse { animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── NWS Alert Banner ────────────────────────────────────────── */
.nws-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-left: 4px solid var(--banner-border);
  background: var(--banner-bg);
  color: var(--banner-text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 12px;
  border-radius: 0 6px 6px 0;
  position: relative;
}

.nws-banner__icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.nws-banner__body {
  flex: 1;
  min-width: 0;
}

.nws-banner__title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.nws-banner__headline {
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nws-banner__meta {
  margin-top: 4px;
  font-size: 0.78rem;
  opacity: 0.7;
}

.nws-banner__dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  font-size: 1.1rem;
  padding: 0 0 0 8px;
  flex-shrink: 0;
  line-height: 1;
}

.nws-banner__dismiss:hover { opacity: 1; }

/* Stack multiple alerts */
#nws-alert-banner .nws-banner + .nws-banner { margin-top: -4px; }
