/* Basic CSS Reset */
body, h1, h2, h3, p, ul, li {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
body.no-scroll {
    overflow: hidden;
}


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

    /* --- Sticky Footer Flexbox Setup --- */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
ul {
    list-style: none;
}
a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}
a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- Header Styling --- */
header {
    background-color: #fff;
    padding: 5px 20px 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex; /* Changed to flex for alignment */
    justify-content: flex-start; /* Align logo to the left */
    align-items: center;

    /* --- Added for fixed header --- */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-sizing: border-box;
}

/* --- Mobile Navigation Toggle (Hamburger) --- */
.mobile-nav-toggle {
    display: none; /* Hidden on desktop */
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1001;
    background: transparent;
    border: none;
    width: 30px;
    height: 22px;
    cursor: pointer;
    padding: 0;
}
.mobile-nav-toggle .hamburger-icon {
    position: relative;
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}
.mobile-nav-toggle .hamburger-icon::before,
.mobile-nav-toggle .hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}
.mobile-nav-toggle .hamburger-icon::before { top: -8px; }
.mobile-nav-toggle .hamburger-icon::after { bottom: -8px; }

/* Active state for hamburger (turns into an 'X') */
.mobile-nav-toggle.is-active .hamburger-icon {
    background-color: transparent;
}
.mobile-nav-toggle.is-active .hamburger-icon::before {
    transform: translateY(8px) rotate(45deg);
}
.mobile-nav-toggle.is-active .hamburger-icon::after {
    transform: translateY(-8px) rotate(-45deg);
}
.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-color);
}
/* Style for image logo if used */
.logo a img {
    max-height: 80px; /* Adjust as needed */
    width: auto;
    display: block; /* Prevents extra space below image */
}
/* Style for text logo if no image */
.logo a {
    text-decoration: none;
    color: inherit;
    font-size: 24px;
    font-weight: bold;
}


/* --- Navigation Styling --- */
.primary-navigation {
    background-color: var(--secondary-color);
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

    /* --- Added for fixed navigation --- */
    position: fixed;
    top: 85px; /* This should match the height of the header (logo height (80px) + top padding (5px)) */
    left: 0;
    right: 0;
    z-index: 999;
    box-sizing: border-box;
}
.primary-navigation ul {
    display: flex;
    justify-content: center;
    gap: 8px; /* Use gap for modern spacing */
}
.primary-navigation ul li {
    margin: 0; /* Remove old margin */
}
.primary-navigation a {
    display: inline-block; /* Ensure padding is respected */
    color: #fff;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    text-align: center;
    font-size: 0.9em;
}
.primary-navigation a:hover {
    background-color: var(--darker-secondary); /* Use calculated color */
    text-decoration: none;
}
.primary-navigation a.active {
    background-color: var(--primary-color);
}
main {
    /* The main element is now just a basic wrapper. Spacing is handled by .page-container */
    padding: 0;

    /* --- Sticky Footer Flexbox Setup --- */
    flex-grow: 1; /* Allows main content to expand and push footer down */
}
.page-container {
    padding: 200px 20px 40px 20px; /* top(header+nav height), right, bottom, left */
    max-width: 1200px;
    margin: 0 auto;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.page-header {
    /* Top padding is now handled by the main element's padding-top */
    padding-bottom: 30px;
    text-align: center;
    margin-bottom: 30px;
}
.page-header h1 {
    font-size: 2.8em;
    color: var(--heading-color);
    margin-bottom: 10px;
    font-weight: 500;
}

.button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.button:hover {
    background-color: var(--darker-primary); /* Use calculated color */
    color: white;
    text-decoration: none;
}
.button.button-warning {
    color: #ffffff;
    background-color: #002f4d;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
    font-size: 16px;
    line-height: 26px;
    background-image: none;
    mix-blend-mode: hard-light;
}
.button.button-warning:hover {
    background-color: #4D93EF;
}

/* --- Form Error/Success Message Styling --- */
.form-message {
    padding: 10px 15px;
    border: 1px solid;
    border-radius: 4px;
    margin-bottom: 15px;
}
.form-message.error { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.form-message.success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }

/* --- Footer Styling --- */
footer {
    background-color: var(--text-color);
    color: #fff;
    text-align: center;
    padding: 30px;
    font-size: 0.9em;
}
footer a {
    color: #fff;
    text-decoration: underline;
}
footer a:hover {
    color: #ccc;
}

/* --- Media Queries for Responsiveness --- */
@media (max-width: 768px) {
    header {
        justify-content: center; /* Center logo on mobile */
    }
    .mobile-nav-toggle {
        display: block; /* Show hamburger button */
    }
    .primary-navigation {
        position: fixed;
        top: 85px; /* Position below the header */
        right: 0;
        bottom: 0;
        left: auto; /* Override desktop setting */
        width: 80%;
        max-width: 300px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 998;
        padding: 40px 20px;
        overflow-y: auto;
        /* Mobile-specific overrides */
        box-shadow: none;
    }
    .primary-navigation.is-open {
        transform: translateX(0);
    }
    .primary-navigation ul { /* Style the mobile navigation list */
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    main {
        padding-top: 100px; /* Adjust padding for mobile header only */
    }
}

.text-center {
    text-align: center;
}