/* ==========================================================================
   damiencura.com — feuille de style principale
   Reset minimal + styles du site + grille portfolio (CSS Grid).
   Couleurs : or #f6cf87, fond gris #808080, texte #000, liens #3d3d3d.
   ========================================================================== */

/* --- Reset minimal (uniquement ce qui est utilisé) ----------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body,
h1,
h2,
p,
figure {
    margin: 0;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
    background: transparent;
}

/* --- Base ---------------------------------------------------------------- */
body {
    font-family: "Chivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.428571429;
    background: #808080;
    color: #000;
    overflow-y: scroll;
}

a,
a:visited {
    color: #3d3d3d;
    -webkit-transition: all 0.2s ease-out;
    transition: all 0.2s ease-out;
}

/* --- En-tête : logo + lien retour --------------------------------------- */
#header {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 15px;
}

#logo {
    background-image: url("/images/Logo.svg");
    background-repeat: no-repeat;
    background-position: 50% 50%;
    height: 113px;
    text-align: center;
}

@media only screen and (-webkit-min-device-pixel-ratio: 2),
       only screen and (min-resolution: 192dpi),
       only screen and (min-resolution: 2dppx) {
    #logo {
        background-image: url("/images/logo.png");
        background-size: 258px 48px;
    }
}

#logo img {
    margin: 0 auto;
    width: 258px;
    height: 113px;
}

#logo a {
    display: inline-block;
}

.breadcrumb {
    margin: 0 0 28px 0;
    line-height: 40px;
    font-size: 16px;
    text-transform: uppercase;
}

.breadcrumb .back {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 12px;
    vertical-align: middle;
    background: url("/images/retour.png") no-repeat 50% 50%;
    background-size: contain;
}

.breadcrumb a,
.breadcrumb .current {
    vertical-align: middle;
    text-decoration: none;
    color: #3d3d3d;
}

.breadcrumb a:hover {
    color: #000;
}

.breadcrumb .current {
    color: #000;
}

.breadcrumb .sep {
    margin: 0 8px;
    vertical-align: middle;
    color: #999;
}

/* --- Page de contenu (texte) -------------------------------------------- */
.content {
    max-width: 540px;
    margin: 56px auto 0;
    padding: 0 15px;
    font-size: 18px;
    text-align: justify;
}

/* --- Grille portfolio (CSS Grid) ----------------------------------------
   Mobile : 2 colonnes fluides.
   >=768px : pistes fixes de 200px, centrées, plafonnées à 4 par ligne
   via max-width = 4*200 + 3*gap.
   ------------------------------------------------------------------------ */
#dgrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    justify-content: center;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (min-width: 768px) {
    #dgrid {
        grid-template-columns: repeat(auto-fill, 200px);
        padding: 0;
    }
}

.thumb {
    position: relative;
    -webkit-transition: all 0.2s ease-out;
    transition: all 0.2s ease-out;
}

.thumb:hover {
    z-index: 2;
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
}

.thumb a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.thumb img {
    width: 100%;
    display: block;
    height: auto;
}

/* Libellé (titre) : or sur fond noir ; inversé au survol */
.thumb a h2 {
    line-height: 28px;
    height: 28px;
    font-size: 14px;
    text-align: center;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #f6cf87;
    background: #000;
}

@media (min-width: 992px) {
    .thumb a h2 {
        font-size: 16px;
    }
}

.thumb a:hover h2 {
    background: #f6cf87;
    color: #000;
}

/* Description en surimpression (galeries), révélée au survol */
.thumb a .infos {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    margin: 0;
    line-height: 1.5;
    background: #000;
    color: #f6cf87;
    overflow: hidden;
    -webkit-transition: 0.6s;
    transition: 0.6s;
}

.thumb a:hover .infos {
    opacity: 1;
}

/* --- Transition de vue : fondu d'opacité classique (navigation MPA) ------
   Comportement proche du défaut : la page sortante/entrante se fond en
   opacité, sans déplacement. Activée seulement si l'utilisateur ne demande
   pas de mouvement réduit.
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }

    ::view-transition-old(root) {
        animation: vt-fade 0.3s ease both reverse;
    }

    ::view-transition-new(root) {
        animation: vt-fade 0.3s ease both;
    }

    @keyframes vt-fade {
        from {
            opacity: 0;
        }
    }
}
