/* === VARIABLES === */
:root {
  --color-primary: #1A3A5C;
  --color-primary-light: #2A5A8C;
  --color-accent: #2E7D32;
  --color-accent-light: #4CAF50;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F4F6F8;
  --color-border: #D1D9E0;
  --color-text-primary: #1A1A1A;
  --color-text-secondary: #4A5568;
  --color-text-inverse: #FFFFFF;
  --color-warning: #E65100;
  --font-heading: 'Roboto Slab', Georgia, serif;
  --font-body: 'Roboto', system-ui, sans-serif;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
  --max-width: 1100px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-primary);
  background: var(--color-surface);
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary-light); }
a:hover { color: var(--color-accent); }
ul, ol { padding-left: 1.5em; }

/* === SKIP LINK === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-accent);
  color: var(--color-text-inverse);
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { top: 0; }

/* === CONTAINER === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary);
  margin-bottom: 0.5em;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.375rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.callsign, .site-callsign {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 64px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-primary);
  flex-shrink: 0;
}
.site-logo img { display: block; }
.site-brand { display: flex; flex-direction: column; line-height: 1.2; }
.site-name { font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; color: var(--color-primary); }
.site-callsign { font-size: 0.75rem; color: var(--color-accent); }

/* === NAV === */
#primary-nav { margin-left: auto; }
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.nav-list li { position: relative; }
.nav-list a {
  display: block;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}
.nav-list a[aria-current="page"] { color: var(--color-accent); }

/* Dropdown */
.has-dropdown > a::after { content: ' ▾'; font-size: 0.7em; }
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  min-width: 180px;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 0.25rem 0;
  list-style: none;
}
.dropdown li a {
  font-weight: 400;
  padding: 0.4rem 1rem;
  border-bottom: none;
  font-size: 0.85rem;
}
.dropdown li a:hover { background: var(--color-surface-alt); color: var(--color-accent); border-bottom: none; }
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { display: block; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  margin-left: auto;
  padding: 0.5rem;
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  #primary-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-primary);
    z-index: 99;
    padding: 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  }
  #primary-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list a { padding: 0.65rem 1.25rem; border-bottom: 1px solid var(--color-border); border-right: none; font-size: 1rem; }
  .nav-list a[aria-current="page"] { border-bottom-color: var(--color-border); border-left: 3px solid var(--color-accent); }
  .dropdown { position: static; border: none; border-top: none; box-shadow: none; background: var(--color-surface-alt); display: none; }
  .has-dropdown.dropdown-open .dropdown { display: block; }
  .has-dropdown > a::after { float: right; }
}

/* === FOOTER === */
.site-footer {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  margin-top: 3rem;
  padding-top: 2.5rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
}
.footer-col p, .footer-col li { font-size: 0.9rem; line-height: 1.6; }
.footer-col h3 { color: var(--color-accent-light); font-size: 1rem; margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.3rem; }
.footer-col a { color: #90CAF9; text-decoration: none; }
.footer-col a:hover { color: var(--color-accent-light); text-decoration: underline; }
.footer-col img { border-radius: 50%; margin-bottom: 0.75rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1rem 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* === HERO === */
.hero {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 3rem 0;
  text-align: center;
}
.hero h1 { color: var(--color-text-inverse); margin-bottom: 0.5rem; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto 1.5rem; }

.hero-strip {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 2.5rem 0;
  text-align: center;
}
.hero-strip h1 { color: var(--color-text-inverse); margin-bottom: 0.25rem; }
.hero-strip .tagline { font-size: 1rem; opacity: 0.85; margin: 0; }

/* === HERO LOGO === */
.hero-logo {
  display: block;
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
}

/* === CONTENT AREA === */
.content-section { padding: 2.5rem 0; }
.content-section + .content-section { border-top: 1px solid var(--color-border); }

/* === CARDS === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}
.card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.9rem; color: var(--color-text-secondary); margin-bottom: 0.75rem; }
.card a.card-link {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
}
.card a.card-link:hover { background: var(--color-primary-light); }

/* === TABLES === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
th {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 0.6rem 0.85rem;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
}
td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
tr:nth-child(even) td { background: var(--color-surface-alt); }
tr:hover td { background: #EBF4FF; }
.table-responsive { overflow-x: auto; }

/* === ALERTS === */
.alert {
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--color-warning);
  background: #FFF3E0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.alert-info {
  border-color: var(--color-primary-light);
  background: #EBF4FF;
}
.alert-success {
  border-color: var(--color-accent);
  background: #E8F5E9;
}

/* === PHOTO GALLERY === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.gallery-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.gallery-grid img:hover { opacity: 0.85; transform: scale(1.02); }

.gallery-section { margin-bottom: 2.5rem; }
.gallery-section h3 { margin-bottom: 1rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--color-border); }

/* === EVENT CATEGORY CARDS === */
.event-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.event-cat-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s, transform 0.15s;
  color: var(--color-text-primary);
}
.event-cat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-2px); color: var(--color-primary); }
.event-cat-card img { width: 100%; height: 160px; object-fit: cover; }
.event-cat-card .card-body { padding: 1rem; }
.event-cat-card h3 { font-size: 1rem; color: var(--color-primary); margin-bottom: 0.25rem; }
.event-cat-card p { font-size: 0.85rem; color: var(--color-text-secondary); margin: 0; }

