/*
  Publik CSS - filkarta
  Sok efter rubriker som beskriver ytan du vill ändra, t.ex.
  "Header / navigation", "Karta", "Tävlingsresultat", "Fångstbilder",
  "Kontakt" eller "Mobil".

  Låg risk-städning: bara orienteringskommentarer. Reglerna ligger kvar i
  befintlig ordning for att inte ändra sidans utseende.
*/

:root {
  --bg: #eef7f2;
  --card: #fff;
  --text: #153327;
  --muted: #66756d;
  --primary: #0f3d2e;
  --accent: #d99a28;
  --danger: #a83232;
  --border: #d9e8df;
  --shadow: 0 18px 40px rgba(15, 61, 46, .12);
}

/* Grund */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

/* Header / navigation */
#siteHeader {
  position: sticky;
  top: 0;
  z-index: 3000;
}

.site-header {
  background: rgba(15, 61, 46, .96);
  color: white;
}

.nav {
  width: 100%;
  position: relative;

  display: flex;
  align-items: center;

  padding: 10px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

.brand span,
.brand div,
.brand p,
.brand a {
  font-weight: 800;
  text-align: left;
  color: white;
}

.nav-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 10px;

  flex-wrap: nowrap;
  white-space: nowrap;

  width: auto;
  height: auto;
  background: transparent;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 650;
}

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  color: white;
  border-radius: 10px;
  padding: 8px;
}


/* Hero */
.hero {
  min-height: 30vh;
  display: grid;
  place-items: center;
  padding: 30px 20px;
  background:
    linear-gradient(rgba(9, 30, 22, .55), rgba(9, 30, 22, .65)),
    url("../images/hero.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
}

.hero-inner {
  text-align: center;
  max-width: 900px;
}

.hero-logo {
  max-width: 360px;
  width: 85%;
  height: auto;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 5rem);
  margin: 0 0 12px;
}

.hero-buttons {
  margin-top: 18px;
}

/* Layout */
.page,
.section {
  max-width: 1180px;
  margin: auto;
  padding: 48px 20px;
}

.narrow {
  max-width: 760px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

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

/* Kort */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Klickbara nyheter på startsidan */
.clickable-news .card {
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.clickable-news .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0,0,0,.12);
}

/* Knappar */
.btn {
  display: inline-flex;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  margin: 3px;
}

.btn.secondary {
  background: var(--accent);
  color: #1c160b;
}

.btn.danger {
  background: var(--danger);
}

.btn.ghost {
  background: #eef7f2;
  color: var(--primary);
  border: 1px solid var(--border);
}

/* Formulär */
input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font: inherit;
}

label {
  display: block;
  font-weight: 750;
  margin: 10px 0 6px;
}

/* Text / små komponenter */
.meta {
  color: var(--muted);
  font-size: .92rem;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  background: #e4f3ea;
  color: var(--primary);
  padding: 4px 10px;
  font-size: .82rem;
  font-weight: 800;
}

/* Tabeller */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

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

th {
  background: #e4f3ea;
  color: var(--primary);
  font-weight: 850;
}

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

/* Info-rutor */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.info-box {
  background: #e4f3ea;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.info-box strong {
  display: block;
  color: var(--primary);
  margin-bottom: 6px;
}

/* Karta och bilder */
.map {
  height: 520px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.gallery-img,
.water-img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  object-fit: cover;
  max-height: 360px;
}

/* Galleri - valkort */
#galleryMenu .grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 360px));
  gap: 22px;
  justify-content: start;
}

.gallery-select-card {
  max-width: 360px;
}

.gallery-preview-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  display: block;
}

/* Startsida - preview-korten ska kunna växa i höjdled */
.home-preview > .grid {
  align-items: start;
}

.home-preview > .grid > .card {
  min-height: 320px;
  max-height: none;
  overflow: visible;
  position: relative;

  display: flex;
  flex-direction: column;
}

.home-preview > .grid > .card img,
.home-preview > .grid > .card .gallery-img,
.home-preview > .grid > .card .water-img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
}

.preview-footer {
  margin-top: auto;
  padding-top: 12px;
  position: relative;
  z-index: 2;
}

.footer-cookie-note {
  margin-top: 6px;
  font-size: 0.82rem;
  opacity: 0.75;
  line-height: 1.4;
}

.home-preview .card {
  height: auto;
}

.home-preview .accordion-card,
.home-preview .gallery-card,
.home-preview .catch-card {
  height: auto;
  min-height: unset;
}

