:root {
    --bg-color: #6A34BA;
    --text-color: #ffffff; 
    --primary-teal: #6366f1;
    --accent-green: #d946ef;
    --top-bg: #3b0764;
    --card-bg: #f7f4fc;
    --border-color: #faf5ff; 
    --mork-lilla: #3b0764;
    --hoved-lilla: #6366f1;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

/* Sørger for at ALLE bilder på hele nettstedet krymper automatisk på mobil */
img {
    max-width: 100% !important;
    height: auto !important;
}


body { 
    background-image: url("Page-BgTexture.png");
    background-repeat: repeat; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    line-height: 1.6; 
}

header { 
    background-color: var(--top-bg); 
    border-bottom: none !important; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
}

.nav-container { 
    max-width: 1000px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1rem 2rem; 
    background-color: var(--top-bg) !important;
}

.logo { 
    font-weight: 700; 
    font-size: 1.3rem; 
    color: var(--primary-teal); 
    text-decoration: none; 
}

/* --- HOVEDINNHOLD / LAYOUT --- */
main { 
    max-width: 1000px; 
    margin: 2rem auto; 
    padding: 0 2rem; 
    display: grid; 
    grid-template-columns: 250px 1fr; 
    gap: 2rem; 
}

.sidebar { 
    background-color: var(--card-bg); 
    padding: 1.5rem; 
    border-radius: 8px; 
    border: 1px solid var(--border-color); 
    text-align: center; 
    height: fit-content; 
    color: #000000; 
}

.profile-img { 
    width: 130px; 
    height: 130px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 3px solid var(--primary-teal); 
    margin-bottom: 1rem; 
}

.content-area { 
    background-color: var(--card-bg); 
    padding: 2rem; 
    border-radius: 8px; 
    border: 1px solid var(--border-color); 
    color: #000000; 
}

h1, h2 { 
    color: var(--primary-teal); 
    margin-bottom: 1rem; 
}

p { 
    margin-bottom: 1rem; 
}

footer { 
    max-width: 1000px; 
    margin: 2rem auto; 
    text-align: center; 
    padding: 1rem; 
    color: #7f8c8d; 
    font-size: 0.9rem; 
}


/* ==========================================================================
   STILER KUN FOR PC (Skjermer fra 769px og oppover)
   ========================================================================== */
@media (min-width: 769px) {
    /* 1. SKJUL checkbox og hamburger totalt */
    .menu-toggle, 
    #menu-toggle, 
    .hamburger {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    /* 2. PC Meny-oppsett (Vannrett linje) */
    .menu { 
        display: flex !important; 
        list-style: none; 
        gap: 1.5rem; 
        margin: 0;
        padding: 0;
        background-color: transparent;
    }

    .menu li { 
        position: relative; 
    }

    .menu a { 
        text-decoration: none; 
        color: var(--text-color); 
        font-weight: 500; 
        transition: color 0.2s, background 0.3s; 
        padding: 5px 10px;
        display: block;
    }

    .menu a:hover, .menu a.active { 
        color: var(--accent-green); 
    }

    /* PC Dropdown / Undermeny */
    .menu ul {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--top-bg);
        border: 1px solid var(--border-color);
        list-style: none;
        display: none; 
        min-width: 150px;
        z-index: 1000;
    }

    .menu li:hover > ul {
        display: block; 
    }

    .menu ul a {
        padding: 10px;
        font-size: 14px;
    }
}


/* ==========================================================================
   STILER KUN FOR MOBIL (Skjermer opp til 768px)
   ========================================================================== */
@media (max-width: 768px) { 
    /* Dette tvinger venstre og høyre tekstboks til å legge seg UNDER hverandre på mobil */
    main { 
        display: block !important;
        width: 100% !important;
        padding: 0 1rem !important;
        margin: 1rem auto !important;
    } 

    /* Sørg for at sidebar (venstre boks) får luft i bunnen når den ligger øverst */
    .sidebar {
        width: 100% !important;
        margin-bottom: 1.5rem !important;
    }

    /* Sørg for at hovedinnholdet (høyre boks) strekker seg helt ut */
    .content-area {
        width: 100% !important;
    }
    

    .nav-container {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        background-color: var(--top-bg) !important;
    }

    .logo {
        text-align: center;
        margin-bottom: 1rem;
    }

    /* Gjem checkbox på mobil */
    .menu-toggle, #menu-toggle {
        display: none !important;
    }

    /* Vis hamburger-ikonet */
    .hamburger {
        display: block !important;
        visibility: visible !important;
        font-size: 30px;
        color: #ffffff;
        background-color: var(--mork-lilla);
        padding: 10px;
        cursor: pointer;
        text-align: center;
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 4px;
        width: auto !important;
        height: auto !important;
    }

    /* Skjul hovedmenyen som standard på mobil */
    .menu {
        display: none;
        flex-direction: column; 
        width: 100%;
        background-color: var(--mork-lilla);
        padding: 0;
        gap: 0;
        margin-top: 10px;
    }

    /* VIS menyen når man trykker på hamburger-ikonet */
    .menu-toggle:checked ~ .menu {
        display: flex !important;
    }

    .menu li {
        width: 100%;
    }
    
    .menu a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: #ffffff;
    }

    /* Dropdown legger seg flatt og innrykket under forelderen på mobil */
    .menu ul {
        position: static; 
        display: block;
        padding-left: 20px; 
        background-color: rgba(0, 0, 0, 0.2); 
        border: none;
    }
}
