/* Fargeinnstillinger */
:root {
    --background-color: #1c1c1c;
    --text-color: #f5f5f5;
    --heading-color: #e0e0e0;
    --paragraph-color: #ccc;
    --cta-background-start: #ff6b6b;
    --cta-background-end: #ff4757;
    --overlay-background: rgba(0, 0, 0, 0.5);
    --button-hover-scale: 1.05;
    --box-shadow-color1: rgba(0, 0, 0, 0.3);
    --box-shadow-color2: #121212;
    --box-shadow-color3: #2a2a2a;
}

/* Tekststørrelser */
:root {
    --body-font-size: 18px; /* Tekststørrelse for kroppstekst */
    --heading1-font-size: 2.5em; /* Tekststørrelse for H1 */
    --heading2-font-size: 2em; /* Tekststørrelse for H2 */
    --heading3-font-size: 1.75em; /* Tekststørrelse for H3 */
    --paragraph-font-size: 1.1em; /* Tekststørrelse for avsnitt og lister */
    --hero-heading-font-size: 2.5em; /* Tekststørrelse for Hero-seksjon H1 */
    --hero-paragraph-font-size: 1.2em; /* Tekststørrelse for Hero-seksjon avsnitt */
    --cta-font-size: 1em; /* Tekststørrelse for CTA-knapper */
    --scroll-down-font-size: 2em; /* Tekststørrelse for Scroll ned knapp */
}

/* Hovedinnstillinger for kroppstekst */
body {
    font-family: Jura, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: var(--body-font-size);
    line-height: 1.6;
}

/* Overskriftsstørrelser */
.h1 {
    font-size: var(--heading1-font-size);
    margin: .5em 0;
    color: var(--heading-color);
    font-weight: 700;
}

.h2 {
    font-size: var(--heading2-font-size);
    margin: .5em 0 10px 0;
    color: var(--heading-color);
    font-weight: 700;
}

.h3 {
    font-size: var(--heading3-font-size);
    margin: .5em 0;
    color: var(--heading-color);
    font-weight: 700;
}

/* Avsnitt og liste fontstørrelser */
.paragraph, p, ul {
    font-size: var(--paragraph-font-size);
    color: var(--paragraph-color);
}

/* Hero-seksjon innstillinger */
.hero {
    position: relative;
    text-align: center;
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
    max-width: 100%;
    margin: 0px auto;
    padding: 20px;
    background: 0 0;
    border-radius: 15px;
}

.hero video {
    display: none; /* Hide the video on all devices */
}

.hero .mobile-bg {
    display: block; /* Ensure the background image is displayed on all devices */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.hero .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    animation: 2s ease-in-out fadeIn;
}

.hero .overlay .hero-heading {
    font-size: var(--hero-heading-font-size);
    margin: .5em 0;
    animation: 1.5s ease-in-out slideInFromLeft;
    color: var(--heading-color);
}

.hero .overlay .center-button {
    margin-top: 30px; /* Juster denne verdien etter behov */
}

/* CTA-knapp innstillinger */
.cta a, .hero .overlay a, .button-container a {
    padding: 10px 20px;
    font-size: var(--cta-font-size);
    background: linear-gradient(45deg, var(--cta-background-start), var(--cta-background-end));
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color .3s, transform .3s;
    border-radius: 5px;
    margin-top: 15px;
    box-shadow: 0 4px 6px var(--box-shadow-color1);
}

.cta a:hover, .hero .overlay a:hover, .button-container a:hover {
    background: linear-gradient(45deg, var(--cta-background-end), var(--cta-background-start));
    transform: scale(var(--button-hover-scale));
}

/* Scroll ned knapp innstillinger */
.scroll-down {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--scroll-down-font-size);
    color: var(--heading-color);
    cursor: pointer;
    animation: 2s infinite bounce;
}

/* Hovedseksjoner og alternative innstillinger */
section {
    padding: 20px;
    opacity: 0;
    animation: 1.5s ease-in-out forwards fadeIn;
    max-width: 800px;
    margin: 0 auto;
}

