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

body { 
    font-family: 'Inter', sans-serif; 
    background-color: #ffffff;
    color: #333333; 
    display: flex;
    height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    width: 300px;
    background-color: #0a0e27; /* Deep Navy */
    color: #ffffff;
    height: 100vh;
    padding: 20px 35px;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
    box-sizing: border-box;
    overflow-y: auto;                  /* Sprout a scrollbar ONLY if content overflows the screen */
    -webkit-overflow-scrolling: touch; /* Keeps scrolling silky smooth on iOS devices */
}

.profile-container {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.profile-pic {
    width: 140px;          /* Perfect, elegant size for the sidebar width */
    height: 140px;         /* Must match the width for a perfect circle */
    border-radius: 50%;    /* This creates the clean circular crop */
    object-fit: cover;     /* CRITICAL: Prevents your face from stretching if the photo isn't a perfect square */
    border: 2px solid rgba(255, 255, 255, 1); /* Adds a sophisticated, subtle frame against the navy background */
}

.sidebar h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    line-height: 1.1;
    letter-spacing: 1px;
}

.bio {
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 25px;
}

.nav-links { list-style: none; margin-top: 35px; flex-grow: 1; }
.nav-links li { margin-bottom: 1px; }
.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    position: relative;
    padding-bottom: 4px;
    display: inline-block;
}

/* Underline effect on hover/active */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1.5px;
    bottom: 0;
    left: 0;
    background-color: #ffffff;
    transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.social-icons {
    display: flex;
    gap: 18px;            /* spacing between the two icons */
    align-items: center;
    position: static !important;
    padding-top: 30px;
    margin-top: auto !important;
    margin-bottom: 15px !important;
}

.social-icons a {
    display: inline-block;
    text-decoration: none;
}

.social-icons img {
    width: 20px;          /* Clean, subtle icon width */
    height: 20px;         /* Clean, subtle icon height */
    object-fit: contain;
}

.social-icons a:hover img {
    opacity: 1;
    transform: translateY(-2px); /* Tiny, premium feeling 3D bounce */
}

.social-icons + * {
    display: block;
    margin-top: 0;
    margin-bottom: 15px !important;
    font-size: 0.85rem;
}

/* Copyright text spacing */
.social-icons + * + * {
    display: block;
    font-size: 0.72rem;
    line-height: 1.4;
    letter-spacing: 0.5px;
    opacity: 0.35;
    padding-bottom: 5px; /* Keeps it slightly elevated from the absolute edge */
}

.language-selector a.active-lang {
    font-weight: 600;
    color: #ffffff !important;
    border-bottom: 1px solid #ffffff;
}

.copyright { font-size: 0.7rem; color: rgba(255, 255, 255, 0.4); }

/* ==========================================
   GLOBAL CONTENT FRAMEWORK 
   ========================================== */
.content {
    margin-left: 300px;         /* Steps aside for the sidebar */
    width: calc(100% - 300px);  /* Fills the entire remaining screen width */
    height: 100vh;
}

/* ==========================================
   HOME PAGE (Full Bleed Image/GIF)
   ========================================== */
.hero-gif {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ==========================================
   TEXT CONTENT LAYOUT (About Me, Research)
   ========================================== */
.page-layout {
    padding: 60px;
    max-width: 950px;   /* Prevents long text lines on wide monitors */
    overflow-y: auto;   /* Scrollbar appears ONLY when content is long */
}

.page-layout p {
    margin-bottom: 18px; /* space after paragraph */
    line-height: 1.65;   /* space between lines of same paragram */
    color: #333333;
}

.pub-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    margin-top: 20px;
    margin-bottom: 25px;
    color: #111111;
}

.separator { 
    border: none; 
    border-top: 1px solid #eeeeee; 
    margin: 35px 0; 
}

.page-layout h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #111111;
    margin-top: 35px;    /* Repousse l'année précédente vers le haut */
    margin-bottom: 15px; /* Donne de l'espace avant les textes en dessous */
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.6rem;
    margin-bottom: 40px;
    color: #111111;
}

.profile-block {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0; 
}

.page-layout a {
    color: #0a0e27;
    text-decoration: underline;
}

