/* --- 1. VARIABLES --- */
:root {
    --overlay-bg: rgba(0, 0, 0, 0.95);
    --header-bg: rgba(0, 0, 0, 0.85);
    --footer-bg: #111111;
    
    --text-color: #ffffff;      /* Main white text */
    --text-white: #ffffff;      /* Alias for white */
    --footer-text: #b0b0b0;     /* Grey text for footer */
    
    --border-color: rgba(255, 255, 255, 0.3);
    --hover-color: #ff3b30;     /* Red Accent */
}

/* --- 2. BODY & LAYOUT --- */
body {
    font-family: "El Messiri", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f4f4f4;
    
    /* Sticky Footer Fix */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    
    padding-top: 80px; 
}

/* Push footer to bottom */
main, .main-content {
    flex: 1;
}

.body-no-scroll {
    overflow: hidden;
}

/* --- 3. HEADER STYLES --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--hover-color);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
}

.logo-dot {
    color: var(--hover-color);
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.main-navigation a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--hover-color);
    transition: width 0.3s ease;
}

.main-navigation a:hover {
    color: var(--text-color);
}

/* Triggers the line on hover AND keeps it on the active WordPress page */
.main-navigation a:hover::after,
.main-navigation li.current-menu-item a::after,
.main-navigation li.current_page_item a::after {
    width: 100%;
}

/* --- NEW: Header Tools & Auth Buttons --- */
.header-tools {
    display: flex;
    align-items: center;
    gap: 20px; /* Space between Search icon and Buttons */
}

.header-tools .js-search-trigger {
    color: var(--text-color);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s;
    padding: 10px;
}

.header-tools .js-search-trigger:hover {
    color: var(--hover-color);
    transform: scale(1.1);
}

/* Button Container */
.auth-buttons {
    display: flex;
    gap: 15px;
}

/* Shared Button Styles */
.auth-btn {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 25px;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: "El Messiri", sans-serif;
}

/* Login Button (Ghost/Outline) */
.btn-login {
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
}

.btn-login:hover {
    border-color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

/* Register Button (Solid Red) */
.btn-register {
    background-color: var(--hover-color);
    color: var(--text-color);
    border: 1px solid var(--hover-color);
}

.btn-register:hover {
    background-color: transparent;
    color: var(--hover-color);
    border: 1px solid var(--hover-color); 
}

/* --- 4. SEARCH OVERLAY --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 9999;
    
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: center; 
    
    padding-top: 150px;
    box-sizing: border-box;
    display: none; 
}

.search-overlay.search-overlay--active {
    display: flex;
}

.search-overlay .container {
    width: 80%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
}

.search-overlay input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 3rem;
    font-family: inherit;
    font-weight: 300;
    margin: 0 30px;
}

.search-overlay i {
    color: var(--text-color);
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.search-overlay .search-overlay__close:hover {
    color: var(--hover-color);
    transform: rotate(90deg);
}

#search-overlay__results {
    width: 80%;
    max-width: 1100px;
    margin-top: 30px;
    color: var(--text-color);
    font-size: 1.2rem;
    overflow-y: auto; 
    max-height: calc(100vh - 250px);
}

.spinner-loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--text-color);
    animation: spin 1s ease-in-out infinite;
    margin: 60px auto;
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 5. FOOTER STYLES --- */

/* Keeps the active footer link red and indented */
.links-col li.current-menu-item a {
    color: var(--hover-color);
    transform: translateX(5px);
}

.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 80px 0 0 0;
    font-family: "El Messiri", sans-serif;
    border-top: 1px solid var(--border-color);
    margin-top: auto; 
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    margin-bottom: 60px;
}

.footer-col h4 {
    color: var(--text-white);
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 30px;
    height: 2px;
    background-color: var(--hover-color);
}

