/* General body styling */
body { 
    font-family: 'Times New Roman', Times, serif; 
    font-size: 20px;
    color: #333;
    line-height: 1.6;
    background-color: #ffffff;
    margin: 0 auto;
    max-width: 1000px; /* Keeps main content constrained */
    padding: 0 20px;
    text-align: justify;
}

/* Full-Width Header Section with Background Image */
.header {
    position: relative;
    width: 100vw; /* Full viewport width */
    margin-left: calc(-50vw + 50%);
    height: 400px;
    background: url('WomensHealthcare.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Blue Transparent Overlay */
.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 163, 31, 0.802); /* Semi-transparent blue overlay */
    z-index: 1;
}

/* Title Text Overlay */
.header h1 {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 2.7em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Paragraphs below the header */
p {
    margin-bottom: 1em;
    font-weight: 300;
    text-align: justify;
}

/* Headings */
h2 {
    color: #000000;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    text-align: center;
}

h3, h4, h5, h6 {
    color: #1d3557;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    text-align: justify;
}

/* Adjust heading sizes */
h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 1.75em;
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.25em;
}

/* General Figure Styling */
figure {
    margin: 0 auto;
    text-align: center;
    overflow-x: auto; /* Ensure horizontal scrolling if content overflows */
}

/* Default Visualization Styling */
#Location1, #Location2, #Location3, #Location4, #Location5 {
    width: 100%; /* Take full width of the container */
    max-width: 1000px; /* Match the text container width */
    margin: 0 auto; /* Center align */
    overflow-x: auto; /* Prevent clipping */
}

/* Links */
a {
    color: #0b8961;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Dropdown Styling */
label {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #1a1a1a;
}

select {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #1a1a1a;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 10px;
    margin-left: 5px;
    background-color: #ffffff;
    cursor: pointer;
}

select option {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: normal;
}

/* Responsive Adjustments */

/* Tablets and Medium Screens (max-width: 1024px) */
@media (max-width: 1024px) {
    body {
        font-size: 18px;
        padding: 0 15px;
    }

    .header {
        height: 300px;
    }

    .header h1 {
        font-size: 2em;
    }

    h1 {
        font-size: 2.2em;
    }

    h2 {
        font-size: 1.6em;
    }

    /* Ensure visualization adapts better */
    #Location1, #Location2, #Location3, #Location4, #Location5 {
        width: 95vw; /* Slightly more width on tablets */
        max-width: 1000px;
    }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding: 0 10px;
    }

    .header {
        height: 250px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.4em;
    }

    section {
        margin-bottom: 1.5em;
    }

    figure {
        overflow-x: auto;
    }

    /* Visualization adapts fully */
    #Location1, #Location2, #Location3, #Location4, #Location5 {
        width: 100%; /* Fit the mobile screen width */
        max-width: 90vw; /* Slight padding from screen edges */
        margin: 0 auto; /* Center horizontally */
        overflow-x: auto; /* Enable horizontal scrolling only if needed */
    }
}

/* Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
        padding: 0 5px;
    }

    .header {
        height: 200px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }

    h3 {
        font-size: 1.1em;
    }

    p {
        font-size: 0.9em;
    }

    section {
        margin-bottom: 1em;
    }

    #chartGrid {
        flex-direction: column;
    }

    /* Visualization adjustments for smaller screens */
    #Location1, #Location2, #Location3, #Location4, #Location5 {
        width: 100%; /* Fit screen width */
        max-width: 90vw; /* Padding from screen edges */
        height: auto; /* Maintain aspect ratio */
        margin: 0 auto; /* Keep centered */
        overflow-x: auto; /* Enable horizontal scrolling only if needed */
    }
}
