/* ============================================================
   Google Fonts
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

/* ============================================================
   Raw color tokens
   ============================================================ */
:root {
  --color-forest: #2d4a2d;
  --color-water:  #3a6b7a;
  --color-sand:   #c8b89a;
  --color-bark:   #5c3d1e;
  --color-mist:   #f0ece4;
  --color-deep:   #1a2e1a;
  --color-night:  #0e1a0e;
  --color-reed:   #8fad7a;
}

/* ============================================================
   Light theme (default)
   ============================================================ */
:root,
[data-theme="light"] {
  --bg-primary:     var(--color-mist);
  --bg-secondary:   #e4ddd0;
  --bg-card:        #ffffff;
  --text-primary:   var(--color-deep);
  --text-body:      #3a3a2e;
  --text-muted:     #6b6b55;
  --accent-primary: var(--color-forest);
  --accent-hover:   #3d6b3d;
  --accent-water:   var(--color-water);
  --border:         #d4c9b0;
  --shadow:         rgba(26,46,26,0.10);
  --nav-bg:         rgba(240,236,228,0.95);
}

/* ============================================================
   Dark theme – auto via prefers-color-scheme
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary:     var(--color-night);
    --bg-secondary:   #152215;
    --bg-card:        #1c2e1c;
    --text-primary:   var(--color-mist);
    --text-body:      #cfc8b8;
    --text-muted:     #8a8a6a;
    --accent-primary: var(--color-reed);
    --accent-hover:   #a8cc90;
    --accent-water:   #5a9aaa;
    --border:         #2a3d2a;
    --shadow:         rgba(0,0,0,0.35);
    --nav-bg:         rgba(14,26,14,0.97);
  }
}

/* Dark theme – manual toggle */
[data-theme="dark"] {
  --bg-primary:     var(--color-night);
  --bg-secondary:   #152215;
  --bg-card:        #1c2e1c;
  --text-primary:   var(--color-mist);
  --text-body:      #cfc8b8;
  --text-muted:     #8a8a6a;
  --accent-primary: var(--color-reed);
  --accent-hover:   #a8cc90;
  --accent-water:   #5a9aaa;
  --border:         #2a3d2a;
  --shadow:         rgba(0,0,0,0.35);
  --nav-bg:         rgba(14,26,14,0.97);
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Source Serif 4', Georgia, serif;
  background-color: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.7;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--text-primary);
  line-height: 1.25;
}

h1 { font-size: clamp(2rem,   5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

p {
  margin-bottom: 1rem;
  max-width: 70ch;
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.right {
  float: right;
  width: 28%;
  margin: 0 0 1.25rem 1.75rem;
}

.wrap {
  overflow: auto;
}

@media (max-width: 600px) {
  .right {
    float: none;
    display: block;
    width: 55%;
    margin: 0 auto 1.5rem;
  }

  .table-wrapper table thead {
    display: none;
  }

  .table-wrapper table tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
  }

  .table-wrapper table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
  }

  .table-wrapper table td:last-child {
    border-bottom: none;
  }

  .table-wrapper table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    flex-shrink: 0;
  }
}

ul {
  margin-bottom: 1em;
}

/* ============================================================
   Layout utilities
   ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.section {
  padding-block: 5rem;
}

.section--alt {
  background-color: var(--bg-secondary);
  transition: background-color 0.25s ease;
}

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.section__header h2 {
  margin-bottom: 0.75rem;
}

.section__header p {
  margin-inline: auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn--primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg-primary);
}

.btn--secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn--secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

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

.btn--outline:hover {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

/* ============================================================
   Tvåkolumners löptext
   ============================================================ */
.two-col {
  column-count: 2;
  column-gap: 2.5rem;
}

@media (max-width: 600px) {
  .two-col {
    column-count: 1;
  }
}

/* ============================================================
   Scroll-reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Tables
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: 'Playfair Display', serif;
  font-weight: 600;
}

td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) td {
  background-color: var(--bg-secondary);
}

/* ============================================================
   Leaflet-karta
   ============================================================ */
.site-map {
  width: 100%;
  height: 420px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

@media (max-width: 480px) {
  .site-map { height: 300px; }
}

/* Leaflet-popup för klickbara områden */
.map-omrade-popup .leaflet-popup-content-wrapper {
  font-family: 'Source Serif 4', serif;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.map-omrade-popup .leaflet-popup-content h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: #1a2e1a;
}

.map-omrade-popup .leaflet-popup-content p {
  font-size: 0.82rem;
  margin: 0 0 0.35rem;
  color: #3a3a2e;
  max-width: none;
}

.map-omrade-popup .leaflet-popup-content p:last-child {
  margin-bottom: 0;
}

/* Leaflet-etikett för fågelskyddsområde */
.map-fagelskydd-label {
  background: rgba(184, 92, 0, 0.85);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-family: 'Source Serif 4', serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.map-fagelskydd-label::before {
  display: none;
}

/* ============================================================
   Map placeholder
   ============================================================ */
.map-placeholder {
  width: 100%;
  height: 380px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
  gap: 0.5rem;
}

.map-placeholder svg {
  opacity: 0.4;
  width: 48px;
  height: 48px;
}

/* ============================================================
   Notice / warning box
   ============================================================ */
.notice {
  background-color: var(--bg-card);
  border-left: 4px solid var(--accent-water);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.5rem;
  color: var(--text-body);
  font-size: 0.95rem;
}

.notice--warning {
  border-left-color: #c8760a;
}

/* ============================================================
   Rule list
   ============================================================ */
.rule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rule-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background-color: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-body);
  transition: background-color 0.25s ease;
}

.rule-list li .rule-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .section {
    padding-block: 3rem;
  }

  p {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .section {
    padding-block: 2.5rem;
  }

  .btn {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
  }
}
