/* ============================================================
   Mads68.dk – Globalt stylesheet
   Minimalistisk hvid/grå design, responsivt
   ============================================================ */

/* ── Reset & grundlæggende ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --hvid:       #ffffff;
    --lysegrå:    #f5f5f5;
    --kant:       #e0e0e0;
    --tekst:      #1a1a1a;
    --dæmpet:     #6b6b6b;
    --accent:     #2c6fad;
    --accent-mørk:#1e4f7e;
    --fare:       #c0392b;
    --succes:     #27ae60;
    --advarsel:   #e67e22;
    --radius:     6px;
    --skygge:     0 1px 4px rgba(0,0,0,.10);
}

html  { font-size: 16px; scroll-behavior: smooth; }
body  {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--lysegrå);
    color: var(--tekst);
    line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-mørk); text-decoration: underline; }

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

/* ── Typografi ──────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

/* ── Layout – site wrapper ──────────────────────────────── */
.site-header {
    background: var(--hvid);
    border-bottom: 1px solid var(--kant);
    padding: 0 1.5rem;
}
.site-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.site-header__logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--tekst);
}
.site-header__logo:hover { text-decoration: none; color: var(--accent); }

.site-main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.site-footer {
    border-top: 1px solid var(--kant);
    background: var(--hvid);
    text-align: center;
    padding: 1.2rem;
    font-size: .85rem;
    color: var(--dæmpet);
    margin-top: 3rem;
}

/* ── Præsentationstekst ─────────────────────────────────── */
.praesentation {
    background: var(--hvid);
    border: 1px solid var(--kant);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.3rem;
    margin-bottom: 1.4rem;
    box-shadow: var(--skygge);
    font-size: .97rem;
    line-height: 1.7;
    color: #333;
}
.praesentation p  { margin-bottom: .6rem; }
.praesentation p:last-child { margin-bottom: 0; }
.praesentation h2, .praesentation h3 { margin: .6rem 0 .3rem; }

/* ── Artikelkort på forsiden ────────────────────────────── */
.artikel-liste { display: flex; flex-direction: column; gap: 1.5rem; }

.artikel-kort {
    background: var(--hvid);
    border: 1px solid var(--kant);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--skygge);
    transition: box-shadow .15s;
}
.artikel-kort:hover { box-shadow: 0 3px 10px rgba(0,0,0,.13); }

.artikel-kort__titel { margin-bottom: .35rem; }
.artikel-kort__titel a { color: var(--tekst); }
.artikel-kort__titel a:hover { color: var(--accent); text-decoration: none; }

.artikel-kort__meta {
    font-size: .82rem;
    color: var(--dæmpet);
    margin-bottom: .75rem;
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
}

.artikel-kort__uddrag {
    font-size: .95rem;
    color: #333;
    margin-bottom: .9rem;
}

/* ── Tags ───────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }

.tag {
    display: inline-block;
    background: var(--lysegrå);
    border: 1px solid var(--kant);
    border-radius: 20px;
    padding: .15rem .65rem;
    font-size: .78rem;
    color: var(--dæmpet);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.tag:hover, .tag.aktiv {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--hvid);
    text-decoration: none;
}

/* ── Sidebar – links ─────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1.2rem; }

.link-gruppe {
    background: var(--hvid);
    border: 1px solid var(--kant);
    border-radius: var(--radius);
    box-shadow: var(--skygge);
    overflow: hidden;
}
.link-gruppe__header {
    background: var(--lysegrå);
    border-bottom: 1px solid var(--kant);
    padding: .6rem 1rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--dæmpet);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.link-gruppe__liste { list-style: none; }
.link-gruppe__liste li { border-bottom: 1px solid var(--kant); }
.link-gruppe__liste li:last-child { border-bottom: none; }

.link-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem 1rem;
    color: var(--tekst);
    font-size: .92rem;
    transition: background .12s;
}
.link-item:hover { background: var(--lysegrå); text-decoration: none; }
.link-item__ikon { color: var(--accent); width: 18px; text-align: center; }
.link-item__tekst { flex: 1; }
.link-item__beskrivelse { font-size: .78rem; color: var(--dæmpet); display: block; }

/* ── Enkelt artikel-side ────────────────────────────────── */
.artikel-side { max-width: 800px; }

.artikel-side__header { margin-bottom: 1.5rem; }
.artikel-side__titel  { margin-bottom: .4rem; }
.artikel-side__meta   { font-size: .85rem; color: var(--dæmpet); display: flex; gap: .8rem; flex-wrap: wrap; }

.artikel-indhold { font-size: 1rem; line-height: 1.75; }
.artikel-indhold p  { margin-bottom: 1rem; }
.artikel-indhold h2 { margin: 1.5rem 0 .5rem; }
.artikel-indhold ul, .artikel-indhold ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.artikel-indhold img { border-radius: var(--radius); margin: 1rem 0; }

/* Billedgalleri */
.billede-galleri {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--kant);
}
.billede-galleri img {
    border-radius: var(--radius);
    border: 1px solid var(--kant);
    object-fit: cover;
    width: 100%;
    height: 160px;
    cursor: pointer;
    transition: opacity .15s;
}
.billede-galleri img:hover { opacity: .85; }

