/******************************************
 * FICHE RACE – VERSION COMPACT PREMIUM
 * CSS FINAL OPTIMISÉ
 ******************************************/

/* =============================
   WRAPPER BANNIÈRE
============================= */

.fiche-chien-banniere {
    width: 100%;
    max-width: 1200px;
    padding: 28px;
    border: 2px solid #e5e5e5;
    border-radius: 14px;
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.fiche-chien-columns {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.fiche-chien-left {
    flex: 1;
    max-width: 620px;
}

.fiche-chien-right {
    width: 450px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* =============================
   WRAPPER PRINCIPAL FICHE RACE
============================= */

.single-race-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================
   TITRE + SOUS-TITRE + INTRO
============================= */

.fiche-chien-title {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 28px 0;
    letter-spacing: -0.3px;
    color: #2d2d2d;
    max-width: 100%;
}

.race-subtitle {
    font-size: 1.15rem;
    font-weight: 400;
    color: #555;
    margin-bottom: 10px;
}

/* Style visuel de l'intro uniquement — pas de clamp ici */
.fiche-chien-intro {
    margin-bottom: 22px;
    max-width: 620px;
    line-height: 1.55;
    font-size: 1rem;
    color: #333;
}

/* =============================
   BADGES PREMIUM
============================= */

.race-badges-top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 3px 0 20px 0;
}

.fiche-chien-banniere .race-tag {
    background: #f3f3f3;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #333;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* =============================
   INFOS ESSENTIELLES (GRID CARD)
============================= */

.fiche-chien-infos-cle {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 28px;
    margin-top: 18px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.fiche-chien-infos-cle p {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fiche-chien-infos-cle .label {
    font-weight: 700;
    color: #000;
}

/* =============================
   CARACTÉRISTIQUES PHYSIQUES
============================= */

.carac-box {
    width: 100%;
    max-width: 1200px;
    padding: 20px 28px;
    background: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.carac-box h2 {
    font-size: 1.8rem;
    margin: 0 0 6px 0;
    color: #523a1c;
}

.carac-table-wrapper {
    width: 100%;
    background: #f9fafb;
    border-radius: 12px;
}

.carac-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.97rem;
    margin: 0;
    background: transparent;
    border: none;
}

.carac-table thead th {
    text-align: center;
    padding: 14px 10px;
    background: #ffffff;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 700;
    color: #1f2937;
}

.carac-table tbody td {
    text-align: center;
    padding: 12px 10px;
    background: #ffffff;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

.carac-table tbody tr:last-child td {
    border-bottom: none;
}

.carac-table tbody tr:hover td {
    background: #f9fafb;
}

/* =============================================
   ASPECT GÉNÉRAL
============================================= */

.carac-aspect {
    background: #f8f8f8;
    border: 1px solid #e2e2e2;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    margin-top: 12px;
    font-size: 0.88rem;
    line-height: 1.35;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.carac-aspect h3 {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 700;
    color: #2d2d2d;
    line-height: 1.2;
}

.carac-aspect p {
    margin: 2px 0;
    font-size: 0.88rem;
}

.carac-aspect strong {
    font-weight: 600;
    color: #222;
}

.carac-intro {
    margin-bottom: 8px !important;
}

/* =============================
   RESPONSIVE
============================= */

@media (max-width: 768px) {

    .carac-box {
        padding: 18px;
    }

    .carac-box h2 {
        font-size: 1.55rem;
    }

    .carac-aspect {
        padding: 16px;
    }
}

@media (max-width: 900px) {

    .fiche-chien-columns {
        flex-direction: column;
        gap: 24px;
    }

    .fiche-chien-right {
        width: 100%;
        order: -1;
    }

    .fiche-chien-image {
        margin-bottom: 10px;
    }

    .ia-banner {
        margin-top: 10px;
        padding: 12px 14px;
        font-size: 0.88rem;
        line-height: 1.45;
        border-radius: 8px;
    }

    .cg-toc {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        border-radius: 0;
    }

}

@media (max-width: 768px) {

    .fiche-chien-banniere {
        padding: 20px;
        padding-top: 22px;
        margin-bottom: 18px;
    }

    .fiche-chien-title {
        font-size: 1.6rem;
        line-height: 1.25;
        letter-spacing: -0.2px;
        margin-bottom: 18px;
    }

    .race-subtitle {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .fiche-chien-infos-cle {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .race-badges-top {
        justify-content: center;
    }

    .fiche-chien-banniere .race-tag {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .fiche-fci-box {
        padding: 22px 22px 26px;
    }

    .fiche-fci-row {
        flex-direction: column;
        gap: 6px;
    }

    .note-globale {
        gap: 6px;
        flex-wrap: wrap;
    }

}

/* =============================
   BADGES – GRID PREMIUM (2x2)
============================= */

.race-badges-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 8px 18px;
    margin: 10px 0 20px 0;
}

.badge-item {
    font-size: 0.95rem;
    color: #333;
    background: #f7f7f7;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e2e2e2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-item strong {
    font-weight: 700;
}

@media (max-width: 768px) {
    .race-badges-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   ÉTOILES
=========================================== */

.note-globale {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.note-globale .note-info {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    opacity: 0.85;
}

.note-stars {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    margin-top: -1px;
}

.note-value {
    font-size: 0.9rem;
    color: #555;
    white-space: nowrap;
    opacity: 0.85;
}

.note-info {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    opacity: 0.85;
}

/* =============================
   IMAGE 16:9
============================= */

.fiche-chien-image {
    margin: 0;
    padding: 0;
}

.fiche-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: 12px;
    background: #dcdcdc;
}

.fiche-image-wrapper img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.race-caption {
    margin-top: 8px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.fiche-chien-image img {
    width: 100%;
    height: auto;
}

/* =============================
   BANNIÈRE IA
============================= */

.ia-banner {
    width: 100%;
    margin-top: 8px;
    padding: 14px 16px;
    background: #fff7e6;
    border: 1px solid #f5d6a1;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #7a4a00;
    line-height: 1.5;
}

.ia-banner strong {
    font-weight: 600;
    color: #5c3500;
}

.ia-banner a {
    color: #d07000;
    font-weight: 600;
    text-decoration: underline;
}

/* =============================
   IDENTIFICATION FCI
============================= */

.race-fci-box {
    width: 100%;
    max-width: 900px;
    margin: 24px auto 40px;
    padding: 24px 28px;
    background: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.race-fci-box h2 {
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ececec;
    color: #523a1c;
    font-size: 1.7rem;
}

.race-fci-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.race-fci-list li {
    font-size: 1rem;
    margin-bottom: 6px;
}

.race-content {
    padding-top: 24px;
}

.aspect-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #333;
}

/* =============================
   H3 – FICHE RACE
============================= */
.single-race-wrapper h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #452D16;
    margin-top: 36px;
    margin-bottom: 14px;
    line-height: 1.3;
    position: relative;
}

.single-race-wrapper h3::after {
    content: "";
    display: block;
    width: 28px;
    height: 2px;
    background: #EA7D1F;
    margin-top: 6px;
    border-radius: 2px;
    opacity: 0.8; /* 🔥 plus subtil */
}

/* =========================================================
   ENCADRÉ ÉDITORIAL
========================================================= */

.cg-insight {
    background: #fff7ee;
    border-left: 4px solid #f4a261;
    padding: 14px 18px;
    margin: 22px 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #3b2f2f;
}

/* 👉 UNIQUEMENT le titre */
.cg-insight > strong:first-of-type {
    display: block;
    font-weight: 600;
    color: #5c3500;
    line-height: 1.3;
    margin-bottom: 6px;
}

/* 👉 Les autres <strong> restent inline */
.cg-insight strong {
    font-weight: 600;
    color: inherit;
}

.cg-insight p {
    margin: 0;
}

@media (max-width: 768px) {
    .cg-insight {
        padding: 16px;
        font-size: 0.95rem;
    }
}

/* =========================================================
   TITRE CAROUSEL
========================================================= */

.cg-carousel-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #452D16;
    margin: 0 0 20px 0;
    line-height: 1.3;
    position: relative;
}

.cg-carousel-title::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: #EA7D1F;
    margin-top: 8px;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .cg-carousel-title {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }
}

@media (max-width: 1023px) {

    /* Réduit l’espace sous l’intro uniquement en mobile */
    .fiche-chien-intro {
        margin-bottom: 6px;
    }

    /* Ajuste finement l’espace bouton */
    .fiche-chien-intro + .cg-readmore-toggle {
        margin-top: 4px;
    }

}

/* ============================================================
   TABLEAU NOTATION FICHE RACE – .race-rating-table
   Override ciblé du comportement Gutenberg has-fixed-layout
   Scope : uniquement les tableaux avec cette classe custom
   Sans régression sur les autres .wp-block-table du site
============================================================ */

/* --- Wrapper figure --- */
.wp-block-table.race-rating-table {
    overflow-x: visible; /* Annule le scroll horizontal du wrapper global */
    width: 100%;
    margin: 28px 0;
}

/* --- La table elle-même --- */
/* Cible has-fixed-layout uniquement dans ce contexte */
.wp-block-table.race-rating-table table,
.wp-block-table.race-rating-table table.has-fixed-layout {
    table-layout: auto;  /* Override de fixed imposé par Gutenberg */
    width: 100%;
    min-width: 0;        /* Annule le min-width: 480px hérité de global.css */
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* --- Cellules header --- */
.wp-block-table.race-rating-table table thead th {
    white-space: normal;   /* Autorise le retour à la ligne si nécessaire */
    word-break: break-word;
}

/* --- Cellules body --- */
.wp-block-table.race-rating-table table tbody td {
    white-space: normal;
    word-break: break-word;
}

/* ============================================================
   RESPONSIVE MOBILE – race-rating-table uniquement
   Breakpoint 600px : ajustements typographie et padding
============================================================ */

@media (max-width: 600px) {

    .wp-block-table.race-rating-table {
        overflow-x: visible; /* Confirmé : pas de scroll horizontal */
    }

    .wp-block-table.race-rating-table table {
        font-size: 0.88rem;
        min-width: 0; /* Écrase le min-width: 420px de global.css @600px */
    }

    .wp-block-table.race-rating-table table thead th,
    .wp-block-table.race-rating-table table tbody td {
        padding: 10px 10px;
    }
}

@media (max-width: 400px) {

    /* Très petits écrans : padding encore réduit */
    .wp-block-table.race-rating-table table thead th,
    .wp-block-table.race-rating-table table tbody td {
        padding: 8px 8px;
        font-size: 0.82rem;
    }
}

/* ============================================================
   TABLEAU BUDGET FICHE RACE – race-budget-table
   Isolation complète + responsive propre
   Aucun impact sur les autres wp-block-table
============================================================ */

/* --- Table --- */
.wp-block-table.race-budget-table table,
.wp-block-table.race-budget-table table.has-fixed-layout {
    width: 100%;
    min-width: 0;
    table-layout: auto; /* Override Gutenberg fixed */
    border-collapse: collapse;
}

/* --- Header uniquement --- */
.wp-block-table.race-budget-table thead th {
    font-weight: 600; /* léger, pas trop fort */
    white-space: normal;
    word-break: break-word;
}

/* --- Cellules body --- */
.wp-block-table.race-budget-table tbody td {
    font-weight: 400; /* évite tout gras hérité */
    white-space: normal;
    word-break: break-word;
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 768px) {

    .wp-block-table.race-budget-table table {
        font-size: 0.9rem;
    }

    .wp-block-table.race-budget-table thead th,
    .wp-block-table.race-budget-table tbody td {
        padding: 10px;
		white-space: nowrap; /* 🔥 empêche le € de passer à la ligne */
    }

}

/* =========================================================
   FIL D'ARIANE MOBILE – VERSION COMPACTE
========================================================= */

@media (max-width: 768px) {

    .breadcrumb,
    .breadcrumbs,
    .rank-math-breadcrumb,
    nav.breadcrumb {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        max-width: 100%;
        margin-bottom: 12px;
        opacity: 0.75;
    }

    .breadcrumb a,
    .breadcrumbs a,
    .rank-math-breadcrumb a {
        white-space: nowrap;
    }

}