/* ===========================================================
   V I N D F A L L – SITE CSS
   Visual styling only (no page layout / grid logic)
   =========================================================== */

/* ===========================================================
   ROOT / VARIABLES
   =========================================================== */

:root {
    /* Backgrounds */
    --background: #f7f6f3;
    --background-darker: #ffffff;
    /* Text */
    --text-main: #111111;
    --text-muted: #666666;
    /* Borders */
    --border-light: #e2e2e2;
    /* Accents */
    --accent: #1aa3a3;
    --accent-new: #c0392b;
    /* Header colors */
    --header-bg: #ffffff;
    --header-border: rgba(0,0,0,0.08);
    --nav-text: #1C6C73;
    --nav-hover: #3E8C5A;
    /* Hero */
    --hero-overlay-top: rgba(255, 255, 255, 0.5);
    --hero-overlay-mid: rgba(255, 255, 255, 0.7);
    --hero-overlay-bottom: rgba(255, 255, 255, 0.5);
    --hero-text-color: #1A1A1A;

}

/* ===========================================================
   BASE / RESET
   =========================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background: var(--background);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   MARKDOWN TABLE – VERIFICATION VIEW
   ========================================= */

.markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
}

.markdown th,
.markdown td {
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 0.6rem 0.7rem;
    vertical-align: top;
}

.markdown th {
    background-color: rgba(0, 0, 0, 0.03);
    font-weight: 600;
}

/* ===========================================================
   LINKS – ARTICLE CONTENT (Vindfall)
   =========================================================== */

.article a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}


.article a:hover {
    text-decoration-thickness: 2px;
}
	
/* =========================================
Article framing – Vindfall palette
========================================= */

article.article:not(.full-width-article) {
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
}
article.article:not(.full-width-article) > h2:first-child {
    margin-top: 0;
}


/* ===========================================================
   CARDS
   =========================================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.card {
    background: #ffffff;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

    .card h3 {
        margin-top: 0;
    }

.card-link {
    cursor: pointer;
}

    .card-link:hover,
    .card-link:focus-visible {
        box-shadow: 0 12px 32px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }

/* ===========================================================
   HEADER & NAVIGATION
   =========================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
}

/* ---------------------------
   MOBILE HEADER
   --------------------------- */

.mobile-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 14px 16px;
    min-height: 56px;
    background: linear-gradient( to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) );
    z-index: 100;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
}

.mobile-logo {
    text-align: center;
}

    .mobile-logo img {
        height: 32px;
        width: auto;
        margin: 0 auto;
    }

.mobile-lang {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
}

    .mobile-lang a {
        cursor: pointer;
    }

        .mobile-lang a.active {
            color: #ffffff;
            font-weight: 600;
        }

/* ---------------------------
   MAIN NAV – MOBILE
   --------------------------- */

#main-nav {
    display: none;
    width: 100%;
    background: var(--background-darker);
    border-bottom: 1px solid var(--border-light);
}

    #main-nav.open {
        display: block;
    }

    #main-nav .nav-item {
        padding: 0.5rem 1rem;
    }

    #main-nav .menu-link {
        font-size: 1rem;
        font-weight: 500;
    }

/* ===========================================================
   DESKTOP NAVIGATION
   =========================================================== */

@media (min-width: 768px) {

    .mobile-header {
        display: none;
    }

    #main-nav {
        display: flex;
        align-items: center;
        gap: 2rem;
        background: transparent;
        border-bottom: none;
    }

    .nav-item {
        position: relative;
        padding-bottom: 0.6rem;
    }

    .menu-link {
        font-size: 1.05rem;
        font-weight: 500;
        letter-spacing: 0.02em;
        cursor: pointer;
    }

    .submenu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        padding: 0.5rem 0;
        background: var(--background-darker);
        border: 1px solid var(--border-light);
        border-radius: 6px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.35);
        z-index: 2000;
    }

    .nav-item.has-submenu:hover .submenu {
        display: block;
    }

    .submenu-link {
        display: block;
        padding: 0.4rem 1rem;
        white-space: nowrap;
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) {

    .submenu-link {
        transition: background-color 0.15s ease, color 0.15s ease;
    }

        .submenu-link:hover {
            background-color: var(--background);
            color: var(--nav-hover);
        }

    .lang-switch a {
        transition: color 0.15s ease, text-decoration-color 0.15s ease;
    }

        .lang-switch a:hover {
            color: var(--nav-hover);
            text-decoration: underline;
            text-decoration-thickness: 2px;
            text-underline-offset: 3px;
            cursor: pointer;
        }
}

/* ===========================================================
   ARTICLES / TYPOGRAPHY
   =========================================================== */

.article > h2 {
    margin-bottom: 0.25em;
}

