/* =========================================
   Beulah & Steinway Community Coalition
   Refined civic informational site
   ========================================= */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette — warm neutrals with one quiet accent */
  --bg: #f8f7f5;
  --white: #ffffff;
  --text: #393835;
  --text-mid: #5e5c57;
  --text-light: #8a877f;
  --heading: #2e2e2c;
  --accent: #5c7a5f;
  --accent-hover: #496349;
  --accent-bg: #eef3ee;
  --border: #e2dfd9;
  --card: #ffffff;
  --footer-bg: #2e2e2c;
  --footer-text: #c8c5be;

  /* Type */
  --font-body: 'Libre Franklin', 'Segoe UI', system-ui, sans-serif;
  --font-heading: 'Lora', 'Georgia', serif;

  /* Layout */
  --max-w: 780px;
  --gutter: 1.5rem;

  /* Spacing scale */
  --s1: 0.4rem;
  --s2: 0.75rem;
  --s3: 1.25rem;
  --s4: 2rem;
  --s5: 3.25rem;
  --s6: 5rem;
}

/* --- Base --- */
html { font-size: 16.5px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--heading);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 1.85rem; letter-spacing: -0.01em; margin-bottom: var(--s2); }
h2 { font-size: 1.3rem; margin-bottom: var(--s3); }
h3 { font-size: 1.05rem; margin-bottom: var(--s1); color: var(--accent); font-weight: 600; }

p { margin-bottom: var(--s3); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(92,122,95,0.35);
  transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

/* --- Header --- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem var(--gutter);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-name {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.site-logo {
  height: 75px;
  width: auto;
}

/* --- Nav --- */
.main-nav { display: flex; gap: 0.15rem; }

.main-nav a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}
.main-nav a:hover, .main-nav a.active {
  background: var(--accent-bg);
  color: var(--heading);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}

/* --- Page Content --- */
.page-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s5) var(--gutter);
}

/* --- Hero --- */
.hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: var(--s6) var(--gutter) var(--s5);
  text-align: center;
}

.hero-inner { max-width: var(--max-w); margin: 0 auto; }

.hero h1 {
  font-size: 2.1rem;
  margin-bottom: var(--s1);
  letter-spacing: -0.015em;
}

.hero .tagline {
  font-size: 1.02rem;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto var(--s4);
  line-height: 1.7;
}

.hero-nav {
  display: flex;
  gap: var(--s2);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.35rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  letter-spacing: 0.01em;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--accent-bg); color: var(--heading); }
.btn-secondary:hover { background: #dce8dd; color: var(--heading); }

/* --- Sections --- */
.section { margin-bottom: var(--s5); }
.section:last-child { margin-bottom: 0; }

/* --- Section divider (replaces h2 border-bottom for cleaner look) --- */
.section h2 {
  padding-bottom: var(--s1);
  border-bottom: 1.5px solid var(--border);
}

/* --- Card --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s3);
}
.card:last-child { margin-bottom: 0; }

/* --- Highlight box --- */
.callout {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  padding: var(--s3) var(--s4);
  border-radius: 0 6px 6px 0;
  margin-bottom: var(--s4);
}

/* --- Fact grid --- */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.fact-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--s2) var(--s3);
  text-align: center;
}

.fact-item .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.15rem;
  font-weight: 500;
}

.fact-item .value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.3;
}

/* --- Source citations --- */
.source {
  font-size: 0.78rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: var(--s1);
}

/* --- Timeline --- */
.timeline {
  border-left: 2px solid var(--border);
  padding-left: var(--s4);
}

.timeline-entry {
  margin-bottom: var(--s4);
  position: relative;
}
.timeline-entry:last-child { margin-bottom: 0; }

.timeline-entry::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--s4) - 5px);
  top: 5px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

/* --- Impact sections --- */
.topic {
  margin-bottom: var(--s5);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}
.topic:last-of-type { border-bottom: none; padding-bottom: 0; }

/* --- Forms --- */
.form-stack { max-width: 480px; }

.form-stack label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--heading);
  margin-bottom: 0.25rem;
}

.form-stack input[type="text"],
.form-stack input[type="email"],
.form-stack input[type="date"],
.form-stack input[type="file"],
.form-stack select,
.form-stack textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: var(--s3);
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s;
}
.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-stack textarea { min-height: 90px; resize: vertical; }

.form-stack select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235e5c57' d='M1.41.59L6 5.17 10.59.59 12 2l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: var(--s3);
}
.check-row input[type="checkbox"] {
  margin-top: 0.3rem;
  accent-color: var(--accent);
  width: 15px; height: 15px;
  flex-shrink: 0;
}
.check-row label { font-weight: 400; font-size: 0.88rem; margin-bottom: 0; }