.bio-text { font-size: 1rem; line-height: 1.6; color: #333333; }
.bio-text p { margin-bottom: 15px; }

/* Tables */
.clean-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.clean-table td { border: none !important; padding: 10px 0; vertical-align: top; }
.date-col { width: 130px; font-weight: 600; color: #555555; }
.inline-rows td { padding: 6px 0; }

/* ==========================================
   INSTITUTIONS LOGO GRID
   ========================================== */
.institutions-section {
    margin-top: 40px;
    padding-bottom: 20px;
}

.institutions-section h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888888;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Flex container that centers the logos and wraps them if they run out of space */
.logo-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 40px; /* Even spacing between logos */
}

.logo-grid img {
    height: 80px;          /* logo sizes */
    width: auto;           /* Automatically scales the width proportionally */
    object-fit: contain;   /* Prevents distortion */
    
    /* The chic portfolio trick: muted and grayscale by default */
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
}

/* Elegant color fade on hover */
.logo-grid img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ==========================================
   PAGE RESEARCH
   ========================================== */
.research-intro {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #444444;
    margin-bottom: 60px;
    font-style: italic;
}

/* Flexbox aligns text on left, image on right */
.research-item {
    display: flex;
    gap: 45px;            /* Nice gap between text and image */
    align-items: center;  /* Centers them vertically relative to each other */
    margin-bottom: 65px;  /* Clean breathing room between projects */
}

.research-text {
    flex: 1;              /* Takes up the maximum available space */
}

.research-theme h2, 
.research-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.65rem;
    color: #0a0e27;
    margin-bottom: 6px;
}

.research-meta {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888888;
    font-weight: 600;
    margin-bottom: 14px;
}

/* THE IMAGE CONTAINER (Fixed proportions so it looks uniform) */
.research-image {
    width: 380px;         /* Increased from 280px so plots are readable */
    height: 250px;        /* Increased from 180px to maintain a great aspect ratio */
    flex-shrink: 0;       
    overflow: hidden;
    border-radius: 6px;   
    border: 1px solid #f0f0f0; /* Adds a soft boundary for plots with white backgrounds */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03); /* Extremely subtle depth */
}

.research-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;    /* CRITICAL: Automatically crops any photo to fit the box without distortion */
}


/* ==========================================
   PUBLICATIONS PAGE
   ========================================== */

.citation {
    position: relative;
    padding-left: 35px;
    margin-bottom: 22px;
    line-height: 1.65;
    color: #333333;
    display: block; 
}

/* 2. THE MAGICAL FISH BULLET (The Child) */
.citation::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 24px;
    height: 18px;
    background-image: url('images/fish-bullet.png'); 
    background-size: contain;
    background-repeat: no-repeat;
}

/* ==========================================
   SIDE QUESTS PAGE (Grid Portfolio)
   ========================================== */
.p-50 { padding: 50px; } /* Legacy padding class */

.quests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.quest-item { text-align: center; }
.quest-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
    transition: opacity 0.3s;
}
.quest-item img:hover { opacity: 0.8; }
.quest-item h3 { font-family: 'Playfair Display', serif; margin-top: 15px; }

/* ==========================================
   MOBILE RESPONSIVENESS (The Adapter)
   ========================================== */

