/* =====================================================================
   HANDICATS — page /adoption (galerie de cartes) et fiche d'un chat
   Rappel : html { font-size: 55% } → 1rem ≈ 8.8px ; violet du site #A10684
   ===================================================================== */

/* ---------- Galerie des chats (/adoption) ---------- */
.galerie-entete {
    width: min(1120px, 92%);
    margin: 0 auto;
    text-align: center;
}

.galerie-entete h1 {
    font-size: 4.4rem;
    line-height: 1.1;
    font-weight: 700;
    color: #2b0f26;
    margin: 0;
}

/* Bandeau image sans la boîte de titre : le contenu enchaîne juste sous l'image */
main.bandeau-simple .galerie-entete {
    margin-top: 5rem;
}

/* Sans la boîte de titre absolue, les grandes marges de .sous-legende n'ont plus lieu d'être */
main.sans-bandeau .sous-legende,
main.bandeau-simple .sous-legende {
    margin: 2.5rem auto 4rem;
    width: min(900px, 92%);
}

.galerie-chats {
    clear: both;
    width: min(1120px, 92%);
    margin: 0 auto 6rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));
    gap: 3rem;
}

.galerie-chats .carte-chat {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(71, 71, 71, 0.12);
    color: #222;
    text-decoration: none;
    transition: transform 0.25s, box-shadow 0.25s;
}

.galerie-chats .carte-chat:hover,
.galerie-chats .carte-chat:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(161, 6, 132, 0.22);
    outline: none;
}

.galerie-chats .carte-photo {
    position: relative;
    aspect-ratio: 1 / 1; /* carré : photos larges ou hautes, le chat reste visible */
    overflow: hidden;
    background: #f3e9f6;
}

.galerie-chats .carte-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    transition: transform 0.5s;
}

.galerie-chats .carte-chat:hover .carte-photo img {
    transform: scale(1.04);
}

.galerie-chats .carte-badge {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.92);
    color: #A10684;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.galerie-chats .carte-texte {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.8rem 2rem 2rem;
    border-top: 4px solid #A10684;
    flex: 1;
}

.galerie-chats .carte-texte h3 {
    font-size: 2.4rem;
    font-weight: 700;
    color: #2b0f26;
    line-height: 1.15;
    margin: 0;
}

.galerie-chats .carte-resume,
.galerie-chats .carte-resume p {
    font-size: 1.5rem;
    line-height: 1.45;
    color: #555;
    font-style: italic;
    font-weight: 300;
}

.galerie-chats .carte-resume {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.galerie-chats .carte-lien {
    margin-top: auto;
    padding-top: 0.6rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #A10684;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.galerie-chats .carte-chat:hover .carte-lien i {
    transform: translateX(4px);
}

.galerie-chats .carte-lien i {
    transition: transform 0.2s;
}

.galerie-vide {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.8rem;
    color: #555;
    padding: 4rem 0;
}

.galerie-vide a {
    width: auto;
    color: #A10684;
    text-decoration: underline;
}

.sous-legende .sous-legende-aide {
    margin-top: 1.5rem;
    font-size: 1.4rem;
    font-style: normal;
    color: #A10684;
    font-weight: 600;
}

.pagination-chats {
    clear: both;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0 0 4rem;
    font-size: 1.6rem;
}

.pagination-chats a,
.pagination-chats span {
    width: auto;
    color: #A10684;
    font-weight: 600;
}

@media screen and (max-width: 640px) {
    .galerie-entete h1 {
        font-size: 3.2rem;
    }

    .galerie-chats {
        grid-template-columns: 1fr;
        gap: 2.4rem;
    }

    .galerie-chats .carte-photo {
        aspect-ratio: 1 / 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .galerie-chats .carte-chat,
    .galerie-chats .carte-photo img,
    .galerie-chats .carte-lien i {
        transition: none;
    }
}

/* ---------- Fiche ---------- */
/* Sans bandeau : le menu du site est fixe, on laisse la place dessous (ajusté au pixel par le script de la fiche) */
main.sans-bandeau {
    padding-top: 15rem;
}

.fiche-chat {
    clear: both;
    width: min(1200px, 92%);
    margin: 4rem auto 6rem;
    color: #222;
}

.fiche-chat a {
    width: auto;
}

/* neutralise les règles globales nav { width: 85% } du site */
.fiche-chat nav {
    width: 100%;
    margin: 0;
    text-align: left;
}

.fiche-retour {
    margin-bottom: 2.5rem;
    font-size: 1.5rem;
}

.fiche-retour a {
    color: #A10684;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.fiche-retour a:hover {
    text-decoration: underline;
}

.fiche-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 5rem;
    align-items: start;
}

/* Photos */
.fiche-photos {
    position: sticky;
    top: 2rem;
}

.fiche-photo-principale {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f3e9f6;
    box-shadow: 0 10px 30px rgba(71, 71, 71, 0.18);
}

.fiche-zoom {
    all: unset;
    display: block;
    position: relative;
    width: 100%;
    cursor: zoom-in;
}

.fiche-zoom img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0;
}

