/* GRUNNLEGGENDE STILER OG TYPOGRAFI */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Roboto+Slab:wght@400;700&display=swap');

:root {
    --hovedfarge: #2c3e50;
    --sekundaerfarge: #3498db;
    --bakgrunnsfarge: #f4f6f9;
    --tekstfarge: #34495e;
    --hvit: #ffffff;
    --lys-gra: #ecf0f1;
    --kremhvit: #FAF9F6;
}

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    font-family: 'Lato', sans-serif;
    line-height: 1.7;
    color: var(--tekstfarge);
    background-color: var(--bakgrunnsfarge);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    color: var(--hovedfarge);
    line-height: 1.3;
}

h1 { font-size: 3.2rem; margin: 0; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.4rem; }

/* Egen farge for hovedtittel */
.parallax-1 h1 {
    color: var(--kremhvit);
}

/* Felles farge for titler på bilde/video-bakgrunn */
.parallax-seksjon h2,
.video-parallax-seksjon h2 {
    color: var(--kremhvit);
}

p { margin-bottom: 1.2rem; }
a { color: var(--sekundaerfarge); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--hovedfarge); }

/* LAYOUT-SEKSJONER */
.statisk-seksjon {
    padding: 5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.mork-bakgrunn {
    background-color: var(--hovedfarge);
    color: var(--lys-gra);
}
.mork-bakgrunn h2, .mork-bakgrunn h3 {
    color: var(--hvit);
}

.intro-tekst {
    font-size: 1.2rem;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

/* PARALLAX-SEKSJONER */
.parallax-seksjon {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--hvit);
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 1;
}

.parallax-seksjon h1, .parallax-seksjon h2, .parallax-seksjon p {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.tekst-innhold {
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    max-width: 90%;
}

.undertittel-boks {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
}

/* Bakgrunnsbilder */
.parallax-1 { background-image: url('undervisning.jpg'); }
.parallax-pris { background-image: url('pris.jpg'); }
.parallax-2 { background-image: url('campus.jpg'); }
.parallax-3 { background-image: url('sti.jpg'); }
.parallax-4 { background-image: url('teknologi.jpg'); }


/* KOMPONENT-STILER */
.profil-boks {
    display: flex;
    align-items: center;
    gap: 2rem;
    background-color: var(--hvit);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.1);
    border: 1px solid var(--lys-gra);
    transition: opacity 1s ease-out, transform 1s ease-out;
}
.profil-bilde {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--hvit);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.profil-tekst-container ul {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}
.profil-tekst-container li {
    padding: 0.2rem 0;
}

.ute-seksjon {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.ute-bilde-container {
    flex-basis: 40%;
    min-width: 250px;
    position: relative;
    aspect-ratio: 4 / 3;
}

.slideshow-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slideshow-img.active {
    opacity: 1;
}

.ute-tekst-container {
    flex-basis: 60%;
}

.fokus-tekst {
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 750px;
    margin: 0 auto;
    color: var(--tekstfarge);
}

.prinsipp-container, .praksis-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}
.prinsipp {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--sekundaerfarge);
    transition: transform 0.3s, box-shadow 0.3s;
}
.prinsipp:hover {
    transform: translateY(-5px);
}
.praksis-kort {
    background-color: var(--hvit);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}
.praksis-kort:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(44, 62, 80, 0.15);
}
.bilde-i-kort {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.praksis-kort h3 {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    color: var(--sekundaerfarge);
}
.praksis-kort p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    flex-grow: 1;
}

blockquote {
    border-left: 5px solid var(--sekundaerfarge);
    padding-left: 1.5rem;
    margin: 2.5rem auto;
    font-size: 1.1rem;
    max-width: 80%;
    font-style: italic;
}
blockquote cite {
    font-style: normal;
    display: block;
    margin-top: 1rem;
    font-weight: bold;
    color: var(--hovedfarge);
}

/* SEKSJON FOR MEDIA-KLIPP (SLIDER) */
.media-klipp-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 3rem;
}

.media-slider-inner {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.media-klipp {
    flex: 0 0 100%;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
}

.media-klipp h3 {
    color: var(--sekundaerfarge);
    margin-top: 1rem;
}

.media-klipp p {
    color: var(--lys-gra);
    font-size: 0.95rem;
}

/* Stiler for navigasjonspiler */
.slider-btn {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Arial', sans-serif;
}

.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slider-btn.prev {
    left: 15px;
}

.slider-btn.next {
    right: 15px;
}

/* FOTER */
footer {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--hovedfarge);
    color: var(--lys-gra);
    font-size: 0.9rem;
}
footer p { margin: 0.2rem 0; }

/* ANIMASJON */
.skjult {
    opacity: 0;
    transform: translateX(-50px);
}

/* RESPONSIVITET */
@media (max-width: 768px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    .statisk-seksjon { padding: 4rem 1.5rem; }

    .profil-boks,
    .ute-seksjon {
        flex-direction: column;
        text-align: center;
    }

    .parallax-seksjon {
        background-attachment: scroll;
        min-height: 40vh;
    }
}

/* RESPONSIV VIDEO CONTAINER */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 0 auto 1rem auto;
    border-radius: 8px;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* VIDEO-PARALLAKSEFFEKT */
.video-parallax-seksjon {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--hvit);
    overflow: hidden;
}

.parallax-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.video-parallax-seksjon .tekst-innhold {
    position: relative;
    z-index: 1;
}

/* KODE FOR LYDKNAPP */
.mute-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.mute-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* STILER FOR ILLUSTRASJON-SLIDESHOW */
.illustrasjon-slideshow {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.illustrasjon-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.0s ease-in-out;
}

.illustrasjon-slide.active {
    opacity: 1;
}

/* STILER FOR CONSTRUCTIVE ALIGNMENT-SLIDESHOW */
.ca-slideshow-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Juster gjerne dette forholdet etter bildenes dimensjoner */
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.ca-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Sørger for at hele bildet vises */
    opacity: 0;
    /* transition er fjernet for umiddelbar overgang */
}

.ca-slide.active {
    opacity: 1;
}