/*
Theme Name: GeneratePress Child spurt.no
Template: generatepress
Version: 1.8
*/

/* --- 1. GRUNNLEGGENDE SIDEBAKGRUNN & OVERGANG --- */
body {
    background-color: #f2f6fa !important;
    border-top: none !important;
    overflow-x: hidden;
}

#page, .site-content, #content, .site-main, .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* --- 2. HEADER & NAVIGASJON (STICKY) --- */
.site-header, .main-navigation {
    margin-bottom: 0 !important;
    background-color: #0d2b54 !important;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
    width: 100%;
}

body.admin-bar .site-header { top: 32px; }

@media (max-width: 782px) {
    body.admin-bar .site-header { top: 0; }
}

.site-logo img,
.site-logo img.header-image {
    width: auto !important;
    max-height: 80px;
    display: block;
}

@media (max-width: 768px) {
    .site-logo img.header-image {
        max-height: 65px;
    }
}

/* ENDRET HER: Lagt til transition og hover-effekt */
.main-navigation .main-nav ul li a {
    color: #ffffff !important;
    font-weight: 600;
    transition: opacity 0.3s ease; /* Gir en myk overgang */
}

.main-navigation .main-nav ul li a:hover {
    opacity: 0.7 !important; /* Gjør teksten litt svakere når du peker på den */
}

/* --- 3. IKONER: SØK & HAMBURGER --- */
.main-navigation .search-item a svg,
.main-navigation .search-item a svg path,
.menu-bar-items .search-item a svg,
.menu-bar-items .search-item a svg path,
.menu-toggle .gp-icon svg,
.menu-toggle .gp-icon svg path {
    fill: #ffffff !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

.main-navigation .search-item a,
.menu-bar-item.search-item a,
.menu-toggle,
.main-navigation .menu-toggle {
    background: transparent !important;
    box-shadow: none !important;
}

.main-navigation .search-item a:hover svg path,
.menu-toggle:hover .gp-icon svg path {
    opacity: 0.9 !important;
}

.gp-icon.icon-search svg,
.gp-icon.icon-menu svg {
    fill: #ffffff !important;
}

/* --- 4. HOVEDLAYOUT --- */
.site-content, #content, .site-main {
    background: transparent !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 1000px !important;
    margin: 10px auto 0 auto !important;
}

article {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    padding: 32px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}

/* --- 5. HERO --- */
.hero-clean {
    text-align: center !important;
}

.hero-subtitle {
    text-align: center !important;
    margin: 0 auto !important;
    display: block;
}

/* --- 6. MOBILMENY & X-IKON --- */
button.menu-toggle .mobile-menu-text { display: none !important; }

button.menu-toggle.toggled .gp-icon,
button.menu-toggle.toggled svg { display: none !important; }

button.menu-toggle.toggled::after {
    content: "✕";
    font-size: 30px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    display: inline-block;
}

/* MOBIL LAYOUT */
@media (max-width: 768px) {
    .site-content,
    #content,
    .site-main {
        width: 98vw !important;
        margin-top: 10px !important;
    }

    article {
        padding: 20px 10px !important;
    }

    /* RØD HELSVART MOBILMENY (matcher lukkeraden) */
    .main-navigation .main-nav ul {
        background-color: #000000 !important;
        margin: 0 16px !important;
    }

    .main-navigation .main-nav ul li a {
        background-color: #000000 !important;
        border-bottom: 1px solid #333;
        color: #ffffff !important;
    }
}

/* --- 7. FORFATTERBOKS --- */
.spurt-author-box {
    display: flex;
    gap: 24px;
    background: #f8f9fb;
    padding: 32px;
    border-radius: 14px;
    margin-top: 50px;
    border-left: 5px solid #0d2b54;
    align-items: center;
}

