:root {
  --ink: #132238;
  --muted: #5f6d7e;
  --line: #dbe3ea;
  --bg: #f4f7fa;
  --panel: #ffffff;
  --primary: #0b6b5d;
  --primary-dark: #06483f;
  --accent: #c9971a;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(19, 34, 56, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #fff;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.site-header {
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.navbar { padding: .85rem 0; }

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
}

.navbar-brand small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #1d8f77 58%, var(--accent));
}

.nav-link {
  color: var(--ink);
  font-weight: 650;
  padding-inline: .85rem !important;
}

.nav-link.active,
.nav-link:hover { color: var(--primary); }

.hero {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(6, 33, 45, .94), rgba(7, 73, 64, .78), rgba(6, 33, 45, .38)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 110px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.96));
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 5rem 0 6rem;
}

.hero h1 {
  max-width: 860px;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: .98;
  letter-spacing: 0;
  font-weight: 800;
}

.hero .lead {
  max-width: 720px;
  margin: 1.35rem 0 2rem;
  color: rgba(255,255,255,.9);
  font-size: 1.18rem;
}

.kicker {
  margin: 0 0 .55rem;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08rem;
  text-transform: uppercase;
}

.search-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .8rem;
  align-items: center;
  max-width: 760px;
  padding: .55rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel i { color: var(--primary); padding-left: .7rem; }
.search-panel .form-control { min-height: 48px; border: 0; box-shadow: none; }

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  font-weight: 700;
}

.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  font-weight: 700;
}

.status-panel,
.open-data-callout,
.data-panel,
.topic-card,
.document-card,
.dataset-card,
.contact-panel,
.contact-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-panel {
  padding: 1.5rem;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.status-label {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.status-panel strong { display: block; margin: .25rem 0 .6rem; font-size: 1.7rem; }
.status-panel p { margin: 0; color: var(--muted); }

.section { padding: 4.8rem 0; }
.section-compact { padding: 3rem 0 0; }
.section-muted { background: var(--bg); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.section-heading.compact { display: block; }
.section-heading h2,
.panel-heading h2,
.newsletter h2,
.page-title h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
}

.indicator-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
}

.indicator-card {
  min-height: 154px;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(19, 34, 56, .06);
}

.indicator-card span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
}

.indicator-card strong {
  display: block;
  margin: .75rem 0 .35rem;
  font-size: 1.65rem;
  line-height: 1.1;
}

.indicator-card small { color: var(--primary); font-weight: 750; }
.indicator-card small.negative { color: var(--danger); }

.data-panel { padding: 1.2rem; box-shadow: 0 10px 28px rgba(19, 34, 56, .08); }

.definition-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  padding: 1.5rem;
  border: 1px solid rgba(11, 107, 93, .18);
  border-radius: 8px;
  background: #f7fbf9;
  box-shadow: 0 10px 28px rgba(19, 34, 56, .06);
}

.definition-panel h2 {
  margin: 0 0 .85rem;
  font-size: 1.35rem;
  font-weight: 800;
}

.definition-panel p:not(.kicker) {
  margin: 0 0 .85rem;
  color: var(--muted);
  line-height: 1.7;
}

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

.definition-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  border-radius: 8px;
  background: var(--primary);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.view-toggle button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 34px;
  padding: .35rem .65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
  white-space: nowrap;
}

.view-toggle button.active {
  color: #fff;
  background: var(--primary);
}

.map {
  width: 100%;
  min-height: 390px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(11, 107, 93, .08), rgba(47, 125, 154, .12)),
    #eef5f4;
}

.map .leaflet-container,
.leaflet-container {
  font-family: inherit;
}

.map .leaflet-control-zoom {
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(19, 34, 56, .12);
}

.map .leaflet-control-zoom a {
  color: var(--ink);
  border-color: var(--line);
}

.province-label {
  padding: .22rem .45rem;
  color: var(--ink);
  font-size: .75rem;
  font-weight: 800;
  text-align: center;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(19, 34, 56, .14);
}

