/* Context Lab Website - Main Stylesheet */
/* Matching Squarespace design exactly */

/* Import fonts - proxima-nova and interface alternatives */
/* Using Nunito Sans as closest match to proxima-nova/interface */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700&display=swap');

/* CSS Variables */
:root {
    --primary-green: rgb(0, 112, 60);
    --primary-green-light: rgba(0, 112, 60, 0.6);
    --primary-green-lighter: rgba(0, 112, 60, 0.5);
    --bg-green: rgba(0, 112, 60, 0.2);
    --bg-green-light: rgba(0, 112, 60, 0.15);
    --accent-green: rgba(0, 112, 60, 0.3);
    --white: #FFFFFF;
    --dark-text: rgba(0, 0, 0, 0.7);
    --font-body: 'Nunito Sans', 'proxima-nova', sans-serif;
    --font-heading: 'Nunito Sans', 'interface', sans-serif;
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--dark-text);
    background-color: var(--bg-green);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-green);
    text-transform: lowercase;
    letter-spacing: 0.6px;
    font-weight: 300;
    line-height: 1.2;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 18px;
    line-height: 1.6;
    color: var(--primary-green-light);
    letter-spacing: 0.4px;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

strong {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Bold text in headings should inherit green color */
h3 strong {
    color: inherit;
}

/* Bold text in body paragraphs should be dark */
p strong {
    color: var(--dark-text);
}

/* Header */
.site-header {
    background-color: var(--white);
    padding: 20px 0;
    position: relative;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    width: 50px;
    height: 50px;
}

/* Hide logo text in header - only show logo image */
.site-header .logo-text {
    display: none;
}

/* Hide header on all pages - navigation is in footer only */
.site-header {
    display: none;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 300;
    color: var(--primary-green);
    text-transform: lowercase;
    letter-spacing: 0.6px;
    text-decoration: none;
}

.logo-text:hover {
    text-decoration: none;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
}

.main-nav li {
    position: relative;
}

.main-nav a,
.main-nav .dropdown-toggle {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 400;
    color: var(--primary-green);
    text-transform: lowercase;
    letter-spacing: 0.9px;
    text-decoration: none;
    padding: 8px 15px;
    display: block;
    cursor: pointer;
    background: none;
    border: none;
}

.main-nav a:hover,
.main-nav .dropdown-toggle:hover {
    text-decoration: none;
    opacity: 0.7;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--accent-green);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Style for dropdown toggle when on a page in that section */
.dropdown.current-section .dropdown-toggle {
    font-weight: 600;
    color: var(--primary-green);
}

.dropdown-menu li {
    border-bottom: 1px solid var(--accent-green);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    padding: 12px 20px;
    display: block;
    font-size: 13px;  /* Decreased from main nav 17px */
}

.dropdown-menu a:hover {
    background-color: var(--bg-green-light);
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 15px;
    margin-left: 20px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.social-icons svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-green);
    transition: opacity 0.2s ease;
}

.social-icons a:hover svg {
    opacity: 0.7;
}

/* Main Content */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 64px;
    background-color: var(--white);
}

.page-header {
    margin-bottom: 64px;
}

.page-header h1 {
    margin-bottom: 40px;
    line-height: 1.2;
}

.page-header h3 {
    font-weight: 300;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 16px;
    text-transform: none;
    color: rgba(0, 112, 60, 0.6);
}

.page-header p {
    margin-bottom: 16px;
    line-height: 1.7;
}

.page-intro {
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.7;
}

/* Section Dividers */
hr, .divider {
    border: none;
    border-top: 1px solid var(--accent-green);
    margin: 64px 0;
}

/* Jump Links */
.jump-links {
    font-family: var(--font-heading);
    font-size: 15px;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    white-space: nowrap;
}

.jump-links a {
    margin: 0 5px;
}

/* Content Sections */
.content-section {
    margin-bottom: 80px;
}

.content-section h2 {
    margin-bottom: 32px;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 85px;
}

.two-column.reverse {
    grid-template-columns: 1fr 200px;
}

/* Lab Director specific - wider image column */
.two-column.lab-director {
    grid-template-columns: 415px 1fr;
    margin-bottom: 110px;
}

.two-column.lab-director figure {
    margin-top: -35px;  /* Move image up so top is above text */
}

.two-column.lab-director h3 {
    margin-top: 0;
    margin-bottom: 35px;
}

.two-column.lab-director p {
    margin-bottom: 28px;
}

.two-column img {
    max-width: 100%;
    height: auto;
}

/* People Grid */
.people-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 85px 40px;
    margin-bottom: 85px;
}

.person-card {
    text-align: left;
}

.person-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 18px;  /* Reduced from 35px for tighter spacing */
}

.person-card h3 {
    font-size: 17px;
    margin-bottom: 22px;
    line-height: 1.5;
}

.person-card p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 0;
}

/* Publications Grid */
.publications-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.publication-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 30px;
    align-items: start;
}

.publication-card img {
    width: 150px;
    height: auto;
    object-fit: contain;
}

.publication-card h4 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 300;
    color: var(--dark-text);
}

.publication-card h4 a {
    color: var(--dark-text);
}

.publication-card h4 a:hover {
    color: var(--primary-green);
}

.publication-card p {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.7;
}

.publication-links {
    font-size: 14px;
}

.publication-links a {
    /* Removed margin-right to avoid space before closing bracket */
}

/* News Items */
.news-list {
    max-width: 872px;
}

.news-item {
    position: relative;
    display: block;
    margin-bottom: 35px;
    padding-bottom: 0px;
    padding-left: 104px;
    border-bottom: none;
    min-height: 85px;
}

.news-item:last-child {
    border-bottom: none;
}

.news-thumbnail {
    position: absolute;
    left: 0;
    top: 0;
    width: 85px;
    height: 85px;
    object-fit: cover;
    border: none;
    overflow: hidden;
}

.news-content h3 {
    font-size: 18px;
    text-transform: uppercase;
    font-weight: 400;
    margin-bottom: 12px;
    line-height: 1.5;
}

.news-content h3 a {
    color: #666;
    text-decoration: none;
}

.news-content h3 a:hover {
    text-decoration: underline;
}

.news-content p {
    font-size: 12px;
    line-height: 21px;
    margin-bottom: 12px;
    color: rgba(0, 0, 0, 0.7);
}

.news-content p:last-child {
    margin-bottom: 0;
}

.news-content p a {
    color: var(--primary-green);
}

/* Software List */
.software-section h2 {
    display: flex;
    align-items: center;
    gap: 15px;
}

.software-section h2 img {
    width: 40px;
    height: 40px;
}

.software-list p {
    margin-bottom: 7px;
}

/* Back to Top */
.back-to-top {
    text-align: center;
    margin: 25px 0;
    font-size: 11px;
}

.back-to-top a {
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Your Name Here Section - Stacked Layout */
.your-name-here-section {
    text-align: left;
    margin-bottom: 60px;
}

.your-name-image {
    max-width: 350px;
    margin-bottom: 25px;
}

.your-name-image img {
    width: 100%;
    height: auto;
}

.your-name-content {
    max-width: 500px;
}

.your-name-content h3 {
    margin-bottom: 20px;
}

.your-name-content p {
    margin-bottom: 18px;
}

/* Alumni Header - vertically centered image */
.two-column.alumni-header {
    align-items: center;
    margin-bottom: 50px;
}

.two-column.alumni-header figure {
    max-width: 200px;
}

.two-column.alumni-header h2 {
    margin-bottom: 20px;
}

.two-column.alumni-header h3 {
    text-transform: none;
    margin-bottom: 15px;
}

.two-column.alumni-header p {
    margin-bottom: 0;
}

/* Collaborators Header - dragon on right, vertically centered */
.two-column.collaborators-header {
    grid-template-columns: 1fr 300px;
    align-items: center;
}

.two-column.collaborators-header figure {
    order: 2;
}

.two-column.collaborators-header figure img {
    width: 100%;
    height: auto;
}

.two-column.collaborators-header h3 {
    margin-bottom: 15px;
}

.two-column.collaborators-header p {
    margin-bottom: 0;
}

/* Alumni Section */
#lab-alumni .two-column.mt-40 {
    grid-template-columns: 45% 55%;
    gap: 40px;
}

#lab-alumni h3 {
    font-size: 16px;
    margin-bottom: 15px;
    margin-top: 25px;
}

#lab-alumni h3:first-child {
    margin-top: 0;
}

#lab-alumni p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 0;
}

/* Alumni List - Two columns on desktop */
.alumni-list {
    font-size: 14px;
    line-height: 1.7;
    column-count: 2;
    column-gap: 30px;
}

/* Collaborators Section */
#collaborators h1 {
    margin-bottom: 25px;
}

#collaborators .mt-20 {
    margin-top: 30px;
}

#collaborators .mt-20 p {
    margin-bottom: 18px;
    line-height: 1.8;
}

/* Contact Section */
.contact-page .page-header {
    margin-bottom: 50px;
}

.contact-cta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    margin: 45px 0 50px 0;
}

.zombie-illustration {
    width: 215px;
    height: auto;
}

.contact-info-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 40px;
}

.tree-illustration {
    width: 180px;
    height: auto;
}

.contact-details h1 {
    font-size: 30px;
    text-transform: lowercase;
    margin-bottom: 10px;
    letter-spacing: 0.6px;
}

.contact-details h3 {
    margin-bottom: 20px;
    text-transform: lowercase;
}

.contact-details p {
    margin-bottom: 15px;
    line-height: 1.8;
}

/* Buttons */
.btn, .btn-outline {
    display: inline-block;
    padding: 15px 40px;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover, .btn-outline:hover {
    background-color: var(--primary-green);
    color: var(--white);
    text-decoration: none;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    border: 2px solid var(--primary-green);
    background-color: var(--primary-green);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-green);
    text-decoration: none;
}

/* Form Success Message */
.form-success {
    text-align: center;
    padding: 40px 20px;
}

.form-success h3 {
    color: var(--primary-green);
    font-size: 24px;
    margin-bottom: 10px;
}

.form-success p {
    color: var(--dark-text);
    font-size: 16px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-text);
}

.modal h2 {
    text-transform: none;
    font-size: 24px;
    margin-bottom: 30px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--dark-text);
}

.form-group label span {
    color: #999;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #4a4a4a;
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a4a4a; /* Keep gray border on focus */
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group .helper-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

/* Themed Select Dropdown */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a4a4a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
    border: 1px solid #4a4a4a;
    color: #4a4a4a;
}

.form-group select:focus {
    border-color: #4a4a4a; /* Keep gray border on focus */
    outline: none;
}

/* Style select dropdown options */
.form-group select option {
    color: #4a4a4a;
    background-color: var(--white);
}

.form-group select option:first-child {
    color: #999;
}

/* Centered Submit Button in Modal */
.modal .contact-form {
    display: flex;
    flex-direction: column;
}

.modal .contact-form .btn-primary {
    align-self: center;
    margin-top: 10px;
}

/* Helper text above textarea */
.form-group .textarea-helper {
    font-size: 13px;
    color: #4a4a4a;
    margin-bottom: 8px;
    font-style: italic;
}

/* Keep borders gray regardless of validation state */
.form-group input:user-invalid,
.form-group select:user-invalid,
.form-group textarea:user-invalid,
.form-group input:user-valid,
.form-group select:user-valid,
.form-group textarea:user-valid,
.form-group input:invalid:focus:not(:placeholder-shown),
.form-group select:invalid:focus:not([value=""]),
.form-group textarea:invalid:focus:not(:placeholder-shown) {
    border-color: #4a4a4a; /* Keep gray border */
    box-shadow: none;
}

/* Required field asterisk styling */
.form-group label .required {
    color: var(--primary-green);
    font-weight: 400;
}

/* Custom validation tooltip styling */
.validation-message {
    position: absolute;
    background: var(--primary-green);
    color: var(--white);
    padding: 8px 12px;
    font-size: 13px;
    font-family: var(--font-body);
    border-radius: 4px;
    margin-top: 5px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 112, 60, 0.3);
}

.validation-message::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 15px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--primary-green);
}

.form-group {
    position: relative;
}

/* Homepage Specific */
body.homepage {
    padding-bottom: 0;
}

body.homepage main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Homepage Hero Container with Animated Transitions */
.homepage-main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 74px; /* Footer nav height: padding 17px + logo 40px + padding 17px */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    padding: 40px;
}

.brain-wrapper {
    position: absolute;
    top: calc(50% - 20px); /* Offset up to visually center in the green area above the menu */
    left: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.27s ease, transform 0.27s ease, top 0.27s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brain-image {
    width: 80vw;
    max-width: 900px;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    /* No transition by default - instant resize with browser window */
}

/* Only apply transition during info button toggle */
body.info-transitioning .brain-image {
    transition: width 0.27s ease, max-width 0.27s ease, max-height 0.27s ease;
}

.info-text {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    width: 45%;
    max-width: 450px;
    opacity: 0;
    transition: opacity 0.27s ease; /* 50% faster animation */
    pointer-events: none;
    z-index: 10;
}

.info-text h2 {
    font-size: clamp(20px, 3vw, 32px); /* Responsive: min 20px, scales with viewport, max 32px */
    font-weight: 400;
    color: var(--primary-green);
    margin-bottom: clamp(15px, 2vw, 25px);
    line-height: 1.3;
    text-transform: lowercase;
}

.info-text p {
    font-size: clamp(12px, 1.5vw, 16px); /* Responsive: min 12px, scales with viewport, max 16px */
    line-height: 1.7;
    color: var(--dark-text);
    margin-bottom: clamp(15px, 2vw, 25px);
}

.info-text .read-more {
    display: inline-block;
    color: var(--primary-green);
    font-family: var(--font-heading);
    font-size: clamp(11px, 1.2vw, 14px); /* Responsive: min 11px, scales with viewport, max 14px */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
}

.info-text .read-more:hover {
    text-decoration: underline;
}

/* Info Panel Active State - Gallery View */
body.info-active .brain-wrapper {
    left: 27%;
    top: 50%;
}

body.info-active .brain-image {
    /* Sized to fill ~80% of left half, but never exceed 90% of untoggled size */
    width: 40vw;
    max-width: 810px; /* 90% of untoggled max (900px) */
    max-height: 80vh;
}

body.info-active .info-text {
    opacity: 1;
    pointer-events: auto;
}

/* Legacy hero section styles (for fallback) */
.hero-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

.hero-image {
    max-width: 700px;
    margin: 0 auto;
}

.hero-image img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

/* Hide gallery header and slideshow on initial view - show on scroll */
body.homepage .gallery-header,
body.homepage .slideshow-container,
body.homepage .slideshow-dots {
    display: none;
}

.gallery-header {
    text-align: center;
    margin-bottom: 20px;
}

.gallery-header h2 {
    margin-bottom: 10px;
}

/* Slideshow */
.slideshow-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.slide.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: center;
    padding: 40px;
    background: var(--white);
}

.slide-content img {
    width: 100%;
    height: auto;
}

.slide-content h2 {
    margin-bottom: 15px;
}

.slide-content .read-more {
    display: inline-block;
    margin-top: 15px;
    font-weight: 500;
}

.slideshow-dots {
    text-align: center;
    padding: 20px;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background: var(--accent-green);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dot.active,
.dot:hover {
    background: var(--primary-green);
}

.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--white);
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 20px;
    color: var(--primary-green);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.slideshow-nav:hover {
    opacity: 1;
}

.slideshow-nav.prev {
    left: 0;
}

.slideshow-nav.next {
    right: 0;
}

/* Footer Navigation (Sticky Bottom) */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 17px 0;
    z-index: 100;
    transform: translateY(0);
}

/* Mobile menu toggle - hidden by default on desktop */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--primary-green);
    transition: transform 0.3s ease;
}

/* Homepage specific - always show footer nav */
body.homepage .footer-nav {
    transform: translateY(0);
}

/* Hide header on homepage */
body.homepage .site-header {
    display: none;
}

.footer-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.footer-nav .logo {
    margin-right: 15px;
}

.footer-nav .logo img {
    width: 40px;
    height: 40px;
}

.footer-nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
}

.footer-nav a,
.footer-nav .dropdown-toggle {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 400;
    color: var(--primary-green-lighter);
    text-transform: lowercase;
    letter-spacing: 0.6px;
    text-decoration: none;
    padding: 3px 10px;
    line-height: 24px;
}

