* { box-sizing: border-box; }

:root {
  --green: #1a6b2e;
  --green-light: #e8f5ec;
  --green-dark: #0f4d1f;
  --text: #1c1c1c;
  --text-muted: #5c5c5c;
  --bg: #fefefe;
  --bg-warm: #fdfcfa;
  --card-bg: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 12rem);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--green); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; color: var(--green-dark); }

/* Header */
.site-header {
  background: var(--card-bg);
  border-bottom: 3px solid var(--green);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.site-header .wrap {
  max-width: 52rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-weather {
  /* Always sit on its own row below the nav so the layout doesn't depend on
     the length of the forecast text returned by Yr. */
  flex-basis: 100%;
  justify-content: flex-start;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 0;
}
.header-weather-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.1rem;
}
.header-weather-temp {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.header-weather-sep {
  opacity: 0.45;
  user-select: none;
}
.header-weather-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}
.header-weather-credit {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--green);
  text-decoration: none;
  margin-left: 0.15rem;
}
.header-weather-credit:hover {
  color: var(--green-dark);
  text-decoration: underline;
}
.site-header a.brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--green);
  letter-spacing: -0.02em;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-left: auto;
  align-items: center;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--green); text-decoration: none; }

/* Hamburger: hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--green);
  border-radius: var(--radius);
  margin-left: auto;
}
.nav-toggle:hover { background: var(--green-light); }
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.site-header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.site-header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
@media (max-width: 768px) {
  .site-header .wrap {
    flex-wrap: nowrap;
  }
  .brand {
    order: 1;
    flex-shrink: 0;
  }
  .header-weather {
    order: 2;
    margin-left: auto;
  }
  .nav-toggle {
    display: flex;
    flex-shrink: 0;
    order: 3;
    margin-left: 0;
  }
  .site-nav {
    order: 4;
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--card-bg);
    border-bottom: 3px solid var(--green);
    box-shadow: var(--shadow-hover);
    padding: 0.5rem 0 1rem;
  }
  .header-weather-desc {
    display: none;
  }
  .site-header.nav-open .site-nav {
    display: flex;
  }
  .site-nav a {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .site-nav a:last-child { border-bottom: none; }
}

/* Main */
main {
  flex: 1;
  max-width: 52rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  width: 100%;
}
h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--green);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 36rem;
}

/* Prose */
.prose p { margin-bottom: 1rem; color: var(--text); }
.prose h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--green);
  margin: 2rem 0 0.5rem;
}
.prose ul { margin: 0 0 1rem 1.5rem; }
.prose a { color: var(--green); text-decoration: underline; font-weight: 500; }

/* Cards / links */
.card-list { list-style: none; padding: 0; margin: 0; }
.card-list li { margin-bottom: 1.25rem; }
.card-list a {
  display: block;
  padding: 1.5rem 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.card-list a:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  transform: translateY(-2px);
}
.card-list a:hover h2 { color: var(--green-dark); }
.card-list h2 { margin: 0 0 0.35rem; font-size: 1.1875rem; font-weight: 600; color: var(--green); transition: color 0.2s ease; }
.card-list p { margin: 0; font-size: 0.9375rem; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover {
  background: var(--green-dark);
  text-decoration: none;
  color: #fff;
}
.btn-secondary {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--card-bg);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}
textarea { min-height: 100px; resize: vertical; }
label { display: block; font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text); }
.form-group { margin-bottom: 1rem; }
.form-actions { margin-top: 1.25rem; }
.error { color: #b91c1c; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.success { color: var(--green); font-size: 0.9375rem; margin-bottom: 0.5rem; font-weight: 500; }

/* Bot trap: visually hidden but present for basic bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  padding: 2.5rem 1.5rem;
}
.site-footer .wrap { max-width: 52rem; margin: 0 auto; font-size: 0.9375rem; color: var(--text-muted); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--green); text-decoration: none; }

/* Dashboard */
.dash-header {
  background: var(--card-bg);
  border-bottom: 2px solid var(--green);
  padding: 0.875rem 1.5rem;
  box-shadow: var(--shadow);
}
.dash-header .wrap { max-width: 52rem; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.dash-nav a { margin-left: 1rem; font-size: 0.9375rem; color: var(--text-muted); font-weight: 500; }
.dash-nav a:hover { color: var(--green); }
.dash-page { max-width: 52rem; margin: 0 auto; padding: 2rem 1.5rem; }
.back-link { display: inline-block; margin-bottom: 1.5rem; font-size: 0.9375rem; font-weight: 500; }

/* Events */
.event-card {
  padding: 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.event-card .meta { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.event-card h2 { font-size: 1.1875rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--green); }
.event-card .about { white-space: pre-wrap; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.event-card .location { font-size: 0.9375rem; color: var(--text-muted); }

/* WYSIWYG / textarea for content */
.content-editor {
  width: 100%;
  min-height: 200px;
  padding: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  background: var(--card-bg);
}

/* Admin tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th {
  background: var(--green-light);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--green);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions form { display: inline; }
.admin-table .actions button, .admin-table .actions .btn { margin-right: 0.35rem; padding: 0.35rem 0.6rem; font-size: 0.8125rem; }
.admin-table .status { font-size: 0.8125rem; }
.admin-table .status .badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 0.25rem; font-size: 0.75rem; font-weight: 600; }
.admin-table .status .badge-suspended { background: #b91c1c; color: #fff; }
.admin-table .status .badge-must-change { color: var(--text-muted); background: var(--green-light); }

/* Home page link blocks */
.home-cards {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.home-cards a {
  display: block;
  padding: 1.5rem 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.home-cards a:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  transform: translateY(-2px);
}
.home-cards a h2 { font-size: 1.125rem; margin: 0 0 0.35rem; color: var(--green); }
.home-cards a:hover h2 { color: var(--green-dark); }
.home-cards a p { margin: 0; font-size: 0.9375rem; color: var(--text-muted); }

.newsletter-cta {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: var(--green-light);
  border: 1px solid rgba(26, 107, 46, 0.2);
  border-radius: var(--radius-lg);
}
.newsletter-cta h2 { font-size: 1.25rem; margin: 0 0 0.5rem; }
.newsletter-cta p { margin-bottom: 1rem; font-size: 0.9375rem; color: var(--text-muted); }
