/* styles.css */

/* ===== CSS VARIABLES ===== */
:root {
    --blue-dark:  #003d7a;
    --blue-mid:   #0056a3;
    --blue-light: #b3d4f0;
    --blue-pale:  #e8f4fd;
    --bg:         #f5f9fc;
    --text:       #222;
    --text-muted: #555;
    --border:     #d0e5f5;
    --radius:     8px;
    --transition: 0.22s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.75;
    font-size: 17px;
}

a {
    color: var(--blue-mid);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    text-decoration: underline;
    color: var(--blue-dark);
}


/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
    color: #fff;
    padding: 0;
    position: relative;
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px 0;
}

header h1 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: #fff;
    letter-spacing: -0.02em;
}

header .tagline {
    font-size: 0.95rem;
    color: var(--blue-light);
    margin-bottom: 16px;
}

/* ===== NAV ===== */
nav {
    background: rgba(0,0,0,0.22);
    margin-top: 12px;
    position: relative;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

nav ul li a {
    display: block;
    padding: 12px 14px;
    color: var(--blue-light);
    font-size: 0.9rem;
    font-family: Arial, sans-serif;
    transition: background var(--transition), color var(--transition);
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    background: #fff;
    transform: scaleX(0);
    transition: transform var(--transition);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    transform: scaleX(1);
}

nav ul li a:hover,
nav ul li a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
}

/* Hamburger button */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 14px 20px;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== NAV DROPDOWN ===== */
.nav-has-dropdown {
    position: relative;
    display: flex;
}

.nav-has-dropdown .nav-dropdown-btn {
    flex: 1;
}

.nav-dropdown-btn {
    display: block;
    padding: 12px 14px;
    color: var(--blue-light);
    font-size: 0.9rem;
    font-family: Arial, sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
    position: relative;
}

.nav-dropdown-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    background: #fff;
    transform: scaleX(0);
    transition: transform var(--transition);
}

.nav-has-dropdown:hover .nav-dropdown-btn::after,
.nav-parent-active .nav-dropdown-btn::after {
    transform: scaleX(1);
}

.nav-has-dropdown:hover .nav-dropdown-btn,
.nav-dropdown-btn:focus,
.nav-parent-active .nav-dropdown-btn {
    background: rgba(255,255,255,0.12);
    color: #fff;
    outline: none;
}

.nav-caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 4px;
    vertical-align: middle;
    transition: transform var(--transition);
}

.nav-has-dropdown.open .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--blue-dark);
    min-width: 170px;
    border-top: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 200;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-has-dropdown:hover .nav-dropdown-menu,
.nav-has-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu li a {
    display: block;
    padding: 11px 16px;
    color: var(--blue-light);
    font-size: 0.88rem;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.nav-dropdown-menu li a:hover,
.nav-dropdown-menu li a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.container.full-width {
    grid-template-columns: 1fr;
    max-width: 800px;
}

main {
    min-width: 0;
}

/* ===== ARTICLE / CONTENT ===== */
article h2, .content h2 {
    font-size: 1.5rem;
    color: var(--blue-dark);
    margin-top: 36px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border);
}

article h2:first-child, .content h2:first-child {
    margin-top: 0;
}

article h3, .content h3 {
    font-size: 1.15rem;
    color: var(--blue-mid);
    margin-top: 22px;
    margin-bottom: 8px;
}

article p, .content p {
    margin-bottom: 1.1em;
    color: #333;
}

article ul, .content ul {
    margin: 10px 0 16px 20px;
    color: #333;
}

article ul li, .content ul li {
    margin-bottom: 6px;
}

article a, .content a {
    text-decoration: underline;
}

/* ===== INTRO BOX ===== */
.intro-box {
    background: var(--blue-pale);
    border-left: 4px solid var(--blue-mid);
    padding: 16px 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 28px;
    font-size: 1.05rem;
    color: var(--blue-dark);
}


/* ===== ARTICLE IMAGES ===== */
.article-image {
    margin: 24px 0 32px;
    text-align: center;
}
.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}
.article-image figcaption {
    font-size: 0.8rem;
    color: var(--blue-dark);
    font-family: Arial, sans-serif;
    margin-top: 6px;
}

