:root {
  /* Site palette: pulled from the current dark NM Ham Radio logo. */
  --ink: #111820;
  --charcoal: #080d10;
  --blue: #24aeb9;
  --blue-dark: #0f4b56;
  --blue-soft: #e7f7f8;
  --muted: #5b6875;
  --line: #d7dee6;
  --panel: #f6f8fa;
  --paper: #ffffff;
  --signal: #bf2333;
  --signal-dark: #8d1b27;
  --alert-bg: #fff7e5;
  --alert-line: #f5bd25;
  --sky: #dceefc;
  --copper: #bd4d2f;
  --brown: #bd4d2f;
  --brown-dark: #82331f;
  --brown-soft: #faece7;
  --gold: #f5bd25;
  --cream: #f4f0e8;
  --green: #1f5f86;
  --green-bright: #7aa8bf;
  --shadow: 0 18px 55px rgba(17, 24, 32, 0.12);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(36, 174, 185, 0.11), rgba(189, 77, 47, 0.06) 44%, rgba(238, 242, 245, 1) 100%),
    #eef2f5;
}

a {
  color: inherit;
}

.event-banner {
  display: none;
  background: var(--alert-bg);
  color: var(--ink);
  padding: 14px 16px;
  font-weight: 700;
  border: 1px solid var(--alert-line);
  border-left: 6px solid var(--gold);
  border-radius: 8px;
  margin-bottom: 16px;
}

.event-banner.is-visible {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.event-banner a {
  color: var(--brown-dark);
  text-decoration-thickness: 2px;
}

.site-header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
}

.site-header {
  background: rgba(8, 13, 16, 0.96);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand-logo img {
  /* Keep the PNG logo proportional. Do not add a fixed height here. */
  display: block;
  width: clamp(310px, 36vw, 560px);
  max-width: 100%;
  height: auto;
}

.brand-logo .logo-mark {
  display: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
footer,
.lead,
.panel-heading p,
.calendar-summary,
.resource-list small,
.page-card p,
.event-meta {
  color: var(--muted);
}

.top-nav {
  color: rgba(255, 255, 255, 0.82);
}

.top-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
  max-width: 100%;
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.82);
}

.top-nav .home-link {
  color: #fff;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary::after {
  content: " ▾";
  font-size: 0.82em;
}

.nav-menu[open] summary,
.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--gold);
}

.nav-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 20;
  display: grid;
  min-width: 220px;
  padding: 8px;
  border: 1px solid rgba(245, 189, 37, 0.34);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.nav-dropdown a {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ink);
  white-space: nowrap;
}

.nav-dropdown a:hover,
.nav-dropdown a:focus-visible {
  background: #fff4d2;
  outline: none;
}

.top-nav a,
footer a {
  text-decoration: none;
  font-weight: 700;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 42px);
}

/* Homepage intro and shared page hero blocks. */
.intro {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: stretch;
  margin-bottom: 28px;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  background: var(--paper);
  border: 1px solid rgba(245, 189, 37, 0.32);
  border-top: 5px solid var(--brown);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brown-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.45rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.1;
}

.lead {
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.6;
}

.lead a {
  overflow-wrap: anywhere;
}

.quick-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.quick-status span {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
}

.quick-status strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.home-grid {
  display: block;
}

/* Shared card surfaces used by resource pages and calendar panels. */
.resource-panel,
.calendar-panel,
.page-card,
.event-list {
  background: var(--paper);
  border: 1px solid rgba(31, 95, 134, 0.22);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.resource-panel,
.calendar-panel {
  padding: clamp(18px, 3vw, 28px);
}

.resource-list {
  display: grid;
  gap: 10px;
}

.resource-list a {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 6px;
  text-decoration: none;
  background: var(--panel);
}

.resource-list a:hover,
.resource-list a:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}

