#header .logo img {
    transition: all 0.3s ease;
}

.header-fixed #header {
    z-index: 1000;
}

#header {
    background-position: center center;
    /* Center the background image vertically and horizontally */
    z-index: 1000;
}

#header.scrolled .logo img {
    content: url('../images/logo/logo_dark.png');
}

.mobile-menu .button_container span {
    background: #fff;
    ;
    background-color: #fff;
}

.treemenu li a.active,
.treemenu li a:focus,
.treemenu li a:hover {
    color: #fff !important;
}



body {
    font-family: 'Manrope', sans-serif;
    overflow-x: hidden;
    /* Prevent horizontal scroll causing off-screen menu */
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
blockquote {
    font-family: 'Manrope', sans-serif;
}

.footer {
    background-color: #f8f9fa;
    padding: 20px;
    border-top: 2px solid #ddd;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-section {
    flex: 1;
    margin-right: 5em;
}

.footer-section h4 {
    font-size: 1.2em;
    color: #333;
}

.footer-section p {
    margin: 2px 0;
    /* Reduce space between items */
}

.footer-section a {
    color: #007bff;
    text-decoration: none;
}

.footer-section iframe {
    border: 1px solid #ddd;
    border-radius: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #444;
    font-size: 0.85em;
}

.modular-hero {
    background-position: center top;
    background-repeat: repeat-x;
    background-size: auto 100%;
}

.modular-hero.parallax {
    background-attachment: scroll;
    /* Required for the JS-based positionY movement */
}

/* News Section Styles */
.news-container {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.news-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
    /* Primary highlight color */
}

.news-card-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
    background-color: #f0f0f0;
    /* Fallback */
}

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

.news-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.news-title {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    font-weight: 700;
    color: #222;
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    color: #007bff;
}

.news-excerpt {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Fix error page logo visibility */
body.error-page #header .logo img,
body.template-error #header .logo img {
    content: url('../images/logo/logo_dark.png') !important;
}

.news-link {
    margin-top: auto;
    color: #007bff;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.news-link:after {
    content: '→';
    margin-left: 5px;
    transition: transform 0.2s ease;
}

.news-card:hover .news-link:after {
    transform: translateX(4px);
}

/* Single Post Styles */
.single-post-container {
    max-width: 800px;
    /* Focused reading width */
    margin: 0 auto 4rem auto;
    padding: 0 2rem;
}

.post-hero-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-header {
    margin: 3rem 0 2rem 0;
    text-align: center;
}

.post-date {
    color: #888;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 1.5rem;
}

/* Fix mobile menu z-index to sit above the high z-index header AND the overlay */
.mobile-menu {
    z-index: 1005 !important;
}

.mobile-container {
    z-index: 1002 !important;
}

.overlay {
    z-index: 1002 !important;
}

/* Ensure close button (active state) is above the overlay */
.mobile-menu .button_container.active {
    z-index: 1005 !important;
}

/* Change hamburger color to dark when header is white (scrolled) */
#header.scrolled~.mobile-menu .button_container span {
    background-color: #222 !important;
}

/* Keep close button white when active (on top of dark overlay) */
.mobile-menu .button_container.active span,
#header.scrolled~.mobile-menu .button_container.active span {
    background-color: #fff !important;
}

/* Hide the main header (duplicate logo) when mobile menu is open */
body.mobile-nav-open #header {
    opacity: 0 !important;
    pointer-events: none;
}

/* Adjust close button alignment to match overlay logo */
.mobile-menu .button_container.active {
    top: 1.4rem !important;
    /* Push down slightly to align with overlay logo center */
}

/* Force Sticky Header */
.header-fixed #header {
    position: fixed !important;
    top: 0;
    width: 100%;
}

/* Fix text wrapping for citations */
.citation-row p,
.citation-row a,
.modular-text a,
.article-item p {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}
/* Global Section Title */
.section-title {
    font-size: 3.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    color: #222;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }
}
