/* Grundlayout. Ingen eksterne skrifttyper (kravspecifikation §19). Fungerer ned til 320 px. */
:root {
  --bg: #ffffff;
  --text: #1c2a33;
  --muted: #4a5a66;
  --accent: #1d6b57;
  --accent-text: #ffffff;
  --border: #c8d6cd;
  --band: #eef5f1;
  --ok: #14602f;
  --error: #9b1c1c;
  --warn: #7a4b00;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1rem; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid #0b4fc4; outline-offset: 2px; box-shadow: 0 0 0 2px #fff; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: .6rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Sidehoved og menu ---------- */
.site-header { background: var(--band); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-top: .75rem; padding-bottom: .75rem; }
.site-name { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; align-items: center; }

.main-nav { position: relative; }
.menu-toggle > summary {
  cursor: pointer; padding: .45rem .9rem; border: 1px solid #6b7b86; border-radius: 4px; background: #fff;
  list-style: none; font-weight: 600;
}
.menu-toggle > summary::-webkit-details-marker { display: none; }
.menu-toggle[open] > summary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.menu { flex-direction: column; align-items: stretch; gap: .1rem; margin-top: .5rem; }
.menu a, .menu-group > summary { display: block; padding: .5rem .6rem; color: var(--text); text-decoration: none; border-radius: 4px; }
.menu a:hover, .menu-group > summary:hover { background: #fff; text-decoration: underline; }
.menu a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.menu-group > summary { cursor: pointer; list-style: none; font-weight: 600; }
.menu-group > summary::-webkit-details-marker { display: none; }
.menu-group > summary::after { content: " \25BE"; }
.menu-group.current > summary { text-decoration: underline; text-underline-offset: .25em; }
.menu-group > ul { flex-direction: column; align-items: stretch; gap: 0; padding-left: 1rem; }

@media (min-width: 52rem) {
  .js .menu-toggle > summary { display: none; }
  .menu { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin: 0; }
  .has-group { position: relative; }
  .menu-group[open] > ul {
    position: absolute; top: 100%; left: 0; z-index: 5; min-width: 15rem; padding: .4rem; margin: 0;
    background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
  }
}

/* ---------- Indhold ---------- */
main { padding: 1.5rem 0 2.5rem; min-height: 50vh; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }

.body > :first-child { margin-top: 0; }
.body img { max-width: 100%; height: auto; }
.meta, .hint, .muted { color: var(--muted); }
.meta { margin: -.25rem 0 .75rem; font-size: .95rem; }
.hint { font-size: .9rem; font-weight: 400; }

.events ul, .board, .recent, .event-list { list-style: none; padding: 0; margin: 0; }
.events li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.news-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.news-item h3 { margin: 0 0 .25rem; }
.news-item p { margin: .25rem 0; }
.filter ul { margin: 0 0 1rem; }
.filter a[aria-current="true"] { font-weight: 700; color: var(--text); text-decoration: none; border-bottom: 3px solid var(--accent); }
.pager { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; margin-top: 1.5rem; }
.board li { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.back { margin-top: 2rem; }

.news-thumb { display: block; max-width: 100%; height: auto; margin: .5rem 0; border-radius: 4px; }
.news-image { margin: 0 0 1.25rem; }
.news-image img { max-width: 100%; height: auto; border-radius: 4px; }
.doclist { list-style: none; padding: 0; margin: 0 0 1rem; }
.doclist li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.statutes { margin: 1.5rem 0; padding: 1rem 1.2rem; background: var(--band); border: 1px solid var(--border); border-radius: 6px; }
.statutes h2 { margin-top: 0; }
.statutes p { margin: .25rem 0; }

.site-footer { border-top: 1px solid var(--border); background: var(--band); padding: 1rem 0; color: var(--muted); font-size: .95rem; }
.site-footer p { margin: .25rem 0; }

/* ---------- Formularer ---------- */
.form label { display: block; font-weight: 600; margin-bottom: .25rem; }
.form label.check { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; }
.form label.check.small { display: inline-flex; font-size: .9rem; margin: 0 .25rem; }
.form input[type="text"], .form input[type="password"], .form input[type="date"], .form input[type="time"],
.form input[type="number"], .form input[type="url"], .form select, .form textarea {
  width: 100%; max-width: 40rem; font: inherit; padding: .55rem .6rem; border: 1px solid #6b7b86; border-radius: 4px; background: #fff; color: var(--text);
}
.form input[disabled] { background: var(--band); color: var(--muted); }
.form input.short { width: 4.5rem; }
.form input[type="date"] { max-width: 12rem; }
.form input[type="time"] { max-width: 9rem; }
.form textarea { max-width: 100%; min-height: 10rem; line-height: 1.5; }
.form .hint { display: block; margin-top: .25rem; }
textarea[readonly], input[readonly] { background: var(--band); width: 100%; max-width: 40rem; font: inherit; padding: .55rem .6rem; border: 1px solid #6b7b86; border-radius: 4px; }

button, .button {
  font: inherit; padding: .55rem 1.1rem; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .button:hover { filter: brightness(1.1); }
button.secondary { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--error); border-color: var(--error); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
form.inline { display: inline; margin: 0 .25rem 0 0; }
td form.inline button { padding: .3rem .7rem; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.more { margin: 1rem 0; }
.more > summary { cursor: pointer; font-weight: 600; }
.more[open] > summary { margin-bottom: .75rem; }
.danger-zone { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.flash { padding: .75rem 1rem; border-left: 5px solid var(--accent); background: var(--band); margin: 0 0 1rem; }
.flash-ok { border-color: var(--ok); }
.flash-error { border-color: var(--error); }
.flash ul { margin: 0; padding-left: 1.2rem; }
code { font-size: 1.05em; background: #fff; border: 1px solid var(--border); padding: .1rem .35rem; border-radius: 3px; }
#temp-password { font-size: 1.15rem; user-select: all; }

/* ---------- Tabeller ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--band); }
tr.muted td { color: var(--muted); }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 1rem; font-size: .85rem; border: 1px solid var(--border); background: var(--band); }
.badge-published { background: #e3f3e8; border-color: #9ccaa9; color: var(--ok); }
.badge-draft { background: #fff4d6; border-color: #e0c77a; color: var(--warn); }
.badge-archived, .badge-hidden { background: #eee; color: var(--muted); }
.status-line { margin: 0 0 1rem; color: var(--muted); }

/* ---------- Administration ---------- */
.admin-menu { font-size: .95rem; }
.cards { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.cards a, .cards .card-body {
  display: block; height: 100%; padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: 6px; background: var(--band);
  text-decoration: none; color: var(--text);
}
.cards a:hover { border-color: var(--accent); background: #fff; }
.cards strong { display: block; font-size: 1.15rem; color: var(--accent); }
.cards span { color: var(--muted); font-size: .95rem; }
.cards .disabled { opacity: .6; }
.recent li, .event-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.event-list li { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.event-list li > span { flex: 1 1 14rem; }
.menu-preview { margin: 0 0 1.5rem; padding-left: 1.2rem; }
.share { margin-top: 2rem; padding: 1rem 1.2rem; background: var(--band); border: 1px solid var(--border); border-radius: 6px; }
.share h2 { margin-top: 0; }

/* ---------- Editor ---------- */
.editor { margin: 1rem 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.toolbar[hidden], .preview-wrap[hidden], [hidden] { display: none !important; }
.toolbar button { background: #fff; color: var(--text); border-color: #6b7b86; padding: .35rem .75rem; }
.preview-wrap { margin-top: 1rem; padding: 1rem 1.2rem; border: 1px dashed #6b7b86; border-radius: 6px; background: #fcfdfe; }
.preview-title { margin: 0 0 .5rem; font-size: 1rem; color: var(--muted); }
.image-field { border: 1px solid var(--border); border-radius: 6px; padding: .75rem 1rem; margin: 1rem 0; }
.image-field legend { font-weight: 600; padding: 0 .4rem; }
.admin-thumb { max-width: 12rem; height: auto; border-radius: 4px; border: 1px solid var(--border); }
.warning-box { padding: .6rem .9rem; border-left: 5px solid var(--warn); background: #fff4d6; }
.link-dialog, .image-dialog { max-width: 32rem; width: calc(100% - 2rem); border: 1px solid #6b7b86; border-radius: 8px; padding: 1.25rem; }
.link-dialog::backdrop, .image-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.link-dialog h2, .image-dialog h2 { margin-top: 0; }
.form input[type="file"] { max-width: 100%; }

@media print {
  .site-header nav, .skip-link, .site-footer, .pager, .filter, .back { display: none; }
  body { color: #000; }
  a { color: #000; }
  .site-header { background: none; border: 0; }
}

/* Status, historik og sikkerhedskopi (administration) */
.health ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.health li { border-left: 4px solid var(--border, #999); padding: .5rem .75rem; margin: .5rem 0; background: #fff; }
.health-error { border-left-color: var(--error); }
.health-warn { border-left-color: #b26a00; }
pre.log { overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-size: .85rem; background: #f4f4f4; padding: .75rem; }
tr.failed td { color: var(--error); }

/* ---------- Forside-banner og lidt mere liv (offentlige sider) ---------- */
.hero { position: relative; background: #2b3a33; overflow: hidden; }
.hero img { display: block; width: 100%; height: clamp(8rem, 24vw, 14rem); object-fit: cover; object-position: center 40%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 30, 22, .15) 0%, rgba(10, 30, 22, .65) 100%); }
.hero-text { position: absolute; inset: 0; z-index: 1; display: flex; align-items: flex-end; padding-bottom: 1rem; left: 0; right: 0; margin: 0 auto; }
.hero .site-name { color: #fff; font-size: clamp(1.4rem, 4.5vw, 2.4rem); line-height: 1.15; text-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.hero .site-name:hover { text-decoration: underline; }
.has-hero .navbar { background: var(--band); border-bottom: 1px solid var(--border); }
.has-hero .navbar .wrap { padding-top: .5rem; padding-bottom: .5rem; justify-content: flex-start; }
.has-hero .navbar .menu-toggle > summary { background: #fff; }
.news-item { margin: 1rem 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(20, 50, 35, .08); }
.area-public h1 { color: #17493a; }
.area-public h2 { padding-bottom: .25rem; border-bottom: 2px solid var(--border); }
.site-footer { border-top: 4px solid var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .news-item { transition: box-shadow .15s ease, border-color .15s ease; }
  .news-item:hover { box-shadow: 0 4px 12px rgba(20, 50, 35, .14); border-color: var(--accent); }
}

/* Direkte link til login for administratorer og redaktører */
.has-hero .navbar .wrap { justify-content: space-between; align-items: center; }
.login-link { padding: .4rem .9rem; border: 1px solid var(--accent); border-radius: 4px; background: #fff; color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.login-link:hover, .login-link:focus-visible { background: var(--accent); color: var(--accent-text); }

/* ---------- Moderne layout (offentlige sider) ---------- */
.area-public .wrap { max-width: 68rem; padding: 0 1.25rem; }
.area-public main { padding: 2rem 0 3rem; }
.area-public h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.01em; margin-bottom: 1rem; }
.area-public .body { max-width: 46rem; font-size: 1.05rem; }
.area-public .body.intro { margin-bottom: 1.5rem; }

/* Fast menu på computer, sticky så den altid er ved hånden */
@media (min-width: 52rem) {
  .has-hero .navbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); box-shadow: 0 1px 0 var(--border), 0 4px 12px rgba(20, 50, 35, .06); }
  .has-hero .navbar .menu a, .has-hero .navbar .menu-group > summary { padding: .55rem .85rem; border-radius: 6px; font-weight: 600; }
  .has-hero .navbar .menu a:hover, .has-hero .navbar .menu-group > summary:hover { background: var(--band); text-decoration: none; }
  .has-hero .navbar .menu a[aria-current="page"] { background: var(--band); color: var(--accent); text-decoration: none; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 6px 6px 0 0; }
}

/* Genveje på forsiden */
.tiles ul { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.tiles a { display: block; height: 100%; padding: 1rem 1.15rem; background: var(--band); border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; border-top: 4px solid var(--accent); }
.tiles strong { display: block; font-size: 1.1rem; color: var(--accent); }
.tiles span { display: block; margin-top: .2rem; font-size: .92rem; color: var(--muted); }
.tiles a:hover, .tiles a:focus-visible { background: #fff; border-color: var(--accent); }

/* Nyheder og sidebjælke */
.home-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 62rem) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 20rem; }
  .side { position: sticky; top: 4.5rem; }
}
.home-grid h2 { margin-top: 0; }
.side-box { margin: 0 0 1.5rem; padding: 1rem 1.2rem; background: var(--band); border: 1px solid var(--border); border-radius: 10px; }
.side-box h2 { font-size: 1.1rem; border: 0; padding: 0; margin-bottom: .5rem; }
.side-box .events ul, .side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.side-box li:last-child { border-bottom: 0; }
.side-box p { margin: .5rem 0 0; }

.news-item { display: flex; flex-direction: column; gap: .75rem; padding: 1.1rem 1.25rem; border-radius: 12px; }
.news-item h3 { font-size: 1.25rem; line-height: 1.25; margin: .1rem 0 .4rem; }
.news-item h3 a { color: var(--text); text-decoration: none; }
.news-item h3 a:hover { color: var(--accent); text-decoration: underline; }
.news-item .meta { margin: 0; text-transform: none; }
.news-pic { display: block; }
.news-item .news-thumb { width: 100%; height: auto; margin: 0; border-radius: 8px; }
@media (min-width: 40rem) {
  .news-item.has-image { flex-direction: row; align-items: flex-start; }
  .news-item.has-image .news-pic { flex: 0 0 13rem; }
}

/* Bestyrelsen som kort */
.board-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); margin: 1rem 0 2rem; }
.board-cards li { padding: 1rem 1.15rem; border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(20, 50, 35, .08); }
.board-cards strong { display: block; font-size: 1.1rem; }
.board-cards .role { display: inline-block; margin: .15rem 0 .35rem; padding: .05rem .6rem; border-radius: 1rem; background: var(--band); border: 1px solid var(--border); font-size: .85rem; color: var(--accent); font-weight: 600; text-transform: capitalize; }

/* Dokumentlister */
.area-public .doclist li { padding: .6rem .9rem; margin: .4rem 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.area-public .side-box .doclist li { padding: .5rem 0; margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; }
.area-public .documents h2 { margin-top: 1.5rem; }

.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .25rem 2rem; justify-content: space-between; }

.tiles li { display: flex; }
.tiles a { flex: 1; }
@media (max-width: 40rem) {
  .tiles ul { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .tiles a { padding: .8rem .9rem; }
  .tiles strong { font-size: 1rem; }
  .tiles span { display: none; }
}