/* Admin-layout */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--primary);
  color: white;
  padding: 24px;
}

.sidebar button {
  width: 100%;
  margin: 6px 0;
}

.admin-main {
  padding: 30px;
}

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

.stat {
  background: white;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border);
}

.stat strong {
  display: block;
  font-size: 2rem;
}

.pending-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}

.pending-card img {
  width: 100%;
  border-radius: 16px;
}

/* Footer */
.footer {
  background: var(--primary);
  color: white;
  padding: 28px;
  text-align: center;
  margin-top: 40px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #10251d;
  color: white;
  padding: 16px 22px;
  border-radius: 18px;
  display: none;
  z-index: 100;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}

.toast.show {
  display: block;
}


/* Mobil */
@media (max-width: 820px) {
  .nav {
    position: relative;
    justify-content: space-between;
    gap: 12px;
  }

  .brand {
    min-width: 0;
    max-width: calc(100% - 58px);
  }

  .brand span {
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-logo {
    width: 40px;
    height: 40px;
  }

  .menu-btn {
    display: block;
    flex-shrink: 0;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 12px;
    left: auto;
    transform: none;

    width: min(300px, calc(100vw - 24px));
    max-height: 75vh;
    overflow-y: auto;

    background: var(--primary);
    padding: 14px;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .25);

    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 10px 12px;
  }

  .grid,
  .grid.two,
  .stat-grid,
  .admin-layout,
  .pending-card,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .map {
    height: 380px;
  }

  .hero-logo {
    max-width: 260px;
  }
}

/* Fiskevatten - fiskeförbud på karta */
/* .water-marker {
  width: 26px;
  height: 26px;

  display: grid;
  place-items: center;

  border-radius: 999px;
  background: #0f3d2e;
  color: white;
  border: 3px solid white;
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
  font-weight: 900;
}

.water-marker-ban {
  background: #ff0000;
  color: white;
  border-color: #fff;
  box-shadow: 0 0 0 5px rgba(255,0,0,.28), 0 10px 24px rgba(0,0,0,.34);
  animation: banPulse 1.8s infinite;
} 

@keyframes banPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255,0,0,.45), 0 10px 24px rgba(0,0,0,.34);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255,0,0,0), 0 10px 24px rgba(0,0,0,.34);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255,0,0,0), 0 10px 24px rgba(0,0,0,.34);
  }
} */

.map-ban-warning {
  display: inline-block;
  margin: 4px 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ff0000;
  color: white;
  font-weight: 900;
}

.fishing-ban-card {
  border-color: #ff0000;
  background: #fff1f1;
}

.fishing-ban-card h2 {
  color: #b00000;
}


/* PWA / appkänsla */
.pwa-update-notice {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(120%);
  z-index: 5000;

  width: min(560px, calc(100vw - 24px));
  padding: 12px 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  background: #10251d;
  color: white;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0,0,0,.28);

  opacity: 0;
  pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
}

.pwa-update-notice.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.pwa-update-notice .btn {
  white-space: nowrap;
}

/* Mobilfix: karta får inte lägga sig ovanpå menyn */
.leaflet-container {
  z-index: 1;
}

.leaflet-pane,
.leaflet-top,
.leaflet-bottom {
  z-index: 1 !important;
}

.leaflet-control {
  z-index: 2 !important;
}

@media (max-width: 820px) {
  .pwa-update-notice {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pwa-update-notice .btn {
    width: 100%;
    justify-content: center;
  }
}


/* Mobil-app-layout med bottom navigation */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .site-header {
    box-shadow: 0 8px 26px rgba(0,0,0,.18);
  }

  .nav {
    min-height: 58px;
    padding: 8px 14px;
  }

  .brand {
    text-decoration: none;
  }

  .brand span {
    font-size: .92rem;
  }

  .nav-logo {
    width: 32px;
    height: 32px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: env(safe-area-inset-bottom);

    z-index: 4000;

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;

    padding: 8px;

    background: rgba(15, 61, 46, .96);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 18px 50px rgba(0,0,0,.32);
    backdrop-filter: blur(14px);
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    min-width: 0;
    padding: 7px 4px 6px;

    display: grid;
    place-items: center;
    gap: 2px;

background: transparent;
border: 0;
appearance: none;
-webkit-appearance: none;

    color: rgba(255,255,255,.78);
    text-decoration: none;
    border-radius: 18px;
    font-size: .72rem;
    font-weight: 800;

    transition: background .18s ease, color .18s ease, transform .18s ease;
  }

  .mobile-bottom-nav a span,
  .mobile-bottom-nav button span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 25px;
    font-size: 1.16rem;
    line-height: 1;
  }

  .mobile-bottom-nav a strong,
  .mobile-bottom-nav button strong {
    font-size: .68rem;
    line-height: 1;
    white-space: nowrap;
  }

  .mobile-bottom-nav a.active,
  .mobile-bottom-nav button.active {
    background: rgba(217,154,40,.22);
    color: #ffd27a;
  }

  .mobile-bottom-nav a:active,
  .mobile-bottom-nav button:active {
    transform: scale(.96);
  }

  .nav-links {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .page,
  .section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .home-preview > .grid > .card {
    min-height: auto;
    max-height: none;
  }

  .home-preview > .grid > .card::after {
    display: none;
  }

  .home-preview > .grid > .card p {
    -webkit-line-clamp: 5;
  }

  .footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 821px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}