.resource-list span {
  font-weight: 800;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.panel-heading p {
  max-width: 340px;
  margin-bottom: 0;
  line-height: 1.45;
}

/* Calendar: the data comes from data/events.js and script.js builds this markup. */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.calendar-summary {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

.next-event-card,
.calendar-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.next-event-card {
  border-left: 6px solid var(--brown);
}

.next-event-card strong,
.calendar-note strong {
  display: block;
  color: var(--ink);
  margin-bottom: 5px;
}

.next-event-card a {
  color: var(--blue);
  font-weight: 800;
  text-decoration-thickness: 2px;
}

.month {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.month h3 {
  margin: 0;
  padding: 13px 14px;
  background: var(--charcoal);
  color: #fff;
  font-size: 1rem;
}

.days,
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays span {
  padding: 9px 4px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--panel);
}

.day {
  position: relative;
  min-height: 48px;
  padding: 7px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 0.88rem;
}

.day:nth-child(7n) {
  border-right: 0;
}

.day.empty {
  background: #f9fafb;
}

.day.today {
  outline: 2px solid var(--brown);
  outline-offset: -2px;
  background: #fffaf0;
}

.day.has-event {
  background: #f8fbfd;
}

.day.past {
  color: #88929d;
  background: #f7f8f9;
}

.date-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  width: 28px;
  height: 28px;
  color: var(--muted);
  font-weight: 800;
}

.day-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  text-decoration: none;
}

.day-link:hover,
.day-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-radius: 5px;
}

.event-dot {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brown);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.month-events {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.month-event {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-decoration: none;
}

.month-event:hover,
.month-event:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.month-event.urgent {
  border-color: #e4b3ba;
  background: #fff6f7;
}

.month-event-date {
  color: var(--brown-dark);
  font-weight: 900;
}

.month-event strong,
.month-event small {
  display: block;
}

.month-event small,
.no-events {
  color: var(--muted);
  line-height: 1.35;
}

.no-events {
  margin: 0;
  padding: 8px 2px;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.feature-strip article {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.feature-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}

.feature-strip p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

/* Secondary content pages. */
.page-hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
  margin-bottom: 26px;
}

.page-hero .intro-copy {
  min-height: 0;
  padding: clamp(24px, 4vw, 42px);
}

.page-hero h1 {
  font-size: clamp(2.25rem, 4vw, 4.25rem);
}

.page-hero img {
  width: 100%;
  height: clamp(280px, 34vw, 440px);
  min-height: 0;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.page-card {
  padding: 20px;
}

.page-card h2 {
  font-size: 1.22rem;
}

.page-card p {
  line-height: 1.55;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.button-link:hover,
.button-link:focus-visible {
  background: var(--blue);
  outline: none;
}

.event-list {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.event-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.event-row:last-child {
  border-bottom: 0;
}

.event-row-urgent {
  background: #fffaf0;
}

.event-date {
  color: var(--brown-dark);
  font-weight: 900;
}

.event-row h2 {
  margin-bottom: 6px;
}

.event-meta {
  margin-bottom: 0;
}

.weather-dashboard {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 20px;
  margin-bottom: 22px;
}

/* Live weather and NOAA/SWPC data panels on pages/weather.html. */
.engineering-data {
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.weather-widget,
.radio-pro-panel {
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid rgba(31, 95, 134, 0.22);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.widget-status {
  margin-bottom: 14px;
  color: var(--muted);
}

.forecast-periods {
  display: grid;
  gap: 10px;
}

.forecast-period {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.forecast-period strong {
  display: block;
  margin-bottom: 4px;
}

.forecast-period p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.radio-pro-panel ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.metric-card strong {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.metric-card strong small {
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.metric-card > small {
  color: var(--muted);
}

.alert-feed {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.alert-feed a {
  color: var(--blue);
  font-weight: 800;
}

footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 1080px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo img {
    width: min(560px, 92vw);
  }

  .intro,
  .page-hero {
    grid-template-columns: 1fr;
  }

  .calendar-grid,
  .page-grid,
  .calendar-summary,
  .weather-dashboard,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .brand-logo .logo-full {
    display: none;
  }

  .brand-logo .logo-mark {
    display: block;
    width: 112px;
  }

  .site-header,
  footer,
  .panel-heading,
  .event-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header,
  footer {
    display: grid;
    width: 100%;
    overflow-x: hidden;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    line-height: 1.4;
    width: 100%;
  }

  .top-nav > a,
  .nav-menu summary {
    padding: 4px 0;
  }

  .top-nav > a[href^="mailto:"] {
    grid-column: 1 / -1;
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .feature-strip article {
    grid-template-columns: 1fr;
  }

  .quick-status {
    grid-template-columns: 1fr;
  }

  .day {
    min-height: 58px;
    padding: 5px;
  }

  .nav-dropdown {
    left: 0;
    right: auto;
  }

  h1 {
    font-size: 2.55rem;
  }
}
