html {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif; /* Modern system font stack */
    font-size: 16px; /* Base font size */
    line-height: 1.6; /* Body text line height */
    background-color: #f9f9f9; /* Neutral background */
    color: #333333; /* Dark gray for body text */
    padding-top: 80px; /* Space for fixed header */
}

/* --- NEW HEADER STYLES --- */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #e0f2f7; /* Match footer color */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.site-title {
    margin: 0;
    font-size: 1.5em;
}
.site-title a {
    text-decoration: none;
    color: #003366;
    font-weight: 900;
}
.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 20px;
}
.main-nav a {
    text-decoration: none;
    color: #333333;
    font-weight: 700;
    transition: color 0.3s ease;
}
.main-nav a:hover {
    color: #0056b3;
}
.nav-toggle {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}
.hamburger {
    display: block;
    position: relative;
    width: 25px;
    height: 3px;
    background: #333333;
    transition: all 0.3s ease-in-out;
}
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: #333333;
    left: 0;
    transition: all 0.3s ease-in-out;
}
.hamburger::before {
    top: -8px;
}
.hamburger::after {
    bottom: -8px;
}
/* --- End of New Header Styles --- */

body.reading-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Common Header Styles */
h1 {
    line-height: 1.2;
    margin-bottom: 1em;
}

.content-wrap {
    flex: 1; /* Pushes footer down */
}

/* Common Footer Styles */
footer {
    text-align: center;
    padding: 20px;
    background-color: #e0f2f7; /* Lighter complementary blue */
}
footer a {
    display: inline-flex; /* For touch target */
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    text-decoration: none;
    color: #333333; /* Dark gray for contrast on light background */
    transition: color 0.3s ease;
}
footer a:hover {
    color: #0056b3; /* Accent color on hover */
}
.footer-logo {
    height: 30px; /* Set fixed height */
    width: 30px; /* Set fixed width */
    object-fit: contain; /* Ensure image fits within the square */
    margin: 0 10px;
    background-color: white; /* The white square */
    padding: 6px; /* Creates the border effect */
    border-radius: 4px; /* Softens the corners */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle lift */
}


/* --- INDEX PAGE SPECIFIC STYLES --- */

/* Background Image Setup */
.bg-image {
    background-image: url('/images/emergent-strategies-banner.jpeg'); /* Original image fully visible */
    flex-grow: 1; /* Allows bg-image to take up available space */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex; /* Make it a flex container */
    flex-direction: column; /* Stack children vertically */
}

.main-content-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1; /* Allow content to push footer down */
    max-width: 70ch; /* Max width for readability */
    margin: 0 auto; /* Center the content area */
    width: 100%; /* Ensure it respects parent's width */
    padding: 2rem; /* Subtle padding */
}

.bg-image h1 {
    font-weight: 900;
    color: #003366; /* Dark blue text on original background image */
    font-size: 3em;
    margin-top: 0;
    margin-bottom: 0.5em;
}

.services {
    text-align: left;
}
.styled-text-block {
    color: #003366; /* Dark blue text on original background image */
    font-size: 1.1em;
}

.content-h2 {
    font-weight: 700;
    font-size: 2em;
    line-height: 1.3;
    margin-top: 1em;
    margin-bottom: 0.8em;
    color: #003366; /* Match main h1 color */
}

.services ul {
    list-style-type: '– ';
    padding-left: 20px;
}

.services li {
    padding-bottom: 0.5em;
}


/* --- RECOMMENDED READING PAGE SPECIFIC STYLES --- */

.reading-page h1 {
    text-align: center;
    font-weight: 700;
    font-size: 2em;
    line-height: 1.3;
    margin-top: 1em;
    margin-bottom: 0.8em;
    color: #003366; /* Match main h1 color */
}

#highlights-container {
    max-width: min(70ch, 50%); /* Max width for readability, respecting 50% */
    margin: 0 auto;
    padding: 2rem 0; /* Vertical padding for the main content container */
}
#highlights-container .card-link {
    width: 100%;
    text-decoration: none;
    color: #333333; /* Default link color in card */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for hover */
}
#highlights-container .card-link:hover {
    color: #0056b3; /* Accent color on hover */
    transform: translateY(-5px); /* Subtle lift effect */
    box-shadow: 0 8px 16px rgba(0,0,0,0.2); /* Enhanced shadow */
}
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    box-sizing: border-box;
}
.card-image {
    width: 120px;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
}
.card-content {
    display: flex;
    flex-direction: column;
}
.card-content p:first-child {
    margin-top: 0;
}
.card-text {
    font-style: italic;
    margin-bottom: 1em; /* Adjusted to em for consistency */
}
.card-note {
    background-color: #f9f9f9;
    border-left: 3px solid #ccc;
    padding: 10px;
    margin-bottom: 1em; /* Adjusted to em for consistency */
    font-size: 0.9em;
}
.card-title {
    font-weight: bold;
    font-size: 1.1em; /* Consistent with li on index.html */
    margin-bottom: 0.5em; /* Space for author */
}
.card-author {
    color: #777;
    font-size: 0.9em;
}

/* Flickity Widget Styles */
.flickity-prev-next-button {
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #0056b3; /* Set button color to accent */
}
.flickity-prev-next-button .flickity-button-icon {
    fill: #0056b3; /* Set icon color to accent */
}
.flickity-prev-next-button.previous {
    left: -60px;
}
.flickity-prev-next-button.next {
    right: -60px;
}

.flickity-page-dots {
    bottom: -30px; /* Position dots below the carousel */
}
.flickity-page-dots .dot {
    width: 10px;
    height: 10px;
    opacity: 0.25;
    background: #ccc; /* Neutral light gray */
    border-radius: 50%;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}
.flickity-page-dots .dot.is-selected {
    background: #0056b3; /* Accent color for active dot */
    opacity: 1;
}


/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #e0f2f7;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .main-nav.nav-open {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }
    .main-nav.nav-open .hamburger {
        background: transparent;
    }
    .main-nav.nav-open .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    .main-nav.nav-open .hamburger::after {
        transform: rotate(-45deg);
        bottom: 0;
    }
    
    /* Index Page */
    .bg-image h1 {
        font-size: 2.2em;
    }
    .services h2 {
        font-size: 1.8em;
    }
    .services li {
        font-size: 1em;
    }
    .main-content-area {
        padding: 1rem; /* Adjust padding on smaller screens */
    }

    /* Recommended Reading Page */
    .reading-page h1 {
        font-size: 2em;
    }
    .card {
        grid-template-columns: 100px minmax(0, 1fr); /* Smaller image on small screens */
        gap: 15px;
        padding: 15px;
    }
    .card-image {
        width: 100px;
    }
    #highlights-container {
        max-width: 90%; /* Wider on small screens */
    }
    .flickity-prev-next-button.previous {
        left: -30px; /* Adjust arrow position for smaller screens */
    }
    .flickity-prev-next-button.next {
        right: -30px;
    }
    .flickity-page-dots {
        bottom: -20px; /* Adjust dot position for smaller screens */
    }
}