.footer-logo {
    color: var(--text-white);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-logo i, .footer-logo span {
    color: var(--hover-color);
}

.brand-col p {
    line-height: 1.6;
    margin-bottom: 25px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: var(--text-white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--hover-color);
    transform: translateY(-3px);
}

.links-col ul, .contact-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-col li {
    margin-bottom: 12px;
}

.links-col a {
    color: var(--footer-text);
    text-decoration: none;
    transition: 0.3s;
    display: inline-block;
}

.links-col a:hover {
    color: var(--hover-color);
    transform: translateX(5px);
}

.contact-col li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-col i {
    color: var(--hover-color);
    margin-top: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    background-color: #0d0d0d;
    width: 100%;
}

/* --- 6. RESPONSIVE --- */
@media (max-width: 900px) {
    .main-navigation { display: none; } /* Hide menu on tablet/mobile */
    
    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* Hide Auth Buttons on small screens (optional) */
    .auth-buttons {
        display: none; 
    }
}

/* --- 7. HERO SECTION --- */
.hero-section {
    position: relative;
    width: 100%;
    /* Exactly the viewport height minus the 80px header */
    height: calc(100vh - 80px); 
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distributes space: content middle, cards bottom */
    align-items: center;
    
    background-image: url('https://images.unsplash.com/photo-1562774053-701939374585?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: hidden; /* Strictly prevents scrollbars */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.85));
    z-index: 1;
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    
    /* Flex-grow allows this div to take up all remaining middle space */
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-subtitle {
    color: var(--hover-color);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

.hero-title {
    color: var(--text-color);
    font-size: 3.8rem;
    line-height: 1.1;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.hero-title .highlight {
    color: var(--hover-color);
}

.hero-description {
    color: #e0e0e0;
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 35px;
    font-weight: 300;
}

/* Hero Buttons */
.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    text-decoration: none;
    padding: 12px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: "El Messiri", sans-serif;
}

.btn-primary {
    background-color: var(--hover-color);
    color: var(--text-color);
    border: 2px solid var(--hover-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--hover-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    border-color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- HERO FEATURE CARDS (Quick Links) --- */
.hero-features {
    position: relative; /* Changed from absolute */
    width: 100%;
    z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 20px 0 30px 0; /* Slightly tighter padding to save space on small screens */
}

.features-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px 15px; /* Slightly reduced padding */
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(0);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--hover-color);
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.card-icon {
    font-size: 2rem;
    color: var(--hover-color);
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.feature-card:hover .card-icon {
    transform: scale(1.1);
}

.feature-card h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.feature-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #b0b0b0;
}


/* --- 8. ABOUT US SECTION --- */
.about-section {
    background-color: #ffffff; /* Crisp white to contrast against your #f4f4f4 body */
    padding: 100px 0;
    overflow: hidden; /* Prevents shadow clipping */
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center; /* Centers content vertically between the two columns */
}

/* --- IMAGE COLUMN --- */
.about-image-col {
    position: relative;
    padding-right: 20px; /* Space for the floating badge */
}

.image-wrapper {
    position: relative;
    z-index: 2;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: block;
    object-fit: cover;
}

/* Decorative red border shape behind the image */
.about-image-col::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% - 20px);
    height: 100%;
    border: 3px solid var(--hover-color);
    border-radius: 20px;
    z-index: 1;
}

/* Premium Floating Badge */
.image-experience-badge {
    position: absolute;
    bottom: -30px;
    right: -10px;
    background-color: var(--hover-color);
    color: var(--text-color);
    padding: 25px 35px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(255, 59, 48, 0.3);
    text-align: center;
    z-index: 3;
}

.image-experience-badge .years {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    font-family: inherit;
}

.image-experience-badge .text {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- TEXT COLUMN --- */
.section-subtitle {
    color: var(--hover-color);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 15px;
}

.section-title {
    color: #111111; /* Dark text for light background */
    font-size: 3rem;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 25px 0;
}

.section-title .highlight-text {
    color: var(--hover-color);
}

.section-description {
    color: #555555;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    font-weight: 400;
}

/* Button spacing adjustment */
.btn-about {
    display: inline-block;
    margin-top: 15px;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1024px) {
    .about-container {
        gap: 50px;
    }
    .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 900px) {
    /* Stacks columns vertically on mobile/tablet */
    .about-container {
        grid-template-columns: 1fr;
        gap: 80px; /* Extra gap to clear the floating badge */
        text-align: center;
    }

    .about-image-col {
        padding-right: 0;
        margin: 0 20px; /* Ensures the offset border doesn't touch screen edges */
    }

    .image-experience-badge {
        bottom: -25px;
        right: 10px;
        padding: 20px 25px;
    }

    .image-experience-badge .years {
        font-size: 2.2rem;
    }
}

/* --- 9. INTERNAL PAGES (page.php) --- */

/* Page Banner */
.page-banner {
    position: relative;
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 60px;
}

.page-banner__bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
}

.page-banner__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--header-bg), rgba(0,0,0,0.4));
    z-index: 2;
}