/* Seksjon for alternative innstillinger */
.alternative, .media-links {
    margin: 20px 0;
}

/* Alternativ innstillinger for bilder */
.alternative img,
.article-content img {
    width: 100%;
    height: auto;
    opacity: 0;
    animation: 2s ease-in-out .5s forwards fadeIn;
    border-radius: 15px;
    box-shadow: 4px 4px 8px var(--box-shadow-color2), -4px -4px 8px var(--box-shadow-color3);
}

/* Marger for alternative innstillinger */
.alternative p {
    margin-bottom: 20px;
}

.alternative+h2 {
    margin-top: 40px;
}

.alternative+p {
    margin-top: 20px;
}

/* CTA innstillinger */
.cta {
    opacity: 0;
}

/* Center knappen under "For innbyggere" seksjon */
.button-container {
    display: flex;
    justify-content: center;
}

.center-button {
    display: inline-block;
}

/* Footer innstillinger */
footer {
    background: var(--background-color);
    padding: 10px 0;
    text-align: center; /* Sentraliserer teksten */
    line-height: 1.5; /* Justerer linjehøyden for bedre lesbarhet */
}

/* Nyhetsbrev-seksjon */
#nyhetsbrev {
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 40px 20px;
    text-align: center;
}

.nyhetsbrev-container {
    max-width: 800px;
    margin: 0 auto;
}

.nyhetsbrev-container .h2 {
    font-size: var(--heading2-font-size);
    margin-bottom: 20px;
    color: var(--heading-color);
}

form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

form input[type="email"] {
    padding: 10px;
    font-size: var(--cta-font-size);
    border: 1px solid #ccc;
    border-radius: 5px;
}

form button {
    padding: 10px 20px;
    font-size: var(--cta-font-size);
    background: linear-gradient(45deg, var(--cta-background-start), var(--cta-background-end));
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
}

form button:hover {
    background: linear-gradient(45deg, var (--cta-background-end), var(--cta-background-start));
    transform: scale(var(--button-hover-scale));
}

/* Kontaktlenker */
.contact-link {
    color: var(--text-color);
    font-weight: bold;
    text-decoration: none;
}

.contact-link:hover,
.contact-link:focus {
    text-decoration: underline;
}

/* Responsive designjusteringer */
@media (max-width: 768px) {
    .hero video {
        display: none;
    }
    .hero .mobile-bg {
        display: block;
    }
    .hero .overlay {
        padding: 0 20px;
    }

    .h1 {
        font-size: 1.8em;
    }

    .h2 {
        font-size: 1.5em;
    }

    .h3 {
        font-size: 1.3em;
    }

    .paragraph, p, ul {
        font-size: 1.1em;
    }

    .cta .h2 {
        font-size: 1.2em;
    }

    .cta .paragraph {
        font-size: 1.1em;
    }

    .scroll-down {
        bottom: 15px;
    }

    .hero .overlay .hero-heading {
        font-size: 1.7em;
        line-height: 1.2;
        word-break: break-word; /* Ensure the text breaks to a new line */
        text-align: center; /* Center-align the text */
    }
}

/* Link stiler */
a {
    color: #ff6b6b; /* Bruk samme farge som knappegradientstart */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ff4757; /* Bruk samme farge som knappegradient slutt */
    text-decoration: underline;
}

/* Animasjonskeyframes */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Video container stiler */
.video-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0; /* Juster luft over og under videoen */
}

.video-container iframe {
    width: 100%;
    max-width: 560px; /* Maks bredde på videoen */
    height: 315px;
    border-radius: 15px; /* Samme avrunding som bilder */
    box-shadow: 4px 4px 8px var(--box-shadow-color2), -4px -4px 8px var(--box-shadow-color3); /* Samme skygger som bilder */
}

@media (max-width: 768px) {
    .video-container iframe {
        width: 100%;
        height: auto; /* For å beholde riktig forhold på mobil */
    }
}

