/* ======================================================
   Färger, mått och återanvändbara designvärden
   ====================================================== */
:root {
  --ink: #14213d;
  --muted: #57647d;
  --blue: #1e5eff;
  --blue-dark: #123ba2;
  --sky: #eaf1ff;
  --yellow: #ffd43b;
  --paper: #ffffff;
  --soft: #f5f7fb;
  --line: #dce2ed;
  --green: #138a62;
  --red: #b42318;
  --radius: 1.25rem;
  --shadow: 0 18px 50px rgba(20, 33, 61, .12);
}

/* ======================================================
   Grundinställningar och sidbredder
   ====================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1rem; line-height: 1.6; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.narrow { width: min(100% - 2rem, 52rem); }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--ink); color: white; padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

/* ======================================================
   Gemensam header och navigation
   ====================================================== */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-size: 1.22rem; font-weight: 850; letter-spacing: -.035em; }
.brand-mark { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .7rem; background: var(--yellow); color: var(--ink); font-size: .84rem; font-weight: 900; box-shadow: inset 0 -.22rem 0 rgba(20,33,61,.1); }
.menu-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .5rem .75rem; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: .75rem; cursor: pointer; }
.menu-toggle-lines, .menu-toggle-lines::before, .menu-toggle-lines::after { display: block; width: 1.15rem; height: 2px; background: currentColor; content: ""; transition: .2s ease; }
.menu-toggle-lines { position: relative; }
.menu-toggle-lines::before { position: absolute; top: -.36rem; }
.menu-toggle-lines::after { position: absolute; top: .36rem; }
.menu-open .menu-toggle-lines { background: transparent; }
.menu-open .menu-toggle-lines::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-toggle-lines::after { top: 0; transform: rotate(-45deg); }
.site-nav { display: none; position: absolute; top: 4.5rem; left: 0; right: 0; padding: .75rem 1rem 1rem; background: white; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(20,33,61,.08); }
.menu-open .site-nav { display: grid; }
.site-nav a { padding: .8rem .9rem; border-radius: .65rem; text-decoration: none; font-weight: 700; }
.site-nav a:hover, .site-nav a.is-active { color: var(--blue-dark); background: var(--sky); }
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.share-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; padding: .5rem .7rem; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: .75rem; font-weight: 750; cursor: pointer; }
.share-button:hover, .share-button:focus-visible { color: var(--blue-dark); background: var(--sky); border-color: #b8c9f7; outline: none; }
.share-button svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share-button.is-copied { color: white; background: var(--green); border-color: var(--green); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* ======================================================
   Startsida: hero, kommunsökning och nästa lov
   ====================================================== */
.tool-hero { overflow: hidden; position: relative; padding: 2.5rem 0 3rem; background-color: var(--blue); background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 2rem 2rem; color: white; }
.hero-grid { display: grid; gap: 2rem; }
.eyebrow { margin: 0 0 .55rem; color: var(--blue); font-size: .78rem; line-height: 1.3; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.tool-hero .eyebrow { color: var(--yellow); }
h1, h2, h3 { margin-top: 0; line-height: 1.13; letter-spacing: -.035em; }
h1 { margin-bottom: .8rem; font-size: clamp(2.35rem, 9vw, 4.7rem); }
h2 { font-size: clamp(1.65rem, 5vw, 2.5rem); }
h3 { font-size: 1.1rem; }
.lead { max-width: 41rem; margin: 0 0 1.5rem; font-size: 1.08rem; line-height: 1.55; }
.municipality-search { padding: 1rem; background: white; color: var(--ink); border-radius: 1rem; box-shadow: var(--shadow); }
.municipality-search label { display: block; margin-bottom: .45rem; font-weight: 800; }
.search-row { display: grid; gap: .6rem; }
.search-row input,
.search-row select { width: 100%; min-width: 0; min-height: 3.15rem; padding: .75rem .9rem; border: 2px solid var(--line); border-radius: .7rem; color: var(--ink); background: white; }
.search-row select { cursor: pointer; }
.search-row input:focus,
.search-row select:focus { border-color: var(--blue); outline: 3px solid rgba(30,94,255,.16); }
.search-row button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.15rem; padding: .72rem 1.05rem; border: 0; border-radius: .7rem; background: var(--blue); color: white; font-weight: 800; text-decoration: none; cursor: pointer; }
.search-row button:hover, .button:hover { background: var(--blue-dark); }
.form-note { margin: .55rem 0 0; color: var(--muted); font-size: .86rem; }
.form-note a { color: var(--blue-dark); font-weight: 750; }
.form-note--error { color: var(--red); }

/* ======================================================
   Mobilvänlig autocomplete för kommunfält
   ====================================================== */
.autocomplete-list {
  overflow-y: auto;
  max-height: min(22rem, 55vh);
  margin-top: .4rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: white;
  box-shadow: 0 12px 30px rgba(20, 33, 61, .14);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.autocomplete-list[hidden] {
  display: none;
}

.autocomplete-option {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: .7rem .9rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: white;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.autocomplete-option:last-child {
  border-bottom: 0;
}

.autocomplete-option:hover,
.autocomplete-option:focus-visible,
.autocomplete-option[aria-selected="true"] {
  color: var(--blue-dark);
  background: var(--sky);
  outline: none;
}

.quick-links { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.quick-links a { padding: .35rem .65rem; border: 1px solid rgba(255,255,255,.32); border-radius: 999px; color: white; text-decoration: none; font-size: .86rem; }
.quick-links a:hover { background: white; color: var(--blue-dark); }
.next-card { position: relative; padding: 1.6rem; background: var(--yellow); color: var(--ink); border-radius: 1.5rem; box-shadow: 0 1.2rem 0 rgba(12,43,122,.24); transform: rotate(1deg); }
.next-card::before { content: ""; position: absolute; left: -.7rem; top: 50%; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--blue); }
.next-card-label { margin: 0 0 1.2rem; font-size: .82rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.next-card-icon { font-size: 2.2rem; }
.next-card h2 { margin: .35rem 0 .2rem; font-size: 2.1rem; }
.countdown { margin: 0; line-height: 1; }
.countdown strong { display: block; font-size: 4rem; letter-spacing: -.07em; }
.next-date { margin: 1rem 0 1.25rem; font-weight: 700; }
.button--dark { width: 100%; background: var(--ink); }
.button--dark:hover { background: #050b18; }

/* ======================================================
   Gemensamma innehållssektioner, annonser och ämneskort
   ====================================================== */
.section { padding-block: 3.75rem; }
.ad-container { width: min(100% - 2rem, 72rem); min-height: 5.5rem; margin: 1.5rem auto; color: var(--muted); text-align: center; font-size: .72rem; }
.adsbygoogle { display: block; }
.section--soft { background: var(--soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading h2 { margin-bottom: 0; }
.text-link { color: var(--blue-dark); font-weight: 800; text-decoration: none; white-space: nowrap; }
.topic-grid { display: grid; gap: .85rem; }
.topic-card { display: flex; align-items: center; gap: 1rem; min-height: 7rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.topic-card > span { display: grid; place-items: center; flex: 0 0 3.5rem; width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: var(--soft); font-size: 1.75rem; }
.topic-card h3, .topic-card p { margin: 0; }
.topic-card p { color: var(--muted); font-size: .92rem; }
.topic-card--sport > span { background: #e5f1ff; }
.topic-card--easter > span { background: #fff0c7; }
.topic-card--autumn > span { background: #ffeadb; }
.topic-card--summer > span { background: #fff7bd; }
.content-split { display: grid; gap: 1rem; }
.content-split h2 { margin-bottom: 0; }
.prose p { margin-top: 0; color: var(--muted); }

/* ======================================================
   Kommun- och undersidor
   ====================================================== */
.page-hero { padding: 3rem 0; background: var(--sky); }
.page-hero .lead { margin-bottom: 0; color: var(--muted); }
.page-hero--municipality { background: var(--ink); color: white; }
.page-hero--municipality .eyebrow { color: #94b4ff; }
.back-link { display: inline-block; margin-bottom: 1.5rem; color: #cad6ef; text-decoration: none; font-weight: 700; }
.municipality-next { display: flex; align-items: center; gap: .85rem; margin-top: 1.5rem; padding: .85rem 1rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: .9rem; }
.municipality-next-icon { font-size: 1.7rem; }
.municipality-next span, .municipality-next strong { display: block; }
.municipality-next strong { color: var(--yellow); font-size: 1.25rem; }
.holiday-list { display: grid; gap: .75rem; }
.holiday-row { display: flex; align-items: center; gap: 1rem; padding: 1.05rem; border: 1px solid var(--line); border-radius: 1rem; }
.holiday-row--next { border: 2px solid var(--blue); box-shadow: 0 8px 25px rgba(30,94,255,.1); }
.holiday-icon { display: grid; place-items: center; flex: 0 0 3.25rem; width: 3.25rem; height: 3.25rem; border-radius: .9rem; background: var(--soft); font-size: 1.55rem; }
.holiday-copy { flex: 1; min-width: 0; }
.holiday-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.holiday-row h3, .holiday-row p { margin: 0; }
.holiday-row p { color: var(--muted); font-size: .93rem; }
.next-label { padding: .18rem .45rem; border-radius: 999px; background: var(--blue); color: white; font-size: .7rem; font-weight: 850; text-transform: uppercase; }
.calendar-action { display: grid; gap: 1rem; margin-top: 2rem; padding: 1.3rem; background: var(--yellow); border-radius: var(--radius); }
.calendar-action h2, .calendar-action p { margin: 0; }
.calendar-action p { margin-top: .2rem; }
.calendar-action + .long-form { margin-top: 3rem; }
.source-box { margin-top: 2rem; padding: 1.2rem; border-left: .3rem solid var(--blue); background: var(--soft); }
.source-box h2 { margin-bottom: .4rem; font-size: 1.25rem; }
.source-box p { margin: 0; color: var(--muted); }
.source-box a { color: var(--blue-dark); font-weight: 700; }

/* ======================================================
   Artiklar, tabeller och sidan Alla lov
   ====================================================== */
.article-layout { display: grid; gap: 2rem; padding-block: 3rem; }
.article-content section + section { margin-top: 2.5rem; }
.article-content h2 { margin-bottom: .7rem; font-size: 1.65rem; }
.article-content p { color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 1rem; }
table { width: 100%; border-collapse: collapse; background: white; text-align: left; }
th, td { padding: .8rem .85rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead { background: var(--ink); color: white; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody a { color: var(--blue-dark); }
.article-tool, .inline-tool { padding: 1.2rem; background: var(--soft); border-radius: var(--radius); }
.article-tool > h2, .inline-tool > h2 { margin-bottom: 1rem; font-size: 1.35rem; }
.article-tool .municipality-search, .inline-tool .municipality-search { padding: 0; box-shadow: none; background: transparent; }
.all-holidays-grid { display: grid; gap: .8rem; }
.all-holiday-card { display: grid; grid-template-columns: 2.8rem 1fr auto; align-items: start; gap: .8rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: 1rem; text-decoration: none; }
.all-holiday-card:hover { border-color: var(--blue); box-shadow: 0 8px 24px rgba(20,33,61,.08); }
.all-holiday-card > span { font-size: 1.6rem; }
.all-holiday-card h2 { margin: 0; font-size: 1.25rem; }
.all-holiday-card p { margin: .25rem 0 0; color: var(--muted); font-size: .92rem; }
.all-holiday-card b { color: var(--blue); font-size: 1.4rem; }
.inline-tool { margin-top: 2rem; }
.long-form h2 { margin-top: 2.5rem; }
.empty-page { min-height: 55vh; padding-block: 5rem; text-align: center; }

/* ======================================================
   Gemensam footer
   ====================================================== */
.site-footer { padding: 3rem 0 1.5rem; background: var(--ink); color: #dce5f8; }
.footer-grid { display: grid; gap: 2rem; }
.brand--footer { color: white; }
.footer-grid p { color: #aebbd5; }
.footer-grid h2 { margin-bottom: .6rem; color: white; font-size: .92rem; letter-spacing: .04em; }
.footer-grid > div:not(:first-child) { display: grid; align-content: start; gap: .38rem; }
.footer-grid a:not(.brand) { color: #c7d3eb; text-decoration: none; }
.footer-grid a:hover { color: white; }
.footer-bottom { display: flex; flex-direction: column; gap: .25rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.15); color: #91a0bd; font-size: .82rem; }

/* ======================================================
   Sportlov: veckoväljare och kommunlistor
   ====================================================== */
.section-intro {
  margin-top: -.25rem;
}

.week-jump-grid {
  display: grid;
  gap: .7rem;
  margin-top: 1.25rem;
}

.week-jump {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: .8rem;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.week-jump:hover,
.week-jump:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(30, 94, 255, .12);
  outline: none;
}

.week-jump span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.week-jump strong {
  grid-row: 1 / span 3;
  grid-column: 1;
  min-width: 3.5rem;
  color: var(--blue);
  font-size: 2.8rem;
  line-height: 1;
  letter-spacing: -.07em;
  text-align: center;
}

.week-jump small {
  color: var(--muted);
  font-size: .86rem;
}

.week-jump b {
  color: var(--blue-dark);
  font-size: .88rem;
}

.week-sections {
  margin-top: 3.5rem;
}

.week-section {
  scroll-margin-top: 6rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.week-section + .week-section {
  margin-top: 1.25rem;
}

.week-section-heading {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}

.week-section-heading h2,
.week-section-heading p {
  margin-bottom: 0;
}

.week-section-heading > a {
  color: var(--blue-dark);
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
}

.municipality-result-grid {
  display: grid;
  gap: .55rem;
}

.municipality-result-grid > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem .95rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: white;
  text-decoration: none;
}

.municipality-result-grid > a:hover {
  border-color: var(--blue);
}

.municipality-result-grid span,
.municipality-result-grid strong,
.municipality-result-grid small {
  display: block;
}

.municipality-result-grid small {
  color: var(--muted);
}

.municipality-result-grid b {
  color: var(--blue);
  font-size: 1.25rem;
}

/* ======================================================
   Responsiv layout: större mobiler och surfplattor
   ====================================================== */
@media (min-width: 38rem) {
  .search-row { grid-template-columns: minmax(0, 1fr) auto; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .calendar-action { grid-template-columns: 1fr auto; align-items: center; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }

  .week-jump-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .week-jump {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .week-jump strong {
    min-width: 0;
    font-size: 3.4rem;
    text-align: left;
  }

  .week-section-heading {
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
  }

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

/* ======================================================
   Responsiv layout: dator
   ====================================================== */
@media (min-width: 52rem) {
  .menu-toggle { display: none; }
  .site-nav { order: 2; display: flex; position: static; margin-left: auto; padding: 0; border: 0; box-shadow: none; gap: .2rem; }
  .header-actions { order: 3; margin-left: 0; }
  .site-nav a { padding: .55rem .7rem; font-size: .92rem; }
  .tool-hero { padding: 4.5rem 0 5rem; }
  .hero-grid { grid-template-columns: minmax(0, 1.3fr) minmax(20rem, .7fr); align-items: center; gap: 4rem; }
  .next-card { padding: 2rem; }
  .content-split { grid-template-columns: .9fr 1.1fr; gap: 4rem; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
  .article-tool { position: sticky; top: 6rem; }
}

@media (max-width: 25rem) {
  .share-button [data-share-label],
  .menu-label { display: none; }
  .share-button, .menu-toggle { width: 2.75rem; padding-inline: .5rem; }
}

/* Minska rörelser för besökare som har valt detta i sin enhet. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