.page-banner__content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.page-banner__title {
    color: var(--text-color);
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Layout Container */
.page-layout-container {
    max-width: 1200px;
    margin: 0 auto 100px auto;
    padding: 0 40px;
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

/* Sidebar Menu */
.page-sidebar {
    width: 300px;
    flex-shrink: 0;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.sidebar-title {
    margin: 0;
    background-color: var(--hover-color);
    padding: 20px;
    text-align: center;
}

.sidebar-title a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #eeeeee;
}

.sidebar-menu li:last-child {
    border-bottom: none;
}

.sidebar-menu li a {
    display: block;
    padding: 18px 25px;
    color: #555555;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:hover {
    background-color: #f9f9f9;
    color: var(--hover-color);
    padding-left: 30px;
}

/* WordPress adds this class automatically to the active page! */
.sidebar-menu li.current_page_item a {
    background-color: #fdfdfd;
    color: var(--hover-color);
    border-left: 4px solid var(--hover-color);
    font-weight: 700;
}

/* Main Content Area */
.page-content {
    flex-grow: 1;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.page-breadcrumb {
    margin-bottom: 25px;
}

.page-breadcrumb a {
    color: #888;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.3s;
}

.page-breadcrumb a:hover {
    color: var(--hover-color);
}

/* Generic Content Formatting (For WP Editor) */
.generic-content p {
    color: #444;
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.generic-content h2 {
    color: #111;
    font-size: 2.2rem;
    margin: 40px 0 20px 0;
    position: relative;
    padding-bottom: 10px;
}

.generic-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--hover-color);
}

.generic-content ul {
    margin-bottom: 25px;
    padding-left: 20px;
}

.generic-content ul li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .page-layout-container {
        flex-direction: column;
    }
    .page-sidebar {
        width: 100%;
    }
}

/* --- 10. PAGINATION --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    margin-bottom: 20px;
    font-family: "El Messiri", sans-serif;
}

/* Base style for all numbers and buttons */
.pagination .page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background-color: #ffffff;
    color: #333333;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px; /* Slightly rounded corners */
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

/* Hover effect for clickable links */
.pagination a.page-numbers:hover {
    background-color: var(--hover-color);
    color: var(--text-white);
    border-color: var(--hover-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(255, 59, 48, 0.2); /* Soft red shadow */
}

/* The Active / Current Page */
.pagination .page-numbers.current {
    background-color: var(--hover-color);
    color: var(--text-white);
    border-color: var(--hover-color);
    cursor: default;
}

/* Specific styles for Next / Prev buttons */
.pagination .prev, 
.pagination .next {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

/* --- 11. SINGLE POST (single.php) --- */
.post-meta-box {
    background-color: #f9f9f9;
    border-left: 4px solid var(--hover-color);
    padding: 15px 25px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 10px 10px 0;
    font-size: 0.95rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

.post-meta-box .back-to-blog {
    color: var(--hover-color);
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.post-meta-box .back-to-blog:hover {
    transform: translateX(-5px);
}

.post-meta-box .meta-details {
    color: #666;
    font-weight: 500;
}

.post-meta-box .meta-details a {
    color: var(--hover-color);
    text-decoration: none;
}

.post-meta-box .meta-details a:hover {
    text-decoration: underline;
}

/* Responsive Fix for Meta Box */
@media (max-width: 768px) {
    .post-meta-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .post-meta-box .meta-details i {
        margin-left: 0 !important;
        margin-right: 5px;
    }
    
    .post-meta-box .meta-details {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* --- 12. BLOG PAGE GRID (index.php) --- */
.blog-grid-container {
    max-width: 1200px;
    margin: 0 auto 80px auto;
    padding: 0 40px;
}

.blog-grid {
    display: grid;
    /* Automatically creates columns that are at least 320px wide */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

/* The Card */
.blog-card {
    background-color: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Image Wrapper */
.blog-card__image {
    width: 100%;
    height: 220px;
    background-color: #f4f4f4;
    overflow: hidden;
}

.blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card__image img {
    transform: scale(1.08); /* Zoom effect on hover */
}

/* Content Area */
.blog-card__content {
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Pushes the button to the bottom if text is short */
}

/* Meta Data (Date & Category) */
.blog-card__meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
    font-family: sans-serif;
}

.blog-card__meta i {
    color: var(--hover-color);
}

.blog-card__meta a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.blog-card__meta a:hover {
    color: var(--hover-color);
}

/* Title */
.blog-card__title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin: 0 0 15px 0;
}

.blog-card__title a {
    color: #111111;
    text-decoration: none;
    transition: color 0.3s;
}

.blog-card__title a:hover {
    color: var(--hover-color);
}

/* Excerpt */
.blog-card__excerpt {
    color: #555555;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1; /* Fills empty space */
}

/* Read More Link */
.blog-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hover-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: gap 0.3s ease, color 0.3s ease;
}

.blog-card__btn:hover {
    gap: 15px; /* Arrow slides to the right on hover */
    color: #cc2e25; /* Slightly darker red */
}

/* --- 13. HOMEPAGE RECENT NEWS --- */
.recent-news-section {
    padding: 100px 0;
    /* Uses a slightly off-white background to alternate with the white About section */
    background-color: #f4f4f4; 
}

.recent-news-header {
    text-align: center;
    margin-bottom: 50px;
}

.recent-news-title {
    color: #111111;
    font-size: 2.8rem;
    line-height: 1.2;
    font-weight: 700;
    margin: 0;
}

.recent-news-title .highlight-text {
    color: var(--hover-color);
}

.btn-center {
    text-align: center;
    margin-top: 20px;
}


/* --- 14. HOMEPAGE EVENTS --- */
.events-section {
    padding: 100px 0;
    background-color: #ffffff; /* Use #f4f4f4 if placed directly below the white About section */
}

.events-container {
    max-width: 800px; /* Kept narrow so the list looks elegant and readable */
    margin: 0 auto;
    padding: 0 40px;
}

.events-list {
    margin-top: 50px;
}

/* Event List Item */
.event-summary {
    display: flex;
    align-items: center;
    gap: 30px;
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    border-left: 4px solid transparent;
}

.event-summary:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-left-color: var(--hover-color); /* Red line slides in on hover */
}

/* The Circular Date Badge */
.event-summary__date {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--hover-color);
    color: var(--text-white);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(255, 59, 48, 0.3);
    transition: transform 0.3s;
}

.event-summary:hover .event-summary__date {
    transform: scale(1.05);
}

.event-summary__month {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
}

.event-summary__day {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

/* Event Content */
.event-summary__content {
    flex-grow: 1;
}

.event-summary__title {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
}

.event-summary__title a {
    color: #111;
    text-decoration: none;
    transition: color 0.3s;
}

.event-summary__title a:hover {
    color: var(--hover-color);
}

.event-summary__content p {
    color: #666;
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Simple Text Link */
.btn-text {
    color: var(--hover-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Responsive fix for mobile */
@media (max-width: 600px) {
    .event-summary {
        flex-direction: column;
        text-align: center;
    }
}

/* --- 15. PROJECTS PORTFOLIO ARCHIVE (1-COLUMN LIST) --- */
.portfolio-container {
    max-width: 1200px; 
    margin: 0 auto 80px auto;
    padding: 0 40px;
}

/* Replaced the grid with a vertical flex column */
.project-portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 100px; /* Massive spacing between projects for a premium feel */
    margin-bottom: 80px;
}

/* The Layout: Image on one side, text on the other */
.portfolio-item {
    display: flex;
    flex-direction: row;
    align-items: center; /* Vertically centers text with the image */
    gap: 60px;
}

/* THE MAGIC: Every 2nd project automatically swaps sides! */
.portfolio-item:nth-child(even) {
    flex-direction: row-reverse;
}

/* Image Wrapper (Takes up 55% of the row) */
.portfolio-item__image-wrapper {
    position: relative;
    width: 55%; 
    flex-shrink: 0;
    aspect-ratio: 16 / 10;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    display: block;
}

.portfolio-item__image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Red Glass Hover Overlay (Untouched!) */
.portfolio-item__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 59, 48, 0.85); 
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.overlay-text {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.portfolio-item__image-wrapper:hover img {
    transform: scale(1.05); 
}

.portfolio-item__image-wrapper:hover .portfolio-item__overlay {
    opacity: 1; 
}

.portfolio-item__image-wrapper:hover .overlay-text {
    transform: translateY(0); 
}

/* Text Wrapper (Takes up remaining 45%) */
.portfolio-item__info {
    width: 45%;
    padding: 0;
}

.portfolio-item__title {
    margin: 0 0 15px 0;
    font-size: 2.5rem; /* Made the title bigger since there is more room! */
    line-height: 1.1;
}

.portfolio-item__title a {
    color: #111111;
    text-decoration: none;
    transition: color 0.3s;
}

.portfolio-item__title a:hover {
    color: var(--hover-color);
}

.portfolio-item__excerpt {
    color: #555555;
    font-size: 1.15rem;
    line-height: 1.7;
    margin: 0;
}

/* Mobile Responsiveness: Stacks everything perfectly on small screens */
@media (max-width: 900px) {
    .portfolio-item, 
    .portfolio-item:nth-child(even) {
        flex-direction: column;
        gap: 30px;
    }
    
    .portfolio-item__image-wrapper {
        width: 100%;
    }
    
    .portfolio-item__info {
        width: 100%;
        text-align: center; /* Centers text on mobile */
    }
}

/* --- 16. SINGLE PROJECT PAGE --- */

/* Massive Hero Section */
.project-hero {
    position: relative;
    width: 100%;
    height: 60vh; /* Takes up 60% of the screen height */
    min-height: 450px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: flex-end; /* Pushes text to the bottom */
    padding-bottom: 60px;
    box-sizing: border-box;
}

.project-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient goes from clear at the top to dark at the bottom */
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.9) 100%);
    z-index: 1;
}

.project-hero__content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 40px;
}

.project-hero__subtitle {
    color: var(--hover-color);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: block;
    margin-bottom: 10px;
}

.project-hero__title {
    color: var(--text-color);
    font-size: 4.5rem; /* Massive title */
    line-height: 1.1;
    margin: 0;
    font-weight: 700;
}

/* Two-Column Layout */
.project-layout-container {
    max-width: 1200px;
    margin: 60px auto 100px auto;
    padding: 0 40px;
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.project-main-content {
    flex-grow: 1;
    width: 65%;
}

/* Sticky Sidebar */
.project-sidebar {
    width: 35%;
    flex-shrink: 0;
    position: sticky; /* Makes it float as you scroll! */
    top: 100px; /* Stops 100px from the top of the screen */
}

.project-sidebar__card {
    background-color: #f9f9f9;
    border-radius: 15px;
    padding: 35px 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.03);
    border-top: 5px solid var(--hover-color);
}

.project-sidebar__card h3 {
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    color: #111;
}

.project-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.project-sidebar__list li {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: flex-start;
}

.project-sidebar__list i {
    font-size: 1.5rem;
    color: var(--hover-color);
    margin-top: 5px;
}

.project-sidebar__list strong {
    display: block;
    font-size: 0.95rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.project-sidebar__list span {
    font-size: 1.15rem;
    color: #222;
    font-weight: 600;
}

.project-sidebar__action {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #ddd;
}

/* Responsive Fix */
@media (max-width: 900px) {
    .project-layout-container {
        flex-direction: column;
    }
    
    .project-main-content,
    .project-sidebar {
        width: 100%;
    }
    
    .project-hero__title {
        font-size: 3rem;
    }
}

/* --- 17. PROFESSORS ARCHIVE (FACULTY DIRECTORY) --- */
.professor-grid-container {
    max-width: 1200px;
    margin: 0 auto 80px auto;
    padding: 0 40px;
}

.professor-grid {
    display: grid;
    /* Cards will resize beautifully, staying around 280px wide */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

/* The Profile Card */
.professor-card {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border-bottom: 4px solid transparent; /* Hidden by default */
    transition: all 0.3s ease;
}

.professor-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    border-bottom-color: var(--hover-color); /* Red line appears on hover */
}

/* Circular Profile Image */
.professor-card__image {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px auto;
    border-radius: 50%; /* Magic circle CSS! */
    overflow: hidden;
    border: 4px solid #f4f4f4;
    transition: border-color 0.3s;
}

.professor-card:hover .professor-card__image {
    border-color: var(--hover-color); /* Image border turns red on hover */
}

.professor-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Prevents the image from stretching! */
}

/* Professor Name & Excerpt */
.professor-card__name {
    font-size: 1.5rem;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.professor-card__name a {
    color: #111111;
    text-decoration: none;
    transition: color 0.3s;
}

.professor-card__name a:hover {
    color: var(--hover-color);
}

.professor-card__excerpt {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}


/* --- 18. HOMEPAGE FEATURED PROJECTS (DARK MODE) --- */
.featured-projects-section {
    padding: 100px 0;
    background-color: #1a1a1a; /* Sleek dark background */
    border-top: 1px solid rgba(255,255,255,0.05);
}

.featured-projects-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.hp-projects-grid {
    display: grid;
    /* Adapts perfectly: 2 columns on desktop, 1 on mobile */
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

/* The Image Card */
.hp-project-card {
    position: relative;
    height: 400px; /* Tall, premium cards */
    border-radius: 15px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.hp-project-card__bg {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.7s ease;
}

/* Gradient overlay to make text readable */
.hp-project-card__overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.1) 100%);
    transition: background 0.5s ease;
}

.hp-project-card__content {
    position: absolute;
    bottom: 0; 
    left: 0; 
    width: 100%;
    padding: 40px 35px;
    color: var(--text-white);
    z-index: 2;
}

.hp-project-card__content h3 {
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    line-height: 1.2;
    font-weight: 700;
}

.hp-project-card__content p {
    margin: 0;
    font-size: 1.05rem;
    color: var(--hover-color); /* Red text by default */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease, color 0.3s ease;
}

/* --- THE HOVER MAGIC --- */
.hp-project-card:hover .hp-project-card__bg {
    transform: scale(1.08); /* Slow zoom */
}

.hp-project-card:hover .hp-project-card__overlay {
    /* Gradient turns a deep, transparent red on hover */
    background: linear-gradient(to top, rgba(255, 59, 48, 0.9) 0%, rgba(0,0,0,0.3) 100%);
}

.hp-project-card:hover .hp-project-card__content p {
    gap: 15px; /* Arrow pushes to the right */
    color: var(--text-white); /* Text turns white on top of the red background */
}

/* Mobile Fixes */
@media (max-width: 768px) {
    .hp-projects-grid {
        grid-template-columns: 1fr;
    }
    .hp-project-card {
        height: 350px;
    }
}


/* --- 19. LIVE SEARCH STYLES --- */
.search-results-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    width: 100%;
}

.search-overlay__section-title {
    color: var(--hover-color);
    font-size: 1.5rem;
    margin: 0 0 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

/* Kills the default blue links and bullet points */
.search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-list li {
    margin-bottom: 15px;
}

.search-list a {
    color: var(--text-color); /* White text */
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s;
}

.search-list a:hover {
    color: var(--hover-color); /* Turns red on hover */
}

/* Style for the "No results found" text */
.search-col p {
    color: #888;
    font-style: italic;
    font-size: 1.1rem;
}

/* Mobile Fix */
@media (max-width: 900px) {
    .search-results-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}