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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
    color: #333;
    font-size: 16px; /* Base font size */
}

/* Responsive typography */
@media (max-width: 767px) {
    body {
        font-size: 18px; /* Larger base font size for mobile */
        line-height: 1.7; /* Slightly more line height for better readability */
    }
    
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }
    p, li, a, span {
        font-size: 1.05rem;
    }
    
    .nav a {
        font-size: 1.1rem; /* Slightly larger nav links */
    }
}

/* Grid Layout */
.grid-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.left-sidebar,
.right-sidebar,
.main-content {
    width: 100%;
}

@media (min-width: 768px) {
    .grid-container {
        display: grid;
        grid-template-columns: 250px 1fr 250px;
        grid-template-areas: "left main right";
        padding: 40px;
    }

    .left-sidebar {
        grid-area: left;
    }

    .main-content {
        grid-area: main;
    }

    .right-sidebar {
        grid-area: right;
    }
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #4a4a4a 0%, #666666 50%, #4a4a4a 100%);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.logo {
    text-decoration: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #ff8c42;
}

/* Navigation */
.nav {
    display: flex;
    gap: 30px;
    position: relative;
}

.nav a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
    padding: 10px 0;
}

.nav a.active,
.nav a:hover {
    color: #ff8c42;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
    overflow: hidden;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-content {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    display: block;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
    color: #ff8c42;
}

/* Ensure proper spacing for dropdown items */
.dropdown-content a:first-child {
    padding-top: 16px;
}

.dropdown-content a:last-child {
    padding-bottom: 16px;
}

/* Active state for dropdown items */
.dropdown-content a.active {
    color: #ff8c42;
    font-weight: 500;
    background-color: #f9f9f9;
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .dropdown-content {
        position: static;
        box-shadow: none;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: transparent;
        padding-left: 20px;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        color: white;
        padding: 8px 0;
    }
}

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

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-content {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.section-content p {
    margin-bottom: 1em;
}

.section-content ul {
    list-style: none;
    padding-left: 20px;
}

.section-content li {
    margin-bottom: 8px;
    position: relative;
}

.section-content li:before {
    content: "•";
    color: #666;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.highlight-section {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
    border-left: 4px solid #ff8c42;
}

.highlight-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Project Images */
.project-image-container {
    text-align: center;
    margin: 2.5rem 0;
}

.project-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.image-caption {
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.5;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .project-image {
        max-width: 100%;
    }
    
    /* Ensure text containers don't get too wide on mobile */
    .main-content, .left-sidebar, .right-sidebar {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .nav {
        gap: 15px;
    }
    
    .nav a {
        font-size: 16px;
    }
}

/* Hero Image */
.hero-image-container {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    padding: 2rem;
    color: white;
}

.hero-overlay h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .hero-overlay h1 {
        font-size: 2rem;
    }
}

/* About Page */
.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.about-image {
    max-width: 100%;
    height: auto;
}

.about-text {
    flex: 1;
}

.about-image-container {
    text-align: center;
}

@media (min-width: 768px) {
    .about-content {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .about-image-container {
        flex: 0 0 300px;
        margin-right: 40px;
    }
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #004999;
    text-decoration: underline;
}

/* Page-specific styles */
.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.home-logo {
    color: white;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
}

.page-title {
    text-align: center;
    font-size: 36px;
    font-weight: 400;
    color: #333;
    margin-bottom: 60px;
}

/* Responsive adjustments for main content */
@media (max-width: 768px) {
    .main {
        padding: 40px 20px;
    }
    
    .page-title {
        font-size: 28px;
        margin-bottom: 40px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

/* Work Grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.work-card {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    height: 250px; /* Fixed height for all cards */
    background-color: #f5f5f5;
    background-size: cover;
    background-position: center top; /* Anchor image to top */ 
   background-repeat: no-repeat;
    display: flex;
    align-items: flex-start; /* Align content to top */
    overflow: hidden; /* Ensure content doesn't overflow */
    justify-content: center; /* Center content horizontally */
}

.card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease;
    z-index: 2; /* Ensure title is above the image */
}

.work-card:hover .card-title {
    background: rgba(0, 0, 0, 0.9);
}

/* Adjust the RNA Quantification card specifically for its containered image */
.work-card[href="rna-quantification.html"] .card-image {
    background-color: #f5f5f5;
    background-size: contain;
    background-position: center top; /* Keep image anchored to top */
    background-repeat: no-repeat;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .work-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        padding: 0 15px;
    }
    
    .card-title {
        padding: 12px 15px;
        font-size: 1rem;
    }
}
