/* style.css */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }

body { display: flex; flex-direction: column; min-height: 100vh; color: #333; background-color: #bc2f27; }

/* Header */
header { background-color: #bc2f27; color: white; padding: 1.5rem 5%; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.logo-container a { display: flex; align-items: center; gap: 15px; text-decoration: none; color: white; }
.logo-container h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; }
.logo-container p { font-size: 0.8rem; color: #f0f0f0; }

/* Navigation */
nav ul { list-style: none; display: flex; gap: 2rem; }
nav a { color: white; text-decoration: none; font-weight: 500; transition: color 0.3s; }
nav a:hover { color: #f9c2c0; }

/* Main Content */
main { flex: 1; padding: 4rem 10%; margin: 0; width: 100%; background-color: #f9f9f9; }
.hero { text-align: center; margin-bottom: 3rem; }
.hero h1 { color: #bc2f27; font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; color: #555; }

/* Search Bar */
.search-container { display: flex; justify-content: center; margin-bottom: 2rem; }
.search-container input { width: 100%; max-width: 500px; padding: 12px 20px; font-size: 1rem; border: 2px solid #ccc; border-radius: 25px; outline: none; transition: border-color 0.3s; }
.search-container input:focus { border-color: #bc2f27; }

/* Section Titles (for Events) */
.section-title { color: #333; font-size: 1.8rem; margin: 2rem 0 1rem 0; border-bottom: 2px solid #bc2f27; padding-bottom: 0.5rem; }

/* Cards & Grids */
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.card { background: white; border-radius: 8px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-top: 4px solid #bc2f27; transition: transform 0.2s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-5px); }

/* Card Images - Supports 'img' or 'avatar' attributes */
.card-img-container { width: 100%; height: 180px; margin-bottom: 1rem; border-radius: 4px; overflow: hidden; background-color: #eee; display: flex; align-items: center; justify-content: center; }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem auto; display: block; }

.card h3 { color: #bc2f27; margin-bottom: 0.5rem; font-size: 1.3rem; }
.card .meta { font-size: 0.9rem; color: #777; margin-bottom: 1rem; font-style: italic; }
.card p { line-height: 1.5; margin-bottom: 1rem; font-size: 0.95rem; flex-grow: 1; }

/* Tags & Links */
.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tag { background: #eee; padding: 0.3rem 0.6rem; border-radius: 4px; font-size: 0.8rem; color: #555; }
.card-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: auto; border-top: 1px solid #eee; padding-top: 1rem; }
.card-links a { font-size: 0.9rem; color: #4a90e2; text-decoration: none; font-weight: 500; }
.card-links a:hover { text-decoration: underline; }

/* Footer */
footer { background-color: #bc2f27; color: white; padding: 3rem 5%; display: flex; flex-wrap: wrap; gap: 3rem; }
.footer-section { flex: 1; min-width: 300px; }
.footer-section h3 { border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 0.5rem; margin-bottom: 1rem; }
.footer-section p, .footer-section a { color: #e0e0e0; text-decoration: none; line-height: 1.6; }
.contact-list { list-style: none; }
.contact-list li { margin-bottom: 1rem; }

/* --- Professional Landing Page Additions --- */

.home-main {
    padding: 0; /* Remove default padding for full-width hero */
    max-width: 100%; 
}

.hero-professional {
    background: linear-gradient(135deg, #bc2f27 0%, #8a1f18 100%);
    color: white;
    padding: 6rem 5%;
    text-align: center;
    border-bottom: 5px solid #333;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-professional h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-professional .highlight {
    color: #f9c2c0; /* Soft contrast color */
}

.hero-professional p {
    font-size: 1.2rem;
    color: #f0f0f0;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: white;
    color: #bc2f27;
    border: 2px solid white;
}

.btn-primary:hover {
    background-color: transparent;
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Make secondary button dark if used outside the hero */
.featured-section .btn-secondary, .latest-publications .btn-secondary {
    color: #bc2f27;
    border-color: #bc2f27;
}
.featured-section .btn-secondary:hover, .latest-publications .btn-secondary:hover {
    background-color: #bc2f27;
    color: white;
}

/* Pillars Section */
.research-pillars {
    padding: 5rem 10%;
    background-color: white;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pillar-card {
    text-align: center;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
    border-top: 4px solid #bc2f27;
}

.pillar-card h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 1rem;
}

/* Featured Section */
.featured-section {
    padding: 5rem 5%;
    background-color: #f4f4f4;
}
.featured-section .section-title {
    max-width: 1200px;
    margin: 0 auto 1rem auto;
}
.featured-section p, .featured-section .grid-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Latest Publications Section */
.latest-publications {
    padding: 5rem 5%;
    background-color: white; /* Contrasts with the grey of the featured projects */
}
.latest-publications .section-title {
    max-width: 1200px;
    margin: 0 auto 1rem auto;
}
.latest-publications p, .latest-publications .grid-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}


/* --- Animated Hamburger Button Styles --- */
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    flex-direction: column;
    gap: 6px; /* Spacing between bars */
    z-index: 100; /* Ensures it stays above the menu */
}

/* The three lines */
.menu-toggle .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Animation: When the 'active' class is added...
   - The top bar rotates down 45 degrees
   - The middle bar fades away
   - The bottom bar rotates up 45 degrees
*/
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* =========================================
   RESPONSIVE DESIGN (Tablets & Mobile)
   ========================================= */
@media (max-width: 768px) {
    
    /* --- Header & Navigation --- */
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 5%;
    }

    .menu-toggle {
        display: flex; /* Show the hamburger menu as a flex container */
    }

    .nav-menu {
        width: 100%;
        display: none; /* Hide links by default on mobile */
        margin-top: 1rem;
    }

    .nav-menu.active {
        display: block; /* Show links when toggled */
        animation: fadeIn 0.3s ease;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
    }

    .nav-menu a {
        display: block;
        padding: 1rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* --- Hero Section Typography --- */
    .hero-professional {
        padding: 4rem 5%;
    }
    
    .hero-professional h1 {
        font-size: 2.2rem; /* Shrink giant text */
    }

    .hero-professional p {
        font-size: 1rem;
    }

    /* --- Buttons --- */
    .hero-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 1rem;
    }

    .btn {
        width: 100%; /* Make buttons full width for easy tapping */
        text-align: center;
    }

    /* Pillars Section */
    .research-pillars {
        padding: 5rem 10%;
        background-color: white;
    }

    /* --- Grids & Cards --- */
    .grid-container, .pillars-grid {
        /* Force single column on small screens to prevent overflow */
        grid-template-columns: 1fr; 
    }

    .search-container input {
        border-radius: 8px; /* Slightly softer corners for mobile inputs */
    }

    /* --- Footer --- */
    footer {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem 5%;
        text-align: center; /* Center footer text on mobile */
    }
    
    .contact-list li {
        justify-content: center; /* Center footer icons */
    }
}

/* Simple animation for the mobile menu opening */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}