/**
 * Glossaire Tooltip - Styles pour blocs Gutenberg IA
 * 
 * Styles frontend pour les nouveaux formats de blocs :
 * - Encadrés d'avertissement et d'info
 * - Citations
 * - Tableaux comparatifs
 * - Listes numérotées procédurales
 * - Boîtes de définition technique
 */

/* ==========================================================================
   ENCADRÉS
   ========================================================================== */

.gt-encadre-warning {
    background: #fffbf0;
    border-left: 4px solid #e8a000;
    padding: 1.1rem 1.4rem;
    margin: 1.75rem 0;
    border-radius: 0 4px 4px 0;
}

.gt-encadre-warning .gt-encadre-label {
    font-weight: 700;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a06800;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
}

.gt-encadre-warning p:not(.gt-encadre-label) {
    margin: 0 !important;
    color: #3d2e00;
    line-height: 1.65;
}

/* Style magazine/presse pour l'encadré info */
.gt-encadre-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 4px 4px 0;
}

.gt-encadre-info .gt-encadre-label {
    font-weight: 700;
    color: #0c5460;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
}

.gt-encadre-info p:not(.gt-encadre-label) {
    margin: 0 !important;
    color: #0c5460;
    line-height: 1.65;
}

/* ==========================================================================
   BOÎTE DE DÉFINITION TECHNIQUE
   ========================================================================== */

.gt-definition-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.gt-definition-box .gt-def-term {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 0.75rem;
    color: #212529;
}

.gt-definition-box .gt-def-text {
    margin: 0;
    color: #495057;
    line-height: 1.6;
}

/* ==========================================================================
   CITATIONS
   ========================================================================== */

.gt-citation {
    border-left: 3px solid #6c757d;
    margin: 1.5rem 0;
    padding-left: 1.25rem;
    font-style: italic;
}

.gt-citation p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.gt-citation cite {
    display: block;
    font-size: 0.875em;
    color: #6c757d;
    font-style: normal;
    margin-top: 0.5rem;
}

.gt-citation cite::before {
    content: "— ";
}

/* ==========================================================================
   TABLEAUX COMPARATIFS
   ========================================================================== */

.gt-tableau {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.gt-tableau table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.gt-tableau th,
.gt-tableau td {
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    text-align: left;
    vertical-align: top;
}

.gt-tableau th {
    background: #f8f9fa;
    font-weight: 600;
    color: #212529;
}

.gt-tableau tr:nth-child(even) {
    background: #fafbfc;
}

.gt-tableau tr:hover {
    background: #f1f3f5;
}

/* ==========================================================================
   LISTES NUMÉROTÉES PROCÉDURALES
   ========================================================================== */

.gt-etapes {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.gt-etapes li {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    line-height: 1.6;
}

.gt-etapes li:last-child {
    margin-bottom: 0;
}

/* Style pour les étapes avec titre intégré */
.gt-etapes li strong:first-child {
    display: block;
    margin-bottom: 0.25rem;
    color: #212529;
}

/* ==========================================================================
   POINTS CLÉS
   ========================================================================== */

.gt-points-cles {
    background: linear-gradient(135deg, #fafbfc 0%, #f0f2f5 100%);
    padding: 1.5rem 1.75rem;
    margin: 1.75rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    position: relative;
}

.gt-points-cles::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0073aa 0%, #00a8e6 50%, #0073aa 100%);
    border-radius: 8px 8px 0 0;
    opacity: 0.6;
}

.gt-points-cles__label {
    font-weight: 700;
    font-size: 1.05em;
    color: #1a1a1a;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    letter-spacing: -0.01em;
}

.gt-points-cles__list {
    margin: 0 !important;
    padding-left: 0 !important;
    list-style: none;
}

.gt-points-cles__list li {
    margin-bottom: 0.6rem !important;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
    font-size: 0.95em;
    color: #333;
}

.gt-points-cles__list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #0073aa;
    font-weight: 600;
    opacity: 0.7;
}

.gt-points-cles__list li:last-child {
    margin-bottom: 0 !important;
}

/* ==========================================================================
   POINTS CLÉS - FORMAT STEPPER "À RETENIR" (Proposition A)
   Cible visuelle : a-retenir-propositions.html section A
   ========================================================================== */

.gt-points-cles.gt-stepper {
    background: #fff !important;
    padding: 40px !important;
    margin: 2.5rem 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04) !important;
    position: relative;
    text-align: center;
}

/* Neutraliser les overrides Gutenberg/Astra sur wp-block-group */
.wp-block-group.gt-points-cles.gt-stepper {
    padding: 40px !important;
}

/* Pas de double filet — le prototype n'en a pas */
.gt-points-cles.gt-stepper::before {
    display: none;
}

/* ── Badge "À RETENIR" — pill grise centrée (= .section-label du prototype) ── */
.gt-stepper-badge {
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #888;
    background: #f5f5f3;
    border-radius: 20px;
    display: inline-block !important;
    padding: 4px 14px !important;
    margin: 0 0 28px 0 !important;
    line-height: 1.4;
}