/* Accordion-kort för nyheter och tävling */
.accordion-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
}

.accordion-card-head {
  display: block;
}

.accordion-card-head h2 {
  margin: 10px 0 0;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.accordion-excerpt {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;

  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;

  overflow: hidden;
}

.accordion-full {
  margin-top: 16px;
  line-height: 1.7;
}

.accordion-full[hidden] {
  display: none !important;
}

.accordion-full img {
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.accordion-toggle-bottom {
  width: calc(100% + 44px);
  margin: auto -22px -22px;
  padding: 13px 18px;

  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0 0 22px 22px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background: linear-gradient(to bottom, rgba(255,255,255,.72), #e4f3ea);
  color: var(--primary);
  font-weight: 900;
  cursor: pointer;

  transition: background .18s ease, color .18s ease;
}

.accordion-toggle-bottom strong {
  font-size: 1.2rem;
  line-height: 1;
}

.accordion-toggle-bottom.open {
  background: var(--primary);
  color: white;
}

.accordion-toggle-bottom:active {
  filter: brightness(.95);
}

@media (max-width: 820px) {
  .accordion-card {
    min-height: 210px;
  }

  .accordion-excerpt {
    -webkit-line-clamp: 5;
  }

  .accordion-toggle-bottom {
    width: calc(100% + 36px);
    margin-left: -18px;
    margin-right: -18px;
    margin-bottom: -18px;
  }
}

.home-preview .accordion-card {
  min-height: unset !important;
  max-height: none !important;
  overflow: visible !important;
}

.home-preview > .grid {
  align-items: start;
}



.clickable-accordion-card {
  cursor: pointer;
}

.clickable-accordion-card .accordion-toggle-bottom {
  cursor: pointer;
}


/* Moderna kartkort */
.map-style-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 420px;
}

.map-style-card {
  width: 86px;
  border: 2px solid rgba(255,255,255,.14);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(16,20,24,.84);
  backdrop-filter: blur(12px);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.map-style-card:hover {
  transform: translateY(-2px);
}

.map-style-card.active {
  border-color: #6fcf7a;
  box-shadow: 0 0 0 2px rgba(111,207,122,.28);
}

.map-style-thumb {
  height: 58px;
  background-size: cover;
  background-position: center;
}

.map-style-card span {
  display: block;
  padding: 7px 6px 8px;
  text-align: center;
  color: white;
  font-size: .78rem;
  font-weight: 700;
}

.thumb-satellite {
  background:
    linear-gradient(rgba(0,0,0,.15), rgba(0,0,0,.15)),
    #54734f;
}

.thumb-street {
  background:
    linear-gradient(135deg, #e5d7b5, #b4d4a8);
}

.thumb-topo {
  background:
    linear-gradient(135deg, #7ba66f, #4d7250);
}

.thumb-fishing {
  background:
    linear-gradient(135deg, #2b6b2d, #6fcf7a);
}

.thumb-fvo {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,.14),
      rgba(255,255,255,.14) 8px,
      rgba(255,255,255,.03) 8px,
      rgba(255,255,255,.03) 16px
    ),
    linear-gradient(135deg, #444, #777);
}

@media (max-width: 820px) {
  .map-style-picker {
    max-width: 270px;
    gap: 8px;
  }

  .map-style-card {
    width: 76px;
  }

  .map-style-thumb {
    height: 50px;
  }

  .map-style-card span {
    font-size: .72rem;
  }
}


/* Kompakt kartlager-väljare */
.map-layer-control {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.map-layer-toggle {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16,20,24,.90);
  color: white;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,.30);
  backdrop-filter: blur(12px);
}

.map-layer-toggle-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(111,207,122,.20);
  color: #9df0a7;
}

.map-layer-control.collapsed .map-style-picker {
  display: none;
}

.map-layer-control:not(.collapsed) .map-style-picker {
  animation: mapLayerPop .16s ease-out;
}

@keyframes mapLayerPop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.thumb-other {
  background:
    radial-gradient(circle at 30% 40%, rgba(255,255,255,.32), transparent 26%),
    linear-gradient(135deg, #6fcf7a, #b7ecb9);
}


/* Tävlingsresultat */
.competition-results-section {
  margin-top: 34px;
}

.competition-result-card {
  overflow: hidden;
}

.competition-result-head {
  text-align: center;
  margin-bottom: 24px;
}

.competition-result-head h2 {
  margin-bottom: 8px;
}

.competition-result-class {
  margin-top: 24px;
}

.competition-result-class h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 12px;
}

.competition-result-table th,
.competition-result-table td {
  vertical-align: middle;
}

.competition-result-total-row td {
  background: #fffaf0;
  border-top: 2px solid var(--accent) !important;
  font-weight: 850;
}

.competition-result-total-label {
  color: var(--primary);
  text-align: right;
}

.competition-result-weight {
  white-space: nowrap;
}

.result-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.result-medal {
  min-width: 1.4em;
  display: inline-block;
}

.result-thumb {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 5px 14px rgba(0,0,0,.14);
}

@media (max-width: 820px) {
  .competition-result-table {
    min-width: 620px;
  }
}





/* Färgade pokaler för tävlingsresultat */
.result-trophy {
  display: inline-grid;
  place-items: center;
  width: 1.45em;
  height: 1.45em;
  flex: 0 0 auto;
}

.result-trophy svg {
  width: 1.35em;
  height: 1.35em;
  display: block;
  fill: currentColor;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.20));
}

.trophy-gold {
  color: #d99a28;
}

.trophy-silver {
  color: #aeb8c2;
}

.trophy-bronze {
  color: #b86b32;
}


/* Utfällbara tävlingsresultat på publika tävlingssidan */
.competition-result-card {
  padding-bottom: 0;
}

.competition-result-card .competition-result-head {
  margin-bottom: 0;
}

.competition-result-full {
  margin-top: 20px;
}

.competition-result-card .accordion-toggle-bottom {
  margin-top: 22px;
}

/* Fix så Visa resultat-knappen inte klipps */
.competition-result-card {
  overflow: visible;
}


/* Fångstbilder - snabbare och tydligare kort */
.catch-card {
  display: flex;
  flex-direction: column;
}

.catch-thumb {
  aspect-ratio: 16 / 10;
  width: 100%;
  max-height: none !important;
  object-fit: cover;
  background: #e9f2ec;
}

.catch-meta {
  line-height: 1.55;
}

.catch-description {
  color: var(--muted);
  line-height: 1.55;
}

#approvedGallery .catch-card,
#frontCatchGallery .catch-card {
  height: auto;
  overflow: visible;
}



