/* Stadens nycklar – färger och typsnitt från den gamla sajten (Poppins + Bebas Neue, båda OFL),
   men med bättre kontrast, synligt fokus och responsiv layout utan horisontell scroll. */
@font-face { font-family: "Poppins"; font-weight: 300; font-display: swap; src: url(/static/fonts/poppins-light-webfont.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url(/static/fonts/poppins-medium-webfont.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url(/static/fonts/poppins-bold-webfont.woff2) format("woff2"); }
@font-face { font-family: "Bebas Neue"; font-weight: 400; font-display: swap; src: url(/static/fonts/BebasNeue-webfont.woff) format("woff"); }

:root {
  --beige: #f0f4e5;
  --beige-dark: #e3ebd0;
  --sand: #f4ebda;
  --green: #aabf9f;
  --green-dark: #5f7a52;     /* mörkare än originalets #9dac7b för text/kant med kontrast */
  --gold: #e0be58;
  --gold-dark: #8a6d14;
  --ink: #2b2b2b;
  --ink-soft: #434343;
  --muted: #5e5e5e;
  --white: #fff;
  --vardagsliv: #5f7a52;
  --kommunikation: #8a6d14;
  --forandring: #8c4a2f;
  --focus: #1a4fd6;
  --radius: 12px;
  --maxw: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--beige);
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: "Bebas Neue", "Poppins", sans-serif; font-weight: 400; letter-spacing: .02em; line-height: 1.1; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h3 { font-size: 1.4rem; }
strong { font-weight: 700; }
p { margin: 0 0 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); font-size: .95em; }
.lead { font-size: 1.2rem; max-width: 60ch; }

.skip { position: absolute; left: 1rem; top: -4rem; padding: .6rem 1rem; background: var(--ink); color: var(--white); z-index: 100; border-radius: 0 0 8px 8px; }
.skip:focus { top: 0; }

/* Sidhuvud */
.head { background: var(--beige-dark); border-bottom: 1px solid var(--green); position: sticky; top: 0; z-index: 20; }
.head__inner { max-width: var(--maxw); margin: 0 auto; padding: .6rem var(--gutter); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.head__brand img { width: 120px; height: auto; }
.head__toggle { margin-left: auto; font: inherit; font-weight: 500; background: var(--white); border: 2px solid var(--ink-soft); border-radius: 999px; padding: .4rem 1rem; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; }
.head__toggle-bars { width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; display: inline-block; }
.nav { flex-basis: 100%; }
.nav ul { list-style: none; margin: 0; padding: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.nav a { font-weight: 500; text-decoration: none; padding: .35rem .2rem; display: inline-block; border-bottom: 2px solid transparent; color: var(--ink); }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--gold-dark); }
.nav__search { margin-left: auto; }
.nav__search form { display: flex; gap: .3rem; }
.nav__search input { font: inherit; padding: .3rem .6rem; border: 1px solid var(--ink-soft); border-radius: 999px; width: 10rem; max-width: 50vw; background: var(--white); }
.nav__search button { font: inherit; display: inline-flex; align-items: center; gap: .3rem; background: var(--white); border: 1px solid var(--ink-soft); border-radius: 999px; padding: .3rem .7rem; cursor: pointer; }
@media (max-width: 47.99em) {
  .js .nav { display: none; }
  .js .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; }
  .nav__search { margin-left: 0; }
}
@media (min-width: 48em) {
  .head__toggle { display: none; }
  .nav { flex-basis: auto; flex: 1; }
  .nav ul { padding: 0; justify-content: flex-end; }
}

/* Innehåll */
main { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem var(--gutter) 3rem; }
.page { max-width: 48rem; }
.page--wide { max-width: none; }
.prose p, .prose li { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; }
.prose a { word-break: break-word; }
.prose--intro { font-size: 1.1rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: inherit; }
.page__head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page__icon { width: 80px; height: 80px; }
.page__figure { margin: 0 0 1.5rem; }
.page__figure img { border-radius: var(--radius); }
.page__links { display: flex; gap: .6rem; flex-wrap: wrap; }

.button { display: inline-block; background: var(--ink); color: var(--white); text-decoration: none; font-weight: 500; padding: .6rem 1.2rem; border-radius: 999px; border: 2px solid var(--ink); cursor: pointer; font: inherit; font-weight: 500; }
.button:hover { background: var(--white); color: var(--ink); }
.button--ghost { background: transparent; color: var(--ink); }
.button--ghost:hover { background: var(--ink); color: var(--white); }

.hero { background: var(--sand); border-radius: var(--radius); padding: clamp(1.2rem, 4vw, 2.5rem); margin-bottom: 2rem; }
.hero__text { max-width: 62ch; }

.themes { margin: 2rem 0; }
.themes__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.theme__link { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-decoration: none; background: var(--white); border-radius: var(--radius); padding: 1.2rem; border: 2px solid transparent; height: 100%; color: var(--ink); }
.theme__link:hover, .theme__link:focus-visible { border-color: var(--gold-dark); }
.theme__icon { width: 96px; height: 96px; }
.theme__title { font-family: "Bebas Neue", sans-serif; font-size: 1.8rem; letter-spacing: .03em; }
.theme__count { color: var(--muted); font-size: .9rem; }