/* === MEETING LIST === */
.meeting-list { list-style: none; padding: 0; }
.meeting-list li {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}
.meeting-list li:last-child { border-bottom: none; }
.meeting-list .meeting-date {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 0.2rem;
}
.meeting-list a { font-weight: 600; text-decoration: none; color: var(--color-primary-light); }
.meeting-list a:hover { color: var(--color-accent); }
.meeting-list .excerpt { font-size: 0.9rem; color: var(--color-text-secondary); margin-top: 0.25rem; }

/* === MEETING NAV === */
.meeting-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: 2rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}
.meeting-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--color-primary-light);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.meeting-nav a:hover { background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary); }
.meeting-nav .back-link { margin: 0 auto; font-weight: 400; color: var(--color-text-secondary); font-size: 0.85rem; }

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn-primary:hover { background: var(--color-primary-light); color: var(--color-text-inverse); }
.btn-accent { background: var(--color-accent); color: var(--color-text-inverse); }
.btn-accent:hover { background: var(--color-accent-light); color: var(--color-text-inverse); }
.btn-outline { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: var(--color-text-inverse); }

/* === FORMS === */
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="email"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(42,90,140,0.15);
}
.callsign-lookup { display: flex; gap: 0.5rem; max-width: 360px; margin: 1.25rem 0; }
.callsign-lookup input { flex: 1; }
.callsign-lookup button { padding: 0.5rem 1rem; background: var(--color-primary); color: var(--color-text-inverse); border: none; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; transition: background 0.15s; white-space: nowrap; }
.callsign-lookup button:hover { background: var(--color-primary-light); }

/* === LINK CATEGORIES === */
.link-category { margin-bottom: 2rem; }
.link-category h3 { color: var(--color-primary); border-bottom: 2px solid var(--color-border); padding-bottom: 0.4rem; margin-bottom: 1rem; }
.link-list { list-style: none; padding: 0; }
.link-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); }
.link-list li:last-child { border-bottom: none; }
.link-list a { font-weight: 600; color: var(--color-primary-light); }
.link-list a:hover { color: var(--color-accent); }
.link-desc { font-size: 0.875rem; color: var(--color-text-secondary); }

/* === REPEATER TABLE === */
.repeater-table th:first-child { width: 30%; }

/* === INFO BOX === */
.info-box {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.info-box h3 { color: var(--color-primary); margin-bottom: 0.5rem; font-size: 1rem; }

/* === OFFICER TABLE === */
.officer-table td:first-child { font-weight: 600; white-space: nowrap; width: 40%; }

/* === PAGE HEADER === */
.page-header {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 2.5rem 0;
  text-align: center;
}
.page-header h1 { color: var(--color-text-inverse); margin-bottom: 0.25rem; }
.page-header p { color: rgba(255,255,255,0.8); margin: 0; font-size: 0.95rem; }

/* === 404 === */
.error-page { text-align: center; padding: 5rem 1rem; }
.error-page h1 { font-size: 4rem; color: var(--color-primary); }
.error-page p { font-size: 1.1rem; margin-bottom: 1.5rem; }

/* === PRINT === */
@media print {
  .site-header, .site-footer, .nav-toggle, .meeting-nav, .skip-link { display: none !important; }
  body { color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
  .container { max-width: 100%; padding: 0; }
  .hero, .hero-strip, .page-header { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000; }
  .hero h1, .hero-strip h1, .page-header h1 { color: #000 !important; }
}

/* === UTILITIES === */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-small { font-size: 0.875rem; }

/* === LIGHTBOX DIALOG === */
dialog.lightbox {
  border: none;
  background: rgba(0,0,0,0.92);
  max-width: 90vw;
  max-height: 90vh;
  padding: 0;
  border-radius: var(--radius-md);
}
dialog.lightbox::backdrop { background: rgba(0,0,0,0.85); }
.lightbox-inner { position: relative; display: flex; align-items: center; justify-content: center; min-width: 300px; min-height: 200px; }
.lightbox-inner img { max-width: 85vw; max-height: 80vh; object-fit: contain; display: block; }
.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }
