/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Didot', serif;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scrolling */
  }

/* Container is responsive */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Add padding to prevent overflow */
    margin-bottom: 10px;
}

/* Header */
header {
    background-color: #26581c;
    color: white;
    padding: 50px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Ensures the header content wraps on small screens */
    max-width: 100%; /* Prevents overflow */
}

.img-profile {
    max-width: 150px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
}

.header-text {
    text-align: center;
    max-width: 100%; /* Prevents text from overflowing */
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 0px;
}

header p {
    font-size: 1.1em;
}

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

/* General Link Styles */
a {
    color: #26581c;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #112e0d;
}

main p a:hover {
    text-decoration: underline;
}

/* Header Specific Links - Ensure these override global link styles */
header a {
    color: white !important; /* Force the header links to be white */
    text-decoration: none;
    font-weight: bold;
    transition: font-size 0.3s ease, color 0.3s ease;
}

header a:hover {
    font-size: 1.2em;
    color: #8eb67b !important; /* Light green on hover */
    text-decoration: underline;
}


/* Social Media Icon Styling */
.social-icon {
    text-decoration: none;
    font-size: 1.5em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: transform 0.3s ease, color 0.3s ease;
    color: white; /* Icon color */
  }

.social-icon:hover {
    transform: scale(1.6);
    color: #88ac78; /* Light green on hover for social icons */
    text-decoration: none;
}

.bluesky-icon {
    width: 0.9em;
    height: 0.9em;
    fill: currentColor;
  }

/* Navigation */
nav {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
    gap: 10px;
}

nav ul li {
    margin: 0 10px;
}

nav ul li a {
    color: #26581c;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    padding: 8px 15px;
    transition: background 0.3s ease;
}

nav ul li a:hover {
    background-color: #26581c;
    color: white;
    border-radius: 4px;
}

nav ul li a.active {
    background-color: #26581c;
    color: white;
    border-radius: 4px;
}

/* Main Content */ 
  main {
    padding: 50px 0;
    flex: 1; /* this pushes footer to the bottom when content is short */
  }

/* Section Titles */
section h2 {
    font-size: 2em;
    color: #26581c;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 10px;
}

h4 {
    font-size: 1.2em;
    color: #26581c;
    margin-bottom: 1px;
}

.h4-cv {
    font-weight: 300
}

/* Subheading and Small Text */
.subheading {
    font-size: 1em;
    /* font-weight: bold; */
    color: #333;
    margin-bottom: 1px;
}

.about-text {
    font-size: 1.5em;
    color: #666;
    margin-bottom: 0px;
}

.small-text {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
}

/* Authors Styling */
.publication-authors {
    font-size: 0.9em;
    color: #404040;
    margin-bottom: 0px;
    font-weight: 300;
}

/* Title Styling */
.publication-title {
    font-size: 1.1em;
    font-weight: 400;
    margin-bottom: 0px;
}

.publication-title a {
    color: #26581c;
    text-decoration: none;
}

.publication-title a:hover {
    text-decoration: underline;
}

/* Metadata Styling */
.publication-metadata {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

.text-primary {
    color: #000000;
}

/* Adjusting Spacing Between Sections */
#publications .experience-item {
    margin-bottom: 30px;
}

/* Experience Item Styling */
.experience-item {
    margin-bottom: 30px; /* More space between different experiences */
}

.grouped-content {
    border-left: 2px solid #26581c; /* Vertical line color */
    padding-left: 15px; /* Space between the line and the text */
    margin-bottom: 30px; /* Space between each item */
    max-width: 100%; /* Prevents overflow */
}

/* Media Section */
.media-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.image-container, .video-container {
    flex: 1 1 48%;
    text-align: center;
    background-color: #fff;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

iframe {
    width: 100%;
    height: 315px;
    border: none;
}

/* Contact Section */
#contact p {
    font-size: 1.2em;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

footer p {
    font-size: 1em;
}

/* Mobile-Responsive Adjustments using Media Queries */
@media (max-width: 768px) {
    /* Make the container take up more space on small screens */
    .container {
        width: 95%;
        padding: 10px;
    }

    /* Adjust the font sizes for smaller screens */
    h2 {
        font-size: 1.6em;
    }

    h3 {
        font-size: 1.4em;
    }

    h4 {
        font-size: 1.2em;
    }

    .subheading {
        font-size: 1em;
    }

    .small-text {
        font-size: 0.85em;
    }

    /* Make the header stack vertically on small screens */
    .header-content {
        flex-direction: column;
        text-align: center;
        width: 100%; /* Ensure it fits within the screen */
    }

    /* Ensure text in grouped content doesn't get too close to the vertical line */
    .grouped-content {
        padding-left: 10px;
    }

    /* Adjust margins and padding for a tighter, mobile-friendly layout */
    .experience-item {
        margin-bottom: 20px;
    }

    /* Social Icons */
    .social-icon {
        font-size: 1.3em;
        margin-right: 10px;
    }
}

@media (max-width: 600px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }

    nav ul li a {
        display: block;
        width: 100%;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    /* Further reduce font sizes for smaller mobile screens */
    h2 {
        font-size: 1.4em;
    }

    h3 {
        font-size: 1.2em;
    }

    h4 {
        font-size: 1em;
    }

    .subheading {
        font-size: 0.9em;
    }

    .small-text {
        font-size: 0.8em;
    }

    /* Adjust image size */
    .img-profile {
        max-width: 100px;
    }

    /* Reduce padding for mobile */
    .grouped-content {
        padding-left: 5px;
    }

    /* Reduce spacing between experience items */
    .experience-item {
        margin-bottom: 15px;
    }
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /*Reduced min width to prevent overflow*/
    grid-gap: 10px;
    padding: 10px;
    overflow: hidden; /* Ensure no overflow */
}

.video-container, .image-container {
    border: 1px solid rgba(70, 66, 66, 1); /* Faint border */
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%; /* Prevent overflow from the container */
}

.video-grid video {
    max-width: 100%; /* Prevent overflow */
    height: auto;
}

.image-container img {
    max-width: 65%; /* Make image fully responsive */
    height: auto;
}

.video-title, .image-title {
    text-align: center;
    margin-top: 5px;
    max-width: 100%; /* Ensure title does not overflow */
}