.fiche-zoom-icone {
    position: absolute;
    right: 1.4rem;
    bottom: 1.4rem;
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 50%;
    background: rgba(161, 6, 132, 0.9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    opacity: 0.85;
    transition: transform 0.2s, opacity 0.2s;
}

.fiche-zoom:hover .fiche-zoom-icone,
.fiche-zoom:focus-visible .fiche-zoom-icone {
    opacity: 1;
    transform: scale(1.08);
}

.fiche-vignettes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 1rem;
    margin-top: 1.4rem;
}

.fiche-vignette {
    all: unset;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.fiche-vignette img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0;
}

.fiche-vignette:hover,
.fiche-vignette:focus-visible {
    transform: translateY(-2px);
}

.fiche-vignette.active {
    border-color: #A10684;
}

/* Texte */
.fiche-surtitre {
    margin: 0 0 0.6rem;
    font-size: 1.3rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #A10684;
    font-weight: 700;
}

.fiche-texte h1 {
    font-size: 4.4rem;
    line-height: 1.1;
    font-weight: 700;
    color: #2b0f26;
    margin: 0 0 1.6rem;
}

.fiche-resume,
.fiche-resume p {
    font-size: 1.9rem;
    line-height: 1.5;
    font-style: italic;
    font-weight: 300;
    color: #4a2358;
}

.fiche-sep {
    width: 6rem;
    margin: 2.4rem 0;
    border: 0;
    border-top: 4px solid #A10684;
}

.fiche-description,
.fiche-description p,
.fiche-description li {
    font-size: 1.7rem;
    line-height: 1.6;
    color: #333;
}

.fiche-description p + p {
    margin-top: 1.4rem;
}

.fiche-description ul,
.fiche-description ol {
    margin: 1.4rem 0 1.4rem 2.2rem;
    list-style: disc;
}

.fiche-description ol {
    list-style: decimal;
}

.fiche-description h2,
.fiche-description h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 2.4rem 0 1rem;
    color: #2b0f26;
}

.fiche-description a {
    color: #A10684;
    text-decoration: underline;
}

.fiche-description img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
}

/* Boutons */
.fiche-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    margin-top: 3.2rem;
}

.btn-fiche {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 5rem;
    padding: 0 2.6rem;
    border-radius: 60px;
    font-size: 1.6rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 5px 7px rgba(71, 71, 71, 0.25);
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.btn-fiche:hover,
.btn-fiche:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 14px rgba(71, 71, 71, 0.3);
}

.btn-fiche-contact {
    background: #A10684;
    color: #fff;
}

.btn-fiche-contact:hover {
    background: #8a0570;
}

.btn-fiche-ext {
    background: #fff;
    color: #A10684;
    border: 2px solid #A10684;
}

