/* =====================================================================
   Trail Life TX-1333 — High Adventure section
   Landing tile grid + trip-page conditions modules, maps, packing lists.
   Loaded after announcements.css (page shell) on every /high-adventure page.
   ===================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ha-intro {
  max-width: 640px;
  margin: 0 auto var(--space-8);
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg2);
}

/* ---------- Landing tiles -------------------------------------------- */
.ha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}
.ha-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.ha-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
}
.ha-tile__photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.ha-tile__placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--tl-forest), var(--tl-leaf));
  color: rgba(255, 255, 255, 0.85);
}
.ha-tile__placeholder svg { width: 56px; height: 56px; }
.ha-tile__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-6);
  flex: 1;
}
.ha-tile__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.ha-tile__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-bold);
  font-size: var(--fs-h5);
  line-height: var(--lh-snug);
  color: var(--fg1);
  margin: 0;
}
.ha-tile .ha-badge { margin-top: auto; align-self: flex-start; }

/* ---------- Status badges -------------------------------------------- */
/* Icon + text always; color is never the only signal. */
.ha-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: var(--fs-caption);
  line-height: 1.3;
  padding: 5px 12px 5px 9px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
}
.ha-badge svg { flex: none; width: 15px; height: 15px; }
.ha-badge--green   { background: var(--success-bg); color: var(--tl-forest); border-color: var(--tl-leaf); }
.ha-badge--yellow  { background: var(--warning-bg); color: #7a4a00; border-color: var(--tl-orange); }
.ha-badge--red     { background: var(--danger-bg);  color: var(--tl-deep-red); border-color: var(--tl-red); }
.ha-badge--unknown { background: var(--bg-alt);     color: var(--fg2); border-color: var(--border-strong); }
[data-theme="dark"] .ha-badge--green  { color: #b7d18a; }
[data-theme="dark"] .ha-badge--yellow { color: #f0c070; }
[data-theme="dark"] .ha-badge--red    { color: #e89a9e; }

/* ---------- Trip page: hero + stats ---------------------------------- */
.ha-hero {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
  margin-bottom: var(--space-7);
}
.ha-stats {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  margin: var(--space-5) 0;
}
.ha-stats th, .ha-stats td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}
.ha-stats th {
  white-space: nowrap;
  width: 34%;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  font-size: var(--fs-overline);
  color: var(--fg3);
}
.ha-stats td { color: var(--fg1); }

/* ---------- Route map ------------------------------------------------- */
.ha-map {
  width: 100%;
  height: 420px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  z-index: 0; /* keep Leaflet panes under the sticky site nav */
}
.ha-map-caption {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  color: var(--fg3);
  margin-top: var(--space-2);
}
.ha-route-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  margin: var(--space-5) 0 var(--space-2);
}
/* Numbered summit markers + put-in/take-out labels (Leaflet divIcons) */
.ha-summit-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--tl-red);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: var(--fw-extrabold);
  font-size: 13px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.ha-endpoint-marker {
  display: inline-block;
  white-space: nowrap;
  transform: translateY(-50%);
  background: var(--tl-bark);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* ---------- Conditions module ---------------------------------------- */
.ha-conditions {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: var(--space-6);
  margin: var(--space-5) 0;
}
.ha-conditions > * + * { margin-top: var(--space-5); }
.ha-verdict {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.ha-verdict .ha-badge { align-self: flex-start; font-size: var(--fs-body-sm); }
.ha-verdict__detail {
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-relaxed);
  color: var(--fg2);
  margin: 0;
}

.ha-gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}
.ha-gauge {
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  background: var(--bg-alt);
}
.ha-gauge__label {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--fg2);
  margin: 0 0 var(--space-2);
}
.ha-gauge__value {
  font-family: var(--font-sans);
  font-weight: var(--fw-extrabold);
  font-size: var(--fs-h3);
  line-height: var(--lh-tight);
  color: var(--fg1);
}
.ha-gauge__secondary {
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  color: var(--fg2);
  margin-top: 2px;
}
.ha-gauge__trend {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  color: var(--fg2);
  margin-top: var(--space-2);
}
.ha-gauge__trend strong { color: var(--fg1); }
.ha-spark {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: var(--space-3);
  color: var(--tl-lake);
}
.ha-gauge__meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--fg3);
  margin-top: var(--space-2);
}
.ha-gauge__meta a { color: inherit; }

/* Threshold legend — static HTML so families always see the numbers */
.ha-thresholds {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
}
.ha-thresholds caption {
  text-align: left;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  font-size: var(--fs-overline);
  color: var(--fg3);
  padding-bottom: var(--space-3);
}
.ha-thresholds th, .ha-thresholds td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--divider);
}
.ha-thresholds th {
  font-size: var(--fs-overline);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--fg3);
}
.ha-thresholds td:first-child { white-space: nowrap; font-weight: var(--fw-semibold); }