.article-image figcaption a {
    color: var(--blue-dark);
}
.section-image {
    margin: 16px 0 24px;
}
.section-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}
.section-image figcaption {
    font-size: 0.8rem;
    color: var(--blue-dark);
    font-family: Arial, sans-serif;
    margin-top: 5px;
}

.section-image figcaption a {
    color: var(--blue-dark);
}

/* ===== FACT BOX ===== */
.fact-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
}

.fact-box h3 {
    color: #e65100;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.fact-box p, .fact-box ul {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* ===== CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0,86,163,0.14);
    transform: translateY(-3px);
}

.card h3 {
    color: var(--blue-dark);
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.card a.btn {
    display: inline-block;
    background: var(--blue-mid);
    color: #fff;
    padding: 7px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: Arial, sans-serif;
    transition: background var(--transition), transform var(--transition);
}

.card a.btn:hover {
    background: var(--blue-dark);
    text-decoration: none;
    transform: translateX(2px);
}

/* ===== SIDEBAR ===== */
aside {
    min-width: 0;
}

.sidebar-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.sidebar-box h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--blue-mid);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.sidebar-box ul {
    list-style: none;
}

.sidebar-box ul li {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.sidebar-box ul li:last-child {
    border-bottom: none;
}

.sidebar-box ul li a {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition), padding-left var(--transition);
}

.sidebar-box ul li a:hover {
    padding-left: 4px;
    text-decoration: none;
}

.sidebar-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Ad placeholder */
.ad-slot {
    background: #f0f4f8;
    border: 1px dashed #aac;
    border-radius: var(--radius);
    text-align: center;
    padding: 20px 10px;
    color: #888;
    font-size: 0.8rem;
    font-family: Arial, sans-serif;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.ads-disabled .ad-slot {
    display: none;
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin: 16px 0 24px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

th {
    background: var(--blue-dark);
    color: #fff;
    text-align: left;
    padding: 11px 14px;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    letter-spacing: 0.03em;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid #e0ecf5;
    color: #333;
    transition: background var(--transition);
}

tr:nth-child(even) td {
    background: #f3f8fd;
}

tr:hover td {
    background: #e4f0fb;
}

/* ===== FAQ ACCORDION ===== */
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
}

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

.faq-item h3 {
    color: var(--blue-dark);
    font-size: 1.05rem;
    margin-bottom: 8px;
    margin-top: 0;
}

.faq-item p {
    margin: 0;
    color: #333;
}

.faq-trigger {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    color: var(--blue-dark);
    transition: color var(--transition);
    margin: 0;
}

.faq-trigger:hover {
    color: var(--blue-mid);
}

.faq-indicator {
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--blue-mid);
    line-height: 1;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform var(--transition);
}

.faq-open .faq-indicator {
    transform: rotate(45deg);
}

.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0;
}

.faq-open .faq-body {
    max-height: 600px;
    padding-bottom: 16px;
}

.faq-body p, .faq-body ul {
    color: #444;
    font-size: 0.97rem;
}

/* ===== SCROLL-TO-TOP ===== */
#scroll-top {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--blue-mid);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--transition), transform var(--transition), background var(--transition);
    z-index: 999;
}

#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
}

#scroll-top:hover {
    background: var(--blue-dark);
}

/* ===== FADE-IN ANIMATIONS ===== */
.fade-target {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== FOOTER ===== */
footer {
    background: var(--blue-dark);
    color: var(--blue-light);
    padding: 36px 20px 20px;
    margin-top: 50px;
}

footer p {
    color: var(--blue-pale);
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
}

footer h2 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin-bottom: 6px;
}

footer a {
    color: var(--blue-light);
    font-size: 0.9rem;
    transition: color var(--transition);
}

footer a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-bottom {
    max-width: 1000px;
    margin: 24px auto 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.12);
    text-align: center;
    font-size: 0.82rem;
    color: var(--blue-pale);
}


/* ===== COOKIE CONSENT BANNER ===== */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a2a3a;
    color: #cde;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    z-index: 1000;
    box-shadow: 0 -3px 16px rgba(0,0,0,0.25);
    transform: translateY(100%);
    transition: transform 0.4s ease;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
}

#cookie-banner.visible {
    transform: translateY(0);
}

.cookie-text {
    flex: 1;
    min-width: 200px;
    line-height: 1.5;
}

