/**
 * Styles Front-Office - Email Protect
 * Conforme Charte V11.1 : Design System Tokenisé, Accessibilité, Performance.
 * Zéro dépendance, zéro couleur en dur.
 */

/* ============================================================================
   1. VARIABLES (Héritage du Thème / Suite)
   ============================================================================ */
:root {
    /* Couleurs : Fallback vers des valeurs sûres si le thème ne les définit pas */
    --abb-color-primary: #2271b1;
    --abb-color-primary-hover: #135e96;
    --abb-text-main: #333333;
    --abb-bg-warning: #fffbcc;
    --abb-border-warning: #f0b046;
    --abb-radius-standard: 4px;
}

/* ============================================================================
   2. LIEN PROTÉGÉ (JavaScript Activé)
   ============================================================================ */

a.protected-email {
    color: var(--abb-color-primary);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    cursor: pointer;
}

a.protected-email:hover,
a.protected-email:focus {
    color: var(--abb-color-primary-hover);
    text-decoration: none;
    outline: 2px solid var(--abb-color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================================
   3. FALLBACK NO-JS (Notification Sécurisée)
   ============================================================================ */

/* 
   NOTE CRITIQUE (Piège #20) :
   Ces styles sont la base. Le fichier class-core.php injecte dynamiquement
   un bloc <style> avec des !important dans le <head> pour garantir que
   aucun thème ne puisse écraser cette notification vitale.
   Ce fichier sert surtout pour la cohérence visuelle si le CSS dynamique échoue rarement.
*/

.abb-ep-nojs-notice {
    border: 1px solid var(--abb-border-warning);
    background-color: var(--abb-bg-warning);
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: var(--abb-radius-standard);
    color: var(--abb-text-main);
    font-size: 14px;
    line-height: 1.5;
    max-width: 600px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.abb-ep-nojs-notice p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: inherit;
}

.abb-ep-nojs-notice a {
    color: var(--abb-color-primary);
    text-decoration: underline;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.abb-ep-nojs-notice a:hover,
.abb-ep-nojs-notice a:focus {
    color: var(--abb-color-primary-hover);
    text-decoration: none;
}

/* Flèche du lien */
.abb-ep-nojs-notice a::after {
    content: '→';
    font-weight: bold;
    transition: transform 0.2s ease;
}

.abb-ep-nojs-notice a:hover::after {
    transform: translateX(4px);
}

/* ============================================================================
   4. WIDGET (Sidebar)
   ============================================================================ */

.abb-ep-widget {
    margin-bottom: 20px;
}

.abb-ep-widget .widget-title {
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--abb-text-main);
}

/* ============================================================================
   5. ACCESSIBILITÉ (Focus & Contraste)
   ============================================================================ */

/* S'assurer que le focus est toujours visible pour la navigation clavier */
a.protected-email:focus-visible,
.abb-ep-nojs-notice a:focus-visible {
    outline: 3px solid var(--abb-color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Mode contraste élevé (si supporté par le navigateur/OS) */
@media (prefers-contrast: more) {
    a.protected-email {
        text-decoration-thickness: 2px;
    }
    
    .abb-ep-nojs-notice {
        border-width: 2px;
    }
}