/*****************************************
 * CaniGuide – Global Styles
 * Version 2025 optimisée
 *****************************************/
 
 :root {
    --accent-color: #EA7D1F;
}

/* =============================
   STYLE GLOBAL
============================= */

body {
    font-family: 'Arial', sans-serif;
    color: #2b2b2b;
}

a {
    color: #1e73be;
    text-decoration: none;
    transition: 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

html {
    scroll-behavior: smooth;
}

/* ==========================================================
   BREADCRUMB CANIGUIDE (GLOBAL)
========================================================== */

.cg-breadcrumb {
    max-width: 1200px;
    margin: 16px auto 24px auto;
    padding: 0 16px;
    font-size: 14px;
    position: relative;
    z-index: 5;
}

.cg-breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cg-breadcrumb-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.cg-breadcrumb-item::after {
    content: "›";
    margin: 0 8px;
    color: #999;
}

.cg-breadcrumb-item:last-child::after {
    content: "";
}

.cg-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.cg-breadcrumb a:hover {
    text-decoration: underline;
}

.cg-breadcrumb-current {
    color: #000;
    font-weight: 500;
}

/* ==========================================================
   BREADCRUMB MOBILE – VERSION COMPACTE
========================================================== */

@media (max-width: 768px) {

    .cg-breadcrumb {
        font-size: 12px;
        margin: 8px auto 12px auto;
        opacity: 0.7;
    }

    .cg-breadcrumb-list {
        flex-wrap: nowrap;        /* empêche retour ligne */
        overflow: hidden;         /* cache débordement */
    }

    .cg-breadcrumb-item {
        min-width: 0;             /* IMPORTANT pour ellipsis en flex */
    }

    .cg-breadcrumb-current {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
        max-width: 100%;
    }

}

/* =============================
   META AUTEUR + DATE
============================= */

.meta-race {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    color: #444;
}

.meta-race .meta-author a {
    font-weight: 600;
    color: #1e73be;
}

.meta-race .meta-sep {
    font-weight: 600;
}

/*****************************************
 * TABLES – STYLE OPTIONNEL PAR DÉFAUT
 *****************************************/

.table-default {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.5;
}

.table-default thead tr {
    background: #f7f7f7;
}

.table-default thead th {
    padding: 14px 18px;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #2c2c2c;
}

.table-default td {
    padding: 12px 18px;
    border-bottom: 1px solid #ececec;
    color: #3a3a3a;
}

.table-default tbody tr:nth-child(even) {
    background: #fafafa;
}

.table-default tbody tr:hover {
    background: #f3f7ff;
}

.table-site-wrapper {
    overflow-x: auto;
}

/*****************************************
 * ÉTOILES – Couleur universelle
 *****************************************/

.acf-stars,
.race-card-rating {
    color: #EA7D1F !important;
}

/* =========================================================
   PROS & CONS – Bloc Gutenberg (Version corrigée)
========================================================= */

.wp-block-columns.pros-cons {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 40px auto;
    max-width: 1000px;
}

/* Colonnes */
.wp-block-columns.pros-cons > .wp-block-column {
    background: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    padding: 22px 26px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Titres */
.wp-block-columns.pros-cons p:first-child {
    font-size: 1.25rem;
    font-weight: 700;
    color: #452D16;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Liste */
.wp-block-columns.pros-cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Items */
.wp-block-columns.pros-cons li {
    margin: 10px 0;
    padding-left: 26px;
    position: relative;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
}

/* IMPORTANT : on écrase le style orange global */
.wp-block-columns.pros-cons li::before {
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
}

/* Colonne gauche – ✓ */
.wp-block-columns.pros-cons > .wp-block-column:first-child li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #2a9d52;
    font-weight: 700;
    font-size: 1.05rem;
}

/* Colonne droite – ✕ */
.wp-block-columns.pros-cons > .wp-block-column:last-child li::before {
    content: "✕";
    position: absolute;
    left: 0;
    top: 0;
    color: #d9534f;
    font-weight: 700;
    font-size: 1.05rem;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-block-columns.pros-cons {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* ============================================================
   CARDS – VERSION SIMPLE (Carousels)
============================================================ */

.race-card-simple {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all .25s ease;
    width: 100%;
}

.race-card-simple:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.race-card-simple-image {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.race-card-simple-content {
    padding: 14px 16px;
    text-align: center;
}

.race-card-simple-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #452D16;
    margin-bottom: 6px;
}

.race-card-simple-stars {
    display: block;
    color: var(--accent-color);
    font-size: 1rem;
    margin-bottom: 10px;
}

.race-card-simple-cta {
    display: inline-block;
    font-weight: 600;
    font-size: .9rem;
    padding: 8px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: var(--primary-color);
    transition: .2s;
}

.race-card-simple-cta:hover {
    background: #eef3f7;
}

.race-card-simple-link {
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
    display: inline-block;
    margin-top: 8px;
    transition: 0.2s;
}

.race-card-simple-link:hover,
.race-card-simple:hover .race-card-simple-link {
    color: #EA7D1F;
    text-decoration: underline;
}

/* ==========================================================
   HEADER & MENU – ASTRA
========================================================== */

.main-header-menu > .menu-item > a {
    font-weight: 600;
    color: #452D16;
}

.main-header-menu > .menu-item > a:hover {
    color: #EA7D1F;
}

.main-header-menu .sub-menu {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 8px 0;
}

.main-header-menu .sub-menu a {
    color: #452D16;
    padding: 10px 18px;
    font-weight: 500;
}

.main-header-menu .sub-menu a:hover {
    background: rgba(234, 125, 31, 0.08);
    color: #EA7D1F;
}

/* ============================================================
   TOC – MOBILE UNIQUEMENT (<1024px)
============================================================ */

@media (max-width: 1023px) {

    .cg-toc {
        position: sticky;
        top: 0;
        z-index: 999;
        margin: 0 0 24px 0;
        padding: 0;
        background: #EA7D1F;
        border: none;
        border-radius: 0;
        box-shadow: 0 4px 12px rgba(234, 125, 31, 0.25);
        overflow: hidden;
    }

    .cg-toc-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        cursor: pointer;
        user-select: none;
        transition: background 0.2s ease;
    }

    .cg-toc-header:active {
        background: rgba(0, 0, 0, 0.1);
    }

    .cg-toc-title {
        color: #fff;
        font-size: 1.05rem;
        font-weight: 700;
        margin: 0;
        letter-spacing: 0.3px;
    }

    .cg-toc-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 8px;
        width: 36px;
        height: 36px;
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .cg-toc-toggle::after {
        content: "▼";
        display: block;
        line-height: 1;
    }

    .cg-toc.is-open .cg-toc-toggle {
        transform: rotate(180deg);
        background: rgba(255, 255, 255, 0.35);
    }

    .cg-toc-content {
        display: none;
        background: #fff;
        padding: 20px 22px;
        max-height: 65vh;
        overflow-y: auto;
        border-top: 2px solid rgba(234, 125, 31, 0.15);
    }

    .cg-toc.is-open .cg-toc-content {
        display: block;
        animation: tocSlideDown 0.3s ease-out;
    }

    @keyframes tocSlideDown {
        from { opacity: 0; transform: translateY(-12px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .cg-toc-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .cg-toc-list li {
        margin-bottom: 14px;
        padding-left: 14px;
        border-left: 3px solid #EA7D1F;
        transition: border-color 0.2s ease;
    }

    .cg-toc-list li:last-child { margin-bottom: 0; }

    .cg-toc-list li:active { border-left-color: #c56a19; }

    .cg-toc-list a {
        display: block;
        color: #2d2d2d;
        font-size: 0.96rem;
        line-height: 1.45;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .cg-toc-list a:active {
        color: #EA7D1F;
        transform: translateX(4px);
    }

    .cg-toc-content::-webkit-scrollbar { width: 8px; }
    .cg-toc-content::-webkit-scrollbar-track { background: #f5f5f5; border-radius: 4px; }
    .cg-toc-content::-webkit-scrollbar-thumb { background: #EA7D1F; border-radius: 4px; }
    .cg-toc-content::-webkit-scrollbar-thumb:hover { background: #c56a19; }
}

/* ============================================================
   TOC – DESKTOP (≥1024px)
============================================================ */

@media (min-width: 1024px) {

    .cg-toc {
        max-width: 1000px;
        margin: 32px auto;
        padding: 20px 24px;
        background: #fcfcfc;
        border: 1px solid #e7e7e7;
        border-radius: 14px;
    }

    .cg-toc-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
    }

    .cg-toc-title {
        font-size: 1.25rem;
        font-weight: 700;
        color: #523a1c;
    }

    .cg-toc-toggle { display: none; }

    .cg-toc-content {
        display: block !important;
        margin-top: 12px;
        padding: 0;
        background: transparent;
        border: none;
        max-height: none;
        overflow: visible;
    }

    .cg-toc-list { list-style: none; margin: 0; padding: 0; }

    .cg-toc-list li { margin-bottom: 10px; }

    .cg-toc-list li:last-child { margin-bottom: 0; }

    .cg-toc-list a {
        color: #444;
        font-size: 1rem;
        line-height: 1.4;
        text-decoration: none;
        transition: 0.2s ease;
    }

    .cg-toc-list a:hover {
        color: #000;
        padding-left: 6px;
    }
}

/* ============================================================
   TOC – LAYOUT 2 COLONNES FICHES RACES (DESKTOP)
============================================================ */

@media (min-width: 1024px) {

    .race-layout-container,
    .races-extra-content-wrapper {
        display: grid;
        grid-template-columns: 1fr 260px;
        gap: 32px;
    }

    .race-main-content,
    .races-extra-content {
        min-width: 0;
    }

    .race-sidebar { position: relative; }

    .race-sidebar .cg-toc,
    .races-extra-content-wrapper .cg-toc {
        position: sticky;
        top: 20px;
        align-self: flex-start;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        margin: 0;
        background: #fcfcfc;
        border: 1px solid #e7e7e7;
        border-radius: 14px;
        padding: 18px 20px;
    }

    .race-sidebar .cg-toc-title,
    .races-extra-content-wrapper .cg-toc-title {
        font-size: 1.15rem;
        font-weight: 700;
        color: #523a1c;
        margin-bottom: 14px;
    }

    .race-sidebar .cg-toc-toggle,
    .races-extra-content-wrapper .cg-toc-toggle {
        display: none;
    }

    .race-sidebar .cg-toc-content,
    .races-extra-content-wrapper .cg-toc-content {
        display: block !important;
        padding: 0;
        max-height: none;
        background: transparent;
        border: none;
    }

    .race-sidebar .cg-toc-list a,
    .races-extra-content-wrapper .cg-toc-list a {
        color: #444;
        font-size: 0.95rem;
        line-height: 1.4;
        transition: 0.2s ease;
    }

    .race-sidebar .cg-toc-list a:hover,
    .races-extra-content-wrapper .cg-toc-list a:hover {
        color: #EA7D1F;
        padding-left: 6px;
    }
}

/* ============================================================
   CANIGUIDE – RESET ASTRA POUR TEMPLATES CUSTOM
============================================================ */

body[class*="page-template-page-"] #content > .ast-container {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    grid-template-columns: none !important;
}

body[class*="page-template-page-"] #primary {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body[class*="page-template-page-"] #secondary {
    display: none !important;
}

/* ============================================================
   CORRECTION MARGIN ASTRA
============================================================ */

@media (min-width: 1200px) {
    .ast-plain-container.ast-no-sidebar #primary {
        margin-top: 0 !important;
        margin-bottom: 60px;
    }
}

/* =========================================================
   VALIDATION DE CONTENU – BLOC MÉTA GLOBAL
========================================================= */

.content-verification-box {
    width: 100%;
    max-width: 900px;
    margin: 16px auto 40px;
    padding: 22px 28px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    font-size: 0.95rem;
    line-height: 1.55;
    color: #374151;
}

.content-verifier-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.content-verifier-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}

.content-verifier-meta { line-height: 1.4; }

.content-verifier-name {
    display: block;
    font-weight: 600;
    color: #111827;
}

.content-verifier-role {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
}

.content-verifier-text {
    font-size: 0.95rem;
    line-height: 1.55;
}

.content-verifier-text p { margin: 0; }

@media (max-width: 768px) {
    .content-verification-box {
        padding: 20px;
        margin-bottom: 32px;
    }
    .content-verifier-header { gap: 12px; }
    .content-verifier-avatar img { width: 48px; height: 48px; }
}

/******************************************
   TABLEAUX GUTENBERG – STYLE GLOBAL PREMIUM
******************************************/

.wp-block-table {
    width: 100%;
    margin: 32px 0;
    overflow-x: auto;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    min-width: 480px;
}

.wp-block-table thead th {
    background: #f9fafb;
    padding: 16px 18px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2d2d2d;
    border-bottom: 2px solid #e5e7eb;
}

.wp-block-table tbody td {
    padding: 15px 18px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.95rem;
    color: #374151;
    vertical-align: middle;
}

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

.wp-block-table tbody tr:hover td { background: #fafafa; }

@media (max-width: 900px) {
    .wp-block-table table { font-size: 0.92rem; }
    .wp-block-table thead th,
    .wp-block-table tbody td { padding: 13px 14px; }
}

@media (max-width: 768px) {

    .wp-block-table table {
        min-width: 0;
        width: 100%;
        table-layout: auto;
    }

}

@media (max-width: 600px) {
    .wp-block-table table { 
        font-size: 0.88rem;
    }	

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

/* ============================================================
   LIRE PLUS / LIRE MOINS – GLOBAL STABLE
============================================================ */

/* Clamp mobile */
.cg-readmore--clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.cg-readmore--clamped.is-open {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* Normalisation paragraphes */
.cg-readmore p {
    margin-top: 0;
    margin-bottom: 0.8em;
}

.cg-readmore p:last-child {
    margin-bottom: 0;
}

/* Important : le bloc readmore ne crée PAS d'espace externe */
.cg-readmore {
    margin-bottom: 0;
}

/* Bouton */
.cg-readmore-toggle {
    display: none;
    margin-top: 6px;
    margin-bottom: 16px; /* espace naturel après le bouton */
    padding: 0;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #d07000;
    cursor: pointer;
    line-height: 1.4;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.cg-readmore-toggle:hover {
    color: #b05c00;
}

.cg-readmore-toggle:focus-visible {
    outline: 2px solid #d07000;
    outline-offset: 3px;
    border-radius: 2px;
}

/* =========================================
   HERO – page /races/
========================================= */

.races-hero .races-subtitle {
    margin-bottom: 4px;
}

.races-hero .cg-readmore-toggle {
    display: inline-block;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* =========================================================
   META ÉDITORIALE – GLOBAL COMPONENT
========================================================= */

.editorial-meta {
    max-width: 1200px;
    margin: 10px auto 20px;
    padding: 0 16px;
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    line-height: 1.5;
}

.editorial-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.editorial-meta a {
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
}

.editorial-meta a:hover {
    text-decoration: underline;
}

.editorial-meta time {
    white-space: nowrap;
}

@media (max-width: 768px) {

    .editorial-meta {
        font-size: 0.75rem;
        margin: 6px auto 16px;
        opacity: 0.85;
        gap: 4px 8px;
    }

}

/* ============================================================
   FOOTER — VERSION STABLE (ASTRA OVERRIDE)
============================================================ */

/* Fond + espacement vertical réduit */
.site-below-footer-wrap {
    background: #f6f6f6;
    border-top: 1px solid #e5e5e5;
    padding: 8px 0;   /* réduit au lieu de 25px */
    font-size: 0.9rem;
    color: #444;
}

/* Centrage du contenu */
.site-below-footer-wrap .ast-builder-grid-row-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Padding horizontal forcé (nécessaire avec Astra) */
.site-below-footer-wrap .ast-builder-grid-row {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Liens */
.site-below-footer-wrap a {
    color: #452D16;
    text-decoration: none;
}

.site-below-footer-wrap a:hover {
    color: #EA7D1F;
}

/* ============================================================
   PAGE DEFAULT – LAYOUT GUTENBERG
============================================================ */

.cg-default-wrapper {
    background: #f9f9f9;
    padding: 40px 20px 60px;
}

.cg-default-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.cg-default-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #452D16;
    margin-bottom: 24px;
    text-align: center;
}

.cg-default-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ============================================================
   TYPOGRAPHIE – PAGE DEFAULT CANIGUIDE
   Harmonisation avec les fiches race
============================================================ */

.cg-default-content h2 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #523a1c;
    margin: 40px 0 12px 0;
    line-height: 1.25;
}

.cg-default-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d2d2d;
    margin: 28px 0 10px 0;
    line-height: 1.3;
}

.cg-default-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 22px 0 8px 0;
}

.cg-default-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 16px;
}

.cg-default-content p:last-child {
    margin-bottom: 0;
}

.cg-default-content strong {
    font-weight: 600;
    color: #222;
}

/******************************************
   LISTES GUTENBERG – STYLE CANIGUIDE
******************************************/

.wp-block-list {
    margin: 18px 0 24px;
    padding-left: 0;
    list-style: none; /* 🔥 supprime la puce native */
}

.wp-block-list li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.wp-block-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    background: var(--accent-color, #EA7D1F);
    border-radius: 50%;
}

.wp-block-list li:last-child {
    margin-bottom: 0;
}

/******************************************
   ACCESSIBILITÉ – TEXTE INVISIBLE VISUELLEMENT
   Utilisé pour fournir un label accessible
   aux lecteurs d’écran sans impacter le design.
   Conforme aux bonnes pratiques WordPress.
******************************************/

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/******************************************
   TITRES DE CARTE / LABELS FORTS
   Utilisé pour les noms dans des cartes,
   blocs ou éléments répétés (non hiérarchiques)
******************************************/

.cg-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    color: #2d3748;
    letter-spacing: -0.2px;
    margin: 0;
}

