/* ---
Theme: CleanSpace
Font: Inter
Tone: Informative & Straightforward
--- */

/* CSS Variables */
:root {
    --bg-color: #F8F9FA;
    --text-color: #212529;
    --primary-color: #00539f; /* Updated for WCAG AA contrast */
    --primary-hover-color: #003d73;
    --secondary-color: #6C757D;
    --card-bg-color: #FFFFFF;
    --border-color: #DEE2E6;
    --header-footer-bg: #343A40;
    --header-footer-text: #FFFFFF;
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

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

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

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex-grow: 1;
    padding: 2rem 0;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Header */
.site-header {
    background-color: var(--header-footer-bg);
    color: var(--header-footer-text);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: var(--header-footer-text);
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}

.main-nav a {
    color: var(--header-footer-text);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    text-decoration: none;
}

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

.main-nav a:hover::after {
    width: 100%;
}

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

.main-nav a.active::after {
    width: 100%;
}


/* Main Section & Articles */
.intro-section {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.article-card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.article-card h2 {
    font-size: 1.25rem;
    margin-top: 0;
}

.article-card p {
    flex-grow: 1;
}

.read-more-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    align-self: flex-start;
    margin-top: 1rem;
}

.read-more-btn:hover {
    background-color: var(--primary-hover-color);
    text-decoration: none;
    color: #fff;
}


/* Sidebar */
.sidebar {
    padding: 1.5rem;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.widget {
    margin-bottom: 2rem;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    margin-bottom: 0.5rem;
}

.widget ul li a {
    font-weight: 500;
}


/* Footer */
.site-footer {
    background-color: var(--header-footer-bg);
    color: var(--header-footer-text);
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--header-footer-text);
}


/* Article Page Specifics */
.article-full {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.article-header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.article-header h1 {
    margin-bottom: 0.5rem;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.article-content h2, .article-content h3 {
    margin-top: 2rem;
}

.cta-section {
    background-color: var(--bg-color);
    border: 2px dashed var(--primary-color);
    padding: 1.5rem;
    margin-top: 2rem;
    border-radius: 8px;
    text-align: center;
}

.cta-section p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Contact Page */
.contact-details {
    margin-top: 2rem;
}
.contact-details h3 {
    color: var(--primary-color);
}

/* Accessibility & UX Enhancements */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--header-footer-bg);
    color: var(--header-footer-text);
    padding: 0.5rem 1rem;
    z-index: 10001;
    transition: top 0.3s ease-in-out;
    border-bottom-right-radius: 5px;
}

.skip-link:focus {
    top: 0;
}

a:focus-visible,
.read-more-btn:focus-visible,
.nav-toggle-label:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Media Queries for Responsive Design */
@media (min-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .layout-grid {
        grid-template-columns: 2fr 1fr;
    }
     .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
     .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* Mobile Nav Toggle - Pure CSS */
.nav-toggle-checkbox {
    display: none;
}

.nav-toggle-label {
    display: none; /* Hidden by default, shown on small screens */
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 1001; /* Above nav */
}

.nav-toggle-label .icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--header-footer-text);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate hamburger to 'X' */
.nav-toggle-checkbox:checked + .nav-toggle-label .icon-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle-checkbox:checked + .nav-toggle-label .icon-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle-checkbox:checked + .nav-toggle-label .icon-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


@media (max-width: 768px) {
    .main-nav {
        display: none;
        width: 100%;
        position: absolute;
        top: 100%; /* Position below the header content */
        left: 0;
        background-color: var(--header-footer-bg);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .nav-toggle-checkbox:checked ~ .main-nav {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .main-nav li {
        text-align: center;
    }

    .main-nav a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid #495057;
    }

    .main-nav a::after {
        display: none;
    }

    .main-nav li:last-child a {
        border-bottom: none;
    }

    .nav-toggle-label {
        display: block;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: #fff;
        color: #000;
        font-family: serif;
        font-size: 12pt;
        line-height: 1.4;
    }

    .site-header,
    .site-footer,
    .sidebar,
    .intro-section,
    .cta-section,
    .article-card,
    .article-header .article-meta,
    .nav-toggle-label,
    .skip-link {
        display: none;
    }

    .container,
    .main-content,
    .article-full,
    .layout-grid,
    .articles-main {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
        border: none;
        box-shadow: none;
    }

    .layout-grid {
        grid-template-columns: 1fr !important;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
    
    .article-content a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        font-weight: normal;
    }
}