/* =========================================
   PROJECT PAGE CSS
   ========================================= */

/* --- HEADER SECTION --- */
.section-page-header {
    background: linear-gradient(135deg, var(--nav), #0f172a);
    color: #fff;
    padding: 6rem 1.5rem 4rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.section-page-header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(30, 136, 229, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.section-page-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.section-page-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    color: var(--muted);
    position: relative;
    z-index: 1;
}

/* --- PROJECT GRID --- */
.projet-list-section {
    padding: 4rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* --- PROJECT CARD --- */
.project-card {
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    /* remove default link underline */
    color: inherit;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.project-image-wrapper {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: #e2e8f0;
}

.project-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image-wrapper img {
    transform: scale(1.05);
}

/* Badges (Difficulty / Status) */
.badge-difficulty {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-heading);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.badge-difficulty.facile {
    background: rgba(34, 197, 94, 0.9);
}

/* Green */
.badge-difficulty.moyen {
    background: rgba(234, 179, 8, 0.9);
    color: #000;
}

/* Yellow */
.badge-difficulty.difficile {
    background: rgba(239, 68, 68, 0.9);
}

/* Red */
.badge-difficulty.expert {
    background: rgba(147, 51, 234, 0.9);
}

/* Purple */

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
    line-height: 1.3;
}

.project-content p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta-footer {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    /* Push to bottom */
}

.project-duration {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.project-cta {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.project-cta::after {
    content: "→";
    transition: transform 0.2s;
}

.project-card:hover .project-cta::after {
    transform: translateX(4px);
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    .section-page-header {
        background: linear-gradient(135deg, #0b1220, #000);
    }

    .project-card {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .project-meta-footer {
        background: rgba(255, 255, 255, 0.03);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

body.dark-mode .section-page-header {
    background: linear-gradient(135deg, #0b1220, #000);
}

body.dark-mode .project-card {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .project-meta-footer {
    background: rgba(255, 255, 255, 0.03);
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* --- PROJECT DETAIL Layout (Migrated from inline) --- */
.project-hero-header {
    position: relative;
    height: 60vh;
    min-height: 400px;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.project-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.project-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.8));
    z-index: 1;
}

.project-hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    color: #fff;
}

.project-hero-content .badge-difficulty {
    display: inline-block;
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 1rem;
}

.project-hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.project-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.project-main .summary-intro {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 2rem;
    font-weight: 500;
}

.project-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.sidebar-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.sidebar-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.tech-stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-badge {
    background: rgba(30, 136, 229, 0.1);
    color: var(--accent);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.project-meta-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
}

.project-meta-list li:last-child {
    border-bottom: none;
}

.cta-button {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--accent);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: opacity 0.2s;
}

.cta-button:hover {
    opacity: 0.9;
    color: #fff;
}

.cta-button.secondary {
    background: var(--nav);
}

@media (max-width: 900px) {
    .project-layout {
        grid-template-columns: 1fr;
    }

    .project-hero-header {
        height: 50vh;
    }
}

@media (prefers-color-scheme: dark) {
    .sidebar-card {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .tech-badge {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .project-meta-list li {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
}

body.dark-mode .sidebar-card {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tech-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .project-meta-list li {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
/* --- Mobile Menu Pro Styles --- */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    pointer-events: none; /* Let overlay handle clicks initially or JS toggles class */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu[aria-hidden='false'] {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-inner {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 80%;
    max-width: 350px;
    height: 100%;
    position: absolute;
    right: 0;
    top: 0;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    padding: 2rem;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu[aria-hidden='false'] .mobile-menu-inner {
    transform: translateX(0);
}

.mobile-menu-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-logo {
    height: 32px;
}

.mobile-menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-nav li {
    margin-bottom: 0.5rem;
}

.mobile-menu-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.mobile-menu-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    padding-left: 1.25rem; /* Slight slide effect */
}

.close-mobile-menu {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-mobile-menu:hover {
    opacity: 1;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-menu[aria-hidden='false'] ~ .mobile-menu-overlay { /* Assuming overlay is sibling control */
    opacity: 1;
    pointer-events: auto;
}

.navlinks[data-visible='true'] ~ .nav-overlay {
    /* Legacy override if needed */
    display: block;
}