/* =====================================================
   SLUTPOLISH / STABIL DESIGN
===================================================== */

:root {
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --shadow-soft: 0 10px 30px rgba(15, 61, 46, .08), 0 2px 8px rgba(15, 61, 46, .04);
  --shadow-hover: 0 18px 42px rgba(15, 61, 46, .12), 0 6px 14px rgba(15, 61, 46, .06);
  --space-section: clamp(36px, 5vw, 76px);
}

/* Konsekvent kortkänsla */
.card,
.accordion-card,
.catch-card,
.competition-result-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border-color: rgba(15, 61, 46, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

@media (hover:hover) and (pointer:fine) {
  .card:hover,
  .accordion-card:hover,
  .catch-card:hover,
  .competition-result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(15, 61, 46, .14);
  }
}

/* Mer konsekvent luftig layout */
.section {
  padding-block: var(--space-section);
}

.grid {
  gap: clamp(16px, 2vw, 24px);
}

.card h1,
.card h2,
.card h3,
.page h1 {
  line-height: 1.15;
  letter-spacing: -.02em;
}

.card p,
.page p {
  line-height: 1.65;
}

.meta,
.badge {
  letter-spacing: .02em;
  font-weight: 650;
}

/* Startsida: håll preview ren och utan klippning */
.home-preview > .grid {
  align-items: start;
}

