:root {
  --navy: #1a2744;
  --amber: #b86e00;
  --amber-light: #f0a830;
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --text: #2c2c2c;
  --text-muted: #5f6672;
  --border: #e2e4e8;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --nav-h: 60px;
}

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

html { scroll-padding-top: calc(var(--nav-h) + 8px); }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

/* NAV */
nav {
  background: var(--navy);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand span { color: var(--amber-light); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: #fff; text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  width: 44px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  position: relative;
  transition: transform 0.2s, background 0.2s;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* HERO */
.hero {
  background: var(--navy);
  color: #fff;
  padding: 4rem 2rem 3.5rem;
  text-align: center;
}
.hero-call {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--amber-light);
  line-height: 1;
}
.hero-name {
  font-size: 1.3rem;
  margin-top: 0.5rem;
  opacity: 0.85;
  font-weight: 400;
}

/* SECTIONS */
section { padding: 3rem 2rem; max-width: 900px; margin: 0 auto; }
section + section { border-top: 1px solid var(--border); }

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.25rem;
  letter-spacing: 0.01em;
}

/* STATUS CARDS */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
.card-value.small { font-size: 1.1rem; }
.card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.card-foot { margin-top: 0.75rem; }
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot-green { background: #22c55e; }
.dot-red { background: #ef4444; }
.dot-amber { background: var(--amber-light); }
.dot-gray { background: #9ca3af; }

.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.wx-item { text-align: center; }
.wx-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}
.wx-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ABOUT */
.about-text p + p { margin-top: 0.75rem; }

/* EVENTS */
.event-list { list-style: none; }
.event-item {
  display: flex;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.event-item:last-child { border-bottom: none; }
.event-date {
  flex: 0 0 56px;
  text-align: center;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}
.event-date .month { text-transform: uppercase; font-size: 0.7rem; opacity: 0.75; }
.event-date .day { font-size: 1.3rem; font-weight: 700; }
.event-info { min-width: 0; }
.event-info h3 { font-size: 1rem; font-weight: 600; color: var(--navy); }
.event-info p { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.1rem; overflow-wrap: anywhere; }
.event-info .event-when { color: var(--text); }
.event-info .event-desc { white-space: pre-line; }

/* FOOTER */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  margin-top: 2rem;
}
footer a { color: var(--amber-light); }

.loading { color: var(--text-muted); font-size: 0.9rem; font-style: italic; }
.error { color: #c53030; font-size: 0.9rem; }

@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--navy);
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .hero { padding: 3rem 1rem 2.5rem; }
  .hero-call { font-size: 2.5rem; }
  section { padding: 2rem 1rem; }
  .card { padding: 1.1rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { transition: none; }
}

/* APRS */
.section-sub { color: var(--text-muted); font-size: 0.9rem; margin: -0.75rem 0 1rem; }
.aprs-map {
  height: 460px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--bg-alt);
  z-index: 0; /* keep Leaflet's panes under the sticky nav */
}
.aprs-status { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }
.aprs-heard-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.25rem;
}
.aprs-heard { list-style: none; }
.aprs-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.aprs-row:last-child { border-bottom: none; }
.aprs-row:hover, .aprs-row:focus-visible { background: var(--bg-alt); outline: none; }
.aprs-call { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.aprs-call .club-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: var(--amber);
  border-radius: 3px;
  padding: 0 0.3rem;
  margin-left: 0.4rem;
  vertical-align: 2px;
  letter-spacing: 0.04em;
}
.aprs-comment { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aprs-meta { font-size: 0.8rem; color: var(--text-muted); text-align: right; white-space: nowrap; }
.aprs-more { font-size: 0.85rem; padding-top: 0.5rem; }

/* APRS symbols: hessu/aprs-symbols 48px sheets shown at 24px (crisp on hi-dpi).
   16 columns x 6 rows; position is set per symbol from JS. */
.aprs-sym { width: 24px; height: 24px; position: relative; }
.aprs-sym > div {
  position: absolute;
  inset: 0;
  background-size: 384px 144px;
  background-repeat: no-repeat;
}
.aprs-sym .sheet-0 { background-image: url(/vendor/aprs-symbols/aprs-symbols-48-0.png); }
.aprs-sym .sheet-1 { background-image: url(/vendor/aprs-symbols/aprs-symbols-48-1.png); }
.aprs-sym .sheet-2 { background-image: url(/vendor/aprs-symbols/aprs-symbols-48-2.png); }
.aprs-marker { background: none; border: none; }
.aprs-marker.club .aprs-sym { filter: drop-shadow(0 0 3px var(--amber-light)) drop-shadow(0 0 2px var(--amber-light)); }
.aprs-marker.old { opacity: 0.55; }
.aprs-label {
  background: rgba(255,255,255,0.85);
  border: none;
  box-shadow: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--navy);
  padding: 0 3px;
}
.aprs-label::before { display: none; }

