:root {
    --primary-color: #00004D; /* Deep navy blue */
    --secondary-color: #5A7B9B; /* Muted blue */
    --accent-color: #8BAABA; /* Soft institutional blue */
    --bg-color: #FFFFFF;
    --bg-light-grey: #F5F5F5;
    --text-color: #333333;
    --text-light: #FFFFFF;
    --border-color: #E0E0E0;
    --font-family: 'Lato', 'Open Sans', sans-serif;
    --header-height: 80px;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* 1. CSS Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1.5rem;
    max-width: 75ch;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

ul {
    list-style: none;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 2. Header & Navigation */
.main-header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.main-header.scrolled {
    box-shadow: var(--shadow);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 0.7em;
    margin-left: 0.3em;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.dropdown-menu li a:hover,
.dropdown-menu li a.active {
    background-color: var(--bg-light-grey);
    color: var(--primary-color);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* 3. Hero Sections */
.hero {
    position: relative;
    background-size: cover;
    background-position: center;
    color: var(--text-light);
    display: flex;
    align-items: center;
    text-align: center;
    padding: 6rem 2rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 77, 0.75); /* Deep navy blue overlay */
}

.hero-home { min-height: 80vh; }
.hero-page { min-height: 45vh; }

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: rgba(255, 255, 255, 0.9);
    margin: 0 auto;
}
img.desaturated {
    filter: grayscale(100%);
}

/* 4. Content & Layout */
.content-section {
    padding: clamp(4rem, 8vw, 6rem) 0;
}

.bg-light {
    background-color: var(--bg-light-grey);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.text-section {
    max-width: 800px;
    margin: 0 auto;
}

.text-image-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.text-image-split .image-content img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    filter: grayscale(1);
    opacity: 0.9;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
}
.breadcrumbs a {
    color: var(--secondary-color);
}
.breadcrumbs a:hover {
    color: var(--primary-color);
}
.breadcrumbs span {
    color: var(--text-color);
}

/* 5. Components */
/* Buttons */
.btn {
    display: inline-block;
    padding: 0.9rem 1.8rem;
    border-radius: var(--border-radius);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--text-light);
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

/* Cards */
.card-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.card-text {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.card-link {
    font-weight: 700;
    text-decoration: none;
    align-self: flex-start;
}
.card-link:hover {
    text-decoration: underline;
}

/* Styled List */
.styled-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.styled-list li {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.styled-list .list-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: var(--accent-color);
}

/* 6. Article Pages */
.article-container {
    max-width: 900px;
}

.article-content h2, .article-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.article-content h2 { border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }

.article-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.article-image {
    width: 100%;
    margin: 2rem 0;
    border-radius: var(--border-radius);
    filter: grayscale(1);
    opacity: 0.9;
}

.diagram-container figcaption {
    font-size: 0.9rem;
    text-align: center;
    color: var(--secondary-color);
    margin-top: -1rem;
    font-style: italic;
}

.editorial-cta {
    margin-top: 3rem;
    padding: 1.5rem;
    background-color: var(--bg-light-grey);
    border-left: 5px solid var(--accent-color);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.related-articles {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-articles h3 {
    margin-bottom: 1.5rem;
}

.related-articles ul li {
    margin-bottom: 1rem;
}
.related-articles ul li a {
    font-size: 1.1rem;
}

.simple-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}
.simple-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* 7. Contact Page */
.contact-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}
@media (min-width: 992px) {
    .contact-container {
        grid-template-columns: 1fr 1.25fr;
    }
}

.contact-info h2 { text-align: left; }

.contact-form-wrapper {
    background-color: var(--bg-light-grey);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 170, 186, 0.3);
}

textarea { resize: vertical; }

/* 8. Thank You Page */
.thank-you-section {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1rem;
}

.thank-you-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.thank-you-icon svg {
    width: 40px;
    height: 40px;
}

.thank-you-section h1 { font-size: 3rem; }
.thank-you-section p { font-size: 1.2rem; margin-bottom: 2.5rem; }

/* 9. Footer */
.main-footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 4rem 0 2rem 0;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--secondary-color);
}

.footer-heading {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
}
.footer-links a:hover {
    color: var(--text-light);
    text-decoration: underline;
}

.footer-bottom {
    padding-top: 2rem;
    text-align: center;
}

/* 10. Cookie Banner & Scroll-to-top */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 1.5rem;
    z-index: 9999;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}

.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
}
.cookie-banner a {
    color: var(--accent-color);
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--secondary-color);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.scroll-to-top:hover {
    background-color: var(--primary-color);
}

.scroll-to-top.visible {
    display: block;
    opacity: 1;
}

/* 11. Responsive Design */
@media (max-width: 992px) {
    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-color);
        flex-direction: column;
        align-items: center;
        padding-top: 3rem;
        gap: 2.5rem;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .nav-links.active {
        transform: translateX(0);
    }
    .nav-link {
        font-size: 1.5rem;
    }
    .dropdown .nav-link {
        display: flex;
        align-items: center;
    }
    .dropdown-menu {
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 1rem 0 0 0;
        min-width: unset;
        width: 100%;
        text-align: center;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none; /* hide by default */
    }
    .dropdown.open .dropdown-menu {
        display: block;
    }
    .dropdown-menu li a {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    .hamburger {
        display: block;
    }
    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    .text-image-split {
        grid-template-columns: 1fr;
    }
    .text-image-split .image-content {
        order: -1;
    }
    .cookie-banner {
        flex-direction: column;
        text-align: center;
    }
}