.home-preview > .grid > .card,
.home-preview .accordion-card,
.home-preview .gallery-card,
.home-preview .catch-card {
  height: auto;
  max-height: none;
  overflow: visible;
}

.home-preview > .grid > .card::after {
  display: none;
}

/* Sticky header polish */
#siteHeader {
  transition: box-shadow .18s ease, backdrop-filter .18s ease, background-color .18s ease;
}

#siteHeader.header-scrolled,
.site-header.header-scrolled {
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}

.site-header.header-scrolled {
  background: rgba(15, 61, 46, .88);
}

/* Mjukare knappar och expanderingar */
.btn,
button,
.accordion-toggle-bottom {
  transition: transform .16s ease, opacity .16s ease, background-color .16s ease, box-shadow .16s ease;
}

@media (hover:hover) and (pointer:fine) {
  .btn:hover,
  button:hover,
  .accordion-toggle-bottom:hover {
    transform: translateY(-1px);
  }
}

.accordion-full,
.competition-result-full {
  animation: accordionFade .18s ease;
}

@keyframes accordionFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bildpolish och fade-in */
.gallery-img,
.catch-thumb,
.water-img {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  transition: transform .22s ease, box-shadow .22s ease, opacity .22s ease;
}

img {
  opacity: 1;
}

img[loading="lazy"] {
  animation: imageFadeIn .25s ease both;
}

@keyframes imageFadeIn {
  from { opacity: .01; }
  to { opacity: 1; }
}

@media (hover:hover) and (pointer:fine) {
  .gallery-img:hover,
  .catch-thumb:hover,
  .water-img:hover {
    transform: scale(1.012);
    box-shadow: 0 18px 34px rgba(0,0,0,.16);
  }
}

/* Mobilpolish */
@media (max-width: 820px) {
  .page,
  .section {
    padding-inline: 14px;
  }

  .card,
  .accordion-card,
  .catch-card {
    padding: 18px;
  }

  .grid {
    gap: 14px;
  }

  .btn,
  button {
    min-height: 46px;
  }

  .card,
  .accordion-card,
  .catch-card,
  .competition-result-card {
    box-shadow: 0 6px 20px rgba(15,61,46,.07), 0 2px 6px rgba(15,61,46,.04);
  }
}

/* Bättre bredd på stora skärmar */
@media (min-width: 1400px) {
  .page,
  .section {
    max-width: 1500px;
    margin-inline: auto;
  }
}

/* Backup-panel i admin */
.backup-card {
  background: linear-gradient(135deg, rgba(15,61,46,.06), rgba(111,207,122,.10));
}



/* =====================================================
   FINSLIPNING / STABIL UI 2026-05-26
   Design, mobil, karta, galleri, accessibility
===================================================== */

:root {
  --ui-radius-sm: 14px;
  --ui-radius-md: 18px;
  --ui-radius-lg: 22px;
  --ui-shadow-soft: 0 10px 30px rgba(15, 61, 46, .08), 0 2px 8px rgba(15, 61, 46, .04);
  --ui-shadow-hover: 0 18px 42px rgba(15, 61, 46, .12), 0 6px 14px rgba(15, 61, 46, .06);
  --ui-focus: 0 0 0 4px rgba(111, 207, 122, .32);
  --ui-section-space: clamp(36px, 5vw, 76px);
}

/* 1. Konsekvent design cleanup */
.card,
.accordion-card,
.catch-card,
.competition-result-card,
.gallery-select-card,
.stat {
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-soft);
  border-color: rgba(15, 61, 46, .08);
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    background-color .18s ease;
}

.section {
  padding-block: var(--ui-section-space);
}

.grid {
  gap: clamp(16px, 2vw, 24px);
}

.card h1,
.card h2,
.card h3,
.page h1,
.page h2 {
  line-height: 1.15;
  letter-spacing: -.02em;
}

.card p,
.page p,
.rich-content {
  line-height: 1.65;
}

.meta,
.badge {
  letter-spacing: .02em;
  font-weight: 650;
}

/* 2. Mjukare transitions */
.btn,
button,
input,
select,
textarea,
.nav-links a,
.mobile-bottom-nav a,
.mobile-bottom-nav button,
.accordion-toggle-bottom,
.map-style-card,
.map-layer-toggle {
  transition:
    transform .16s ease,
    opacity .16s ease,
    background-color .16s ease,
    color .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

@media (hover:hover) and (pointer:fine) {
  .card:hover,
  .accordion-card:hover,
  .catch-card:hover,
  .competition-result-card:hover,
  .gallery-select-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ui-shadow-hover);
    border-color: rgba(15, 61, 46, .14);
  }

  .btn:hover,
  button:hover,
  .accordion-toggle-bottom:hover {
    transform: translateY(-1px);
  }
}