.province-label::before {
  display: none;
}

.publication-list {
  display: grid;
  gap: 1rem;
}

.publication-item {
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.publication-item span,
.document-card span,
.timeline span {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.publication-item h3,
.document-card h2,
.dataset-card h2,
.topic-card h2,
.timeline h2 {
  margin: .35rem 0 .45rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.publication-item p,
.document-card p,
.dataset-card p,
.topic-card p,
.timeline p,
.open-data-callout p { color: var(--muted); }

.open-data-callout { height: 100%; padding: 1.5rem; background: #f7fbf9; }

.newsletter {
  padding: 3rem 0;
  color: #fff;
  background: var(--primary-dark);
}

.newsletter .kicker { color: #f3c44f; }

.newsletter-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem;
}

.newsletter-form .form-control { min-height: 48px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  margin-top: 1.35rem;
}

.publication-switch {
  display: grid;
  gap: .35rem;
  min-width: min(100%, 320px);
}

.publication-switch label {
  color: rgba(255, 255, 255, .86);
  font-size: .86rem;
  font-weight: 800;
}

.publication-switch .form-select {
  min-height: 42px;
  border: 0;
  box-shadow: 0 10px 28px rgba(19, 34, 56, .16);
}

.site-footer {
  padding: 3rem 0 1.5rem;
  color: rgba(255,255,255,.82);
  background: #102130;
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.site-footer a {
  display: block;
  margin: .35rem 0;
  color: rgba(255,255,255,.82);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: .9rem;
}

.page-title {
  padding: 5rem 0 3.5rem;
  color: #fff;
  background: linear-gradient(135deg, #102130, var(--primary-dark));
}

.page-title p:last-child {
  max-width: 680px;
  margin: .9rem 0 0;
  color: rgba(255,255,255,.86);
}

.topic-card,
.document-card,
.dataset-card {
  height: 100%;
  padding: 1.35rem;
}

.topic-card-link {
  display: block;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.topic-card-link:hover {
  color: var(--ink);
  border-color: rgba(11, 107, 93, .45);
  box-shadow: 0 14px 32px rgba(19, 34, 56, .12);
  transform: translateY(-2px);
}

.topic-card-link > span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--primary);
  font-weight: 800;
}

.topic-card i,
.dataset-card i {
  color: var(--primary);
  font-size: 2rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1rem;
}

.data-table th { color: var(--ink); }

.basket-list {
  display: grid;
  gap: .75rem;
}

.basket-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}

.basket-list div:last-child { border-bottom: 0; }
.basket-list span { color: var(--muted); font-weight: 700; }
.basket-list strong { color: var(--primary-dark); }

.meta-grid {
  display: grid;
  gap: .75rem;
}

.meta-grid div {
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}

.meta-grid div:last-child { border-bottom: 0; padding-bottom: 0; }

.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

.meta-grid strong {
  display: block;
  margin-top: .25rem;
  color: var(--ink);
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
}

.metric-row span {
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 750;
}

.metric-row strong { color: var(--primary-dark); }
.metric-row-large span { flex: 1 1 180px; }
.panel-note { margin: 1rem 0 0; color: var(--muted); }

.timeline {
  display: grid;
  gap: 1rem;
  max-width: 880px;
}

.timeline article {
  padding: 1.35rem;
  border-left: 4px solid var(--primary);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
}

.contact-panel,
.contact-form { padding: 1.5rem; }

.contact-panel i {
  color: var(--primary);
  margin-right: .5rem;
}

@media (max-width: 1199px) {
  .indicator-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .hero { min-height: auto; }
  .hero-content { padding: 4rem 0 5rem; }
  .search-panel,
  .newsletter-form,
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .search-panel i { display: none; }
  .indicator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading,
  .panel-heading { align-items: start; flex-direction: column; }
  .map { min-height: 330px; }
}

@media (max-width: 480px) {
  .indicator-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.4rem; }
}