/* ── Knapper ────────────────────────────────────────────── */
.knap {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .13s, border-color .13s, color .13s;
    text-decoration: none;
    line-height: 1.4;
}
.knap-primær  { background: var(--accent); color: var(--hvid); border-color: var(--accent); }
.knap-primær:hover { background: var(--accent-mørk); border-color: var(--accent-mørk); color: var(--hvid); text-decoration: none; }
.knap-sekundær { background: var(--hvid); color: var(--tekst); border-color: var(--kant); }
.knap-sekundær:hover { background: var(--lysegrå); text-decoration: none; }
.knap-fare    { background: var(--fare); color: var(--hvid); border-color: var(--fare); }
.knap-fare:hover { background: #a93226; border-color: #a93226; color: var(--hvid); text-decoration: none; }
.knap-lille   { padding: .3rem .75rem; font-size: .82rem; }

/* ── Formularer ─────────────────────────────────────────── */
.formular { display: flex; flex-direction: column; gap: 1.1rem; }

.felt { display: flex; flex-direction: column; gap: .3rem; }
.felt label { font-size: .9rem; font-weight: 500; }

.input {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--kant);
    border-radius: var(--radius);
    font-size: .95rem;
    background: var(--hvid);
    color: var(--tekst);
    transition: border-color .13s, box-shadow .13s;
}
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(44,111,173,.15);
}
.input.fejl-felt { border-color: var(--fare); }

textarea.input { min-height: 120px; resize: vertical; }
select.input   { cursor: pointer; }

/* ── Beskeder ───────────────────────────────────────────── */
.besked {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    border: 1px solid;
}
.besked-succes  { background: #d5f0e0; border-color: #a3d9b8; color: #1a6b3a; }
.besked-fejl    { background: #fce8e6; border-color: #f0b8b2; color: #7b1a1a; }
.besked-advarsel{ background: #fef3e2; border-color: #f5c77c; color: #7d4a00; }

/* ── Admin – layout ─────────────────────────────────────── */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--lysegrå);
}

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--hvid);
    border-right: 1px solid var(--kant);
    display: flex;
    flex-direction: column;
}
.admin-sidebar__logo {
    padding: 1.2rem 1.4rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--kant);
    color: var(--tekst);
    text-decoration: none;
    display: block;
}
.admin-sidebar__logo:hover { color: var(--accent); }

.admin-nav { flex: 1; padding: .8rem 0; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1.4rem;
    color: var(--dæmpet);
    font-size: .92rem;
    transition: background .12s, color .12s;
    text-decoration: none;
}
.admin-nav a:hover, .admin-nav a.aktiv {
    background: var(--lysegrå);
    color: var(--accent);
}
.admin-nav a i { width: 18px; text-align: center; }

.admin-nav__sektion {
    padding: .9rem 1.4rem .3rem;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #aaa;
}

.admin-sidebar__bund {
    border-top: 1px solid var(--kant);
    padding: .8rem 1.4rem;
    font-size: .85rem;
    color: var(--dæmpet);
}
.admin-sidebar__bund a { color: var(--fare); font-size: .85rem; }

.admin-indhold {
    flex: 1;
    padding: 2rem;
    max-width: 900px;
}

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.admin-top h1 { font-size: 1.5rem; }

/* Tabel i admin */
.data-tabel {
    width: 100%;
    border-collapse: collapse;
    background: var(--hvid);
    border: 1px solid var(--kant);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: .92rem;
}
.data-tabel th {
    background: var(--lysegrå);
    text-align: left;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--kant);
    font-weight: 600;
    font-size: .85rem;
    color: var(--dæmpet);
}
.data-tabel td {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--kant);
    vertical-align: middle;
}
.data-tabel tr:last-child td { border-bottom: none; }
.data-tabel tr:hover td { background: #fafafa; }

.handlinger { display: flex; gap: .4rem; }

/* ── Admin – login-side ─────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lysegrå);
}
.login-boks {
    background: var(--hvid);
    border: 1px solid var(--kant);
    border-radius: var(--radius);
    padding: 2.5rem 2.8rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--skygge);
}
.login-boks__titel {
    font-size: 1.4rem;
    margin-bottom: .3rem;
}
.login-boks__undertitel {
    font-size: .88rem;
    color: var(--dæmpet);
    margin-bottom: 1.8rem;
}

/* ── Søgeformular ───────────────────────────────────────── */
.søgebar {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.2rem;
}
.søgebar .input { flex: 1; }

/* ── Lightbox til billeder ──────────────────────────────── */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay.åben { display: flex; }
.lightbox-overlay img { max-width: 90vw; max-height: 88vh; border-radius: var(--radius); }
.lightbox-luk {
    position: absolute;
    top: 1.2rem; right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    opacity: .8;
}
.lightbox-luk:hover { opacity: 1; }

/* ── Responsivt ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .site-main {
        grid-template-columns: 1fr;
    }
    .sidebar { order: -1; }   /* Vis links øverst på mobil */

    .admin-wrapper { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--kant);
    }
    .admin-nav { display: flex; flex-wrap: wrap; padding: .3rem; }
    .admin-nav a { padding: .4rem .8rem; font-size: .85rem; }
    .admin-nav__sektion { display: none; }
    .admin-indhold { padding: 1rem; }

    .login-boks { padding: 1.8rem; }
}