.article > .published {
    margin-top: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===========================================================
   HERO BLOCK
   =========================================================== */

.hero-block.has-image {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
}

    .hero-block.has-image .hero-overlay {
        position: absolute;
        inset: 0;
        padding: 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        color: var(--hero-text-color);
        background: none;
    }

        .hero-block.has-image .hero-overlay::before {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 100%;
            pointer-events: none;
            background: linear-gradient( to top, var(--hero-overlay-top) 0%, var(--hero-overlay-mid) 50%, var(--hero-overlay-bottom) 100% );
        }

        .hero-block.has-image .hero-overlay > * {
            position: relative;
            z-index: 1;
        }
/* =========================
   NEW badge
   ========================= */

.new-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15em 0.5em;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
    color: #ffffff;
    background-color: var(--accent-new, #c0392b);
    border-radius: 3px;
    vertical-align: middle;
}

/* ===========================================================
   Menu – NEW indicator (dot)
   =========================================================== */

.site-header nav a.menu-link.menu-new {
    position: relative;
}

    .site-header nav a.menu-link.menu-new::after {
        content: "";
        position: absolute;
        top: 50%;
        left: -0.4em;
        transform: translateY(-50%);
        width: 6px;
        height: 6px;
        background-color: var(--accent-new);
        border-radius: 50%;
    }

/* Submenu */
.submenu-link.menu-new {
    position: relative;
}

    .submenu-link.menu-new::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 0.4rem;
        transform: translateY(-50%);
        width: 6px;
        height: 6px;
        background-color: var(--accent-new);
        border-radius: 50%;
    }

.mobile-nav {
    padding: 1rem 1.25rem;
    height: 100%;
    overflow-y: auto;
}

.image-block {
    display: inline-block;
    max-width: 100%;
}

    .image-block figcaption {
        width: 50%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 0.9rem;
        color: var(--text-muted);
    }

    .mobile-nav .nav-item {
        margin-bottom: 1.25rem;
    }
    .mobile-nav .menu-link {
        display: block;
        font-size: 1.05rem;
        font-weight: 600;
        padding: 0.5rem 0;
        color: var(--text-main);
    }
    .mobile-nav .submenu {
        margin-top: 0.25rem;
    }

    .mobile-nav .submenu-link {
        display: block;
        font-size: 0.95rem;
        font-weight: 400;
        padding: 0.35rem 0 0.35rem 1.25rem;
        line-height: 1.35;
        color: var(--text-muted);
    }
    .mobile-nav .nav-item:not(:last-child) {
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 0.75rem;
    }

/* Mobil hero-justering */
@media (max-width: 767px) {

    .hero-block.has-image {
        min-height: 499px;
    }

        .hero-block.has-image .hero-overlay {
            padding-top: 24px;
            padding-bottom: 96px;
        }

    .mobile-lang a {
        display: inline-block;
        padding: 0.4rem 0.5rem;
        margin: -0.4rem -0.5rem;
    }
}

/* ===========================================================
   TYPOGRAPHY – MOBILE ADJUSTMENTS
   =========================================================== */
@media (max-width: 768px) {

    /* Brødtekst */
    body {
        font-size: 0.95rem; /* ca. 15px */
        line-height: 1.45;
    }

    /* Seksjonstitler / h2 */
    h2 {
        font-size: 1.25rem;
        line-height: 1.25;
    }

    /* Underoverskrifter / h3 */
    h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    /* Hero – tittel */
    .hero-block h1 {
        font-size: 1.6rem;
        line-height: 1.15;
    }

    /* Hero – ingress */
    .hero-block .hero-lead {
        font-size: 1.2rem;
        font-weight:500;
        line-height: 1.4;
    }
}

/* Modal overlay */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none; /* skjult som standard */
    align-items: center; /* vertikal sentrering */
    justify-content: center; /* horisontal sentrering */
    padding: 16px; /* trygg margin på mobil */
    background: rgba(0,0,0,0.45);
}

    /* Vis modal når den er aktiv */
    .modal.is-open {
        display: flex;
    }

/* Selve dialogboksen */
.modal-content {
    width: min(520px, calc(100vw - 32px));
    background: #fff;
    border-radius: 12px;
    padding: 18px 18px 14px 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}



    /* Header- og tekststil (valgfritt) */
    .modal-content h2 {
        margin: 0 0 8px 0;
        font-size: 20px;
    }

    .modal-content p {
        margin: 0 0 14px 0;
        opacity: 0.85;
    }

/* Footer (valgfritt) */
.modal-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

    .modal-actions button {
        padding: 8px 12px;
    }

@media (max-width: 767px) {
    .login-btn {
        display: block;
        margin-top: 1rem;
    }
}