/* ==========================================================================
   Weerdagboek - Duinoord, Den Haag
   Licht thema, data-gericht design
   ========================================================================== */

:root {
  --bg:         #f8f9fb;
  --surface:    #ffffff;
  --surface-2:  #f0f2f5;
  --border:     rgba(0, 0, 0, 0.08);
  --text:       #1a1d23;
  --text-muted: #6b7280;
  --accent:     #4f7df5;
  --warm:       #d97706;
  --red:        #dc2626;
  --green:      #059669;
  --purple:     #7c3aed;
  --indigo:     #4f46e5;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0, 0, 0, 0.06);
  --transition: 0.2s ease;
  --font:       'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: 'Source Serif 4', 'Georgia', serif;
}

/* ----- Reset & Base ---------------------------------------------------- */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: linear-gradient(180deg, #dce7f5 0%, #f0ece4 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ----- Topbar ---------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(224, 233, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-home {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.25rem;
  transition: color var(--transition);
}

.topbar-home:hover {
  color: var(--text);
}

.topbar-title {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.topbar-location {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: auto;
}

/* ----- Month Picker ---------------------------------------------------- */

.month-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}

.month-picker-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

.month-picker-select {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 32px 8px 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
}

.month-picker-select:hover {
  border-color: var(--accent);
}

.month-picker-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 125, 245, 0.15);
}

/* ----- Side Navigation ------------------------------------------------- */

.sidenav {
  position: fixed;
  top: 128px;
  left: 0;
  width: 160px;
  padding: 24px 0 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

.sidenav-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 12px;
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  line-height: 1.4;
}

.sidenav-link:hover {
  color: var(--text);
  border-left-color: var(--accent);
}

.sidenav-link.active {
  color: var(--text);
  font-weight: 600;
  border-left-color: var(--accent);
}

/* ----- Main Container -------------------------------------------------- */

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px calc(100vh - 200px);
}

/* ----- Hero ------------------------------------------------------------ */

.hero {
  text-align: center;
  padding: 64px 0 48px;
  scroll-margin-top: 72px;
}

.hero-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-readings {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-reading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-value {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-reading--temp .hero-value { color: var(--red); }
.hero-reading--hum  .hero-value { color: var(--accent); }
.hero-reading--press .hero-value { color: var(--indigo); }

.hero-metric {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-time {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.hero-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ----- Sections -------------------------------------------------------- */

.section {
  margin-top: 56px;
  scroll-margin-top: 72px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}


/* ----- Stat Cards (Vandaag) -------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stat-label {
  display: block;
  font-size: 1.0rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.stat-value--highlight {
  font-size: 1.25rem;
  color: var(--warm);
  white-space: nowrap;
}

.stat-detail {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.stat-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 31px;
  line-height: 1.5;
}

.stat-footnote {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ----- Charts ---------------------------------------------------------- */

.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  height: 300px;
  position: relative;
}

.chart-container--tall {
  height: 380px;
}

/* ----- Note (Kanttekeningen) ------------------------------------------- */

.note {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface-2);
  border-left: 3px solid var(--text-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.note-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 12px;
}

.note p {
  margin-bottom: 0.8em;
}

.note p:last-child {
  margin-bottom: 0;
}

.note em {
  color: var(--text);
  font-style: italic;
}

/* ----- Comfort Table --------------------------------------------------- */

.comfort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 12px;
}

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

.comfort-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comfort-table tbody tr:last-child td {
  border-bottom: none;
}

/* ----- Prose (Story Sections) ------------------------------------------ */

.prose {
  max-width: none;
}

.prose p {
  margin-bottom: 1em;
  line-height: 1.75;
  color: var(--text);
}

.prose h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.75em;
  color: var(--text);
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose em {
  font-style: italic;
  color: var(--indigo);
}

.prose a,
.note a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

.prose a:hover,
.note a:hover {
  color: var(--indigo);
}

.prose ul {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.prose li {
  margin-bottom: 0.4em;
  line-height: 1.65;
  color: var(--text);
}

.prose li::marker {
  color: var(--text-muted);
}

/* ----- Pipeline (Visual) ----------------------------------------------- */

.pipeline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: 24px 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.pipeline-icon {
  font-size: 2.8rem;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
  color: var(--accent);
}

.pipeline-text {
  font-weight: 600;
  font-size: 0.9rem;
}

.pipeline-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pipeline-arrow {
  padding-left: 14px;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
}

/* ----- Data Stats ------------------------------------------------------ */

.data-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.data-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.data-stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.data-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ----- Footer ---------------------------------------------------------- */

.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ----- Responsive ------------------------------------------------------ */

@media (max-width: 1200px) {
  .sidenav {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-readings {
    flex-direction: column;
    gap: 24px;
  }

  .hero-value {
    font-size: 1.65rem;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 240px;
    padding: 16px;
  }

  .data-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar-location {
    display: none;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .section {
    margin-top: 40px;
  }
}

@media (max-width: 380px) {
  .data-stats {
    grid-template-columns: 1fr;
  }

  .stat-row {
    flex-direction: column;
    align-items: stretch;
  }

  .stat-cell {
    flex-direction: row;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
  }

  .stat-cell:last-child {
    border-bottom: none;
  }

  .stat-detail {
    margin-top: 0;
  }
}
