/* /assets/css/common.css (VERSION FINALE NAVBAR ET DESIGN MODERNE) */

* { margin: 0; padding: 0; box-sizing: border-box; }
/* On retire scroll-behavior: smooth; car il cause des bugs de saut sur iPad/iPhone */
html { }
body { 
    font-family: 'Segoe UI', sans-serif; 
    background-color: #f4f7f9; 
    color: #333; 
    min-height: 100vh; /* Sécurité pour vieux navigateurs */
    min-height: 100vh; /* NOUVEAU : Gère parfaitement la barre iPad sans sauter */
    display: flex; 
    flex-direction: column; 
    /* On retire overscroll-behavior-y qui causait des rigidités */
}
main { flex-grow: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* FIX IOS : Empêcher le zoom et le décalage */
input, textarea, select { font-size: 16px !important; }

/* Focus visible pour la navigation au clavier (Accessibilité) */
:focus-visible { outline: 3px solid #667eea; outline-offset: 2px; }

/* --- Header & Navigation --- */
header.site-header { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid #e6e6e6; position: sticky; top: 0; z-index: 999; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
header.site-header nav { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 1rem 20px; }
.logo-link { text-decoration: none; flex-shrink: 0; z-index: 10000; }
.logo { font-size: 2rem; font-weight: bold; background: linear-gradient(45deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: flex; align-items: center; gap: 0.5rem; transition: transform 0.3s ease; }
.logo-link:hover .logo { transform: scale(1.05); }
.logo::before { content: "🎮"; font-size: 1.5rem; }

.nav-links { list-style: none; margin: 0; display: flex; gap: 2rem; align-items: center; }
.nav-links a { text-decoration: none; color: #333; font-weight: 500; transition: color 0.3s; position: relative; padding: 0.5rem 0; white-space: nowrap; }
.nav-links a:hover { color: #667eea; }

.nav-actions { display: flex; align-items: center; gap: 1.5rem; flex-shrink: 0; z-index: 10000; }
.search-widget .search-form { position: relative; }
.search-widget input[type="search"] { padding: 0.5rem 2.5rem 0.5rem 1rem; border: 1px solid #ddd; border-radius: 50px; width: 200px; transition: width 0.3s; font-size: 0.9rem; }
.search-widget input[type="search"]:focus { width: 250px; outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2); }
.search-widget button { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 0.4rem; color: #888; }
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: #333; }
.mobile-menu-overlay { display: none; }
.mobile-search { display: none; }

/* --- Responsive Navigation --- */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .mobile-menu-toggle { display: block; z-index: 1002; }
    .mobile-search { display: none; }
    .mobile-menu-overlay.active { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 1000; }
    .nav-links.active { display: flex; position: fixed; top: 0; left: 0; right: 0; max-height: calc(100vh - 72px); overflow-y: auto; -webkit-overflow-scrolling: touch; background: white; flex-direction: column; justify-content: flex-start; align-items: center; padding: 1rem 1rem; gap: 0.75rem; z-index: 1001; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); animation: slideDown 0.3s ease-out; }
    .nav-links.active a { font-size: 1.1rem; }
}

@media (max-width: 768px) {
    .nav-actions .search-widget { display: none; }
    .nav-links.active { padding-top: 0.5rem; }
    .mobile-search { display: flex; justify-content: center; width: 100%; padding: 0.5rem 1rem; margin-bottom: 0.5rem; border-bottom: 1px solid #eee; }
    .mobile-search .search-form { width: 100%; max-width: 420px; position: relative; }
    .mobile-search input[type="search"] { width: 100%; padding: 0.6rem 3rem 0.6rem 1rem; font-size: 1rem; border-radius: 999px; }
    .mobile-search button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 0.25rem; }
    .nav-links.active li { margin: 0; padding: 0.25rem 0; }
    .nav-links.active { gap: 0.5rem; }
}

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

/* --- Styles de Boutons Modernisés --- */
.btn { 
    display: inline-block; padding: 0.8rem 1.8rem; border: none; border-radius: 50px; 
    font-weight: 600; font-size: 0.95rem; text-decoration: none; text-align: center; 
    cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); 
    position: relative; overflow: hidden;
}
.btn:hover, .btn:focus { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.4); 
    outline: none; 
}
.btn-primary { 
    background: linear-gradient(135deg, #667eea, #764ba2); color: white; 
}
.btn-primary:hover {
    filter: brightness(1.1);
}
.btn-secondary { 
    background: white; color: #667eea; border: 2px solid #e2e8f0; box-shadow: none; 
}
.btn-secondary:hover, .btn-secondary:focus { 
    background: #f8fafc; border-color: #667eea; color: #764ba2; 
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05); 
}
.btn-white { background: white; color: #667eea; border: 2px solid white; }
.btn-white:hover, .btn-white:focus { background: transparent; color: white; }
.back-btn { background: linear-gradient(45deg, #667eea, #764ba2); color: white; border: none; cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.2rem; border-radius: 25px; text-decoration: none; font-weight: 500; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.back-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4); }

/* --- Cartes Modernisées Globales --- */
.card-base {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
    display: flex; flex-direction: column; height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
    overflow: hidden;
    position: relative;
}
.card-link:hover .card-base, .card-base:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    border-color: #e2e8f0;
}

/* --- Footer --- */
footer { background: linear-gradient(135deg, #4b5bb5 0%, #5a3b7e 100%); color: #bdc3c7; padding: 4rem 0 2rem 0; margin-top: auto; font-size: 0.95rem; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2.5rem; margin-bottom: 3rem; }
.footer-section h3 { margin-bottom: 1.5rem; color: #ffffff !important; font-size: 1.1rem; font-weight: 600; position: relative; padding-bottom: 0.5rem; }
.footer-section h3::after { content: ''; position: absolute; bottom: 0; left: 0; width: 30px; height: 2px; background: #667eea; }
.footer-section p, .footer-section li, .footer-section a { color: #bdc3c7 !important; line-height: 1.7; }
.footer-section a { text-decoration: none; display: block; margin-bottom: 0.75rem; transition: color 0.3s ease, padding-left 0.3s ease; }
.footer-section a:hover { color: #ffffff !important; padding-left: 5px; }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid #46627f; color: #95a5a6; font-size: 0.9rem; }

/* --- Utilitaires --- */
.loading { display: block; text-align: center; padding: 2rem; color: #555; }
.loading-small { text-align:center; padding: 2rem; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(102, 126, 234, 0.3); border-top-color: #667eea; border-radius: 50%; margin: 0 auto 1rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === SECTION PARTAGE === */
.post-sharing { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #ecf0f1; text-align: center; }
.post-sharing h3 { font-size: 1.2rem; color: #7f8c8d; font-weight: 500; margin-bottom: 1.5rem; }
.share-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; text-decoration: none; color: white; font-size: 1.3rem; transition: transform 0.2s ease-out, box-shadow 0.2s ease-out; }
.share-btn:hover { transform: translateY(-4px) scale(1.1); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.share-btn.facebook { background-color: #1877F2; }
.share-btn.twitter { background-color: #14171A; }
.share-btn.linkedin { background-color: #0A66C2; }
.share-btn.copy-link { background-color: #7f8c8d; cursor: pointer; border: none;}
.copy-link-feedback { display: inline-block; margin-top: 1rem; padding: 0.5rem 1rem; border-radius: 6px; background-color: #2c3e50; color: white; font-size: 0.9rem; font-weight: 500; opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.copy-link-feedback.visible { opacity: 1; transform: translateY(0); }

/* =========================================================================
   WIDGET D'ACCESSIBILITÉ GLOBAL (A11Y) - DESIGN MODERNE
   ========================================================================= */

/* --- BOUTON FLOTTANT --- */
#a11y-widget-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 56px;
    height: 56px;
    background: #ffffff;
    color: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}
#a11y-widget-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
#a11y-widget-btn svg { 
    width: 28px; 
    height: 28px; 
    fill: currentColor; 
}

/* --- PANNEAU DE RÉGLAGES --- */
#a11y-panel {
    position: fixed;
    bottom: 95px;
    left: 25px;
    width: 320px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    padding: 24px;
    z-index: 99998;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    transform-origin: bottom left;
}
#a11y-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.a11y-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.a11y-header h4 { margin: 0; font-size: 1.2rem; color: #1e293b; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.a11y-close { background: #f1f5f9; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; color: #64748b; transition: 0.2s; display: flex; justify-content: center; align-items: center;}
.a11y-close:hover { background: #fee2e2; color: #ef4444; }

.a11y-section { margin-bottom: 20px; }
.a11y-section strong { display: block; font-size: 0.95rem; margin-bottom: 10px; color: #475569; font-weight: 600;}

/* Boutons segmentés (Style iOS) */
.a11y-btn-group { display: flex; gap: 6px; background: #f1f5f9; padding: 5px; border-radius: 12px; }
.a11y-btn { flex: 1; padding: 10px 5px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 0.9rem; transition: 0.2s; color: #64748b; font-weight: 500;}
.a11y-btn:hover { color: #1e293b; }
.a11y-btn.active { background: #ffffff; color: #667eea; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }

/* Bouton Reset */
.a11y-reset { width: 100%; padding: 12px; background: transparent; color: #94a3b8; border: 2px dashed #cbd5e1; border-radius: 12px; cursor: pointer; font-weight: 600; margin-top: 5px; transition: 0.2s; }
.a11y-reset:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }

@media (max-width: 480px) {
    #a11y-panel { width: calc(100% - 50px); }
}

/* --- SURCHARGES D'ACCESSIBILITÉ ACTIVES --- */

/* 1. Police OpenDyslexic */
html.a11y-dyslexic body,
html.a11y-dyslexic h1, html.a11y-dyslexic h2, html.a11y-dyslexic h3, html.a11y-dyslexic h4,
html.a11y-dyslexic p, html.a11y-dyslexic a, html.a11y-dyslexic span,
html.a11y-dyslexic div, html.a11y-dyslexic button, html.a11y-dyslexic input,
html.a11y-dyslexic textarea, html.a11y-dyslexic select {
    font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

/* 2. Taille du texte */
html.a11y-text-large { font-size: 115% !important; }
html.a11y-text-xlarge { font-size: 130% !important; }