/* ==========================================================================
   Feuille de styles officielle pour la mise en forme des Règles Cardinal
   Utilisée à la fois sur le frontend et dans l'éditeur WordPress (Gutenberg & Classic)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,700;1,400&display=swap');

/* Conteneur principal */
.cardinal-rules-wrapper,
.editor-styles-wrapper .cardinal-rules-wrapper,
.editor-styles-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2D2A26;
    background-color: #FDFBF7;
}

/* Titres de section (4 règles principales / 16 règles bonus) */
.rules-section-title,
.editor-styles-wrapper .rules-section-title,
h2.rules-section-title {
    color: #5C4033 !important;
    font-family: 'EB Garamond', 'Georgia', serif !important;
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    margin-top: 3.5rem !important;
    margin-bottom: 1.5rem !important;
    border-bottom: 2px solid #E8DFD0 !important;
    padding-bottom: 0.75rem !important;
    letter-spacing: -0.5px !important;
}

.rules-section-title:first-of-type,
.editor-styles-wrapper .rules-section-title:first-of-type {
    margin-top: 0.5rem !important;
}

/* Cartes de jeu (game-card) */
.game-card,
.editor-styles-wrapper .game-card {
    background: #ffffff !important;
    border-radius: 14px !important;
    padding: 30px !important;
    margin-bottom: 40px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #E8DFD0 !important;
    position: relative;
    box-sizing: border-box;
}

/* Structure interne */
.game-top,
.editor-styles-wrapper .game-top {
    display: flex;
    gap: 40px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.game-content,
.editor-styles-wrapper .game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Titre du jeu et tag */
.game-title-row,
.editor-styles-wrapper .game-title-row {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.game-title-row h2,
.editor-styles-wrapper .game-title-row h2 {
    font-size: 2.2rem !important;
    margin: 0 !important;
    font-family: 'EB Garamond', 'Georgia', serif !important;
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

.game-tag,
.editor-styles-wrapper .game-tag {
    background: #ffebe5 !important;
    color: #b31b1b !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: inline-block;
}

/* Section But du jeu */
.full-width-bref,
.editor-styles-wrapper .full-width-bref {
    width: 100% !important;
    margin-bottom: 1.5rem !important;
}

.info-column h3,
.editor-styles-wrapper .info-column h3 {
    font-size: 0.9rem !important;
    color: #b31b1b !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 15px !important;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0 !important;
    font-weight: 700 !important;
}

.info-column h3::before,
.editor-styles-wrapper .info-column h3::before {
    content: "■";
    font-size: 0.8em;
}

.bref-content,
.editor-styles-wrapper .bref-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}

/* Ligne des statistiques (Joueurs, Durée, Difficulté) */
.stats-row,
.editor-styles-wrapper .stats-row {
    display: flex !important;
    gap: 30px !important;
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px solid #eee !important;
    flex-wrap: wrap !important;
}

.stat-item,
.editor-styles-wrapper .stat-item {
    display: flex !important;
    flex-direction: column !important;
}

.stat-item:nth-child(1),
.editor-styles-wrapper .stat-item:nth-child(1) {
    width: 150px !important;
}

.stat-item:nth-child(2),
.editor-styles-wrapper .stat-item:nth-child(2) {
    width: 130px !important;
}

.stat-item:nth-child(3),
.editor-styles-wrapper .stat-item:nth-child(3) {
    width: 90px !important;
}

.stat-label,
.editor-styles-wrapper .stat-label {
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    color: #888 !important;
    letter-spacing: 1px !important;
    margin-bottom: 5px !important;
    font-weight: 600 !important;
}

.stat-value,
.editor-styles-wrapper .stat-value {
    font-size: 1.2rem !important;
    font-weight: bold !important;
    color: #1a1a1a !important;
    letter-spacing: 1px !important;
}

/* Colonne des actions & accordéons */
.actions-column,
.editor-styles-wrapper .actions-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
}

.accordion-wrapper,
.editor-styles-wrapper .accordion-wrapper {
    flex: 1 !important;
    width: 100% !important;
}

/* Accordéon stylisé */
details.detailed-version,
.editor-styles-wrapper details.detailed-version {
    background: #b31b1b !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 15px !important;
    display: block !important;
    border: 1px solid #b31b1b !important;
}

details.detailed-version summary,
.editor-styles-wrapper details.detailed-version summary {
    padding: 14px 20px !important;
    font-weight: bold !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    list-style: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    outline: none !important;
    background: #b31b1b !important;
    color: #ffffff !important;
}

details.detailed-version summary::-webkit-details-marker {
    display: none !important;
}

details.detailed-version summary::before {
    content: "📖";
}

details.detailed-version summary::after {
    content: "▼";
    margin-left: auto;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

details.detailed-version[open] summary::after {
    transform: rotate(180deg);
}

details.detailed-version[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px 8px 0 0 !important;
}

.details-inner,
.editor-styles-wrapper .details-inner {
    padding: 20px !important;
    background: #fdfaf6 !important;
    color: #333333 !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
}

/* Liste des 5 points numérotés 01, 02... */
ol.points-list,
.editor-styles-wrapper ol.points-list {
    counter-reset: step-counter !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

ol.points-list li,
.editor-styles-wrapper ol.points-list li {
    margin-bottom: 12px !important;
    padding-left: 32px !important;
    position: relative !important;
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    color: #444 !important;
}

ol.points-list li::before,
.editor-styles-wrapper ol.points-list li::before {
    counter-increment: step-counter !important;
    content: counter(step-counter, decimal-leading-zero) !important;
    position: absolute !important;
    left: 0 !important;
    color: #b31b1b !important;
    font-weight: bold !important;
    font-size: 0.85rem !important;
}

/* Bouton PDF officiel */
.cardinal-pdf-link,
.editor-styles-wrapper .cardinal-pdf-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 20px !important;
    background: #b31b1b !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(179, 27, 27, 0.25) !important;
}

/* Vidéos (éditeur uniquement : sur le frontend, wp_header.php gère les visuels bg-video-regle.png & bg-video-partie.png) */
.editor-styles-wrapper .videos-row {
    display: flex !important;
    gap: 20px !important;
    margin-top: 20px !important;
    flex-wrap: wrap !important;
}

.editor-styles-wrapper .video-box {
    flex: 1 !important;
    min-width: 200px !important;
    background-color: #1a1a1a !important;
    border-radius: 10px !important;
    height: 140px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.9rem !important;
}

/* Dans l'éditeur d'administration : s'assurer que les blocs sont toujours bien visibles et lisibles */
.editor-styles-wrapper details {
    display: block !important;
}

.editor-styles-wrapper details[open] .details-inner,
.editor-styles-wrapper details .details-inner {
    display: block !important;
}

