/* --- style.css --- */

/* --- OPPSETT OG FARGER --- */
:root {
    --bg-color: #f0f2f5;
    --header-bg: #2c3e50;
    --box-bg: #ffffff;
    --text-color: #333;
    --link-color: #0056b3;
    --accent-color: #d35400;
    --section-border: #ccc;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* --- TOPP (HEADER) --- */
header {
    background-color: var(--header-bg);
    color: white;
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* VENSTRE: Tilbake-link */
.header-left {
    flex: 1;
    text-align: left;
}

.back-link {
    font-size: 0.9rem;
    color: #ccc;
    text-decoration: none;
    display: inline-block;
    padding: 5px 0;
}
.back-link:hover { color: white; text-decoration: underline; }

/* MIDTEN: Tittel */
.header-center {
    flex: 2;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2.2rem; /* Desktop størrelse */
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
    line-height: 1.2;
    color: white;
    cursor: default;
}

/* HØYRE: Søkefelt */
.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.search-container {
    width: 100%;
    max-width: 350px;
}

.search-container input {
    padding: 8px 15px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 20px;
    border: none;
    font-size: 15px;
    outline: none;
}

/* --- HOVEDSTRUKTUR --- */
.main-wrapper {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 10px 40px 10px;
}

.category-section { margin-bottom: 30px; }

.section-title {
    font-size: 1.2rem;
    color: var(--header-bg);
    border-bottom: 2px solid var(--section-border);
    margin-bottom: 15px;
    padding-bottom: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

/* --- BOKSENE (MED SCROLL) --- */
.box {
    background-color: var(--box-bg);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    max-height: 350px;
}

.box h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    color: var(--accent-color);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* SCROLL-LOGIKK */
.box ul { 
    list-style-type: none; 
    padding: 0; 
    margin: 0;
    overflow-y: auto;
    padding-right: 5px;
}

/* Penere scrollbar */
.box ul::-webkit-scrollbar { width: 6px; }
.box ul::-webkit-scrollbar-track { background: #f1f1f1; }
.box ul::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.box ul::-webkit-scrollbar-thumb:hover { background: #999; }

/* --- LINKER --- */
li { margin-bottom: 3px; }
a {
    text-decoration: none;
    color: var(--link-color);
    display: block;
    font-size: 0.95rem;
    padding: 2px 0;
}
a:hover { text-decoration: underline; color: #b33600; }

/* --- MOBIL OG NETTBRETT --- */
@media (max-width: 800px) {
    
    header {
        padding: 8px 15px; 
    }

    .header-content {
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
        gap: 10px;
    }

    /* 1. SKJUL SØKEFELT PÅ MOBIL */
    .header-right {
        display: none; 
    }

    /* 2. LINK TIL VENSTRE */
    .header-left {
        flex: 0 0 auto; 
        text-align: left;
    }
    .back-link {
        background: none; 
        padding: 0;
        font-size: 0.85rem; 
        color: #ddd; 
    }

    /* 3. TITTEL TIL HØYRE */
    .header-center {
        flex: 1; 
        text-align: right; 
    }

    header h1 { 
        font-size: 1.6rem; 
        margin: 0;
    }
    
    .grid-container { gap: 10px; }
    a { padding: 6px 0; border-bottom: 1px solid #f9f9f9; }
}
/* --- DATO I HEADER --- */
.date-line {
    font-size: 0.85rem;       /* Ganske liten skrift */
    color: #aab7c4;           /* Lys gråblå farge som passer til bakgrunnen */
    text-transform: uppercase; /* Store bokstaver ser mer "offisielt" ut */
    letter-spacing: 1px;      /* Litt luft mellom bokstavene */
    margin-top: -5px;         /* Trekker datoen litt nærmere tittelen */
    font-weight: normal;
}

/* På mobil kan vi gjøre den enda mindre */
@media (max-width: 800px) {
    .date-line {
        font-size: 0.7rem;
        margin-top: 0;
        text-align: right; /* På mobil ligger tittel til høyre, så dato bør også det */
    }
}/* --- style.css --- */

/* --- OPPSETT OG FARGER --- */
:root {
    --bg-color: #f0f2f5;
    --header-bg: #2c3e50;
    --box-bg: #ffffff;
    --text-color: #333;
    --link-color: #0056b3;
    --accent-color: #d35400;
    --section-border: #ccc;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* --- TOPP (HEADER) --- */
header {
    background-color: var(--header-bg);
    color: white;
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* VENSTRE: Tilbake-link */
.header-left {
    flex: 1;
    text-align: left;
}

.back-link {
    font-size: 0.9rem;
    color: #ccc;
    text-decoration: none;
    display: inline-block;
    padding: 5px 0;
}
.back-link:hover { color: white; text-decoration: underline; }

/* MIDTEN: Tittel */
.header-center {
    flex: 2;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2.2rem; /* Desktop størrelse */
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
    line-height: 1.2;
    color: white;
    cursor: default;
}

/* HØYRE: Søkefelt */
.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.search-container {
    width: 100%;
    max-width: 350px;
}

.search-container input {
    padding: 8px 15px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 20px;
    border: none;
    font-size: 15px;
    outline: none;
}

/* --- HOVEDSTRUKTUR --- */
.main-wrapper {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 10px 40px 10px;
}

.category-section { margin-bottom: 30px; }

.section-title {
    font-size: 1.2rem;
    color: var(--header-bg);
    border-bottom: 2px solid var(--section-border);
    margin-bottom: 15px;
    padding-bottom: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

/* --- BOKSENE (MED SCROLL) --- */
.box {
    background-color: var(--box-bg);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    max-height: 350px;
}

.box h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    color: var(--accent-color);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* SCROLL-LOGIKK */
.box ul { 
    list-style-type: none; 
    padding: 0; 
    margin: 0;
    overflow-y: auto;
    padding-right: 5px;
}

/* Penere scrollbar */
.box ul::-webkit-scrollbar { width: 6px; }
.box ul::-webkit-scrollbar-track { background: #f1f1f1; }
.box ul::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.box ul::-webkit-scrollbar-thumb:hover { background: #999; }

/* --- LINKER --- */
li { margin-bottom: 3px; }
a {
    text-decoration: none;
    color: var(--link-color);
    display: block;
    font-size: 0.95rem;
    padding: 2px 0;
}
a:hover { text-decoration: underline; color: #b33600; }

/* --- MOBIL OG NETTBRETT --- */
@media (max-width: 800px) {
    
    header {
        padding: 8px 15px; 
    }

    .header-content {
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
        gap: 10px;
    }

    /* 1. SKJUL SØKEFELT PÅ MOBIL */
    .header-right {
        display: none; 
    }

    /* 2. LINK TIL VENSTRE */
    .header-left {
        flex: 0 0 auto; 
        text-align: left;
    }
    .back-link {
        background: none; 
        padding: 0;
        font-size: 0.85rem; 
        color: #ddd; 
    }

    /* 3. TITTEL TIL HØYRE */
    .header-center {
        flex: 1; 
        text-align: right; 
    }

    header h1 { 
        font-size: 1.6rem; 
        margin: 0;
    }
    
    .grid-container { gap: 10px; }
    a { padding: 6px 0; border-bottom: 1px solid #f9f9f9; }
}
/* --- DATO I HEADER --- */
.date-line {
    font-size: 0.85rem;       /* Ganske liten skrift */
    color: #aab7c4;           /* Lys gråblå farge som passer til bakgrunnen */
    text-transform: uppercase; /* Store bokstaver ser mer "offisielt" ut */
    letter-spacing: 1px;      /* Litt luft mellom bokstavene */
    margin-top: -5px;         /* Trekker datoen litt nærmere tittelen */
    font-weight: normal;
}

/* På mobil kan vi gjøre den enda mindre */
@media (max-width: 800px) {
    .date-line {
        font-size: 0.7rem;
        margin-top: 0;
        text-align: right; /* På mobil ligger tittel til høyre, så dato bør også det */
    }
}
.til-toppen {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007bff; /* Eller din farge */
  color: white;
  padding: 10px 15px;
  border-radius: 50%;
  text-decoration: none;
  font-size: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  z-index: 1000;
}