.cards { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; border: 2px solid transparent; }
.card:hover, .card:focus-within { border-color: var(--gold-dark); }
.card__link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.card__link:focus-visible { outline-offset: -3px; }
.card__img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card__img--empty { background: linear-gradient(135deg, var(--beige-dark), var(--green)); }
.card__body { padding: .9rem 1rem 1.1rem; }
.card__title { font-size: 1.3rem; margin-bottom: .2rem; }
.card__meta { font-size: .85rem; color: var(--muted); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card__text { font-size: .95rem; margin: .5rem 0 0; }
.tag { display: inline-block; font-size: .78rem; font-weight: 500; letter-spacing: .02em; padding: .1rem .55rem; border-radius: 999px; color: var(--white); background: var(--ink-soft); text-decoration: none; }
.tag--vardagsliv { background: var(--vardagsliv); }
.tag--kommunikation { background: var(--kommunikation); }
.tag--forandring { background: var(--forandring); }
.pills { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.2rem; }
.pills a { text-decoration: none; padding: .35rem .9rem; border-radius: 999px; border: 2px solid var(--ink-soft); color: var(--ink); font-weight: 500; font-size: .95rem; }
.pills a[aria-current="page"], .pills a:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Karta */
.mapsec { margin: 2.5rem 0; }
.map { display: grid; gap: 1rem; }
.map__filter { background: var(--white); border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.map__filter fieldset { border: 0; margin: 0; padding: 0; display: flex; gap: .3rem 1rem; flex-wrap: wrap; }
.map__filter legend { font-weight: 500; padding: 0; margin-bottom: .2rem; }
.map__filter label { display: inline-flex; align-items: center; gap: .35rem; }
.map__filter input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--green-dark); }
.map__range { min-width: 15rem; }
.map__range label { font-weight: 500; display: block; }
.map__range input { width: 100%; accent-color: var(--green-dark); }
.map__count { margin: 0; align-self: center; color: var(--muted); }
.js .map__filter { display: flex; }
.map__canvas { display: none; width: 100%; height: clamp(18rem, 60vh, 34rem); border-radius: var(--radius); background: var(--beige-dark); }
.map__canvas--small { height: 16rem; }
.js .map__canvas.is-ready { display: block; }
.map__list summary { cursor: pointer; font-weight: 500; }
.map__list ul { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .3rem; }
.map__list li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.map__list li[hidden] { display: none; }
.leaflet-container { font: inherit; }
.leaflet-popup-content { margin: .8rem 1rem; }
.leaflet-popup-content a { font-weight: 500; }
.leaflet-popup-content img { border-radius: 6px; margin-bottom: .4rem; }
.leaflet-container a.leaflet-popup-close-button { font-size: 1.4rem; }
.leaflet-marker-icon:focus-visible, .leaflet-control a:focus-visible { outline: 3px solid var(--focus); }

/* Minne */
.memory__meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; color: var(--muted); font-size: .95rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.gallery__item { margin: 0; }
.gallery__item img { border-radius: var(--radius); width: 100%; }
.gallery__item figcaption { font-size: .9rem; color: var(--muted); margin-top: .3rem; }
.video { margin: 1rem 0 1.5rem; }
.video video { width: 100%; border-radius: var(--radius); background: #000; }
.video figcaption { font-size: .9rem; color: var(--muted); }
.memory__text { font-size: 1.1rem; }
.memory__foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--green); color: var(--muted); font-size: .9rem; }

/* Tidslinje */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 3px solid var(--gold); }
.timeline__item { position: relative; padding: 0 0 1.5rem 1rem; }
.timeline__item::before { content: ""; position: absolute; left: -1.5rem; top: .5rem; width: 1rem; height: 1rem; background: var(--gold-dark); border-radius: 50%; transform: translateX(-50%); margin-left: 1.5px; }
.timeline__year { margin-bottom: .2rem; }

/* Sök */
.search { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.5rem; }
.search label { display: block; font-weight: 500; }
.search input { font: inherit; padding: .5rem .8rem; border: 1px solid var(--ink-soft); border-radius: 8px; min-width: 16rem; }
.hits { padding-left: 1.2rem; }
.hits li { margin-bottom: .4rem; }

/* Sidfot */
.foot { background: var(--beige-dark); border-top: 1px solid var(--green); margin-top: 2rem; }
.foot__inner { max-width: var(--maxw); margin: 0 auto; padding: 2rem var(--gutter); }
.foot__keys { width: 120px; margin: 0 auto 1rem; }
.foot__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; }
.foot h2 { font-size: 1.4rem; }
.foot__small { font-size: .85rem; color: var(--muted); }
.foot__owner { text-align: center; margin: 2rem 0 0; font-size: .9rem; color: var(--muted); }