@media (max-width: 1000px) {
    body { flex-direction: column; overflow-y: auto; }
    body:has(.hero-gif), main:has(.hero-gif) {background-color: #050814 !important; padding: 0 !important;overflow: hidden; }
    .sidebar {position: fixed !important; top: 0; left: -280px; width: 280px; height: 100vh; z-index: 9999; 
            transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
            overflow-y: auto; -webkit-overflow-scrolling: touch;}
    .sidebar.mobile-open {left: 0;}
    .content { margin-left: 0; width: 100%; height: auto; }
    .content.page-layout {margin-left: 0 !important; padding: 80px 24px 40px 24px !important; }
    .page-layout { padding: 30px; }
    .profile-block { flex-direction: column; gap: 20px; }
    .profile-pic {width: 150px !important;  height: 150px !important;}
    .hero-gif { width: 100vw !important; height: 100vh !important; object-fit: cover !important; position: fixed; top: 0; left: 0;} /* Prevents the GIF from layout distortion on mobile */
    .logo-grid {justify-content: center; gap: 30px; }
    .logo-grid img { height: 70px; }
    .research-item { flex-direction: column; gap: 20px; } /* Stacks image under text on mobile */
    .research-image { width: 100% !important; height: 350px !important; }       /* Makes image full width on mobile */
    .research-image img {object-fit: cover; object-position: center;}
    .mobile-nav-toggle {
        display: block !important; /* Shows up ONLY on mobile screens */
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 10000;          /* Stays completely above the hidden sidebar */
        background: #0a0e27;     /* Elegant matching dark navy */
        color: #ffffff;
        border: none;
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
        cursor: pointer;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .mobile-nav-toggle.is-open {left: 220px; background: transparent; box-shadow: none;}

    body.is-home-page {display: flex !important; flex-direction: column !important; min-height: 100vh !important; background-color: #050814 !important; overflow-y: auto !important; }
    
    .is-home-page .sidebar {
        position: relative !important;   /* Drops it into natural layout flow at the top */
        left: 0 !important;             /* Pulls it out of hiding */
        width: 100% !important;          /* Spans edge-to-edge on the phone */
        height: auto !important;         /* Packs tightly around the content */
        display: flex !important;
        overflow: visible !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 30px 20px 20px 20px !important;
        background: #0a0e27 !important; /* Your signature deep navy background */
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    }
    .is-home-page .profile-container { margin-bottom: 12px !important; justify-content: center !important;  }
    .is-home-page .profile-pic {width: 250px !important; height: 250px !important; border: 3px solid rgba(255, 255, 255, 0.2) !important; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);}
    .is-home-page .sidebar h1 {font-size: 1.6rem !important; margin-top: 15px !important; margin-bottom: 8px !important; text-align: center !important;}
    .is-home-page .sidebar h2 {font-size: 1.4rem !important; text-align: center !important; margin-bottom: 6px !important; letter-spacing: 1px !important; }
    .is-home-page .sidebar p {text-align: center !important; font-size: 0.88rem !important; max-width: 320px; margin: 0 auto 16px auto !important; opacity: 0.75; line-height: 1.5;}
    .is-home-page .nav-links {display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; gap: 10px 18px !important; margin-top: 25px !important; margin-bottom: 5px !important; width: 100%;}
    .is-home-page .nav-links a {font-size: 0.8rem !important;letter-spacing: 1px !important; margin: 0 !important;}
    .is-home-page .language-selector {margin-top: 0 !important; justify-content: center !important;  margin-bottom: 5px !important; }
    .is-home-page .social-icons,
    .is-home-page .copyright-text,
    .is-home-page .mobile-nav-toggle {display: none !important;}
    .is-home-page .content.page-layout { margin-left: 0 !important; padding: 0 !important; width: 100% !important;}
    .is-home-page .hero-gif {width: 100% !important; height: auto !important;  flex-grow: 1 !important; min-height: 250px; display: block !important; object-fit: cover !important; position: relative !important; top: 0; left: 0; }
} /* @media (max-width: 1000px) */

/* Base desktop rule to keep the toggle button completely invisible on large monitors */
@media (min-width: 1001px) {
    /* Base desktop rule to keep the toggle button completely invisible on large monitors */
    .mobile-nav-toggle { 
        display: none !important; 
    }

    /* ==========================================================
       1. TEXT PAGES: Centered Layout Framework (About, Research, etc.)
       ========================================================== */
    .content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;   /* Centers all child items dead-center on the monitor */
        padding: 60px 40px !important;    
        max-width: none !important;       /* CRITICAL: Breaks the 950px constraint so container spans full screen width */
        width: calc(100% - 300px) !important;
        box-sizing: border-box;
    }

    /* Automatically caps all text elements, profiles, and tables at a pristine reading width */
    .content > * {
        width: 100% !important;
        max-width: 850px !important;  
        box-sizing: border-box;
    }

    /* ==========================================================
       2. HOMEPAGE OVERRIDES: Set the Wave GIF Free Edge-to-Edge
       ========================================================== */
    .is-home-page .content {
        display: block !important;        /* Disables the text flex-centering system completely */
        padding: 0 !important;            /* Vaporizes the white border margins */
        width: calc(100% - 300px) !important;
        height: 100vh !important;
    }

    .is-home-page .content > * {
        max-width: none !important;       /* Shatters the 850px column limit so the GIF fills the window */
        width: 100% !important;
        height: 100% !important;
    }
}
