/* ===========================================================
   V I N D F A L L – SPA CSS (Unified, Cleaned)
   =========================================================== */

:root {
    --vindfall-bluegreen: #1C6C73;
    --vindfall-green: #3E8C5A;
    --vindfall-lightgrey: #E6E6E6;
    --vindfall-white: #FFFFFF;
    --background-dark: #161D22;
    --background-darker: #10161A;
    --background-light: #FAFAFA;
    --text-light: #FFFFFF;
    --text-muted: rgba(255,255,255,0.72);
    --border-light: rgba(255,255,255,0.08);
    --max-width: 1000px;
    --header-height: 64px;
    --transition: 0.25s ease;
    --shadow-strong: rgba(0,0,0,0.25);
    --shadow-soft: rgba(0,0,0,0.15);
    --surface-soft: rgba(255,255,255,0.06);
    --surface-soft-hover: rgba(255,255,255,0.09);
    --surface-border: rgba(255,255,255,0.10);
    --surface-border-hover: rgba(255,255,255,0.18);
    --hero-bg-start: rgba(28,108,115,0.18); /* var(--vindfall-bluegreen) med 18% */
    --hero-bg-end: rgba(62,140,90,0.10); /* var(--vindfall-green) with 10% */
}

/* ===========================================================
   GLOBAL
   =========================================================== */

html, body {
    margin: 0;
    padding: 0;
    background: var(--background-dark);
    color: var(--text-light);
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
}

a {
    text-decoration: none;
    color: var(--vindfall-bluegreen);
    transition: color var(--transition);
}

    a:hover {
        color: var(--vindfall-green);
    }

/* ===========================================================
   HEADER
   =========================================================== */

#header {
    min-height: var(--header-height);
}

.header-skeleton {
    height: var(--header-height);
    background: var(--background-darker);
    border-bottom: 1px solid var(--border-light);
}

header {
    display: block;
    width: 100%;
    margin: 0;
    background: var(--background-darker);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.4rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand img {
    height: 160px;
    display: block;
}

/* ===========================================================
   NAVIGATION (Unified & Clean)
   =========================================================== */

nav {
    display: flex;
    align-items: center;
}

    /* Hovedlenker (støtter både gammel og ny struktur) */
    .menu-link,
    nav > a {
        margin-left: 2rem;
        font-size: 0.95rem;
        font-weight: 400;
        color: var(--text-muted);
        transition: color var(--transition);
        display: inline-block;
        padding: 0 10px;
    }

        .menu-link:hover,
        nav > a:hover {
            color: var(--vindfall-green);
        }

        .menu-link.active,
        nav > a.active {
            color: var(--vindfall-bluegreen);
            font-weight: 600;
        }

/* Container for dropdown-meny */
.nav-item {
    position: relative;
    display: inline-block;
}

/* Dropdown */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0,0,0,0.90);
    padding: 8px 0;
    border-radius: 6px;
    min-width: 180px;
    z-index: 1000;
}

    /* Undermenypunkter */
    .submenu a,
    .submenu-link {
        display: block;
        padding: 8px 16px;
        white-space: nowrap;
        color: var(--text-muted);
    }

        .submenu a:hover,
        .submenu-link:hover {
            color: var(--vindfall-green);
        }

/* Dropdown aktiv */
.has-submenu.open > .submenu {
    display: block;
}

/* Alternativ: hover-aktivering */
.has-submenu:hover > .submenu {
    display: block;
}

/* ===========================================================
   LANGUAGE SWITCH
   =========================================================== */

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}

    .lang-switch span {
        opacity: 0.7;
    }

    .lang-switch a {
        cursor: pointer;
        color: var(--text-muted);
        transition: opacity var(--transition);
    }

        .lang-switch a:hover {
            opacity: 1;
        }

        .lang-switch a.active {
            font-weight: 600;
            color: var(--vindfall-white);
            opacity: 1;
        }

    .lang-switch [data-lang-switch] {
        cursor: pointer;
        color: var(--text-muted);
        transition: opacity var(--transition), color var(--transition);
    }

        .lang-switch [data-lang-switch]:hover {
            opacity: 1;
            color: var(--vindfall-white);
        }


/* ===========================================================
   MAIN LAYOUT
   =========================================================== */

main#app-main {
    min-height: calc(100vh - var(--header-height) - 120px);
}

/* ===========================================================
   HERO
   =========================================================== */

.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 5rem 1rem 4rem 1rem;
    background: linear-gradient( 135deg, var(--hero-overlay-1), var(--hero-overlay-2) );
    border-radius: 10px;
}


article.hero-article {
    grid-column: 1 / -1; /* Full width over alle kolonner */
    padding: 0;
}

/* Make articles containing a hero span all columns */
.full-width-article {
    grid-column: 1 / -1;
}


/* Pill */
.pill {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    background: var(--vindfall-bluegreen);
    color: var(--vindfall-white);
}

/* ===========================================================
   CARD GRID
   =========================================================== */

.card-grid {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 1.6rem;
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
    transition: background var(--transition), border var(--transition), transform var(--transition);
}

    .card:hover {
        background: var(--surface-soft-hover);
        border-color: var(--surface-border-hover);
        transform: translateY(-3px);
        box-shadow: 0 6px 24px rgba(0,0,0,0.45);
    }


    .card h3 {
        color: var(--vindfall-white);
        opacity: 0.90;
    }

    .card p {
        color: var(--text-muted);
        opacity: 0.85;
    }

