/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Playfair+Display:wght@600;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --bg:          #faf8f4;
  --surface:     #ffffff;
  --gold:        #c8973a;
  --gold-dark:   #a67c2e;
  --green:       #2d4a2d;
  --green-light: #3d6b3d;
  --text:        #1a1a1a;
  --text-muted:  #6b6b6b;
  --border:      #e4dfd5;
  --shadow:      0 2px 8px rgba(0,0,0,.08);
  --radius:      6px;
  --font-body:   'Inter', system-ui, sans-serif;
  --font-head:   'Playfair Display', Georgia, serif;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ─────────────────────────────────────────────────────── */
nav {
  background: var(--green);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
nav .site-title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: .01em;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}
nav ul a {
  color: #d4e8d4;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .85rem;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}
nav ul a:hover,
nav ul a.active {
  background: var(--gold);
  color: var(--green);
}

/* ── Layout ──────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.page-title {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--green);
  margin-bottom: .5rem;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--gold);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card h2 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--green);
  margin-bottom: .75rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  border: 2px solid transparent;
}
.btn-gold {
  background: var(--gold);
  color: var(--surface);
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}
.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-outline:hover {
  background: var(--green);
  color: var(--surface);
}

/* ── Forms / Filters ─────────────────────────────────────────── */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}
label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: .3rem;
}
select, input[type="text"] {
  font-family: var(--font-body);
  font-size: .9rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
select:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .9rem;
}
thead th {
  background: var(--green);
  color: #d4e8d4;
  font-weight: 600;
  padding: .75rem 1rem;
  text-align: left;
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: #f4f1ec; }
tbody tr:hover { background: #ede8df; }
tbody td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
}

/* ── Plot container ──────────────────────────────────────────── */
.plot-container {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

/* ── HTMX loading indicator ──────────────────────────────────── */
.htmx-indicator {
  display: none;
  color: var(--text-muted);
  font-size: .85rem;
  margin-left: .5rem;
}
.htmx-request .htmx-indicator { display: inline; }

/* ── Spinner ─────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: .5rem;
}
.blast-loading {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--gold);
  color: var(--text-muted);
  font-size: .95rem;
  margin-top: 1rem;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  background: var(--green);
  color: #a8c8a8;
  text-align: center;
  padding: 1.25rem;
  font-size: .85rem;
}
footer a { color: var(--gold); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Utility ─────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
