/* Svenska Platser 2.0
   Bärande idé: sidrubriken är en gatuskylt. Allt annat är lugnt och läsbart.
   Färger: skyltblå, vit, asfalt, grus och vägmärkesgul för fokus och markeringar. */

:root {
	--bla: #0a4a8f;
	--bla-djup: #07366a;
	--gul: #f6c700;
	--asfalt: #20252b;
	--grus: #5b6570;
	--papper: #f2f4f6;
	--yta: #ffffff;
	--linje: #d5dae0;
	--lank: #0a4a8f;
	--skylt-text: #ffffff;
	--typ: "Overpass", "DIN Alternate", "Bahnschrift", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--radie: 10px;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root {
		--asfalt: #e8ecef;
		--grus: #a3adb8;
		--papper: #15191e;
		--yta: #1d2229;
		--linje: #323a44;
		--lank: #8fbff5;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
	margin: 0;
	font: 1.0625rem/1.6 var(--typ);
	color: var(--asfalt);
	background: var(--papper);
}
a { color: var(--lank); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--gul); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; text-wrap: balance; }
h2 { font-size: 1.5rem; font-weight: 750; letter-spacing: -.01em; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 70ch; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
img { max-width: 100%; height: auto; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.svag { color: var(--grus); font-size: .9375rem; }
.bredd { width: min(100% - 2rem, 70rem); margin-inline: auto; }
.hoppa { position: absolute; left: -999px; top: .5rem; background: var(--gul); color: #20252b; padding: .5rem 1rem; z-index: 2000; border-radius: 6px; }
.hoppa:focus { left: .5rem; }

/* ---------- Sidhuvud ---------- */
.topp { background: var(--yta); border-bottom: 1px solid var(--linje); position: sticky; top: 0; z-index: 1100; }
.topp-rad { display: flex; align-items: center; gap: 1rem; padding-block: .6rem; }
.marke {
	flex: none; display: inline-flex; flex-direction: column; line-height: 1.02; text-decoration: none;
	background: var(--bla); color: #fff; font-weight: 800; font-size: .875rem; letter-spacing: .01em;
	padding: .38rem .7rem; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--bla), inset 0 0 0 3.5px #fff;
}
.sok { position: relative; display: flex; flex: 1; max-width: 40rem; margin-left: auto; }
.sok input {
	flex: 1; min-width: 0; font: inherit; padding: .6rem .85rem; color: var(--asfalt); background: var(--papper);
	border: 1.5px solid var(--linje); border-right: 0; border-radius: var(--radie) 0 0 var(--radie);
}
.sok input:focus { outline: none; border-color: var(--bla); background: var(--yta); }
.sok button {
	font: inherit; font-weight: 700; padding: .6rem 1.1rem; color: #fff; background: var(--bla); cursor: pointer;
	border: 1.5px solid var(--bla); border-radius: 0 var(--radie) var(--radie) 0;
}
.sok button:hover { background: var(--bla-djup); }
.forslag {
	position: absolute; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: .3rem; list-style: none;
	background: var(--yta); border: 1px solid var(--linje); border-radius: var(--radie); box-shadow: 0 12px 28px rgb(10 30 60 / .18);
}
.forslag a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .7rem; border-radius: 6px; color: var(--asfalt); text-decoration: none; }
.forslag a span { color: var(--grus); font-size: .9375rem; white-space: nowrap; }
.forslag li[aria-selected="true"] a, .forslag a:hover { background: var(--gul); color: #20252b; }
.forslag li[aria-selected="true"] a span, .forslag a:hover span { color: #20252b; }

/* ---------- Innehåll ---------- */
main { padding-block: 1rem 3rem; }
.smulor { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .9375rem; color: var(--grus); margin-bottom: 1.25rem; }
.smulor [aria-current] { color: var(--asfalt); }

/* Gatuskylten */
.skylt {
	display: inline-flex; flex-direction: column; gap: .12em; max-width: 100%;
	background: var(--bla); color: var(--skylt-text);
	padding: .5em .8em .46em; margin: 0 0 1.1rem;
	border-radius: .32em;
	box-shadow: inset 0 0 0 .1em var(--bla), inset 0 0 0 .17em #fff, 0 .12em .3em rgb(10 30 60 / .28);
	font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3.4rem); font-weight: 800; letter-spacing: -.005em; line-height: 1.04;
	overflow-wrap: anywhere;
}
.skylt-ort { font-size: .42em; font-weight: 600; letter-spacing: .02em; opacity: .92; }
.ingress { font-size: 1.1875rem; line-height: 1.55; max-width: 62ch; }

.hero { display: grid; gap: 1.5rem; margin-bottom: 2rem; }
@media (min-width: 60rem) {
	.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 2.5rem; }
	.hero-karta { position: sticky; top: 5rem; }
}
.karta { height: 22rem; border-radius: var(--radie); border: 1px solid var(--linje); background: var(--linje); z-index: 0; }
@media (min-width: 60rem) { .karta { height: 30rem; } }
.karta-not { margin-top: .5rem; }
.leaflet-container { font: inherit; }

.fakta { margin: 0 0 1rem; border-top: 2px solid var(--asfalt); }
.fakta > div { display: grid; grid-template-columns: minmax(8rem, 38%) 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--linje); }
.fakta dt { color: var(--grus); }
.fakta dd { margin: 0; font-weight: 600; }
.knappar { display: flex; flex-wrap: wrap; gap: .5rem; }
.knapp {
	display: inline-block; padding: .5rem .9rem; border: 1.5px solid var(--lank); border-radius: var(--radie);
	text-decoration: none; font-weight: 650; font-size: .9375rem; background: var(--yta);
}
.knapp:hover { background: var(--bla); border-color: var(--bla); color: #fff; }

.del { background: var(--yta); border: 1px solid var(--linje); border-radius: var(--radie); padding: 1.5rem; margin-bottom: 1.25rem; }
@media (max-width: 40rem) { .del { padding: 1.1rem; margin-inline: -.35rem; } }
.del > :last-child { margin-bottom: 0; }

.kolumner { list-style: none; padding: 0; columns: 4 13rem; column-gap: 2rem; }
.kolumner.smala { columns: 6 9rem; }
.kolumner li { break-inside: avoid; padding: .2rem 0; }
.traffar { list-style: none; padding: 0; }
.traffar li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--linje); }

