
/* ============================================================
   TECHNO PORTAIL — PROJETS
   ============================================================ */

body.projets-page {
    display: block;
    width: 100%;
    min-height: 100vh;
    height: auto;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: "Poppins", sans-serif;
    background-size: auto, 100% auto;
    background-position: top left, center top;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

.projets-page {
    --projets-accent: #4caf50;
}

.projets-content {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
    padding: 45px 24px 85px;
}

/* HEADER */

.projets-header {
    max-width: 750px;
    margin: 0 auto 35px;
}

.projets-header h1 {
    margin: 0 0 12px;
    color: #444;
    font-size: 2rem;
    font-weight: 600;
}

.projets-header p {
    margin: 0;
    color: #666;
    font-size: .95rem;
    font-weight: 300;
    line-height: 1.6;
}

/* FILTERS */

.projets-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 38px;
}

.projets-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 19px;
    border: 1px solid #ddd;
    border-radius: 25px;
    background: #fff;
    color: #666;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.projets-filter-btn:hover {
    background: #f5f5f5;
}

.projets-filter-btn.active,
.projets-filter-btn.active:hover {
    background: var(--projets-accent);
    border-color: var(--projets-accent);
    color: #fff;
    font-weight: 600;
}

.projets-filter-btn i {
    font-size: .9rem;
}

/* SECTION HEADING */

.projets-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.projets-heading h2 {
    margin: 0;
    color: #444;
    font-size: 1.2rem;
    font-weight: 600;
}

#projetsCount {
    color: #888;
    font-size: .8rem;
    white-space: nowrap;
}

/* GRID */

.projets-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 24px;
}

/* CARDS */

.projets-page .projet-card {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.07);
    border-radius: 17px;
    background: #fff;
    color: #444;
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,.07);
    transform: none;
    transition: box-shadow .2s, transform .2s;
}

.projets-page .projet-card-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f1f3;
}

.projets-page .projet-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none;
}

.projet-category {
    position: absolute;
    bottom: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 6px 11px;
    border-radius: 20px;
    background: rgba(255,255,255,.95);
    color: #333;
    font-size: .7rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.projet-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 19px;
}

.projet-card-title {
    display: block;
    margin: 0;
    color: #333;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
}

.projet-card-description {
    display: -webkit-box;
    overflow: hidden;
    color: #666;
    font-size: .83rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.projet-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    color: #888;
    font-size: .75rem;
}

.projet-card-footer i {
    color: var(--projets-accent);
}

.projet-card-footer .projet-classe {
    margin-left: auto;
    padding: 3px 9px;
    border-radius: 12px;
    background: #f1f3f4;
    color: #666;
    font-weight: 500;
}

/* DESKTOP HOVER */

@media (hover: hover) and (pointer: fine) {
    .projets-page .projet-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 25px rgba(0,0,0,.12);
    }
}

/* EMPTY */

.projets-empty {
    padding: 45px 10px;
    color: #888;
    text-align: center;
}

.projets-empty[hidden] {
    display: none;
}

/* ============================================================
   MODAL
   ============================================================ */

.projets-modal[hidden] {
    display: none !important;
}

.projets-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.projets-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20,25,30,.78);
    backdrop-filter: blur(5px);
}

.projets-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 70px rgba(0,0,0,.3);
}

.projets-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    color: #333;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

.projets-modal-close:hover {
    background: #fff;
}

.projets-modal-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #e9ecef;
}

.projets-modal-image-wrap img {
    display: block;
    width: 100%;
    max-height: 60dvh;
    object-fit: contain;
}

.projets-modal-content {
    padding: 25px 30px 30px;
}

.projets-modal-category {
    display: inline-block;
    margin-bottom: 10px;
    color: #388e3c;
    font-size: .8rem;
    font-weight: 600;
}

.projets-modal-content h2 {
    margin: 0 0 12px;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.projets-modal-content p {
    margin: 0 0 18px;
    color: #666;
    font-size: .9rem;
    line-height: 1.7;
    white-space: pre-line;
}

.projets-modal-author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #777;
    font-size: .85rem;
}

.projets-modal-author i {
    color: var(--projets-accent);
}

body.projets-modal-open {
    overflow: hidden;
}

/* Supprimer les espaces parasites dans les cartes */
.projets-page .projet-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.projets-page .projet-card-image {
    display: block;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.projets-page .projet-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: cover;
    vertical-align: top;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (min-width: 601px) and (max-width: 950px) {
    .projets-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 18px;
    }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

    .projets-content {
        padding: 25px 12px 110px;
    }

    .projets-header {
        margin-bottom: 25px;
    }

    .projets-header h1 {
        font-size: 1.65rem;
    }

    .projets-header p {
        font-size: .82rem;
        line-height: 1.5;
    }

    /* FILTERS */

    .projets-filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0 -12px 28px;
        padding: 0 12px 10px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .projets-filters::-webkit-scrollbar {
        display: none;
    }

    .projets-filter-btn {
        flex-shrink: 0;
        padding: 9px 15px;
        font-size: .8rem;
        white-space: nowrap;
    }

    .projets-heading {
        margin-bottom: 15px;
    }

    .projets-heading h2 {
        font-size: 1.05rem;
    }

    /* SINGLE COLUMN */

    .projets-grid {
        grid-template-columns: minmax(0,1fr);
        gap: 20px;
    }

    .projet-card-body {
        padding: 17px;
    }

    /* MODAL */

    .projets-modal {
        padding: 12px;
    }

    .projets-modal-dialog {
        max-height: calc(100dvh - 24px);
        border-radius: 15px;
    }

    .projets-modal-image-wrap img {
        max-height: 50dvh;
    }

    .projets-modal-content {
        padding: 20px;
    }

    .projets-modal-content h2 {
        font-size: 1.25rem;
    }

    /* BOTTOM NAV */

    .projets-page .home-bottom-nav {
        z-index: 1000;
        display: flex;
        width: 100%;
        height: calc(72px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid #d8dadd;
        box-shadow: 0 -3px 14px rgba(0,0,0,.06);
    }

    .projets-page .home-nav-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 25%;
        height: 72px;
        padding: 8px 2px !important;
        color: #777;
        text-decoration: none;
    }

    .projets-page .home-nav-item:not(:last-child) {
        border-right: 1px solid #e2e3e5;
    }

    .projets-page .home-nav-item i {
        display: block;
        margin-bottom: 6px;
        font-size: 1.3rem;
        line-height: 1;
    }

    .projets-page .home-nav-item span {
        display: block;
        font-size: .7rem;
        font-weight: 400;
        line-height: 1;
    }

    .projets-page .home-nav-active {
        color: #333 !important;
        font-weight: 600;
    }

    .projets-page .home-nav-active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 25%;
        width: 50%;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--projets-accent);
    }
}



/* TOUCH DEVICES */

@media (hover: none), (pointer: coarse) {
    .projets-page .projet-card,
    .projets-page .projet-card:hover,
    .projets-page .projet-card:active {
        transform: none !important;
    }
}

/* ACCESSIBILITY */

.projets-page button:focus-visible {
    outline: 2px solid var(--projets-accent);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .projets-page .projet-card,
    .projets-page .projets-filter-btn {
        transition: none;
    }
}