/* Wide: én card per rad */
.card-grid--wide {
    grid-template-columns: 1fr;
}

/* Compact: mindre cards */
.card-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}


/* ===========================================================
   GENERIC PAGE CONTENT
   =========================================================== */

.page-wrapper {
    max-width: var(--max-width);
    margin: 3.5rem auto 3rem auto;
    padding: 0 1rem;
}

.page-title h1 {
    margin: 0 0 1.2rem 0;
}

#page-container {
    display: grid;
    gap: 2rem;
}

/* Responsive columns */
@media (max-width: 900px) {
    #page-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    #page-container {
        grid-template-columns: 1fr !important;
    }
}

/* Images inside sections */
.page-section img.page-image {
    max-width: 100%;
    border-radius: 6px;
    margin-top: 0.6rem;
}

.page-caption {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.3rem;
}
.page-section img,
.article img,
.image-block img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 6px;
}

/* Info box */
.section-muted {
    max-width: var(--max-width);
    margin: 3rem auto;
    padding: 1.2rem 1rem;
    background: var(--background-darker); /* erstatter rgba(255,255,255,0.04) */
    border-radius: 6px;
    border: 1px solid var(--border-light); /* erstatter rgba(255,255,255,0.06) */
    color: var(--text-muted);
}


/* ===========================================================
   FOOTER
   =========================================================== */

footer {
    margin-top: 4rem;
    padding: 2.2rem 1rem;
    text-align: center;
    background: var(--background-darker);
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
}

    footer div {
        display: flex;
        gap: 0.4rem; /* mellomrom mellom tekst og epost */
        align-items: center;
    }

    footer img {
        height: 26px;
        display: block;
        margin: 0 auto 0.8rem auto;
        opacity: 0.9;
    }
.site-footer {
    width: 100%;
    display: flex;
    justify-content: center; /* sentrerer innholdet */
    padding: 2rem 0;
}

.hero-block {
    position: relative;
    padding: 4rem 2rem;
    border-radius: 12px;
}

    /* When hero has an image */
    .hero-block.has-image {
        min-height: 320px;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        color: white;
    }

/* Overlay for readability */
.hero-overlay {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    padding: 3rem 2rem;
    border-radius: inherit;
}

/* Content wrapper */
.hero-content {
    position: relative;
    z-index: 2;
}

/* Optional styling */
.hero-block h1 {
    margin: 0.5rem 0;
}

.hero-lead {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    max-width: 600px;
    line-height: 1.4;
}

.footer-content {
    display: flex;
    gap: 0.5rem; /* mellomrom mellom tekst og epost */
    align-items: center;
    font-size: 0.95rem;
}

    .footer-content a {
        color: var(--theme-accent, #3bc1c7); /* bruker tema-farge hvis du har */
        text-decoration: none;
    }

        .footer-content a:hover {
            text-decoration: underline;
        }

.site-footer {
    padding: 1.2rem 0;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.85;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.footer-slogan {
    font-style: italic;
    opacity: 0.75;
}

#app-main {
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    gap: 24px;
    padding: 20px;
}

.article {
    background: var(--background-darker);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 8px var(--shadow-strong);
}

.markdown,
.info-markdown,
.table-block {
    line-height: 1.6;
}

/* (Du hadde duplikat card-grid ovenfor – jeg lar denne stå, men tematisk riktig) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.card {
    background: var(--background-darker);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 10px var(--border-light);
}

.image-size-small img {
    width: 40%;
}

.image-size-medium img {
    width: 60%;
}

.image-size-large img {
    width: 100%;
}

.new-badge {
    background: var(--theme-accent, #e00);
    color: white;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: bold;
    margin-left: 8px;
}

.new-article {
    /* optional highlight */
}

/* ---------------------------
   Last Visit Indicator (Dark theme)
---------------------------- */

.last-visit {
    margin: 2rem auto 1rem auto;
    padding: 0.75rem 1.2rem;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.06); /* diskret lysning */
    border-left: 4px solid var(--accent, #3a8f7a);
    border-radius: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    backdrop-filter: blur(3px); /* subtil glass-effekt */
    -webkit-backdrop-filter: blur(3px);
}

    .last-visit::before {
        content: "⏱️";
        margin-right: 0.6rem;
        opacity: 0.8;
        font-size: 1rem;
    }

    .last-visit:hover {
        background: rgba(255, 255, 255, 0.10);
        transition: background 0.25s ease;
    }

.menu-new {
    position: relative;
}

.menu-link.menu-new {
    position: relative;
}

    .menu-link.menu-new::after {
        content: "";
        position: absolute;
        top: 0.5rem;
        left: -0.2rem;
        width: 7px;
        height: 7px;
        background: #ff4d4d;
        border-radius: 50%;
        box-shadow: 0 0 6px rgba(255, 80, 80, 0.8);
        pointer-events: none;
    }
.submenu-link.menu-new {
    position: relative;
}


    .submenu-link.menu-new::after {
        content: "";
        position: absolute;
        top: 1.2rem;
        left: 0.2rem;
        width: 6px;
        height: 6px;
        background: #ff4d4d;
        border-radius: 50%;
        box-shadow: 0 0 4px rgba(255, 80, 80, 0.8);
        pointer-events: none;
    }