.bokstaver { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1.25rem; }
.bokstaver a {
	display: grid; place-items: center; min-width: 2.25rem; height: 2.25rem; padding: 0 .4rem; border-radius: 6px;
	background: var(--papper); border: 1px solid var(--linje); text-decoration: none; font-weight: 700; color: var(--asfalt);
}
.bokstaver a:hover { background: var(--gul); border-color: var(--gul); color: #20252b; }
.bokstav { margin-bottom: 1.25rem; }
.bokstav h3 { display: inline-block; min-width: 2.25rem; text-align: center; background: var(--gul); color: #20252b; padding: .15rem .55rem; border-radius: 5px; margin-bottom: .5rem; }
.bokstav[hidden] { display: none; }

.filter { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.filter label { font-weight: 650; }
.filter input { font: inherit; padding: .5rem .75rem; border: 1.5px solid var(--linje); border-radius: var(--radie); background: var(--papper); color: var(--asfalt); width: min(100%, 20rem); }
.filter p { margin: 0; }

.tabell { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.tabell th, .tabell td { text-align: left; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--linje); vertical-align: top; }
.tabell thead th { border-bottom: 2px solid var(--asfalt); font-weight: 700; }
.adress { font-weight: 650; white-space: nowrap; }
@media (max-width: 40rem) { .tabell { font-size: .9375rem; } .adress { white-space: normal; } }

.platser { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1.25rem 2rem; }
.platser h3 { margin-bottom: .3rem; padding-bottom: .3rem; border-bottom: 2px solid var(--gul); }
.platser ul { list-style: none; padding: 0; margin: 0; }
.platser li { padding: .15rem 0; }

.topplista { list-style: none; padding: 0; counter-reset: plats; }
.topplista li { counter-increment: plats; display: grid; grid-template-columns: 2.2rem minmax(8rem, 15rem) 1fr 3.5rem; align-items: center; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid var(--linje); }
.topplista li::before { content: counter(plats); color: var(--grus); font-variant-numeric: tabular-nums; text-align: right; }
.stapel { height: .7rem; border-radius: 2px; background: var(--bla); width: var(--andel); min-width: 2px; }
@media (prefers-color-scheme: dark) { .stapel { background: #3d82d1; } }
.tal { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
@media (max-width: 40rem) { .topplista li { grid-template-columns: 1.8rem 1fr 3.5rem; } .stapel { display: none; } }

.om-rad { display: grid; gap: 1.5rem; }
@media (min-width: 52rem) { .om-rad { grid-template-columns: 1fr minmax(0, 20rem); } }
.om-rad figure { margin: 0; }
.om-rad img { border-radius: var(--radie); display: block; }
.om-rad figcaption { margin-top: .4rem; }

.foretag { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .9rem 2rem; }

.vader-nu { display: flex; align-items: baseline; gap: .6rem; font-size: 1.125rem; margin-bottom: .75rem; }
.vader-nu strong { font-size: 2rem; line-height: 1; }
.vader-ikon { font-size: 1.8rem; }
.vader-dagar { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.vader-dagar li { display: flex; gap: .4rem; align-items: baseline; }

.start { padding-block: 1.5rem 1rem; }
.start .skylt { font-size: clamp(2.2rem, 1.2rem + 5vw, 4.4rem); }
.start-tips { color: var(--grus); }
.sokresultat h1, .text h1, .tom h1 { font-size: clamp(1.7rem, 1.3rem + 2vw, 2.4rem); font-weight: 800; letter-spacing: -.015em; }
.text { background: var(--yta); border: 1px solid var(--linje); border-radius: var(--radie); padding: clamp(1.1rem, 4vw, 2.5rem); }
.text h2 { margin-top: 1.6em; }
.text h3 { margin-top: 1.2em; }
.text li { margin-bottom: .4em; max-width: 70ch; }
.tom { padding-block: 3rem; }
.bladdra { margin-top: 1.25rem; }

/* Annonsytor: reserverad höjd så att sidan inte hoppar när annonsen laddas */
.annons { min-height: 280px; margin: 0 0 1.25rem; text-align: center; }
.annons::before { content: "Annons"; display: block; font-size: .75rem; color: var(--grus); margin-bottom: .25rem; }

/* ---------- Sidfot ---------- */
.fot { background: var(--yta); border-top: 1px solid var(--linje); padding-block: 1.75rem; font-size: .9375rem; }
.fot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin-bottom: .9rem; font-weight: 650; }
.fot p { margin-bottom: .4rem; max-width: none; }
.fot-kallor { color: var(--grus); }

@media (max-width: 34rem) {
	.topp-rad { flex-wrap: wrap; gap: .5rem; }
	.marke { flex-direction: row; gap: .3em; }
	.sok { flex-basis: 100%; }
	.sok button { padding-inline: .8rem; }
}
@media print {
	.topp, .fot, .annons, .karta, .bokstaver, .filter, .knappar { display: none; }
	body { background: #fff; }
	.del { border: 0; padding: 0; }
}

/* ---------- Statistik ---------- */
.tabell .h { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabell tbody th { font-weight: 650; }
.kvartiler { display: flex; gap: 2px; min-width: 11rem; }
.kv { flex: 1 1 0; text-align: center; font-size: .8125rem; font-weight: 650; padding: .2rem 0; min-width: 1.6rem; color: #10243d; }
.kv1 { background: #cfe0f3; border-radius: 4px 0 0 4px; }
.kv2 { background: #9fc2e8; }
.kv3 { background: #5f97d6; }
.kv4 { background: #0a4a8f; color: #fff; border-radius: 0 4px 4px 0; }
.val td:nth-child(3) { width: 34%; }
.val .stapel { display: block; }
@media (max-width: 40rem) {
	.jamfor, .jamfor tbody { display: block; }
	.jamfor thead { display: none; }
	.jamfor tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .2rem .75rem; padding: .7rem 0; border-bottom: 1px solid var(--linje); }
	.jamfor th, .jamfor td { border: 0; padding: 0; }
	.jamfor tbody th, .jamfor td:last-child { grid-column: 1 / -1; }
	.jamfor td.h { text-align: left; }
	.jamfor td[data-e]::before { content: attr(data-e); display: block; font-size: .8125rem; color: var(--grus); font-weight: 400; }
	.jamfor td:last-child::before { margin-bottom: .2rem; }
	.val th:nth-child(3), .val td:nth-child(3) { display: none; }
	.val th, .val td { padding-right: .4rem; font-size: .9375rem; }
	.val tbody th { overflow-wrap: anywhere; hyphens: auto; }
	.val th:last-child, .val td:last-child { padding-right: 0; }
}
.stat-del { margin-bottom: 2rem; }
.stat-del:last-child { margin-bottom: 0; }
.stat-del h3 { font-size: 1.1875rem; margin-bottom: .4rem; }
.stat-matt { margin: 1rem 0 .2rem; }
.stat td:nth-child(4):not(.h) { width: 26%; }
.stat .stapel { display: block; }
.stat tbody th { font-weight: 500; }
@media (max-width: 40rem) {
	.stat { font-size: .875rem; }
	.stat th, .stat td { padding-right: .4rem; }
	.stat td:nth-child(4):not(.h), .stat th[aria-hidden] { display: none; }
	.stat tbody th { overflow-wrap: anywhere; }
}
.bostader { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem 2rem; }
.natur { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem 2rem; }
.natur.lang { grid-template-columns: 1fr; gap: 0; }
.natur.lang li { padding: .7rem 0; border-bottom: 1px solid var(--linje); max-width: 75ch; }
.stat-rutnat { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1.5rem 2.5rem; margin: 1.25rem 0; }
.stat-del.kompakt { margin: 0; }
.stat-del.kompakt h3 { font-size: 1.0625rem; }
.stat-del.kompakt .tabell { font-size: .9375rem; margin-bottom: 0; }
.stat-del.kompakt .tabell th, .stat-del.kompakt .tabell td { padding: .35rem .5rem .35rem 0; }
.natur a { color: inherit; text-decoration-color: var(--lank); }
.stat-del.kompakt .tabell thead th.h { white-space: normal; }
.stat-del.kompakt .tabell tbody th { overflow-wrap: anywhere; }
.stat-del.kompakt .tabell { table-layout: auto; width: 100%; }
@media (max-width: 40rem) { .stat-del { overflow-x: auto; } }

.adresslista { columns: 3 17rem; font-size: .9375rem; }
.adresslista li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.fler { margin: .5rem 0 1rem; }
details.fler summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