.accordion-full,
.competition-result-full {
  animation: accordionFade .18s ease;
}

@keyframes accordionFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 3. Mobilmeny */
@media (max-width: 820px) {
  .nav-links {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transform: translateY(-8px) scale(.98);
    transform-origin: top right;

    background: rgba(15, 61, 46, .94);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 0 0 22px 22px;

    transition:
      opacity .18s ease,
      visibility .18s ease,
      transform .18s ease;
  }

  .nav-links.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav-links a {
    border-radius: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    background: rgba(255,255,255,.10);
  }

  .menu-btn {
    min-width: 46px;
    min-height: 46px;
    border-radius: 999px;
  }
}

/* 4. Kartan */
.leaflet-popup-content-wrapper {
  border-radius: 18px !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.22) !important;
}

.leaflet-popup-content {
  margin: 14px 16px !important;
  line-height: 1.55;
}

.leaflet-popup-content a {
  color: var(--primary);
  font-weight: 850;
}

.map-layer-toggle {
  border: 1px solid rgba(255,255,255,.13);
}

.map-style-card {
  border-radius: 16px;
}

.map-style-card span {
  line-height: 1.15;
}

/* 5. Galleri och fångstbilder */
#staticGallery,
#approvedGallery {
  align-items: start;
}

.gallery-img,
.gallery-preview-img,
.catch-thumb,
.water-img,
.result-thumb {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    opacity .22s ease;
}

#approvedGallery .catch-card,
#frontCatchGallery .catch-card {
  height: auto;
  overflow: visible;
}

.catch-thumb {
  aspect-ratio: 16 / 10;
  max-height: none !important;
  object-fit: cover;
  background: #e9f2ec;
}

.catch-meta,
.catch-description {
  line-height: 1.55;
}

@media (hover:hover) and (pointer:fine) {
  .gallery-img:hover,
  .gallery-preview-img:hover,
  .catch-thumb:hover,
  .water-img:hover {
    transform: scale(1.012);
    box-shadow: 0 18px 34px rgba(0,0,0,.16);
  }
}

/* 6. Stabilitet/underhåll: tydligare visuella standarder för framtida patchar */
.preview-footer,
.accordion-toggle-bottom {
  position: relative;
  z-index: 2;
}

.home-preview > .grid {
  align-items: start;
}

.home-preview > .grid > .card,
.home-preview .accordion-card,
.home-preview .gallery-card,
.home-preview .catch-card {
  height: auto;
  max-height: none;
  overflow: visible;
}

.home-preview > .grid > .card::after {
  display: none;
}

/* 7. Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus);
}

.btn,
button {
  min-height: 42px;
}

@media (max-width: 820px) {
  .btn,
  button {
    min-height: 46px;
  }

  .page,
  .section {
    padding-inline: 14px;
  }

  .card,
  .accordion-card,
  .catch-card {
    padding: 18px;
  }

  .grid {
    gap: 14px;
  }

  .card,
  .accordion-card,
  .catch-card,
  .competition-result-card {
    box-shadow: 0 6px 20px rgba(15,61,46,.07), 0 2px 6px rgba(15,61,46,.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* 8. Bildoptimeringskänsla */
img[loading="lazy"] {
  animation: imageFadeIn .25s ease both;
}

@keyframes imageFadeIn {
  from { opacity: .01; }
  to { opacity: 1; }
}

@media (min-width: 1400px) {
  .page,
  .section {
    max-width: 1500px;
    margin-inline: auto;
  }
}


/* =========================
   Större karta / fullscreen
========================= */

.water-map-wrap {
  position: relative;
}

.map-expand-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;

  border-radius: 999px;
  padding: 10px 16px;

  backdrop-filter: blur(12px);
  background: rgba(15, 61, 46, .88);
  color: white;

  border: 1px solid rgba(255,255,255,.14);

  box-shadow:
    0 12px 24px rgba(0,0,0,.18);

  font-weight: 800;
}

.water-map-wrap.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 5000;

  background: #eef7f2;

  padding: 14px;

  animation: mapFullscreenFade .18s ease;
}