.cookie-text strong {
    color: #fff;
}

.cookie-text a {
    color: var(--blue-light);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-actions button {
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
    font-family: Arial, sans-serif;
    transition: background var(--transition);
}

#cookie-accept {
    background: var(--blue-mid);
    color: #fff;
}

#cookie-accept:hover {
    background: #4fc3f7;
}

#cookie-decline {
    background: rgba(255,255,255,0.1);
    color: #cde;
    border: 1px solid rgba(255,255,255,0.2);
}

#cookie-decline:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== BLOG POST LIST ===== */
.post-list {
    list-style: none;
    margin: 20px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card-link {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    color: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.post-card-link:hover {
    border-color: var(--blue-mid);
    box-shadow: 0 2px 10px rgba(0, 86, 163, 0.09);
}

.post-card-thumb {
    flex-shrink: 0;
    width: 90px;
    height: 68px;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--border);
}

.post-card-body {
    flex: 1;
    min-width: 0;
}

.post-card-body h3 {
    font-size: 1rem;
    margin: 0 0 5px;
    line-height: 1.4;
    font-weight: 700;
}

.post-card-body h3 a {
    color: var(--blue-mid);
    text-decoration: none;
}

/* Stretched link - expands h3 anchor to cover the whole card */
.post-card-body h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.post-card-link:hover .post-card-body h3 a {
    color: var(--blue-dark);
}

.post-card-desc {
    font-size: 0.855rem;
    color: var(--text-muted);
    font-family: Arial, sans-serif;
    line-height: 1.5;
    margin: 0 0 4px;
}

.post-list-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: Arial, sans-serif;
}

.post-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 10px 0 10px 0 !important;
    color: inherit;
}

.tag-pill {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 2px 9px;
    background: var(--blue-pale);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: Arial, sans-serif;
    color: var(--blue-mid);
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}

.tag-pill:hover {
    background: var(--blue-light);
    border-color: var(--blue-mid);
    text-decoration: none;
    color: var(--blue-dark);
}


/* ===== AUTHOR CARD (om-oss och blogginlägg) ===== */
.author-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--blue-pale);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--blue-mid);
    color: #fff;
    font-size: 1.4rem;
    font-family: Arial, sans-serif;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.author-info h3 {
    margin-top: 0;
    color: var(--blue-dark);
}

.author-role {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-family: Arial, sans-serif;
    margin-bottom: 10px !important;
}

/* ===== POST BYLINE (visas bara i blogginlägg) ===== */
.post-byline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-family: Arial, sans-serif;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--border);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background: var(--blue-pale);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 14px;
    margin: 0 0 24px;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 0.82rem;
    font-family: Arial, sans-serif;
    color: var(--text-muted);
    padding: 0;
    margin: 0;
}

.breadcrumb ol li {
    display: flex;
    align-items: center;
}

.breadcrumb ol li + li::before {
    content: '/';
    margin: 0 7px;
    color: var(--blue-light);
    font-weight: bold;
}

.breadcrumb a {
    color: var(--blue-mid);
    transition: color var(--transition);
}

.breadcrumb a:hover {
    color: var(--blue-dark);
    text-decoration: underline;
}

.breadcrumb ol li:last-child {
    color: var(--text);
    font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .container {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.35rem;
    }

    /* Show hamburger, hide normal nav */
    .nav-toggle {
        display: flex;
    }

    nav {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0;
        background: rgba(0,0,0,0.3);
    }

    nav ul.open {
        display: flex;
    }

    nav ul li a {
        padding: 13px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        font-size: 0.95rem;
    }

    nav ul li a::after {
        display: none;
    }

    /* Dropdown mobile */
    .nav-dropdown-btn {
        width: 100%;
        text-align: left;
        padding: 13px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        font-size: 0.95rem;
    }

    .nav-has-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-has-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu {
        position: static;
        background: rgba(0,0,0,0.2);
        box-shadow: none;
        border-top: none;
        min-width: 0;
    }

    .nav-dropdown-menu li a {
        padding: 11px 20px 11px 36px;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        font-size: 0.95rem;
    }

    body {
        font-size: 16px;
    }

    table {
        font-size: 0.82rem;
    }

    td, th {
        padding: 8px 10px;
    }

    .author-card {
        flex-direction: column;
    }
}
