/* ==========================================================
   Orups Nya Vägsamfällighet – stilmall
   Inga externa resurser. Typsnitten ligger i /fonts.
   ========================================================== */

/* ---------- Typsnitt (egen hosting, SIL Open Font License) ---------- */
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Färger ---------- */
:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --text: #1d2621;
  --muted: #56625a;
  --line: #ddd8cc;
  --accent: #2d5b3a;        /* skogsgrön */
  --accent-hover: #1f4229;
  --accent-soft: #e5ede3;
  --gravel: #8a6c3e;        /* grusbrun */
  --header-bg: #fbfaf6;
  --footer-bg: #24302a;
  --footer-text: #dfe6df;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .06);
  --radius: 10px;
  --wide: 72rem;
  --narrow: 44rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131915;
    --surface: #1b231e;
    --text: #e6ebe5;
    --muted: #a2ada5;
    --line: #2d3832;
    --accent: #8cc49a;
    --accent-hover: #b0dcb9;
    --accent-soft: #223127;
    --gravel: #d1b07a;
    --header-bg: #161d18;
    --footer-bg: #0e1310;
    --footer-text: #c9d3ca;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  }
}

/* ---------- Grund ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

h1, h2, h3 {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); margin-top: 1.8em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--gravel); outline-offset: 2px; border-radius: 2px; }

img { max-width: 100%; height: auto; display: block; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: 6px; z-index: 10;
}
.skip-link:focus { top: 1rem; color: #fff; }

.wrap { width: min(100% - 2rem, var(--wide)); margin-inline: auto; }
.narrow { width: min(100% - 2rem, var(--narrow)); margin-inline: auto; }

/* ---------- Sidhuvud ---------- */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 2rem; padding-block: 1rem;
}
.site-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600; font-size: 1.3rem; line-height: 1.2;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: .6rem;
}
.site-name:hover { color: var(--accent); }
.site-name svg { flex: none; }

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .25rem;
}
.site-nav a {
  display: block; padding: .4rem .75rem; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--accent-hover); }
.site-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .site-nav a[aria-current="page"] { color: #0f1611; }
}

/* ---------- Startsidans bild ---------- */
.hero {
  position: relative;
  min-height: clamp(18rem, 50vw, 30rem);
  display: grid; place-items: end start;
  background: #2d3a30 center 60% / cover no-repeat;
  background-image: url("../bilder/skogsvag-sommar.jpg");
  color: #fff;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(10 20 12 / .75), rgb(10 20 12 / .1) 65%);
}
.hero .wrap { position: relative; padding-block: 2.5rem; }
.hero h1 { margin: 0 0 .25rem; text-shadow: 0 1px 12px rgb(0 0 0 / .4); }
.hero p { margin: 0; font-size: 1.2rem; opacity: .95; }

/* ---------- Sidrubrik på undersidor ---------- */
.page-head { padding-block: 2.5rem 1rem; }
.page-head p.lead { font-size: 1.25rem; color: var(--muted); max-width: 40rem; }
.breadcrumb { font-size: .95rem; margin-bottom: .5rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

section.block { padding-block: 1.5rem; }
.block > h2:first-child,
.split > div > h2:first-child { margin-top: 0; }

/* ---------- Kort ---------- */
.cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-block: 1.5rem;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow);
}
a.card { display: block; color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 .35rem; color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: 1rem; }
.card .more { display: inline-block; margin-top: .6rem; font-weight: 600; color: var(--accent); }

/* ---------- Text + bild ---------- */
.split {
  display: grid; gap: 2rem; align-items: start;
  grid-template-columns: 1fr;
}
@media (min-width: 52rem) {
  .split { grid-template-columns: 1.1fr 1fr; }
}

figure { margin: 0; }
figure img { border-radius: var(--radius); }
figcaption { font-size: .9rem; color: var(--muted); margin-top: .4rem; }

.map {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .5rem;
}
.map img { border-radius: 4px; }
.maps { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); align-items: start; }

/* ---------- Faktaruta ---------- */
.facts {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.1rem 1.4rem; margin: 1rem 0 2rem;
  display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.5rem;
}
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
@media (max-width: 34rem) {
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: .6rem; }
}

/* ---------- Dokumentlista ---------- */
.doc-list { list-style: none; padding: 0; margin: 1rem 0 2rem; display: grid; gap: .6rem; }
.doc-list a {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1.1rem; text-decoration: none; color: var(--text);
}
.doc-list a:hover { border-color: var(--accent); }
.doc-list .icon { flex: none; color: var(--accent); }
.doc-list .title { font-weight: 600; }
.doc-list .meta { margin-left: auto; color: var(--muted); font-size: .95rem; white-space: nowrap; }

/* ---------- Kontakter ---------- */
.people { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); margin: 1rem 0 1.5rem; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.person .role { font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gravel); margin: 0; }
.person .name { font-weight: 600; font-size: 1.15rem; margin: .1rem 0 .3rem; }
.person p { margin: 0; font-size: 1rem; }
.person a { overflow-wrap: anywhere; }
.person.vacant .name { color: var(--muted); font-style: italic; font-weight: 400; }

address { font-style: normal; }

/* ---------- Tidslinje ---------- */
.timeline { list-style: none; padding: 0; margin: 1.5rem 0; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 2rem 1.75rem; }
.timeline li::before {
  content: ""; position: absolute; left: -.6rem; top: .35rem;
  width: .9rem; height: .9rem; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
}
.timeline .year { font-family: "Source Serif 4", Georgia, serif; font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
.timeline h2 { font-size: 1.25rem; margin: .4rem 0 .5rem; }

/* ---------- Knapp ---------- */
.button {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
  padding: .65rem 1.2rem; border-radius: 999px;
}
.button:hover { background: var(--accent-hover); color: #fff; }
@media (prefers-color-scheme: dark) {
  .button, .button:hover { color: #0f1611; }
}

.note {
  background: var(--accent-soft); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0;
}

/* ---------- Sidfot ---------- */
.site-footer {
  background: var(--footer-bg); color: var(--footer-text);
  margin-top: 3rem; padding-block: 2.5rem; font-size: 1rem;
}
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.site-footer h2 { font-size: 1.1rem; margin: 0 0 .5rem; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer p { margin: 0 0 .4rem; }
.site-footer .small { margin-top: 2rem; font-size: .9rem; opacity: .8; }

/* ---------- Utskrift ---------- */
@media print {
  .site-header nav, .site-footer, .skip-link, .hero { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