.water-map-wrap.fullscreen #waterMap {
  height: calc(100vh - 28px) !important;
  border-radius: 22px;
}

body.map-fullscreen-open {
  overflow: hidden;
}

@keyframes mapFullscreenFade {
  from {
    opacity: .2;
    transform: scale(.985);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 820px) {
  .map-expand-btn {
    top: 10px;
    right: 10px;

    padding: 10px 14px;
    font-size: .92rem;
  }

  .water-map-wrap.fullscreen {
    padding: 10px;
  }

  .water-map-wrap.fullscreen #waterMap {
    height: calc(100vh - 20px) !important;
    border-radius: 18px;
  }
}


/* =====================================================
   TABELLSTIL: grön header utan ram, rutram på datarader
===================================================== */

.info-page-card .rich-content {
  min-width: 0;
}

.info-page-card .rich-content table,
.competition-result-table {
  width: 100%;
  margin: 14px 0 0;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
  background: transparent;
}

/* Headern ska vara grön och sakna rutram/ytterram */
.info-page-card .rich-content table th,
.competition-result-table th {
  background: #e4f3ea !important;
  color: var(--primary);
  font-weight: 850;
  border: 0 !important;
}

.info-page-card .rich-content table th:first-child,
.competition-result-table th:first-child {
  border-top-left-radius: 14px;
}

.info-page-card .rich-content table th:last-child,
.competition-result-table th:last-child {
  border-top-right-radius: 14px;
}

/* Rutramen börjar på första dataraden under headern */
.info-page-card .rich-content table td,
.competition-result-table td {
  background: white;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
}

.info-page-card .rich-content table td:first-child,
.competition-result-table td:first-child {
  border-left: 1px solid var(--border) !important;
}

/* Tabeller med thead/tbody */
.info-page-card .rich-content table thead + tbody tr:first-child td,
.competition-result-table thead + tbody tr:first-child td {
  border-top: 1px solid var(--border) !important;
}

/* Tabeller utan thead där första raden är header med th */
.info-page-card .rich-content table tr:first-child:has(th) + tr td {
  border-top: 1px solid var(--border) !important;
}

/* Fallback för tabeller utan thead */
.info-page-card .rich-content table tr:nth-child(2) td {
  border-top: 1px solid var(--border) !important;
}

.info-page-card .rich-content table tr:last-child td:first-child,
.competition-result-table tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.info-page-card .rich-content table tr:last-child td:last-child,
.competition-result-table tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

.info-page-card .rich-content > h1:first-child,
.info-page-card .rich-content > h2:first-child,
.info-page-card .rich-content > h3:first-child {
  margin-top: 0;
}

/* Jämnare radbrytningar från texteditorn */
.info-page-card .rich-content p {
  margin-top: 0;
  margin-bottom: 10px;
}

.info-page-card .rich-content p:empty {
  display: none;
}

.info-page-card .rich-content br + br {
  display: none;
}


/* Gemensam footer */
.footer {
  text-align: center;
}

.footer-copy {
  margin: 0;
}

.footer-cookie-note {
  margin: 6px auto 0;
  max-width: 720px;
  font-size: .82rem;
  line-height: 1.4;
  opacity: .75;
}




.contact-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.contact-message-card textarea {
  resize: vertical;
}

.contact-page {
  max-width: 1200px;
}

.contact-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.contact-info-column,
.contact-message-column {
  min-width: 0;
}

.contact-info-column,
.contact-message-column,
.contact-info-column .card,
.contact-message-column .card {
  height: 100%;
}

.contact-message-card {
  display: flex;
  flex-direction: column;
}

.contact-message-card form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contact-message-card button[type="submit"] {
  align-self: flex-start;
}

@media (max-width: 820px) {
  .contact-page-grid {
    grid-template-columns: 1fr;
  }

  .contact-info-column,
  .contact-message-column,
  .contact-info-column .card,
  .contact-message-column .card {
    height: auto;
  }
}

/* 2026-06-06-004: Stabilare hover-beteende
   Endast tydliga kontroller, som knappar och menylänkar, får röra sig vid hover.
   Innehållskort, bildkort och informationsrutor ska ligga still och bara ändra skugga/kant. */