/* ── Titre H2 — aligné à gauche comme le prototype ── */
.gt-stepper-titre {
    font-family: Georgia, serif !important;
    font-size: 1.1rem !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    color: #1a1a1a !important;
    margin: 0 0 28px 0 !important;
    padding: 0 !important;
    text-align: center;
}

/* ── Dots de navigation ── */
.gt-stepper-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.gt-stepper-tab {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
    font-family: inherit;
    flex-shrink: 0;
}

.gt-stepper-tab:hover,
.gt-stepper-tab:focus {
    background: #aaa !important;
    box-shadow: none !important;
    outline: none;
    transform: scale(1.15);
}

.gt-stepper-tab:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 3px;
    border-radius: 50%;
}

.gt-stepper-tab.is-active {
    background: #1a1a1a !important;
    transform: scale(1.25);
}

.gt-stepper-tab.is-active:hover,
.gt-stepper-tab.is-active:focus {
    background: #1a1a1a !important;
}

/* ── Panneau de contenu ── */
.gt-stepper-content {
    min-height: 100px;
    padding: 24px 0 8px;
    text-align: left;
}

.gt-stepper-panel {
    display: none;
    font-size: 0.93rem !important;
    line-height: 1.75 !important;
    color: #1a1a1a !important;
    margin: 0 !important;
    padding: 0 !important;
}

.gt-stepper-panel.is-active {
    display: block;
}

/* ── Barre de progression ── */
.gt-stepper-progress {
    height: 2px;
    background: #eee;
    border-radius: 1px;
    margin-top: 20px;
    text-align: left;
}

.gt-stepper-progress-fill {
    height: 2px;
    background: #1a1a1a;
    border-radius: 1px;
    transition: width 0.3s ease;
}

/* ── Barre basse : navigation + signature ── */
.gt-stepper-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.gt-stepper-nav button {
    font-size: 0.85rem;
    padding: 7px 16px;
    cursor: pointer;
    color: #555;
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: background 0.15s;
    font-family: inherit;
}

.gt-stepper-nav button:hover:not(:disabled) {
    background: #f5f5f3;
}

.gt-stepper-nav button:disabled {
    opacity: 0.3;
    cursor: default;
}

.gt-stepper-nav button:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

/* ── Signature ── */
.gt-stepper-sig {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: #999;
    font-style: italic;
    user-select: none;
}

.gt-stepper-sig-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f0f0ee;
    border: 1px solid #e0e0de;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    font-style: normal;
    color: #888;
    flex-shrink: 0;
}


/* ── Curseur typewriter IA ── */
@keyframes gt-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.gt-stepper-panel[data-typing]::after {
    content: '|';
    display: inline-block;
    margin-left: 1px;
    color: #1a1a1a;
    font-weight: 300;
    animation: gt-blink 0.7s step-start infinite;
    vertical-align: baseline;
}

/* ── Liste masquée après init JS ── */
.gt-stepper.js-ready .gt-stepper-items,
.gt-stepper.js-ready .gt-stepper-items li {
    display: none !important;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .gt-points-cles.gt-stepper,
    .wp-block-group.gt-points-cles.gt-stepper {
        padding: 24px 20px !important;
        margin: 1.5rem 0 !important;
    }

    .gt-stepper-badge {
        font-size: 10px !important;
        margin-bottom: 20px !important;
    }

    .gt-stepper-titre {
        font-size: 0.97rem !important;
    }

    .gt-stepper-tab {
        width: 7px;
        height: 7px;
    }

    .gt-stepper-panel {
        font-size: 0.875rem !important;
        line-height: 1.65 !important;
    }

    /* Signature sous les boutons de navigation */
    .gt-stepper-nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    .gt-stepper-sig {
        width: 100%;
        order: 1;           /* pousse la signature après les boutons */
        justify-content: center;
        font-size: 0.78rem;
    }

    .gt-stepper-nav button {
        order: 0;           /* boutons en premier */
        font-size: 0.8rem;
        padding: 6px 13px;
    }
}

/* ==========================================================================
   INTRODUCTION
   ========================================================================== */

.gt-intro {
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

/* ==========================================================================
   FAQ ACCORDÉONS
   ========================================================================== */

.gt-faq-accordion {
    margin-bottom: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.gt-faq-accordion summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    background: #f8f9fa;
    border-radius: 4px;
}

.gt-faq-accordion summary:hover {
    background: #e9ecef;
}

.gt-faq-accordion > *:not(summary) {
    padding: 1rem 1.25rem;
    margin: 0;
}

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

@media (max-width: 768px) {
    .gt-tableau {
        font-size: 0.875em;
    }
    
    .gt-tableau th,
    .gt-tableau td {
        padding: 0.5rem 0.75rem;
    }
    
    .gt-encadre-warning,
    .gt-encadre-info,
    .gt-definition-box,
    .gt-points-cles {
        padding: 1rem;
    }
}
