.gdc-base-mosaic-shell {
    width: min(100%, var(--gdc-base-max, 1540px));
    max-width: 100%;
    box-sizing: border-box;
    margin-inline: auto;
    margin-top: var(--gdc-base-mt, 0px);
    margin-bottom: var(--gdc-base-mb, 0px);
    container-type: inline-size;
}

.gdc-base-mosaic-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: calc((100cqw - (5 * var(--gdc-base-gap, 8px))) / 6);
    gap: var(--gdc-base-gap, 8px);
    box-sizing: border-box;
    grid-auto-flow: row dense;
}

.gdc-base-mosaic-cell {
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    border: 0; /* v6.66 : aucun liseré clair autour des tuiles */
    background: rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    color: rgba(255,255,255,.72);
    font-family: inherit;
    overflow: hidden;
    position: relative;
    container-type: inline-size;
}

.gdc-base-mosaic-cell.is-2x1,
.gdc-base-mosaic-cell.is-1x2,
.gdc-base-mosaic-cell.is-2x2 {
    aspect-ratio: auto;
}

.gdc-base-mosaic-cell-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.gdc-base-mosaic-cell span {
    font-size: clamp(12px, 1vw, 16px);
}

.gdc-base-mosaic-cell small {
    margin-top: 4px;
    font-size: 11px;
    opacity: .55;
}

.gdc-base-cell-actions {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.gdc-base-cell-actions .components-button {
    pointer-events: auto;
}

.gdc-base-mosaic-cell-editor .gdc-base-cell-action {
    position: absolute;
    left: 10px;
    bottom: 10px;
    opacity: 0;
    transition: opacity .15s ease;
    white-space: nowrap;
}

.gdc-base-mosaic-cell-editor .gdc-base-span-action-one {
    position: absolute;
    right: 10px;
    bottom: 106px;
    opacity: 0;
    transition: opacity .15s ease;
    white-space: nowrap;
}

.gdc-base-mosaic-cell-editor .gdc-base-span-action-h {
    position: absolute;
    right: 10px;
    bottom: 10px;
    opacity: 0;
    transition: opacity .15s ease;
    white-space: nowrap;
}

.gdc-base-mosaic-cell-editor .gdc-base-span-action-v {
    position: absolute;
    right: 10px;
    bottom: 42px;
    opacity: 0;
    transition: opacity .15s ease;
    white-space: nowrap;
}

.gdc-base-mosaic-cell-editor .gdc-base-span-action-sq {
    position: absolute;
    right: 10px;
    bottom: 74px;
    opacity: 0;
    transition: opacity .15s ease;
    white-space: nowrap;
}

.gdc-base-mosaic-cell-editor .gdc-base-cell-remove {
    position: absolute;
    right: 6px;
    top: 6px;
    opacity: 0;
    transition: opacity .15s ease;
}

.gdc-base-mosaic-cell-editor:hover .gdc-base-cell-action,
.gdc-base-mosaic-cell-editor:hover .gdc-base-span-action,
.gdc-base-mosaic-cell-editor:hover .gdc-base-cell-remove,
.gdc-base-mosaic-cell-editor:focus-within .gdc-base-cell-action,
.gdc-base-mosaic-cell-editor:focus-within .gdc-base-span-action,
.gdc-base-mosaic-cell-editor:focus-within .gdc-base-cell-remove {
    opacity: 1;
}

.gdc-base-mosaic-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .gdc-base-mosaic-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: calc((100cqw - (2 * var(--gdc-base-gap, 8px))) / 3);
    }
}

@media (max-width: 520px) {
    .gdc-base-mosaic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: calc((100cqw - var(--gdc-base-gap, 8px)) / 2);
    }
}

/* v6.3 — la tuile issue de la curation utilise exactement le principe de cadrage de la fiche admin. */
.gdc-base-mosaic-cell.is-curation-test .gdc-base-mosaic-cell-image {
    object-fit: cover;
}