@media (hover:hover) and (pointer:fine) {
  .card:hover,
  .clickable-news .card:hover,
  .accordion-card:hover,
  .catch-card:hover,
  .competition-result-card:hover,
  .gallery-select-card:hover,
  .gallery-img:hover,
  .gallery-preview-img:hover,
  .catch-thumb:hover,
  .water-img:hover,
  .result-thumb:hover,
  .map-style-card:hover {
    transform: none !important;
  }

  .card:hover,
  .clickable-news .card:hover,
  .accordion-card:hover,
  .catch-card:hover,
  .competition-result-card:hover,
  .gallery-select-card:hover {
    box-shadow: var(--ui-shadow-hover, var(--shadow-hover, 0 12px 30px rgba(0,0,0,.12))) !important;
    border-color: rgba(15, 61, 46, .14);
  }

  .gallery-img:hover,
  .gallery-preview-img:hover,
  .catch-thumb:hover,
  .water-img:hover,
  .result-thumb:hover {
    box-shadow: 0 14px 30px rgba(0,0,0,.14);
  }
}

/* =========================================================
   Publik meny: mörkgrön header + mjuk knappmeny + aktiv sida
   Patch 2026-06-06-006
========================================================= */
@media (min-width: 821px) {
  .site-header {
    background: var(--primary);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    box-shadow: 0 10px 30px rgba(15, 61, 46, .22);
  }

  .nav {
    padding: 12px 18px;
  }

  .brand span,
  .brand div,
  .brand p,
  .brand a {
    color: white;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-main-links,
  .nav-utility-links {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .30);
    color: var(--primary);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
    line-height: 1;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    background: #eef6e6;
    border-color: rgba(217, 154, 40, .55);
    color: var(--primary);
    transform: translateY(-1px);
  }

  .nav-links a.active,
  .nav-links a[aria-current="page"] {
    background: var(--accent);
    border-color: rgba(255, 255, 255, .45);
    color: #10251d;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 8px 18px rgba(0, 0, 0, .20);
  }

  .nav-links a.member-nav-link {
    background: #f7efe0;
    border-color: rgba(217, 154, 40, .65);
    color: #10251d;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
  }

  .nav-links a.member-nav-link:hover,
  .nav-links a.member-nav-link:focus-visible {
    background: #fff6e6;
    color: #10251d;
    border-color: rgba(217, 154, 40, .85);
  }

  .nav-links a.member-nav-link.active,
  .nav-links a.member-nav-link[aria-current="page"] {
    background: var(--accent);
    color: #10251d;
    border-color: rgba(255, 255, 255, .50);
  }

  .nav-icon {
    display: inline-grid;
    place-items: center;
    width: 1.15em;
    height: 1.15em;
    line-height: 1;
    font-size: 1.05em;
    color: currentColor;
  }

  .nav-logo {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .24));
  }

  .site-header.header-scrolled {
    background: rgba(15, 61, 46, .98);
  }
}

@media (max-width: 1180px) and (min-width: 821px) {
  .nav-links a {
    padding-left: 10px;
    padding-right: 10px;
    font-size: .9rem;
  }
}

/* Desktop: låt den långa huvudmenyn hålla sig inom skärmbredden. */
@media (min-width: 821px) {
  .nav {
    justify-content: flex-start;
    min-height: 74px;
  }

  .nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 120px);
    max-width: none;
    min-height: 46px;
    display: block;
  }

  .nav-main-links {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    justify-content: center;
    white-space: nowrap;
  }

  .nav-utility-links {
    position: absolute;
    right: 0;
    top: 0;
    justify-content: flex-end;
    white-space: nowrap;
  }
}

@media (max-width: 1700px) and (min-width: 821px) {
  .nav-links a {
    padding-left: 7px;
    padding-right: 7px;
    font-size: .76rem;
  }

  .nav-main-links,
  .nav-utility-links {
    gap: 5px;
  }
}

@media (max-width: 1320px) and (min-width: 821px) {
  .nav-links a {
    padding-left: 6px;
    padding-right: 6px;
    font-size: .72rem;
  }

  .nav-main-links,
  .nav-utility-links {
    gap: 4px;
  }
}

@media (max-width: 820px) {
  .nav-main-links,
  .nav-utility-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
}

.public-youth-content {
  margin-top: 24px;
}

.public-youth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.public-youth-list {
  display: grid;
  gap: 12px;
}

.public-youth-list section {
  padding: 13px 14px;
  border: 1px solid rgba(15, 61, 46, .12);
  border-radius: 14px;
  background: #f7fbf8;
}

.public-youth-list strong {
  display: block;
  margin-bottom: 5px;
}

.public-youth-list p {
  margin: 0;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .public-youth-grid {
    grid-template-columns: 1fr;
  }
}