.btn-fiche-ext:hover {
    background: #fbf3f9;
}

.fiche-mention {
    margin-top: 2.4rem;
    font-size: 1.3rem;
    line-height: 1.5;
    color: #777;
}

/* Précédent / suivant */
.fiche-nav {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 6rem;
    padding-top: 3rem;
    border-top: 1px solid #e6d6ec;
}

.fiche-nav-lien {
    display: inline-flex;
    align-items: center;
    gap: 1.4rem;
    color: #2b0f26;
    font-size: 1.8rem;
    font-weight: 600;
    max-width: 48%;
}

.fiche-nav-lien small {
    display: block;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #A10684;
}

.fiche-nav-lien img {
    width: 6.4rem;
    height: 6.4rem;
    object-fit: cover;
    border-radius: 50%;
    flex: none;
    border: 3px solid #f3e9f6;
    transition: border-color 0.2s;
}

.fiche-nav-lien:hover img {
    border-color: #A10684;
}

.fiche-nav-suiv {
    margin-left: auto;
    text-align: right;
}

/* Visionneuse plein écran */
.fiche-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000; /* au-dessus du header fixe du site (z-index 10000) */
    background: rgba(20, 5, 17, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fiche-lightbox[hidden] {
    display: none;
}

.fiche-lightbox .lb-img {
    max-width: min(96vw, 1400px);
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.fiche-lightbox button {
    all: unset;
    position: absolute;
    color: #fff;
    cursor: pointer;
    width: 5.4rem;
    height: 5.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 2.4rem;
    transition: background 0.15s;
}

.fiche-lightbox button:hover,
.fiche-lightbox button:focus-visible {
    background: rgba(161, 6, 132, 0.9);
}

.fiche-lightbox .lb-fermer {
    top: 2rem;
    right: 2rem;
    font-size: 3.4rem;
}

.fiche-lightbox .lb-prec { left: 2rem; }
.fiche-lightbox .lb-suiv { right: 2rem; }

.fiche-lightbox .lb-compteur {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
}

/* ---------- Tablette ---------- */
@media screen and (max-width: 1023px) {
    .fiche-grid {
        grid-template-columns: 1fr;
        gap: 3.2rem;
    }

    .fiche-photos {
        position: static;
    }

    .fiche-zoom img {
        aspect-ratio: 16 / 10;
    }

    .fiche-texte h1 {
        font-size: 3.8rem;
    }
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 640px) {
    main.sans-bandeau {
        padding-top: 10rem;
    }

    .fiche-chat {
        width: 100%;
        padding: 0 4%;
        box-sizing: border-box;
        margin-top: 2.5rem;
    }

    /* annule le padding 5% que style-site.css met sur "article p" en mobile */
    .fiche-chat p {
        padding: 0;
    }

    .btn-fiche {
        padding: 1.2rem 2rem;
        line-height: 1.3;
        text-align: center;
    }

    .fiche-zoom img {
        aspect-ratio: 1 / 1;
    }

    .fiche-vignettes {
        grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr));
    }

    .fiche-texte h1 {
        font-size: 3.2rem;
    }

    .fiche-resume,
    .fiche-resume p {
        font-size: 1.7rem;
    }

    .fiche-description,
    .fiche-description p,
    .fiche-description li {
        font-size: 1.6rem;
    }

    .fiche-actions {
        flex-direction: column;
    }

    .btn-fiche {
        width: 100%;
        box-sizing: border-box;
    }

    .fiche-nav {
        flex-direction: column;
        gap: 1.6rem;
    }

    .fiche-nav-lien {
        max-width: 100%;
    }

    .fiche-nav-suiv {
        margin-left: 0;
        flex-direction: row-reverse;
        text-align: left;
    }

    .fiche-lightbox .lb-prec,
    .fiche-lightbox .lb-suiv {
        width: 4.4rem;
        height: 4.4rem;
        bottom: 6rem;
        top: auto;
    }
}
