/* ─── SEO Page Styles ──────────────────────────────────────────────────
   Server-rendered pages (campground profiles, indexes, etc.)
   Imports tokens.css for design system consistency with the SPA.
   ──────────────────────────────────────────────────────────────────── */

@import url("tokens.css");

/* ─── Theme variables (mirrored from App.css) ──────────────────────── */

:root {
  --bg: #f5f5f0;
  --bg-card: #fff;
  --bg-hover: #fafaf5;
  --text: #1a1a1a;
  --text-muted: #666;
  --text-light: #777;
  --border: #ddd;
  --border-light: #eee;
  --accent: #2d5016;
  --accent-hover: #3a6b1e;
  --chip-bg: #f0f7e8;
  --chip-border: #c5dbb0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171714;
    --bg-card: #21211e;
    --bg-hover: #2a2a26;
    --text: #deded8;
    --text-muted: #9a9a90;
    --text-light: #8a8a80;
    --border: #38382e;
    --border-light: #2e2e26;
    --accent: #3a6a28;
    --accent-hover: #4a7a38;
    --chip-bg: #1c2618;
    --chip-border: #3d5530;
  }
}

/* ─── Base ─────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: var(--leading-normal);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast) ease;
}

a:hover { color: var(--accent-hover); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

img { max-width: 100%; height: auto; }

/* ─── Skip link ────────────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-2);
  background: var(--accent);
  color: var(--text-on-accent);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semi);
  z-index: var(--z-modal);
}
.skip-link:focus { left: var(--space-2); }

/* ─── Layout ───────────────────────────────────────────────────────── */

.seo-page {
  max-width: var(--max-w-app);
  margin: 0 auto;
  padding: var(--space-4);
}

/* ─── Header ───────────────────────────────────────────────────────── */

.seo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}

.seo-header__brand {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text);
}

.seo-header__nav {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-base);
}

/* ─── Footer ───────────────────────────────────────────────────────── */

.seo-footer {
  margin-top: var(--space-7);
  padding: var(--space-5) var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}

.seo-footer a { color: var(--text-muted); }
.seo-footer a:hover { color: var(--accent); }

/* ─── Breadcrumb ───────────────────────────────────────────────────── */

.breadcrumb {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { margin: 0 var(--space-1); }

/* ─── Cards ────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: var(--space-3); }

/* ─── Tags ─────────────────────────────────────────────────────────── */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
}

.tag {
  display: inline-block;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text);
  transition: background var(--transition-fast) ease;
}

a.tag:hover { background: var(--bg-hover); }

/* ─── Profile page ─────────────────────────────────────────────────── */

.profile__header {
  margin-bottom: var(--space-5);
}

.profile__name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2);
}

.profile__region {
  font-size: var(--text-base);
  color: var(--text-muted);
}

.profile__pitch {
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-4);
}

.profile__description {
  line-height: var(--leading-normal);
  margin-bottom: var(--space-4);
}

.profile__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.profile__meta-item {
  font-size: var(--text-sm);
}

.profile__meta-label {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.profile__booking-link {
  display: inline-block;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semi);
  transition: background var(--transition-fast) ease;
}
.profile__booking-link:hover {
  background: var(--accent-hover);
  color: var(--text-on-accent);
}

.profile__tips {
  list-style: disc;
  padding-left: var(--space-5);
  margin-top: var(--space-2);
}
.profile__tips li {
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
}

/* ─── Nearby section ───────────────────────────────────────────────── */

.nearby {
  margin-top: var(--space-5);
}

.nearby__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semi);
  margin-bottom: var(--space-3);
}

/* ─── Index pages ──────────────────────────────────────────────────── */

.index__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.index__subtitle {
  color: var(--text-muted);
  font-size: var(--text-base);
  margin-bottom: var(--space-5);
}

.index__group-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semi);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-light);
}

.cg-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-light);
}

.cg-row__name {
  font-weight: var(--weight-medium);
  flex: 1;
}

.cg-row__meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── State cards (campgrounds index) ──────────────────────────────── */

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.state-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  transition: box-shadow var(--transition-base) ease, border-color var(--transition-base) ease;
}

.state-card:hover {
  box-shadow: var(--shadow-card);
  border-color: var(--accent);
}

.state-card__abbr {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--accent);
}

.state-card__count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ─── Source badges ────────────────────────────────────────────────── */

.source-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  padding: 0.15rem var(--space-2);
  border-radius: var(--radius-pill);
}

.source-badge--recgov {
  background: var(--src-recgov-badge-bg);
  color: var(--src-recgov-badge-text);
}
.source-badge--wa_state {
  background: var(--src-wa-badge-bg);
  color: var(--src-wa-badge-text);
}
.source-badge--or_state {
  background: var(--src-or-badge-bg);
  color: var(--src-or-badge-text);
}

/* ─── This Weekend ─────────────────────────────────────────────────── */

.weekend__header {
  margin-bottom: var(--space-5);
}

.weekend__date-range {
  font-size: var(--text-base);
  color: var(--text-muted);
}

.weekend__refreshed {
  font-size: var(--text-xs);
  color: var(--text-light);
  margin-top: var(--space-2);
}

.weekend__card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.weekend__avail-count {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--accent);
  min-width: 3ch;
  text-align: center;
}

.weekend__empty {
  text-align: center;
  padding: var(--space-7);
  color: var(--text-muted);
}

/* ─── Tag filter bar ───────────────────────────────────────────────── */

.tag-filter {
  margin-bottom: var(--space-4);
}

.tag-filter__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-right: var(--space-2);
}

/* ─── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .seo-page { padding: var(--space-3); }
  .profile__meta { grid-template-columns: 1fr 1fr; }
  .state-grid { grid-template-columns: 1fr 1fr; }
  .cg-row { flex-direction: column; gap: var(--space-1); }
}
