/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600&family=Merriweather:wght@300;400;700&display=swap');

/* General Styles */
body {
    margin: 0;
    font-family: 'Merriweather', serif;
    background-color: #f0f0f0;
    color: #085DCB;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Adjusting Header */
header {
    background-color: #4b4945;
    width: 100%;
    padding: 30px 0 80px 0; /* Increased bottom padding to create space from the menu */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: auto; /* Ensure the container is auto-sized */
    max-width: 80%; /* Add a max width to ensure consistency */
}

.logo-title {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start; /* Align the title and subtitle to the left */
    width: 100%; /* Make sure the logo doesn't affect alignment */
}

.logo {
    max-width: 200px;
    height: auto;
    margin-left: -22px;
    margin-bottom: -20px;
}

h1 {
    font-size: 7.5rem;
    color: #f26c6d;
    font-family: 'Quicksand', sans-serif;
    font-weight: 800;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    text-align: left;
    margin-left: -9px; /* Shift the RISE title slightly to the left */
}

.sub-title {
    font-size: 1.2rem;
    color: #f26c6d;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    margin: 0;
    padding: 0;
    margin-top: -20px;
    text-align: left;
    width: auto; /* Ensure it aligns based on the content width */
}

/* Navigation Styles */
nav {
    margin-top: 50px; /* Created more space between the header and the menus */
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
}

nav ul li {
    display: inline;
    margin: 0 20px;
    position: relative; /* Added for popup positioning */
}

nav ul li a {
    text-decoration: none;
    color: #ffffff;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 16px;
}

/* Noise Map Popup Styles - UPDATED for full visibility */
.popup-info {
    visibility: hidden;
    width: 300px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    text-align: left;
    border-radius: 8px;
    padding: 15px;
    position: absolute;
    z-index: 1;
    top: 130%; /* Changed from bottom to top positioning */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
}

/* Arrow for popup - UPDATED for top positioning */
.popup-info::after {
    content: "";
    position: absolute;
    bottom: 100%; /* Changed from top to bottom */
    left: 50%;
    margin-left: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent rgba(255, 255, 255, 0.95) transparent; /* Updated arrow direction */
}

/* Show the popup when hovering over the link */
.noise-map-link:hover .popup-info {
    visibility: visible;
    opacity: 1;
}

/* Main Content Styles */
main {
    width: 100%;
    max-width: 1200px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Side-by-side layout for bilingual content */
.side-by-side {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    background-color: #f0f0f0;
}

.content {
    width: 48%;
    padding: 20px;
    text-align: justify;
    font-size: 1.2rem;
    line-height: 1.75;
    color: #085DCB;
}

/* Headings in English and French content */
.content h2 {
    text-align: left;
    font-size: 1.8rem;
    font-weight: 700;
    color: #085DCB;
    margin-bottom: 15px;
}

/* Responsive layout for mobile */
@media (max-width: 768px) {
    .side-by-side {
        flex-direction: column;
    }

    .content {
        width: 100%;
        margin-bottom: 20px;
    }
    
    /* Adjust popup for mobile - UPDATED */
    .popup-info {
        width: 250px;
        max-width: 90vw;
        left: 0;
        transform: none;
        top: 100%; /* Changed from bottom to top */
    }
    
    .popup-info::after {
        left: 20px;
        margin-left: 0;
    }
}

/* Footer Styles */
footer {
    margin: 20px 0;
    text-align: center;
    background-color: transparent;
}

footer p a {
    color: #005a5a;
    text-decoration: underline;
}

/* Adjustments for screens smaller than 768px */
@media (max-width: 768px) {
    .logo {
        max-width: 80px;
        margin-left: 20px;
        margin-bottom: -15px;
        vertical-align: middle;
    }

    h1 {
        font-size: 5rem;
        margin-left: 0;
        text-align: left;
        margin-top: 0; /* Remove any extra margin above */
    }

    .sub-title {
        font-size: 1.3rem;
        margin-top: -10px;
        text-align: left;
    }

    header {
        padding: 40px 0 60px 0; /* Moved the entire header higher */
    }

    nav {
        margin-top: 20px;
        display: flex;
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        padding: 0;
        margin: 0;
    }

    nav ul li {
        display: block;
        margin: 10px 0;
    }

    nav ul li a {
        font-size: 1.1rem;
    }
}

/* Adjustments for screens smaller than 480px */
@media (max-width: 480px) {
    .logo {
        max-width: 120px;
        margin-left: 20px;
        margin-bottom: 27px;
    }

    h1 {
        font-size: 4.5rem;
        margin-left: -5px;
        text-align: left;
        margin-bottom: 40px;
    }

    .sub-title {
        font-size: 1.2rem;
        margin-bottom: 60px;
        margin-top: -55px;
        text-align: left;
    }

    header {
        padding: 50px 0 70px 0; /* Moved the entire header higher for small screens */
    }

    nav {
        margin-top: 20px;
    }

    nav ul li {
        margin: 10px 0;
    }

    nav ul li a {
        font-size: 1rem;
    }
    
    /* Further adjust popup for very small screens */
    .popup-info {
        width: 220px;
        font-size: 12px;
        padding: 10px;
    }
}

/* Control the size of the SSHRC logo */
.sshc-logo {
    max-width: 150px; /* Adjusted size to be smaller */
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Video Gallery Styles */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 videos per row on larger screens */
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.video-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.video-item iframe {
    width: 100%; /* Full width for responsiveness */
    height: 150px; /* Reduced height */
    border-radius: 8px;
}

.video-item p {
    margin-top: 10px;
    font-size: 1rem;
    color: #333333;
    text-align: center;
}

/* Responsive Styles for Mobile */
@media (max-width: 768px) {
    .video-gallery {
        grid-template-columns: repeat(2, 1fr); /* 2 videos per row on smaller screens */
        gap: 10px;
        padding: 0 5px;
    }

    .video-item iframe {
        height: 120px; /* Reduced height for smaller screens */
    }
}

@media (max-width: 480px) {
    .video-gallery {
        grid-template-columns: repeat(1, 1fr); /* 1 video per row on mobile */
    }

    .video-item iframe {
        height: 100px; /* Further reduced height for very small screens */
    }
}

/* Person-specific styles scoped to the people page */
.people-page .person-container {
    margin-bottom: 40px;
}

.people-page .side-by-side {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
}

.people-page .left-side,
.people-page .right-side {
    width: 48%;
    text-align: justify;
}

.people-page .person-image {
    text-align: center;
    margin-top: 20px;
}

.people-page .person-image img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
}

/* General Page Styles for the People Page */
.people-page .person-container {
    margin-bottom: 40px;
}

.people-page .left-side,
.people-page .right-side {
    width: 45%; /* Adjusted widths */
    text-align: justify;
    font-size: 1.2rem;
    line-height: 1.75;
}

/* Adjust the people page layout for centered image */
.people-page .side-by-side {
    background-color: #f0f0f0;
}

.people-page .person-image {
    width: 16%; /* Adjusted image container size */
    text-align: center;
    margin: 0 20px;
}

.people-page .person-image img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
}

/* Responsive Styles specific to people page */
@media (max-width: 768px) {
    .people-page .side-by-side {
        flex-direction: column;
    }

    .people-page .left-side,
    .people-page .right-side {
        width: 100%;
        margin-bottom: 20px;
    }

    .people-page .person-image {
        width: 50%; /* Adjusted image width for mobile */
        margin: 0 auto 20px auto;
    }

    .people-page .person-image img {
        max-width: 100%;
    }
}

/* Center the person's name and title in the people page */
.people-page .person h2 {
    text-align: center;
    margin-bottom: 20px;
}
/* Updated styles for the buttons on the people page */
.people-page .button-container {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap to the next line if necessary */
    justify-content: center;
    margin: 40px 0 20px 0; /* Adjust margins as needed */
}

.people-page .button-container button {
    background-color: #e0e0e0; /* Light gray background */
    color: #333333; /* Dark gray text */
    border: none;
    padding: 14px 28px; /* Increased padding for larger buttons */
    margin: 10px; /* Increased margin for better spacing */
    font-size: 16px;
    cursor: pointer;
    font-family: 'Quicksand', sans-serif;
    border-radius: 25px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
    max-width: 320px; /* Limit button width */
    width: auto; /* Allow buttons to resize based on content */
    white-space: normal; /* Allow text to wrap within the button */
    text-align: center; /* Center the text */
}

.people-page .button-container button:hover {
    background-color: #d5d5d5; /* Slightly darker gray on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