.spurt-author-img,
.spurt-author-img img, 
.spurt-author-box .avatar {
    width: 100px !important;
    min-width: 100px !important;
    height: 100px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

/* --- MOBIL: BIO BILDE OVER TEKST --- */
@media (max-width: 768px) {
    .spurt-author-box {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .spurt-author-img {
        margin-bottom: 16px;
    }
}

.spurt-author-box h3,
.spurt-author-box h4,
.spurt-author-box .author-title {
    text-transform: uppercase !important;
    font-weight: 800 !important;
    margin-top: 0 !important;
    letter-spacing: 0.5px;
    color: #0d2b54;
    font-size: 20px !important;
}

/* --- 8. LUKKERAD (MOBIL) --- */
@media (max-width: 768px) {
    .main-navigation.toggled .mobile-close-button {
        display: block !important;
        background-color: #000000 !important;
    }

    .main-navigation.toggled .mobile-close-button a {
        color: #ffffff !important;
        padding: 16px 20px !important;
        border-bottom: 1px solid #333 !important;
        display: block !important;
        font-weight: 800;
        cursor: pointer !important;
        text-align: right;
    }
}

/* --- 9. FORFATTERBILDE MOBIL --- */
@media (max-width: 768px) {
    .spurt-author-img,
    .spurt-author-img img,
    .spurt-author-box .avatar {
        width: 100px !important;
        height: 100px !important;
        min-width: 100px !important;
        min-height: 100px !important;
        max-width: 100px !important;
        max-height: 100px !important;
        flex-shrink: 0 !important;
        object-fit: cover !important;
    }
}

/* --- 10. KNAPPER (FIKSET BREDDE & NAVIGASJON) --- */

/* 1. Container for Forrige / Neste artikkel */
.post-navigation {
    display: flex !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 15px !important;
    margin-top: 30px !important;
}

.nav-previous,
.nav-next {
    flex: 1 !important; /* Deler plassen likt på desktop */
}

/* 2. Generell stil for ALLE knapper (inkl Les hele, sidetall, nav) */
.post-navigation a,
.paging-navigation a,
.nav-links .page-numbers,
a.read-more-custom.button {
    background-color: #000000;
    color: #ffffff !important;
    border: 2px solid #000000;
    border-radius: 5px;
    padding: 14px 22px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    display: inline-block;
    
    /* VIKTIG: Dette fikser "Les hele guiden" */
    width: auto !important; 
    min-width: 40px; /* Sikrer at tallene 1, 2 ikke blir bittesmå */
}

/* 3. Spesialregel KUN for Neste/Forrige piler */
/* Disse skal fylle containeren sin (som er 50% av skjermen) */
.post-navigation a {
    width: 100% !important;
    display: block;
}

/* Hover-effekt */
.post-navigation a:hover,
.paging-navigation a:hover,
.nav-links .page-numbers:hover,
a.read-more-custom.button:hover {
    background-color: #ffffff;
    color: #000000 !important;
}

/* Kategori-knapper (små hvite) */
.cat-links a {
    background-color: #ffffff;
    color: #000000 !important;
    border: 2px solid #000000;
    border-radius: 5px;
    padding: 14px 22px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    text-decoration: none !important;
    display: inline-block;
    line-height: 1;
}

.cat-links a:hover {
    text-decoration: none !important;
}

/* Tagger */
.tags-links a {
    background-color: #f4f4f4;
    color: #444444 !important;
    border: 1px solid #cccccc;
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 11px;
}

/* --- MOBIL: STABLE NESTE/FORRIGE KNAPPER VERTIKALT --- */
@media (max-width: 768px) {
    .post-navigation {
        flex-direction: column !important;
    }

    /* På mobil skal Neste/Forrige være 100% brede */
    .post-navigation a {
        width: 100% !important;
    }
}

/* --- 11. KATEGORI, ARKIV & SØKERESULTATER (MIDTSTILLING) --- */
body.archive #secondary,
body.category #secondary,
body.search #secondary {
    display: none !important;
}

body.archive .site-content,
body.category .site-content,
body.search .site-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
}

body.archive #primary,
body.category #primary,
body.search #primary {
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    max-width: 800px !important;
}

body.archive header.page-header,
body.category header.page-header,
body.search header.page-header {
    text-align: center !important;
    max-width: 800px;
    margin: 0 auto 40px auto !important;
    width: 100% !important;
}

/* --- 12. TYPOGRAFI (INGEN ORDDELING + MOBILJUSTERING) --- */

/* 1. Slå av all orddeling og tving ord til å henge sammen */
h1, h2, h3, h4, h5, h6,
h1 *, h2 *, h3 *, h4 *, h5 *, h6 *,
.entry-content h1, .entry-content h2, .entry-content h3, 
.entry-content h4, .entry-content h5, .entry-content h6,
.gb-headline, .gb-headline a, .gb-headline-text {
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    hyphens: none !important;
    word-break: normal !important;      /* Unngår kutting midt i ord */
    overflow-wrap: break-word !important; /* Kutter KUN hvis ordet er bredere enn skjermen */
}

/* 2. Krymp overskrifter på mobil så lange ord får plass */
@media (max-width: 480px) {
    h1, .entry-content h1, .gb-headline-text h1 {
        font-size: 26px !important;
        line-height: 1.2 !important;
    }
    
    h2, .entry-content h2, .gb-headline-text h2 {
        font-size: 22px !important; /* Denne redder "Konkurranseforberedelser" */
        line-height: 1.2 !important;
    }

    h3, .entry-content h3, .gb-headline-text h3 {
        font-size: 19px !important;
        line-height: 1.2 !important;
    }
}
/* --- 13. FJERN MAPPEIKON VED KATEGORIER --- */

.cat-links .gp-icon {
    display: none !important;
}

.cat-links {
    margin-left: 0 !important;
}
.post-navigation a,
.paging-navigation a,
.nav-links .page-numbers,
a.read-more-custom.button {
    background-color: #000000;
    color: #ffffff !important;
    border: 2px solid #000000;
    border-radius: 5px;
    padding: 14px 22px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    display: inline-block;

    transition: background-color 0.3s ease, color 0.3s ease;
    transform: none !important;
}