/* Accordion stiler */
.accordion {
    background-color: var(--background-color);
    color: var(--heading-color);
    cursor: pointer;
    padding: 18px 18px 18px 48px; /* Justere padding for å unngå overlapping med ikonet */
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: 0.4s;
    font-size: 1.25em;
    font-weight: bold;
    position: relative;
}

.accordion::before {
    content: '\002B'; /* Plus tegn */
    color: var(--heading-color);
    font-size: 1.25em;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%); /* Vertikal sentrering */
    transition: transform 0.4s;
}

.accordion.active::before {
    transform: translateY(-50%) rotate(45deg); /* Roter plusstegnet til kryss og behold vertikal sentrering */
}

.panel {
    padding: 0 18px;
    background-color: var(--background-color);
    max-height: 0; /* Fjerner høydebegrensningen */
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

/* Facebook plugin container */
.facebook-plugin-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    width: 100%; /* Sørger for at containeren tar hele bredden */
}

.facebook-plugin-container .fb-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .facebook-plugin-container {
        margin: 10px 0;
    }
}

/* Ensure images within articles are responsive and do not exceed container width */
.article-content img,
.alternative img {
    width: 100%;
    height: auto;
    opacity: 0;
    animation: 2s ease-in-out .5s forwards fadeIn;
    border-radius: 15px;
    box-shadow: 4px 4px 8px var(--box-shadow-color2), -4px -4px 8px var(--box-shadow-color3);

}

/* Stil for bilder i nyhetsseksjonen */
.news-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 4px 4px 8px var(--box-shadow-color2), -4px -4px 8px var(--box-shadow-color3);
    opacity: 0;
    animation: 2s ease-in-out .5s forwards fadeIn;
}

.published-date {
    display: block;
    margin-bottom: 10px;
}

.share-buttons {
    margin-top: 10px;
}

.share-buttons p {
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-color);
}

.share-buttons a {
    margin-right: 10px;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s;
}

.share-buttons a:hover {
    transform: scale(var(--button-hover-scale));
}

.social-icon {
    width: 24px; /* Juster størrelsen på ikonene etter behov */
    height: 24px;
 
}

.center-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(45deg, var(--cta-background-start), var(--cta-background-end));
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s;
    margin-top: 20px;
    box-shadow: 0 4px 6px var(--box-shadow-color1);
}

.center-button:hover {
    background: linear-gradient(45deg, var(--cta-background-end), var(--cta-background-start));
    transform: scale(var(--button-hover-scale));
}

/* Nyhetsseksjon */
.news-section {
    margin: 20px 0; /* Legger til margin rundt hele nyhetsseksjonen */
}

.news-section article {
    margin-bottom: 40px; /* Øker avstanden mellom artiklene */
    padding-bottom: 20px; /* Legger til padding nederst i hver artikkel */
    border-bottom: 1px solid var(--paragraph-color); /* Valgfritt: legger til en linje mellom artiklene */
}

/* Stil for listeelementer med artikler */
.article-list {
    list-style: none;
    padding: 0;
}

.article-list li {
    margin-bottom: 40px; /* Øker avstanden mellom artiklene */
    padding-bottom: 20px; /* Legger til padding nederst i hver artikkel */
    border-bottom: 1px solid var(--paragraph-color); /* Valgfritt: legger til en linje mellom artiklene */
}

.article-item {
    margin-bottom: 40px; /* Øker avstanden mellom artiklene */
}

.article-title {
    font-size: var(--paragraph-font-size);
    color: var(--heading-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.button-container {
    display: flex;
    justify-content: space-between;
}

/* Nye stilregler for publiseringsknappen og meldinger */
button[name="publish"] {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 10px 2px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

button[name="publish"]:hover {
    background-color: #45a049;
}

.message {
    background-color: #dff0d8;
    color: #3c763d;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #d6e9c6;
    border-radius: 4px;
}

.error {
    background-color: #f2dede;
    color: #a94442;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #ebccd1;
    border-radius: 4px;
}

.timestamp {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}