/* Active page styling - the parent menu item gets full opacity and bolder */
.footer-nav .dropdown.active > .dropdown-toggle,
.footer-nav li.active > a {
    color: var(--primary-green);
    font-weight: 600;
}

.footer-nav a:hover,
.footer-nav .dropdown-toggle:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Footer Nav Dropdown - opens upward */
.footer-nav .dropdown {
    position: relative;
}

.footer-nav .dropdown-menu {
    position: absolute;
    bottom: 100%;
    top: auto;
    left: 0;
    background: var(--white);
    min-width: 120px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
    border: none;
    padding: 10px 0;
    margin-bottom: 5px;
}

.footer-nav .dropdown:hover .dropdown-menu,
.footer-nav .dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.footer-nav .dropdown-menu li {
    border-bottom: 1px solid var(--accent-green);
    padding: 0;
}

.footer-nav .dropdown-menu li:last-child {
    border-bottom: none;
}

.footer-nav .dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 15px;
    color: var(--primary-green-lighter);
}

.footer-nav .dropdown-menu a:hover {
    opacity: 0.7;
    background: none;
}

/* Footer Social */
.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 30px 0;
    margin-top: 40px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-social svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-green);
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 20px;
    }

    .main-nav {
        flex-direction: column;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .social-icons {
        margin-left: 0;
    }

    .main-content {
        padding: 40px 20px;
    }

    .two-column,
    .two-column.reverse,
    .two-column.lab-director {
        grid-template-columns: 1fr;
    }

    .two-column.lab-director figure {
        margin-top: 0;  /* Reset negative margin on mobile */
    }

    /* People grid - single column on mobile */
    .people-grid {
        grid-template-columns: 1fr;
    }

    .publications-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .slide-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Alumni list - single column on mobile */
    .alumni-list {
        column-count: 1;
    }

    /* Alumni section - single column on mobile */
    #lab-alumni .two-column.mt-40 {
        grid-template-columns: 1fr;
    }

    /* Collaborators header - stack on mobile */
    .two-column.collaborators-header {
        grid-template-columns: 1fr;
    }

    .two-column.collaborators-header figure {
        order: 0;  /* Image on top */
        max-width: 200px;
        margin: 0 auto 20px;
    }

    /* Footer navigation - mobile layout (hamburger menu style) */
    .footer-nav {
        padding: 12px 0;
    }

    .footer-nav-inner {
        justify-content: center;
        gap: 0;
        padding: 0 20px;
        position: relative;
        min-height: 32px;
    }

    .footer-nav .logo {
        /* No absolute positioning - let it take normal flow */
    }

    .footer-nav ul {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 56px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        gap: 15px;
        align-items: center;
        /* Animation properties */
        max-height: 0;
        overflow: hidden;
        padding: 0 20px;
        opacity: 0;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out, opacity 0.2s ease-out;
    }

    /* Hamburger menu button */
    .footer-nav .mobile-menu-toggle {
        display: flex;
        position: absolute;
        left: 20px;
    }

    /* When menu is open - roll down effect */
    .footer-nav.menu-open ul {
        max-height: calc(100vh - 80px); /* Full viewport minus nav bar height */
        padding: 20px;
        opacity: 1;
        overflow-y: auto; /* Enable scrolling within the menu */
    }

    .footer-nav .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 10px 0 0 20px;
        max-height: none;
        overflow: visible;
    }

    /* Center the dropdown toggle text (e.g., "about") in mobile view */
    .footer-nav .dropdown {
        text-align: center;
    }

    .footer-nav .dropdown-toggle {
        display: block;
        text-align: center;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-40 {
    margin-bottom: 40px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-40 {
    margin-top: 40px;
}

/* Info Button (top right corner) */
.info-button {
    position: fixed;
    top: 13px;
    right: 13px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    background: rgba(0, 112, 60, 0.3);
    transition: opacity 0.2s ease;
}

.info-button span {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 400;
    color: rgba(204, 226, 216, 0.9);
    line-height: 1;
}

.info-button:hover {
    opacity: 0.7;
}

.info-button.active {
    background: var(--primary-green);
}

.info-button.active span {
    color: white;
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}