/* v6.5 — plusieurs types de tuiles de curation. */
.gdc-base-mosaic-cell.is-curation-test.has-text {
    background: #fff;
    color: #111;
}

.gdc-base-mosaic-cell-text {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 7%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    font-family: Georgia, 'Times New Roman', serif;
    text-indent: 0;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    -webkit-hyphens: none;
}

/* v6.17 — Bio B peut maintenant être cadré comme les photos.
   Ne pas neutraliser ici le transform / object-position injecté depuis la curation. */
.gdc-base-mosaic-cell-image.is-drawing {
    object-fit: cover;
}

/* v6.7 — fidélité typographique avec la fiche de curation. */
.gdc-base-mosaic-cell.has-text{container-type:inline-size;}
.gdc-base-mosaic-cell-text br{display:block;}


/* v6.21 — 02 Phrase et 10 Souvenir partagent la voix manuscrite GDC. */
.gdc-base-mosaic-cell.gdc-source-phrase .gdc-base-mosaic-cell-text,
.gdc-base-mosaic-cell.gdc-source-memory .gdc-base-mosaic-cell-text {
    font-family: 'Patrick Hand', cursive;
}


/* v6.22 — 07 Tuile composée utilise Cabin Sketch. */
.gdc-base-mosaic-cell.gdc-source-composed_tile .gdc-base-mosaic-cell-text {
    font-family: 'Cabin Sketch', cursive;
    font-weight: 700;
}


/* v6.23 — 06 Surnom utilise Rubik Dirt. */
.gdc-base-mosaic-cell.gdc-source-nickname .gdc-base-mosaic-cell-text {
    font-family: 'Rubik Dirt', system-ui;
}

/* v6.25 — chaque tuile compagnon ouvre son Profil public. */
.gdc-base-mosaic-cell.is-profile-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.gdc-base-mosaic-cell.is-profile-link:visited { color: inherit; }
.gdc-base-mosaic-cell.is-profile-link:focus-visible {
    outline: 2px solid rgba(255,255,255,.85);
    outline-offset: 2px;
}

/* v6.26 — nom du compagnon + coche de visite, visibles seulement au survol/focus. */
.gdc-base-mosaic-cell.is-profile-link .gdc-profile-hover-meta {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 16px);
    box-sizing: border-box;
    padding: 3px 7px 4px;
    border-radius: 999px;
    background: rgba(0,0,0,.48);
    color: #fff;
    font: 500 12px/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: .01em;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity .14s ease, transform .14s ease;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gdc-base-mosaic-cell.is-profile-link .gdc-profile-hover-name {
    overflow: hidden;
    text-overflow: ellipsis;
}
.gdc-base-mosaic-cell.is-profile-link .gdc-profile-hover-check {
    display: none;
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1;
    opacity: .92;
}
.gdc-base-mosaic-cell.is-profile-link.is-visited .gdc-profile-hover-check {
    display: inline-block;
}
@media (hover:hover) and (pointer:fine) {
    .gdc-base-mosaic-cell.is-profile-link:hover .gdc-profile-hover-meta {
        opacity: 1;
        transform: translateY(0);
    }
}
.gdc-base-mosaic-cell.is-profile-link:focus-visible .gdc-profile-hover-meta {
    opacity: 1;
    transform: translateY(0);
}


/* v6.27 — tampons décoratifs de la Galerie : jamais cliquables, image entière sans recadrage. */
.gdc-base-mosaic-cell.is-gallery-stamp{cursor:default}
.gdc-base-mosaic-cell.is-gallery-stamp .gdc-base-mosaic-cell-image{object-fit:contain;object-position:center;transform:none!important;filter:none!important}