/* 3-day NWS strip */
.ha-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-3);
}
.ha-forecast__cell {
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  background: var(--bg-alt);
  padding: var(--space-3);
  text-align: center;
  font-family: var(--font-sans);
}
.ha-forecast__name {
  font-size: var(--fs-overline);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--fg3);
}
.ha-forecast__temp {
  font-size: var(--fs-h4);
  font-weight: var(--fw-extrabold);
  color: var(--fg1);
  margin: var(--space-1) 0;
}
.ha-forecast__short {
  font-size: var(--fs-caption);
  line-height: var(--lh-snug);
  color: var(--fg2);
}
.ha-forecast__precip {
  font-size: var(--fs-caption);
  color: var(--tl-lake);
  margin-top: var(--space-1);
}
[data-theme="dark"] .ha-forecast__precip { color: var(--tl-sky); }

/* Burn ban chips */
.ha-burnbans { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ha-burnban-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-alt);
  color: var(--fg1);
}
.ha-burnban-chip--active { background: var(--danger-bg); border-color: var(--tl-red); color: var(--tl-deep-red); }
[data-theme="dark"] .ha-burnban-chip--active { color: #e89a9e; }
.ha-burnbans__meta {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  color: var(--fg3);
  flex-basis: 100%;
}

/* Normals, notes, links */
.ha-normals {
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-relaxed);
  color: var(--fg2);
  background: var(--bg-alt);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  margin: 0;
}
.ha-normals strong { color: var(--fg1); }
.ha-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-body-sm);
  line-height: var(--lh-relaxed);
  color: var(--fg2);
  border-left: 3px solid var(--tl-orange);
  padding-left: var(--space-4);
  margin: 0;
}
.ha-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
}
.ha-links a { color: var(--tl-lake); font-weight: var(--fw-semibold); }
[data-theme="dark"] .ha-links a { color: var(--tl-sky); }
.ha-section-label {
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  font-size: var(--fs-overline);
  color: var(--fg3);
  margin: 0 0 var(--space-3);
}

/* ---------- Safety notes --------------------------------------------- */
.ha-safety {
  border-left: 4px solid var(--tl-red);
  background: var(--danger-bg);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  padding: var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-relaxed);
  color: var(--fg1);
}
.ha-safety p { margin: 0 0 var(--space-3); }
.ha-safety p:last-child { margin-bottom: 0; }

/* ---------- Packing list --------------------------------------------- */
.ha-packlist {
  columns: 2;
  column-gap: var(--space-8);
  margin: var(--space-4) 0;
}
.ha-packlist h4 {
  break-after: avoid;
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  font-size: var(--fs-overline);
  color: var(--tl-red);
  margin: var(--space-4) 0 var(--space-2);
}
.ha-packlist h4:first-child { margin-top: 0; }
.ha-packlist ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-relaxed);
  color: var(--fg1);
}
.ha-packlist li {
  break-inside: avoid;
  padding-left: 26px;
  position: relative;
  margin-bottom: var(--space-1);
}
.ha-packlist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-xs);
}
.ha-packlist-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-body-sm);
  color: var(--fg2);
  margin: 0 0 var(--space-4);
}

/* ---------- Placeholder block (Camp Beacon dates) --------------------- */
.ha-placeholder {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  color: var(--fg2);
  text-align: center;
}

/* ---------- Footer disclaimer ---------------------------------------- */
.ha-disclaimer {
  max-width: 640px;
  margin: 0 auto;
  font-size: var(--fs-caption);
  line-height: var(--lh-relaxed);
  opacity: 0.85;
}

/* ---------- Mobile ---------------------------------------------------- */
@media (max-width: 680px) {
  .ha-map { height: 300px; }
  .ha-packlist { columns: 1; }
  .ha-stats th { width: auto; }
  .ha-thresholds td:first-child { white-space: normal; }
  .ha-thresholds th, .ha-thresholds td { padding: var(--space-2); }
}
@media (max-width: 380px) {
  .ha-grid { grid-template-columns: 1fr; }
  .ha-gauges, .ha-forecast { grid-template-columns: 1fr; }
}

/* ---------- Print: packing list as a checklist ------------------------ */
@media print {
  .site-nav, .nav-backdrop, .theme-toggle, .ha-map, .page-footer, .ha-conditions { display: none !important; }
  .ha-packlist { columns: 2; }
  .ha-packlist li::before { border-color: #000; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  .ha-tile { transition: none; }
}
