/*-------- Variables -------*/
:root {
    --font: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    --dark: #303030;
    --accent: #cd2220;
}

/*-------- Change Selection Color -------*/
::selection {
    background-color: #fde2d4;
}

html { font-size: 100%; }

/*--------- For Every Page ----------*/
html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 0px;
    font-family: var(--font);
    color: var(--dark);
}

header {
    background-color: var(--dark);
    padding: 32px 121px;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-flow: nowrap;
    gap: 30px;
}

main {
    flex: 1;
    text-align: center;
    margin: 0px;
    padding: 0px;
}

footer {
    background-color: var(--dark);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2vw;
}

h1 {
    color: var(--dark);
    font-weight: bold;
    font-size: 2.4rem;
    padding: 7vh 0px;
    margin-top: 0px;
    background-color: #f8f8f8;
}

h2 {
    color: var(--dark);
    font-weight: bold;
    font-size: 1.7rem;
    margin-top: 64px;
    text-align: left;
}

h3 {
    color: var(--dark);
    font-weight: 400;
    font-size: 1.3rem;
    padding: 1.3rem;
    margin: 0px;
}

p {
    color: var(--dark);
    text-align: left;
    font-size: 1.3rem;
}

article {
    color: var(--dark);
    text-align: left;
    font-size: 1.3rem;
    margin: 32px;
}

a {
    text-decoration: none;
    color: var(--accent);
    text-align: left;
    font-size: 1.3rem;
}
a:hover { color: var(--dark); }

header > a {
    font-weight: bold;
    font-size: 2.15rem;
}

.content {
    margin: 20px 20vw;
    /* justify-self: left; */
    text-align: left;
}

.error-messages {
    position: fixed;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 90vw;
}

.error {
    background-color: #fde2d4;
    color: var(--dark);
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-align: center;
}

#error_msg_js {
    display: none;
}

footer a {
    padding: 8px;
    font-weight: bold;
}

.menu_option {
    color: white;
    text-decoration: none;
}

.menu_option:hover {
    color: white;
    text-decoration: none;
}

nav a {
    font-size: 1.3rem;
    font-weight: bold;
    padding: 8px;
}

nav {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    flex-flow: wrap;
    align-items: center;
}

/*For ol li numbers to be bold if they have h2 text*/
ol li:has(h2) {
  font-weight: bold;
}

.menu_option.active {
    text-decoration: underline;
}

/* Mobile menu button (hidden on desktop) */
header .menu_toggle {
    display: none;
}


/*------- Home Page ---------*/
.index_main_image {
    margin: 20px;
    width: 80%;
}

.pagetitle {
    background-color: #f8f8f8;
    margin-bottom: 20px;
}

.pagetitle > h1 {
    padding-top: 5vh;
    padding-bottom: 0px;
    margin: 0px 40px;
}

.who {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-top: 40px;
}

.who_images {
    display: flex;
    flex-direction: column;
}

.who_images img {
    width: 300px;
    height: auto;
}

.who_text {
    border-left: thick solid var(--accent);
}

.who_text p {
    margin: 20px;
}

.collaborators {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: center;
    gap: 80px;
}

.collaborators img {
    height: 100px;
    width: auto;
}


/*-------- Projects Page --------*/
.current_projects li {
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: start;
    gap: 20px;
}

.current_projects li > img {
    width: 300px;
    height: auto;
}


/*------ Individual Project Page -------*/
.project_info {
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: start;
    gap: 20px;
    border-bottom: 4px solid var(--dark);
    margin: 20px;
}

.project_images {
    display: flex;
    flex-direction: column;
}

.project_images img {
    width: 250px;
    height: auto;
}

.project_relationships {
    border-top: 4px solid var(--dark);
}

/*-------- Dissemination Page ---------*/
ol {
    align-self: left;
}

.to_top_button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--dark);
    color: white;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;
}

.img_zoom {
    width: auto;
    height: 100px;
    cursor: pointer;
}

.diss_img_container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}


/*--------- Members Page ---------*/
ul {
    list-style-type: disc;
}

li {
    color: var(--dark);
    text-align: left;
    font-size: 1.3rem;
    padding: 5px;
}


/*--------- Each Team Member Page --------*/
.profile_info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.profile_img {
    width: 300px;
    height: auto;
    flex-shrink: 0;
}

.profile_description {
    flex: 1;
    min-width: 0;
}

.profile_text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/*-------- Latest News Page -----------*/
.news {
    display: flex;
    align-items: center;
    margin: 20px;
    gap: 30px;
}

.news_text a {
    font-size: 1.7rem;
    font-weight: bold;
}

.news_img {
    width: 200px;
}

.searchbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.searchbar input {
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font);
    color: var(--dark);
}

.searchbar input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(205, 34, 32, 0.15);
}

.searchbar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.searchbar input[type="date"] {
    min-width: 150px;
}

.searchbar label {
    font-size: 0.85rem;
    color: #666;
}


/*------- Tablets and smaller ---------*/
@media (max-width: 900px) {
    /* Header + hamburger menu */
    header {
        flex-wrap: wrap;
        padding: 16px 20px;
        gap: 12px;
    }

    header > a {
        font-size: 1.4rem;
    }

    header .menu_toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: 2px solid white;
        border-radius: 8px;
        padding: 8px;
        margin: 0;
        cursor: pointer;
    }

    header .menu_toggle span {
        display: block;
        width: 24px;
        height: 3px;
        background: white;
        border-radius: 2px;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    /* Hamburger -> X */
    header .menu_toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    header .menu_toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    header .menu_toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    header nav {
        display: none;
        width: 100%;
        flex-flow: column nowrap;
        align-items: stretch;
    }

    header nav.open {
        display: flex;
    }

    header nav a {
        padding: 14px 8px;
        border-top: 1px solid #505050;
    }

    /* Layout and typography */
    .content { margin: 20px 5vw; }
    h1 { font-size: 1.8rem; padding: 4vh 16px; }
    h2 { font-size: 1.4rem; margin-top: 40px; }
    h3 { font-size: 1.15rem; padding: 1rem; }
    p, li, article, a { font-size: 1.1rem; }
    article { margin: 16px; }
    .pagetitle > h1 { margin: 0 16px; }
}


/*------- Smartphones ---------*/
@media (max-width: 700px) {
    /* Stack everything that was a row */
    .who,
    .current_projects li,
    .project_info,
    .news,
    .profile_info {
        flex-direction: column;
    }

    .who_images img,
    .current_projects li > img,
    .project_images img,
    .news_img,
    .profile_img {
        width: 100%;
        max-width: 400px;
        align-self: center;
    }

    .who_text {
        border-left: none;
        border-top: thick solid var(--accent);
    }

    .who_text p { margin: 16px 0; }

    .news { align-items: flex-start; margin: 20px 0; gap: 16px; }
    .news_text a { font-size: 1.4rem; }

    .collaborators { gap: 32px; }
    .collaborators img { height: 70px; }

    .searchbar { padding: 12px; }
    .searchbar input[type="text"] { min-width: 100%; }

    .to_top_button { width: 48px; height: 48px; bottom: 12px; right: 12px; }
    .index_main_image { width: 100%; margin: 12px 0; }
}