/* v6.28 — menu compact du bouton Plus, injecté sans modifier la mise en page existante. */
.gdc-gallery-more-menu{position:fixed;z-index:99999;display:flex;flex-direction:column;min-width:180px;padding:5px;background:#0d0d0e;border:1px solid rgba(191,211,202,.85);border-radius:3px;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.gdc-gallery-more-menu[hidden]{display:none!important}
.gdc-gallery-more-menu button{appearance:none;border:0;background:transparent;color:#d9e6e0;text-align:left;padding:8px 10px;font:inherit;cursor:pointer;border-radius:2px}
.gdc-gallery-more-menu button:hover,.gdc-gallery-more-menu button:focus-visible{background:rgba(191,211,202,.12);outline:none}


/* v6.62 — corrections ciblées Galerie sur les petits écrans.
 * Le menu « Plus » est positionné par filters.js dans le viewport.
 * La recherche est un bloc Gutenberg distinct de la mosaïque. */
@media (max-width: 767px) {
    .gdc-gallery-more-menu {
        box-sizing: border-box;
        max-width: calc(100vw - 16px);
    }

    /* v6.63 : agrandir aussi le CONTENEUR Gutenberg/Kadence du champ.
       En v6.62, seul input etait elargi, mais son parent restait etroit
       et coupait le placeholder sur les petits ecrans. */
    .gdc-recherche-repliable.gdc-ouvert {
        box-sizing: border-box;
        width: min(280px, calc(100vw - 64px)) !important;
        max-width: calc(100vw - 64px) !important;
        min-width: 0;
        flex: 0 0 auto;
        overflow: visible !important;
    }
    .gdc-recherche-repliable.gdc-ouvert .wp-block-search,
    .gdc-recherche-repliable.gdc-ouvert .wp-block-search__inside-wrapper {
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }
    .gdc-recherche-repliable.gdc-ouvert input[type="search"] {
        box-sizing: border-box;
        display: block;
        min-width: 0;
        width: 100% !important;
        max-width: 100% !important;
        color: #F4F1EC !important;
        -webkit-text-fill-color: #F4F1EC;
        caret-color: #F4F1EC;
        background-color: #0d0d0e !important;
    }
    .gdc-recherche-repliable.gdc-ouvert input[type="search"]::placeholder {
        color: #D9D3C9 !important;
        opacity: 1;
    }
}

/* v6.67 — Galerie : masquer les tampons de remplissage sur mobile,
   en conservant les emplacements existants (fond noir, sans recomposition).
   Les tampons restent visibles sur ordinateur. */
@media (max-width: 900px) {
    .gdc-base-mosaic-grid > .gdc-base-mosaic-cell.is-gallery-stamp {
        visibility: hidden;
    }
}

/* v6.72 — Contraste de la recherche sur desktop comme sur mobile.
 * Le champ est un bloc Gutenberg externe à la mosaïque. */
.gdc-recherche-repliable.gdc-ouvert input[type="search"] {
    color: #F4F1EC !important;
    -webkit-text-fill-color: #F4F1EC !important;
    caret-color: #F4F1EC;
    background-color: #0d0d0e !important;
}
.gdc-recherche-repliable.gdc-ouvert input[type="search"]::placeholder {
    color: #D9D3C9 !important;
    -webkit-text-fill-color: #D9D3C9 !important;
    opacity: 1;
}

/* v6.72 — Uniquement en cas de recherche/filtre sans résultat. */
.gdc-base-mosaic-empty {
    box-sizing: border-box;
    width: 100%;
    padding: 42px 16px 54px;
    text-align: center;
    color: #F4F1EC;
    font-family: inherit;
}
.gdc-base-mosaic-empty-title {
    margin: 0;
    font-size: clamp(16px, 1.4vw, 20px);
    font-weight: 500;
    line-height: 1.45;
    color: #F4F1EC;
}
.gdc-base-mosaic-empty-hint {
    margin: 10px 0 0;
    font-size: clamp(13px, 1.1vw, 15px);
    font-weight: 400;
    line-height: 1.5;
    color: #D9D3C9;
}
@media (max-width: 767px) {
    .gdc-base-mosaic-empty {
        padding: 28px 12px 42px;
    }
}
