/* =========================================================
   OVERRIDE DES STYLES GLOBAUX HÉRITÉS DE STYLE.CSS
   ========================================================= */

header {
    position: static;
    width: 100%;
    height: auto;
    padding: 0;
}

main {
    display: block;
    padding: 0;
    margin-bottom: 0;
    gap: 0;
}

a {
    text-decoration: none;
    color: #000000;
}


/* =========================================================
   ANIMATION D'IMPACT BRUTALISTE
   ========================================================= */

@keyframes single-impact {
    0% {
        background-color: #ffffff;
        color: #000000;
    }

    50% {
        background-color: #000000;
        color: #ffffff;
    }

    75% {
        background-color: #ffffff;
        color: #000000;
    }

    100% {
        background-color: #000000;
        color: #ffffff;
    }
}


/* =========================================================
   STROBE DOUX REUSABLE
   ========================================================= */

@keyframes softStrobeHover {
    0% {
        background-color: transparent;
        color: #000;
    }

    30% {
        background-color: #000;
        color: #fff;
    }

    60% {
        background-color: transparent;
        color: #000;
    }

    100% {
        background-color: #000;
        color: #fff;
    }
}


/* =========================================================
   PAGE STRUCTURE
   ========================================================= */

.back-bar {
    padding: 12px 20px;
}

.back-link {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    padding: 2px 6px;
}

.back-link:hover {
    background-color: #000000;
    color: #ffffff;
    animation: single-impact 0.15s steps(2, start) 1 forwards;
}


/* =========================================================
   HEADER PROJET
   ========================================================= */

.project-detail-header {
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.project-detail-title {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: -0.02em;
}

.project-detail-meta {
    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   GALERIE PROJET
   ========================================================= */

.project-gallery {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(280px, 1fr)
    );
    gap: 20px;
    padding: 20px;
    width: 100%;
}

.gallery-item {
    border: 1px solid #000000;
    background-color: #f9f9f9;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.gallery-item--large {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}


/* =========================================================
   TYPOGRAPHIE COSETTE
   ========================================================= */

@font-face {
    font-family: 'Cosette';
    src: url('fonts/CossetteTexte-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cosette';
    src: url('fonts/CossetteTexte-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   STRUCTURE GLOBALE
   ========================================================= */

* {
    font-family: 'Cosette', sans-serif;
    box-sizing: border-box;
    text-transform: uppercase;
}

html,
body {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    color: #000000;
    font-weight: 700;
}


/* =========================================================
   HEADER GLOBAL
   ========================================================= */

header.main-header {
    position: relative;
    width: 100%;
    height: auto;
    padding-top: 60px;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    flex-shrink: 0;
}


/* =========================================================
   NAVIGATION HAUT DROITE
   ========================================================= */

.nav-top-right {
    position: absolute;
    top: 24px;
    right: 32px;
    z-index: 100;
    display: flex;
    gap: 16px;
    align-items: center;
    will-change: transform;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.nav-top-right a {
    font-family: 'Cosette', sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: #ffffff !important;
    background: transparent !important;
    text-decoration: none !important;
    padding: 4px 8px;
    border-radius: 2px;
    display: inline-block !important;
    mix-blend-mode: exclusion !important;
    transition: color 0.2s;
}

.nav-top-right a:hover {
    background: transparent !important;
    mix-blend-mode: exclusion !important;
    animation: softStrobeHover 0.18s ease-in-out forwards;
}


/* =========================================================
   BARRE DES FILTRES
   ========================================================= */

.filter-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    border-top: 1px solid #000 !important;
    border-bottom: none !important;
    padding: 15px 40px 10px 40px;
    width: 100%;
    flex-shrink: 0;
}

.filter-title {
    font-weight: bold;
    font-size: 0.9rem;
    display: block;
    padding-left: 0;
}

.filter-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    row-gap: 8px;
    width: 100%;
    margin-left: -8px;
    align-items: baseline;
}

.filter-categories a {
    text-decoration: none;
    color: inherit;
    padding: 3px 8px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    transition: none;
}

.filter-categories a:hover,
.filter-categories a.active {
    background-color: #000000;
    color: #ffffff;
    animation: single-impact 0.15s steps(2, start) 1 forwards;
}


/* =========================================================
   PAGE PRINCIPALE
   ========================================================= */

main.projects-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px 40px 0px 40px !important;
    margin-bottom: 0 !important;
    width: 100%;
    min-height: 0;
}

.projects-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}


/* =========================================================
   BARRE DE TRI
   ========================================================= */

.sort-header {
    margin-bottom: 10px;
    display: flex;
    gap: 20px;
    padding-left: 0 !important;
    margin-left: -8px !important;
    flex-shrink: 0;
}

.sort-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 3px 8px !important;
    margin: 0 -8px !important;
}

.sort-option:hover {
    background-color: #000000;
    color: #ffffff;
    animation: single-impact 0.15s steps(2, start) 1 forwards;
}

.sort-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.radio-custom {
    display: inline-block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border: 1.5px solid #000;
    border-radius: 50%;
    position: relative;
}

.sort-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    border-radius: 50%;
}

.sort-option:hover .radio-custom {
    border-color: #fff;
}

.sort-option:hover input[type="radio"]:checked + .radio-custom::after {
    background-color: #fff;
}


