/* css/style.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --border-color: #e1e8ed;
    --font-serif: 'Crimson Text', serif;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.site-header .container {
    position: relative; /* For hamburger icon positioning */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows logo and nav to stack if needed, though nav will hide */
}

.logo {
    /* Ensure logo doesn't get pushed down by an invisible hamburger on wider screens */
    /* This might need adjustment based on how .main-nav is handled below */
    flex-grow: 1; 
}

.logo h1 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.logo h1 a {
    color: white;
    text-decoration: none;
}

.logo .subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 300;
}

/* main-nav is the container for the hamburger and the ul */
.main-nav {
    /* On desktop, it behaves normally */
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    padding-left: 0; /* Override default ul padding */
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.main-nav a:hover {
    color: var(--accent-color);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--secondary-color);
    min-width: 250px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0s 0.3s linear, transform 0.3s ease;
    flex-direction: column;
    gap: 0;
    z-index: 1001;
    padding-left: 0; /* Override default ul padding */
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.3s ease, visibility 0s 0s linear, transform 0.3s ease;
}

.dropdown-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0; /* Reset */
}
.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Mobile Menu Toggle Icon (Hamburger/X) */
.main-nav::before {
    display: none; 
    content: '\2630'; 
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    position: absolute;
    /* Position relative to .site-header .container */
    right: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    padding: 0.5rem; 
    z-index: 1005; 
}

.main-nav.nav-open::before {
    content: '\00D7'; 
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px); /* Adjust if footer/header height changes significantly */
    padding: 2rem 0;
}

.content-article {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 3rem;
    margin-top: 1rem;
}

.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: var(--accent-color);
    text-decoration: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; border-bottom: 2px solid var(--accent-color); padding-bottom: 0.5rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1.2rem;
}

.intro-text {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-left: 4px solid var(--accent-color);
}

/* Lists */
ul, ol {
    margin-bottom: 1.2rem;
    padding-left: 2rem; /* Default, may be overridden by nav styles */
}

li {
    margin-bottom: 0.5rem; /* Default,  may be overridden by nav styles */
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
}

.timeline-year {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.1rem;
}

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

.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--light-gray);
    font-weight: 600;
    color: var(--primary-color);
}

/* Footer */
.site-footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-info h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-links h4 {
    color: white;
    margin-bottom: 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
}

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

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #bdc3c7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; /* Ensure vertical alignment if logo/nav content has different heights */
    }

    .logo {
        /* Allow logo to shrink if necessary, but it should be prominent */
        flex-grow: 0; /* Let main-nav (hamburger area) determine its own space*/
        margin-right: auto; /* Push logo to the left */
    }
    
    .main-nav {
        /* On mobile, .main-nav itself effectively becomes the hamburger button area */
        /* Adjust its size or positioning if the ::before icon is not capturing clicks right */
    }

    .main-nav::before { 
        display: block; 
    }

    .main-nav ul {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 100%; 
        left: 0;
        right: 0;
        background-color: var(--secondary-color); 
        box-shadow: 0 4px 6px rgba(0,0,0,0.2);
        z-index: 1000; 
        gap: 0; 
        padding: 0; 
        max-height: 0; 
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.35s ease-in-out, opacity 0.35s ease-in-out, visibility 0.35s linear;
    }

    .main-nav.nav-open ul {
        display: flex; 
        max-height: calc(100vh - 60px); /* Dynamic height, 60px is approx header height */
        opacity: 1;
        visibility: visible;
        overflow-y: auto; 
        transition: max-height 0.35s ease-in-out, opacity 0.35s ease-in-out, visibility 0s linear;
    }
    
    .main-nav ul li {
        width: 100%;
        margin-bottom: 0; 
    }

    .main-nav ul a { /* Styles for top-level links in mobile menu */
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .main-nav ul li:last-child a { /* For non-dropdown last items */
        /* border-bottom: none; /* Ensure this applies correctly later */
    }
    .main-nav ul li:last-of-type > a { /* If the last item itself is a link */
        border-bottom: none; 
    }
    .main-nav ul .dropdown:last-of-type.submenu-active > .dropdown-menu li:last-child a {
         /* If last item is a dropdown and its submenu is open, its last item also no border */
    }
     .main-nav ul .dropdown > a { /* Parent dropdown links in mobile */
        /* No specific change from general 'a' needed unless styling differently */
     }
    
    .main-nav ul .dropdown .dropdown-menu { /* Submenu in mobile nav */
        position: static; /* Crucial for inline expansion */
        opacity: 1; /* Always visible if parent is active */
        visibility: visible; /* Always visible if parent is active */
        transform: none;
        box-shadow: none;
        background: rgba(0,0,0,0.1); /* Slightly darker for distinction */
        margin-top: 0;
        min-width: 100%;
        padding-left: 0; /* Let child 'a' tags handle indent */
        border-bottom: none; /* Remove border from the ul itself */
        max-height: 0; /* Hidden by default */
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }

    .main-nav ul .dropdown.submenu-active > .dropdown-menu {
        max-height: 1000px; /* Large enough value for content, animate in */
    }

    .main-nav ul .dropdown .dropdown-menu a {
        padding: 0.75rem 1.5rem 0.75rem 2.5rem; /* Indent submenu items */
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(255,255,255,0.05); /* Fine lines for submenu items */
    }
    .main-nav ul .dropdown .dropdown-menu li:last-child a {
        border-bottom: none;
    }
    
    .content-article {
        padding: 2rem 1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.highlight { background: #fff3cd; padding: 0.2rem 0.4rem; border-radius: 3px; }