.aprs-popup { font-size: 0.85rem; line-height: 1.45; min-width: 180px; }
.aprs-popup .call { font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.aprs-popup .muted { color: var(--text-muted); }
.aprs-popup .comment { margin-top: 0.25rem; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .aprs-map { height: 340px; }
}

/* EVENTS: other clubs, regular series */
.src-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
  background: #e6eaf2;
  border: 1px solid #ccd3e0;
  border-radius: 3px;
  padding: 0 0.35rem;
  margin-left: 0.45rem;
  vertical-align: 2px;
  line-height: 1.5;
}
a.src-tag:hover { text-decoration: none; background: #d8deea; }
.sub-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1.75rem 0 0.25rem;
}
.regular-list { list-style: none; }
.regular-item { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.regular-item:last-child { border-bottom: none; }
.regular-item h3 { font-size: 0.95rem; font-weight: 600; color: var(--navy); }
.regular-item p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.1rem; overflow-wrap: anywhere; }
.regular-item .event-when { color: var(--text); }
[hidden] { display: none !important; }
.event-more { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.1rem; }
.event-more summary { cursor: pointer; list-style: none; overflow-wrap: anywhere; }
.event-more summary::-webkit-details-marker { display: none; }
.event-more .more-label { color: var(--amber); font-weight: 600; white-space: nowrap; }
.event-more .more-label::after { content: ' ▾'; }
.event-more[open] .more-label::after { content: ' ▴'; }
.event-more[open] summary { margin-bottom: 0.35rem; }
.regular-item .event-more { font-size: 0.85rem; }

/* MEMBERS ON THE AIR */
.spot-list { list-style: none; }
.spot-item { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.spot-item:last-child { border-bottom: none; }
.spot-item.on-air { border-left: 3px solid #2f9e44; padding-left: 0.75rem; }
.spot-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.spot-call { font-weight: 700; color: var(--navy); font-size: 1rem; }
.spot-freq { font-variant-numeric: tabular-nums; }
.spot-what { color: var(--text-muted); font-size: 0.9rem; }
.spot-when { color: var(--text-muted); font-size: 0.85rem; margin-left: auto; white-space: nowrap; }
.spot-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.1rem; overflow-wrap: anywhere; }
.spot-sub .src-tag:first-child { margin-left: 0; }
.spot-ref { margin-right: 0.15rem; }
.spot-by { margin-left: 0.5rem; white-space: nowrap; }
.sub-title .status-dot { margin-right: 0.4rem; }
.empty { color: var(--text-muted); font-size: 0.9rem; padding: 0.5rem 0; }
.more-row { font-size: 0.85rem; padding-top: 0.5rem; }
.link-btn {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--amber); cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.roster-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.roster-item {
  display: flex; flex-direction: column; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.35rem 0.75rem; background: var(--bg-alt); line-height: 1.3;
}
.roster-seen { font-size: 0.75rem; color: var(--text-muted); }
.spot-heard { font-size: 0.85rem; color: var(--text); margin-top: 0.1rem; }
.credit { font-size: 0.75rem; color: var(--text-muted); margin-top: 1.25rem; }