/* =========================================================
   GRILLE 2 COLONNES
   ========================================================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 50px;
    row-gap: 0;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.projects-grid::-webkit-scrollbar {
    display: none;
}

.projects-column {
    list-style: none;
    padding: 0 15px !important;
    margin: 0 !important;
    width: 100%;
}

.project-item {
    margin: 0;
    padding: 0;
    width: 100%;
}


/* =========================================================
   LIENS PROJETS
   ========================================================= */

.project-item a {
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 4px 15px !important;
    margin: 0 -15px !important;
    text-decoration: none;
    color: inherit;
    gap: 15px;
}

.project-name {
    white-space: normal;
    word-break: break-word;
    flex: 1;
}

.project-year {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.project-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #000;
    z-index: -1;
    transition: width 0.35s cubic-bezier(
        0.25,
        1,
        0.5,
        1
    );
}

.project-item.highlight a {
    color: #fff !important;
}

.project-item.highlight a::before {
    width: 100%;
}

.project-item.highlight a span {
    color: #fff !important;
}

.project-item a:hover {
    background-color: #000;
    color: #fff;
}

.project-item a:hover span {
    color: inherit;
}


/* =========================================================
   IMAGE D'APERÇU
   ========================================================= */

.hover-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 380px;
    height: 340px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 90;
}

.hover-preview.visible {
    opacity: 1;
    visibility: visible;
}

.hover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}


/* =========================================================
   FOOTER (PC / Par défaut : Grille 3 colonnes)
   ========================================================= */

.site-footer {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 15px 40px !important;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    background-color: #ffffff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    position: relative !important;
    z-index: 100;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-col-left {
    justify-self: start !important;
    align-items: flex-start;
}

.footer-col-right {
    justify-self: end !important;
    align-items: flex-end;
}

.footer-center {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center !important;
}

.site-footer a {
    font-family: 'Cosette', sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #000000;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.site-footer a:hover {
    opacity: 0.6;
}


/* =========================================================
   LOGO TRAME (Footer)
   ========================================================= */

.site-footer .footer-logo-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.site-footer .footer-logo-link:focus,
.site-footer .footer-logo-link:active,
.site-footer .footer-logo-link:focus-visible {
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.site-footer .footer-logo {
    height: 39px !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    transform: none !important;
    filter: brightness(1) contrast(100%);
    outline: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   STROBOSCOPIQUE LOGO (Footer)
   ========================================================= */

.site-footer .footer-logo-link:hover .footer-logo {
    animation: footerLogoStrobe 0.35s steps(2, start) infinite;
}

@keyframes footerLogoStrobe {
    0% {
        filter: brightness(1) contrast(100%);
    }
    50% {
        filter: brightness(2.5) contrast(150%);
    }
    100% {
        filter: brightness(1) contrast(100%);
    }
}


/* =========================================================
   RESPONSIVE MOBILE (<= 768px : Footer empilé centré)
   ========================================================= */

@media (max-width: 768px) {

    .nav-top-right {
        top: 12px !important;
        right: 20px !important;
        gap: 12px !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
    }

    .nav-top-right a {
        font-size: 0.75rem !important;
        padding: 2px 5px;
    }

    header.main-header {
        padding: 10px 20px 0 20px;
    }

    .filter-header {
        padding: 10px 20px;
        border-top: none !important;
    }

    .filter-title {
        font-size: 1.4rem !important;
        white-space: nowrap;
    }

    .filter-categories a {
        font-size: 0.78rem !important;
        padding: 3px 6px !important;
    }

    .filter-categories {
        margin-left: -5px;
        gap: 10px !important;
        row-gap: 8px !important;
        flex-wrap: wrap !important;
        overflow-x: visible !important;
    }

    main.projects-page {
        padding: 10px 20px 0px 20px !important;
    }

    .sort-header {
        display: none !important;
    }

    main.projects-page .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding-bottom: 110px !important;
    }

    .project-item a {
        font-size: 1.1rem;
    }

    .project-year {
        display: none !important;
    }

    .hover-preview {
        display: none;
    }

    html, body {
        height: 100dvh !important;
        height: 100svh !important;
    }

    /* =========================================================
       FOOTER MOBILE — fixe en bas, identique à projet-detail.html
       ========================================================= */

    .site-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 200 !important;
        background-color: #ffffff !important;
        width: 100% !important;
        padding: 12px 20px !important;
        padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        justify-items: center !important;
        align-items: center !important;
        text-align: center;
        gap: 12px !important;
    }

    .site-footer a {
        font-size: 10px;
    }

    .footer-col,
    .footer-col-right,
    .footer-center {
        justify-self: center !important;
        align-items: center;
    }

    .footer-center {
        order: 1;
    }

    .footer-col {
        order: 2;
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px !important;
    }

    .footer-col-right {
        order: 3;
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px !important;
    }

    .site-footer .footer-logo-link {
        margin: 4px 0 !important;
    }

    .site-footer .footer-logo {
        height: 38px !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        animation: logoStrobeClean 0.8s ease-in-out infinite !important;
    }
}

@keyframes logoStrobeClean {
    0% {
        filter: brightness(1) contrast(100%);
    }
    50% {
        filter: brightness(2.2) contrast(140%) invert(0.1);
    }
    100% {
        filter: brightness(1) contrast(100%);
    }
}