/*
 * Shared styles for every generated /tides/<station>/ page and the /tides/
 * directory. Plain CSS, no build step, matching the LIGHT table in
 * src/theme/tokens.ts so a page and the chart it links to read as one product.
 *
 * Bone in every scheme, and there used to be a `prefers-color-scheme: dark`
 * block here that flipped it. It went for the same reason `useTheme` returns
 * the light table on web: the page at `/` is one composition calibrated in
 * light, and these are its landing pads. Someone arriving from a search result
 * on a machine set to dark would otherwise read a near-black tide table and
 * then be handed a bone one by the button at the bottom of it.
 *
 * `color-scheme` is declared rather than left to be inferred, so the scrollbar
 * and any UA-drawn chrome come up light too.
 */

:root {
  color-scheme: light;
  --surface: #f4f1ea;
  --ink: #1c1a17;
  --secondary: rgba(28, 26, 23, 0.6);
  --muted: rgba(28, 26, 23, 0.45);
  --hairline: rgba(28, 26, 23, 0.12);
  --accent: #9a5518;
  --accent-ink: #f4f1ea;
  --card-bg: rgba(28, 26, 23, 0.04);
  --card-border: rgba(28, 26, 23, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------- nav --- */

.site-nav {
  border-bottom: 1px solid var(--hairline);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-nav .brand {
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-nav .links {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.site-nav .links a {
  text-decoration: none;
  color: var(--secondary);
}

.site-nav .links a:hover {
  color: var(--ink);
}

/* ----------------------------------------------------------------- cta --- */

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--card-border);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.fineprint {
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------------- table --- */

.tide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.tide-table th,
.tide-table td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
}

.tide-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
}

.tide-table td.height,
.tide-table td.time {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.tide-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.tide-kind.high::before,
.tide-kind.low::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.tide-kind.low::before {
  background: var(--muted);
}

/* ----------------------------------------------------------- meta card --- */

.station-meta {
  font-size: 14px;
  color: var(--secondary);
  margin: 4px 0 24px;
}

.sun-moon {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 24px 0;
  font-size: 14px;
}

.sun-moon .item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sun-moon .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sun-moon .value {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 16px;
}

.offset-note {
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--card-border);
  padding-left: 10px;
  margin: 16px 0;
}

/* --------------------------------------------------------------- lists --- */

.station-list {
  columns: 2;
  column-gap: 32px;
}

@media (min-width: 640px) {
  .station-list {
    columns: 3;
  }
}

.station-list a {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  text-decoration: none;
  color: var(--secondary);
  break-inside: avoid;
}

.station-list a:hover {
  color: var(--ink);
}

.region-group {
  margin: 28px 0;
}

.region-group h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}

/* -------------------------------------------------------------- footer --- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0 60px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer .links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
}

main {
  padding-bottom: 40px;
}

main h1 {
  font-size: clamp(26px, 4vw, 34px);
  margin: 32px 0 4px;
}

.eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 600;
  margin-top: 28px;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 32px 0 4px;
}
