/* Shared styles for the generated /tennis-courts/ landing pages. */
:root {
  --ink: #1a1a1a;
  --muted: #667;
  --line: #e5e5e5;
  --brand: #ffd700;

  /* Themed tokens. Dark mode only overrides these. */
  --page-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.9);
  --btn-bg: #1a1a1a;
  --btn-fg: #ffffff;
  --btn-hover: #000000;
  --link: #0a58ca;
  --hover: rgba(0, 0, 0, 0.04);
  --text-body: #333333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg);
  font:
    16px/1.6 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
}

main,
footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--brand);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 auto;
}

.brand-name {
  display: block;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.tagline {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--hover);
}

a.btn-map {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 15px;
  border-radius: 999px;
  white-space: nowrap;
}

a.btn-map:hover {
  background: var(--btn-hover);
}

/* --- Hero --- */
.hero {
  padding: 30px 0 8px;
}

.hero h1 {
  margin-top: 0;
  max-width: 720px;
}

.hero .lede {
  max-width: 640px;
}

.hero-cta {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-ghost {
  display: inline-block;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 15px;
  border-radius: 999px;
}

.btn-ghost:hover {
  background: var(--hover);
}

@media (max-width: 640px) {
  .tagline {
    display: none;
  }
}

/* On very narrow screens keep the logo + nav, drop the wordmark text. */
@media (max-width: 480px) {
  .brand-name {
    display: none;
  }
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
  margin: 24px 0 8px;
}

h2 {
  font-size: 1.25rem;
  margin: 32px 0 12px;
}

a {
  color: var(--link);
}

.lede {
  font-size: 1.05rem;
  color: var(--text-body);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 8px 0 0;
}

.stat {
  font-size: 0.9rem;
  color: var(--muted);
}

.stat b {
  color: var(--ink);
}

/* Surface category swatches (match the map colours). */
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: baseline;
}

.dot.clay {
  background: #e4572e;
}

.dot.grass {
  background: #2ecc71;
}

.dot.hard {
  background: #3498db;
}

.map-wrap {
  position: relative;
  margin: 20px 0;
}

iframe {
  width: 100%;
  height: 340px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
}

a.cta {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

ul.courts {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

ul.courts li {
  border-bottom: 1px solid var(--line);
}

a.court {
  display: flex;
  flex-direction: column;
  padding: 10px 4px;
  text-decoration: none;
  color: var(--ink);
}

.court-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.court-meta {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

ul.cities {
  columns: 2 260px;
  padding: 0;
  list-style: none;
  margin: 0;
}

ul.cities li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px;
  border-radius: 8px;
  break-inside: avoid;
}

ul.cities li:hover {
  background: var(--hover);
}

ul.cities a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

ul.cities a:hover {
  color: var(--link);
}

ul.cities span {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.more,
.nearby {
  font-size: 0.9rem;
  color: var(--muted);
}

.nearby a {
  margin-right: 6px;
}

footer {
  padding: 40px 20px 60px;
  color: var(--muted);
  font-size: 0.85rem;
}

footer a {
  color: inherit;
}

/* --- Dark mode: override the themed tokens only --- */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #f3f3f3;
    --muted: #a3a3a3;
    --line: rgba(255, 255, 255, 0.12);

    --page-bg: #131417;
    --header-bg: rgba(19, 20, 23, 0.85);
    --btn-bg: #f3f3f3;
    --btn-fg: #131417;
    --btn-hover: #ffffff;
    --link: #6ea8fe;
    --hover: rgba(255, 255, 255, 0.08);
    --text-body: #d0d0d0;
  }
}
