/*
 * Referenskarta
 * Färgerna kan ändras från temat, t.ex. .rk { --rk-ink: #123b2a; --rk-underline: #3c8d40; }
 * Typsnittet ärvs från temat.
 */
.rk {
  --rk-surface: #ffffff;
  --rk-ink: #1f2a2c;
  --rk-muted: #5b6a6c;
  --rk-line: #004442;
  --rk-cluster: #1f2a2c;
  --rk-underline: #3c8d40;
  --rk-radius: 6px;
  color: var(--rk-ink);
  line-height: 1.5;
}
.rk [hidden] { display: none !important; }
.rk, .rk *, .rk *::before, .rk *::after { box-sizing: border-box; }
.rk :focus-visible { outline: 3px solid var(--rk-ink); outline-offset: 2px; }

/* Filter */
.rk .rk-filters { display: grid; gap: 1rem; margin: 0 0 1rem; }
.rk .rk-label { display: block; margin: 0 0 .45rem; padding: 0; font-size: .875rem; font-weight: 600; color: var(--rk-muted); }
.rk .rk-chips { min-width: 0; margin: 0; padding: 0; border: 0; }
.rk .rk-chips__list { display: flex; flex-wrap: wrap; gap: .5rem; }
.rk .rk-chip {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0;
  padding: .4rem .85rem .4rem .7rem;
  font: inherit; font-size: .9375rem; line-height: 1.3; letter-spacing: normal; text-transform: none;
  color: var(--rk-ink);
  border: 1.5px solid var(--rk-line); box-shadow: none; cursor: pointer;
}
.rk .rk-chip:hover { color: var(--rk-ink); background: var(--rk-surface); border-color: var(--c); }
.rk .rk-chip__dot { flex: none; width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); }
.rk .rk-chip__n { font-size: .8125rem; color: var(--rk-muted); font-variant-numeric: tabular-nums; }
.rk .rk-chip[aria-pressed="true"] { color: #fff; background: var(--rk-ink); border-color: var(--rk-ink); }
.rk .rk-chip[aria-pressed="true"] .rk-chip__n { color: inherit; opacity: .75; }
.rk .rk-chip.is-empty { opacity: .45; }
.rk .rk-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.5rem; }
.rk .rk-year { display: grid; margin: 0; }
.rk .rk-year select {
  min-width: 9rem; margin: 0; padding: .45rem .6rem;
  font: inherit; color: var(--rk-ink); background-color: var(--rk-surface);
  border: 1.5px solid var(--rk-line); border-radius: var(--rk-radius);
}
.rk .rk-count { margin: 0 0 .5rem; color: var(--rk-muted); font-variant-numeric: tabular-nums; }
.rk .rk-linkbtn {
  margin: 0; padding: .15rem; font: inherit; color: var(--rk-ink);
  background: none; border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.rk .rk-linkbtn:hover { color: var(--rk-ink); background: none; }
.rk .rk-row .rk-linkbtn { margin-bottom: .35rem; }

/* Karta */
.rk .rk-mapwrap { position: relative; overflow: hidden; background: var(--rk-surface); border: 1px solid var(--rk-line); border-radius: var(--rk-radius); }
.rk .rk-map { height: clamp(340px, 58vh, 600px); }
.rk .rk-map img { max-width: none; } /* Vanlig temaregel som annars förstör kartbilderna */
.rk .rk-msg {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 1.5rem;
  text-align: center; color: var(--rk-muted);
  background: repeating-linear-gradient(135deg, transparent 0 10px, var(--rk-line) 10px 11px), var(--rk-surface);
}
.rk .rk-msg__inner { max-width: 46ch; padding: 1rem 1.25rem; background: var(--rk-surface); border-radius: var(--rk-radius); }
.rk .rk-msg__inner p { margin: 0; }
.rk .rk-btn {
  margin: .85rem 0 0; padding: .55rem 1.1rem; font: inherit; font-weight: 600; line-height: 1.3;
  color: #fff; background: var(--rk-ink); border: 0; border-radius: 999px; cursor: pointer;
}
.rk .rk-btn:hover { color: #fff; background: var(--rk-ink); opacity: .9; }

/* Nålar och kluster (fasta färger: kartan är alltid ljus) */
.rk .rk-pin {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--c); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(20, 30, 33, .45);
  transform: translateY(50%); /* centrerar nålen på koordinaten */
  transition: transform .15s ease;
}
.rk .rk-pin.is-hover, .rk .rk-pin.is-active { transform: translateY(50%) scale(1.35); }
.rk .rk-pin.is-active { border-color: #1f2a2c; }
.rk .rk-cluster {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px;
  font-family: var(--rk-font, inherit); font-size: 15px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  color: #fff; background: var(--rk-cluster); border: 3px solid #fff; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(20, 30, 33, .35);
  transform: translateY(50%);
}

/* Lista */
.rk .rk-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1.25rem;
  margin: 2rem 0 0; padding: 0; list-style: none;
}
.rk .rk-card {
  position: relative; display: flex; flex-direction: column; margin: 0; padding: 0; overflow: hidden;
  background: var(--rk-surface); border: 1px solid var(--rk-line); border-radius: var(--rk-radius);
}
.rk .rk-card::before { content: none; }
.rk .rk-card__media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; margin: 0; object-fit: cover; border-radius: 0; }
.rk .rk-ph {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 32%, transparent) 0 1.5px, transparent 1.5px 11px),
              color-mix(in srgb, var(--c) 12%, #fff);
}
.rk .rk-card__body { display: flex; flex: 1; flex-direction: column; gap: .25rem; padding: 1rem 1.1rem 1.15rem; }
.rk .rk-type { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .8125rem; font-weight: 600; line-height: 1.3; color: var(--rk-muted); }
.rk .rk-type::before { content: ""; flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); }
.rk .rk-card__title { margin: .1rem 0 0; padding: 0; font-size: 1.125rem; line-height: 1.25; }
.rk .rk-card__title a { color: inherit; text-decoration: none; box-shadow: none; }
.rk .rk-card__title a::after { content: ""; position: absolute; inset: 0; } /* hela kortet blir klickbart */
.rk .rk-card:hover .rk-card__title a {
  text-decoration: underline; text-decoration-color: var(--rk-underline); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
@supports selector(:has(*)) {
  .rk .rk-card__title a:focus-visible { outline: none; }
  .rk .rk-card:has(.rk-card__title a:focus-visible) { outline: 3px solid var(--rk-ink); outline-offset: 2px; }
}
.rk .rk-card__meta { margin: 0; font-size: .9375rem; color: var(--rk-muted); }
.rk .rk-card__actions { display: none; margin-top: auto; padding-top: .75rem; }
.rk.has-map .rk-card__actions { display: block; }
.rk .rk-card__show, .rk .rk-more {
  position: relative; z-index: 1; margin: 0; padding: .3rem .8rem;
  font: inherit; font-size: .875rem; font-weight: 600; line-height: 1.3; letter-spacing: normal; text-transform: none;
  color: var(--rk-ink); background: var(--rk-surface);
  border: 1.5px solid var(--rk-line); border-radius: 999px; box-shadow: none; cursor: pointer;
}
.rk .rk-more { display: block; margin: 1.75rem auto 0; padding: .6rem 1.2rem; font-size: 1rem; }
.rk .rk-card__show:hover, .rk .rk-more:hover { color: var(--rk-ink); background: var(--rk-surface); border-color: var(--rk-ink); }
.rk .rk-empty { margin: 2rem 0 0; padding: 1.5rem; color: var(--rk-muted); background: var(--rk-surface); border: 1px solid var(--rk-line); border-radius: var(--rk-radius); }
.rk .rk-editor-note { margin: 0 0 1rem; padding: .75rem 1rem; font-size: .875rem; color: #3d3200; background: #fff8e1; border-left: 4px solid #f2b705; }
.rk .rk-editor-note a { color: inherit; }

/* Popup i kartan (Googles ruta är alltid vit) */
.rk .rk-iw { width: min(260px, 68vw); font-family: var(--rk-font, inherit); color: #1f2a2c; }
.rk .rk-iw :focus-visible { outline-color: #1f2a2c; }
.rk .rk-iw__media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0 0 .65rem; object-fit: cover; border-radius: 4px; }
.rk .rk-iw .rk-type { font-size: .75rem; color: #5b6a6c; }
.rk .rk-iw__title { margin: .2rem 0 .1rem; padding: 0; font-family: inherit; font-size: 1rem; line-height: 1.25; color: #1f2a2c; }
.rk .rk-iw__meta { margin: 0; font-size: .8125rem; color: #5b6a6c; }
.rk .rk-iw__text { margin: .5rem 0 0; font-size: .8125rem; line-height: 1.45; }
.rk .rk-iw__link {
  display: inline-block; margin-top: .7rem; font-size: .875rem; font-weight: 600; color: #1f2a2c;
  text-decoration: underline; text-decoration-color: var(--rk-underline); text-decoration-thickness: 2px; text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) { .rk .rk-pin { transition: none; } }