.field-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: -0.9rem;
  margin-bottom: var(--s3);
}

.form-error {
  background: #fef2f2;
  border: 1px solid #e8aaaa;
  color: #8b2020;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.btn-editor {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}
.btn-editor:hover { background: #e8e5dd; }
.btn-editor-remove { color: #8b2020; border-color: #e8aaaa; }
.btn-editor-remove:hover { background: #fef2f2; }

/* --- Wildlife gallery --- */
.sighting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.sighting-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.sighting-card .photo-placeholder {
  background: var(--accent-bg);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
}

.sighting-card .meta {
  padding: var(--s2) var(--s3);
  font-size: 0.82rem;
  line-height: 1.55;
}

.sighting-card .meta strong {
  display: block;
  font-size: 0.9rem;
  color: var(--heading);
  margin-bottom: 0.1rem;
}

.sighting-card .meta .date-loc {
  color: var(--text-light);
  font-size: 0.75rem;
}

/* --- Footer --- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: var(--s5) var(--gutter);
  margin-top: var(--s6);
  font-size: 0.82rem;
  line-height: 1.7;
}

.footer-inner { max-width: var(--max-w); margin: 0 auto; }

.site-footer a { color: #a8bea9; }
.site-footer a:hover { color: #c8dcc9; }

.footer-nav {
  display: flex;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s2);
}

.footer-fine {
  font-size: 0.72rem;
  color: #7d7a73;
  margin-top: var(--s2);
}

/* --- Responsive --- */
@media (max-width: 680px) {
  html { font-size: 15.5px; }
  .nav-toggle { display: block; }
  .main-nav {
    display: none; width: 100%;
    flex-direction: column; gap: 0;
    margin-top: var(--s1);
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  .header-inner { flex-wrap: wrap; }
  .hero h1 { font-size: 1.65rem; }
  .hero-nav { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; text-align: center; }
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: var(--s4) var(--gutter); }
  .footer-nav { flex-direction: column; gap: var(--s1); }
  .card { padding: var(--s3); }
}

@media (max-width: 420px) {
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.45rem; }
}

/* --- Before/After Comparison --- */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.compare-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
}

.compare-panel img {
  width: 100%;
  height: auto;
  display: block;
}

.compare-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--heading);
  background: var(--accent-bg);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 680px) {
  .compare { grid-template-columns: 1fr; }
}

/* --- FAQ --- */
.faq-item {
  margin-bottom: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { color: var(--heading); font-family: var(--font-body); font-weight: 600; font-size: 1rem; margin-bottom: var(--s2); }

/* --- Glossary --- */
.glossary { margin: 0; }
.glossary-entry {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
}
.glossary-entry:last-child { border-bottom: none; }
.glossary dt {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.glossary dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

/* --- Term links (used in key facts etc.) --- */
.term-link {
  text-decoration-style: dotted;
  text-decoration-color: var(--accent);
  cursor: help;
}

/* --- Nav Dropdowns --- */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  cursor: pointer;
}
.nav-dropdown-toggle::after {
  content: '\25BE';
  font-size: 0.65em;
  margin-left: 0.3em;
  opacity: 0.5;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  min-width: 180px;
  padding: 0.4rem 0;
  z-index: 200;
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: var(--accent-bg);
  color: var(--accent);
}
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

/* Mobile: dropdowns expand inline */
@media (max-width: 680px) {
  .nav-dropdown { position: static; }
  .nav-dropdown-toggle::after { content: ''; }
  .main-nav.open .nav-dropdown-menu {
    display: block;
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
    background: transparent;
  }
  .main-nav.open .nav-dropdown-menu a {
    padding-left: 1.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
  }
}

/* --- Footer Columns --- */
.footer-nav-columns {
  display: flex;
  gap: var(--s4);
  justify-content: center;
  margin-bottom: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.footer-col-heading {
  font-weight: 600;
  font-size: 0.82rem;
  color: #fff;
  text-decoration: none;
  margin-bottom: 0.15rem;
}
a.footer-col-heading:hover { opacity: 0.8; }
span.footer-col-heading { cursor: default; }
.footer-col a:not(.footer-col-heading) {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
}
.footer-col a:not(.footer-col-heading):hover {
  color: #fff;
}

@media (max-width: 680px) {
  .footer-nav-columns {
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
    text-align: center;
  }
  .footer-col { min-width: 0; align-items: center; }
}
