:root {
  color-scheme: light;
  --text: #1a2b2e;
  --muted: #5c7477;
  --bg: #ffffff;
  --bg-alt: #eef6f6;
  --bg-card: #f7faf9;
  --border: #dde9e8;
  --accent: #0f7a72;
  --accent-dark: #0b5b55;
  --link: #0b6e66;
  --header-bg: #0b3c3a;
  --header-text: #eaf5f3;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img, iframe { max-width: 100%; }

/* ---------- header ---------- */
.site-header { background: var(--header-bg); color: var(--header-text); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 1.25rem; flex-wrap: wrap;
}
.brand {
  font-weight: 700; font-size: 1.15rem; color: var(--header-text) !important;
  display: flex; align-items: center; gap: 0.4rem;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.brand__mark { font-size: 1.1rem; }

.top-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.top-nav a {
  color: var(--header-text); opacity: 0.85; font-size: 0.92rem;
  padding: 0.25rem 0;
}
.top-nav a:hover { opacity: 1; text-decoration: none; border-bottom: 2px solid var(--header-text); }
.top-nav__current { opacity: 1 !important; border-bottom: 2px solid var(--accent); }

.breadcrumbs {
  font-size: 0.85rem; color: var(--muted);
  padding: 0.55rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-alt);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { color: var(--text); font-weight: 500; }

main.wrap { padding-top: 1.75rem; padding-bottom: 3rem; }

h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 1.25rem; }
h2 { font-size: 1.2rem; margin-top: 0; }
.voivodeship { font-weight: 400; color: var(--muted); font-size: 1rem; }

/* ---------- lake page layout ---------- */
.lake-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.75rem;
  align-items: start;
}
.lake-aside { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.aside-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem;
}
.aside-heading { font-weight: 700; margin: 0 0 0.6rem; font-size: 0.95rem; }

.quick-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin: 0; }
.quick-facts dt { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.quick-facts dd { margin: 0.1rem 0 0; font-weight: 600; }

.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.85rem; }
.badge--great { background: #d3f2df; color: #146c2e; }
.badge--good { background: #d9f0ec; color: #0b5b55; }
.badge--medium { background: #fdf1d0; color: #8a6100; }
.badge--poor { background: #fce3d4; color: #a34b0a; }
.badge--bad { background: #fbdada; color: #a3261d; }
.badge--unknown { background: #eee; color: #666; }

.map-embed { padding: 0; overflow: hidden; }
.map-embed iframe { display: block; width: 100%; }
.map-link { font-size: 0.85rem; margin: 0; padding: 0.6rem 0.85rem; }

.weather-intro { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.6rem; }
.weather-body[data-state="loading"], .weather-body[data-state="error"] { color: var(--muted); font-size: 0.9rem; }
.weather-main { display: flex; align-items: center; gap: 0.5rem; }
.weather-icon { font-size: 1.8rem; line-height: 1; }
.weather-temp { font-size: 1.6rem; font-weight: 700; }
.weather-desc { margin: 0.35rem 0 0.15rem; }
.weather-details { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.3rem; }
.weather-source { color: var(--muted); font-size: 0.72rem; margin: 0; }

.nearby-list { list-style: none; margin: 0; padding: 0; }
.nearby-list li {
  display: flex; justify-content: space-between; gap: 0.5rem;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.92rem;
}
.nearby-list li:last-child { border-bottom: none; }
.nearby-distance { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

.article-body p { margin: 0 0 1rem; }
.article-body .freshness { color: var(--muted); font-size: 0.92rem; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.92rem; }
.data-table th, .data-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { font-weight: 500; color: var(--muted); }

.source-note { font-size: 0.85rem; color: var(--muted); }
.disclaimer { font-size: 0.82rem; color: var(--muted); font-style: italic; }

.back-link { margin-top: 2rem; }

/* ---------- index / listing page ---------- */
#lake-search {
  width: 100%; padding: 0.7rem 0.9rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.5rem;
  background: var(--bg-card); color: var(--text);
}
.lake-count { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
.lake-list { list-style: none; margin: 0; padding: 0; }
.lake-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.lake-list .voivodeship { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

/* ---------- footer ---------- */
.site-footer { background: var(--header-bg); color: var(--header-text); margin-top: 3rem; }
.footer-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem; padding: 2rem 1.25rem 1.25rem;
}
.footer-heading { font-weight: 700; margin: 0 0 0.6rem; color: var(--header-text); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--header-text); opacity: 0.85; font-size: 0.92rem; }
.footer-col a:hover { opacity: 1; }
.footer-note { color: var(--header-text); opacity: 0.75; font-size: 0.85rem; margin: 0 0 0.4rem; }
.footer-note a { color: var(--header-text); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); padding: 0.9rem 1.25rem;
  font-size: 0.82rem; opacity: 0.7;
}

/* ---------- responsive ---------- */
@media (max-width: 800px) {
  .lake-layout { grid-template-columns: 1fr; }
  .lake-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  h1 { font-size: 1.4rem; }
  .quick-facts { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .top-nav { gap: 0.75rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --text: #e6f1ef;
    --muted: #93aeac;
    --bg: #0e1716;
    --bg-alt: #13201f;
    --bg-card: #142322;
    --border: #24504b;
    --accent: #3fd6c4;
    --accent-dark: #2fae9f;
    --link: #6fe0d1;
    --header-bg: #081615;
    --header-text: #e6f1ef;
  }
  .badge--great { background: #123d24; color: #7ee6a3; }
  .badge--good { background: #123832; color: #6fe0d1; }
  .badge--medium { background: #3a2f0d; color: #f2cf7a; }
  .badge--poor { background: #3a220e; color: #f0a877; }
  .badge--bad { background: #3a1414; color: #f19a9a; }
  .badge--unknown { background: #24302f; color: #a9bdba; }
}
