/* Grundläggande återställningar och typografi */
html, body {
    height: 100%; /* Ensures body takes full viewport height */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6; /* Lätt off-white bakgrund */
    color: #333;
}

/* Screen-reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Header och Navigering */
header {
    flex-shrink: 0; /* Prevents header from shrinking */
    background-color: #2b2e30; /* Reverted to dark blue for contrast */
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.site-logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.8em; /* Made bigger */
    font-weight: bold;
    margin-right: auto; /* Pushes nav to the right */
}

header nav {
    display: flex;
    gap: 15px; /* Spaces out nav links */
}

.nav-link {
    color: #ecf0f1; /* Brighter white for better contrast */
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ecf0f1; /* Lättare vit vid hover */
}

/* Huvudinnehåll */
main {
    flex-grow: 1; /* Allows main content to expand and push footer down */
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Sektioner */
section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    padding: 25px;
}

/* Hero sektion (första sektionen med H1) */
.hero-section {
    text-align: center;
    padding: 40px 25px;
    background-color: #e0f2f7; /* Lätt ljusblå */
}

.hero-section h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 1.1em;
    max-width: 700px;
    margin: 0 auto;
}

/* Rubriker */
h1, h2, h3 {
    color: #2c3e50;
    margin-top: 0;
}

h2 {
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db; /* Blå linje under H2 */
    padding-bottom: 10px;
}

h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #34495e; /* Mörkare gråblå */
}

/* Svar sektion - Specifik styling för boxar */
.answer-section h2 {
    text-align: center;
}

.answer-section > p { /* P-taggen direkt under answer-section H2 */
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
    color: #555;
}

.answer-group {
    margin-bottom: 25px;
    border: 1px solid #cce7ff;
    border-radius: 8px;
    padding: 20px;
    background-color: #f0faff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.answer-group h3 {
    color: #0056b3;
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px dashed #aed6f1;
    padding-bottom: 10px;
}

.answer-item {
    margin-bottom: 10px;
    padding: 5px 0;
}

.answer-item p {
    margin: 0;
    line-height: 1.7;
}

.answer-item strong {
    color: #2c3e50;
    font-weight: bold;
}

/* Innehållssektioner (Fördjupning, Tips) */
.content-section p, .content-section ul {
    margin-bottom: 1em;
}

.content-section ul {
    list-style-type: disc;
    margin-left: 20px;
    padding: 0;
}

.content-section li {
    margin-bottom: 8px;
}

.internal-link {
    color: purple; /* Diagnostic color change */
    text-decoration: underline;
}

.internal-link:hover {
    color: darkviolet; /* Diagnostic hover color */
}

/* FAQ Sektion */
.faq-section {
    background-color: #f8f9fa; /* Slightly darker for differentiation */
    border-left: 5px solid #0056b3; /* Using the new accessible blue */
}

.faq-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    font-size: 1.3em;
    color: #000000; /* Pure black for maximum contrast */
    margin-bottom: 10px;
}

/* Footer */
footer {
    flex-shrink: 0; /* Prevents footer from shrinking */
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background-color: #2b2e30;
    color: #ecf0f1; /* Changed text color to light/white */
    font-size: 0.9em;
    border-top: 1px solid #507C7C;
}

footer p, footer a {
    color: #ecf0f1;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsivitet */
@media (max-width: 768px) {
    main {
        margin: 15px auto;
        padding: 0 15px;
    }

    .hero-section h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.8em;
    }

    h3 {
        font-size: 1.3em;
    }

    .answer-group, section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .nav-link {
        margin: 0 10px;
    }
    .hero-section h1 {
        font-size: 1.8em;
    }
    h2 {
        font-size: 1.6em;
    }
    h3 {
        font-size: 1.2em;
    }
    .answer-group h3 {
        font-size: 1.4em;
    }
    .answer-item p {
        font-size: 0.95em;
    }
}

/* Sök och Relaterade Frågor Sektion */
.search-and-related {
    display: flex;
    flex-wrap: wrap;
    gap: 30px; /* Mellanrum mellan sök och relaterade */
    padding: 30px;
    background-color: #f8f9fa; /* Samma som FAQ för enhetlighet */
    border-top: 3px solid #e0f2f7; /* Subtil avgränsare */
}

.search-container, .related-questions {
    flex: 1; /* Båda tar upp lika mycket plats */
    min-width: 300px; /* Förhindrar att de blir för smala */
}

.search-and-related h2 {
    font-size: 1.8em; /* Något mindre för att passa sektionen */
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Styling för sökformuläret i sektionen */
.search-form {
    display: flex;
}

.search-input {
    flex-grow: 1;
    border: 2px solid #ccc;
    padding: 10px;
    font-size: 1em;
    border-radius: 5px 0 0 5px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-button {
    padding: 10px 20px;
    border: none;
    background-color: #2980b9; /* Darker blue for better contrast */
    color: white;
    font-size: 1em;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #2070a0; /* Even darker blue for hover */
}

/* Styling för relaterade frågor listan */
.related-questions ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.related-questions li {
    margin-bottom: 10px;
}

.related-questions a {
    text-decoration: none;
    color: #0056b3;
    background-color: #e0f2f7;
    display: block;
    padding: 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.related-questions a:hover {
    background-color: #cce7ff;
    transform: translateX(5px);
}

/* Responsivitet för Sök och Relaterade sektionen */
@media (max-width: 768px) {
    .search-and-related {
        flex-direction: column; /* Stacking on smaller screens */
    }
}