/* =============================================================
   THEOLOGIA REFORMATA — AMPLIFICATION FESTIVE
   Ajoute du dynamisme aux pages structurelles (index, portails)
   sans casser la lisibilité académique des contenus longs.
   À charger APRÈS style.css, modules.css, magister.css,
   fantaisie.css, festif.css.
   ============================================================= */

/* =============================================
   1. VARIABLES ENRICHIES — palette plus vive
   ============================================= */
:root {
    --feu-vermillon: #d4471f;
    --safran: #e8a532;
    --emeraude: #2d8a4a;
    --azur-vif: #1e6fa8;
    --pourpre: #7a2e5a;
    --ombre-douce: 0 4px 14px rgba(180, 100, 60, 0.18);
    --ombre-marquee: 0 6px 22px rgba(155, 28, 28, 0.22);
}

/* =============================================
   2. ANIMATIONS GLOBALES DISCRÈTES
   ============================================= */
@keyframes scintille-doux {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes ondule-leger {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes apparait-doux {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rotation-lente {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-festive {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* =============================================
   3. EFFETS HOVER GLOBAUX
   ============================================= */
/* Liens dans la navigation latérale et le corps */
.bib-nav a,
.parcours-nav a,
.module-lien,
a.module-card,
.tuile {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bib-nav a:hover,
.parcours-nav a:hover,
.module-lien:hover,
a.module-card:hover,
.tuile:hover {
    transform: translateY(-2px);
    color: var(--feu-vermillon);
    text-decoration: none;
}

/* =============================================
   4. TABLEAUX COMPARATIFS PLUS VIVANTS
   ============================================= */
.tableau-comparatif tbody tr {
    transition: background 0.25s ease;
}
.tableau-comparatif tbody tr:hover {
    background: linear-gradient(90deg,
        rgba(232, 165, 50, 0.08) 0%,
        rgba(212, 71, 31, 0.04) 100%);
}
.tableau-comparatif th {
    position: relative;
}
.tableau-comparatif th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--safran) 50%,
        transparent 100%);
}

/* =============================================
   5. TUILES DE BRANCHES — animation entrée
   ============================================= */
.branche-tuile {
    animation: apparait-doux 0.6s ease-out both;
    transition: transform 0.3s, box-shadow 0.3s;
}
.branche-tuile:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--ombre-marquee);
}
.branche-tuile:nth-child(1) { animation-delay: 0.05s; }
.branche-tuile:nth-child(2) { animation-delay: 0.15s; }
.branche-tuile:nth-child(3) { animation-delay: 0.25s; }
.branche-tuile:nth-child(4) { animation-delay: 0.35s; }

/* Icône qui se balance subtilement */
.branche-icone {
    display: inline-block;
    animation: ondule-leger 4s ease-in-out infinite;
}
.branche-tuile:hover .branche-icone {
    animation: pulse-festive 0.8s ease-in-out infinite;
}

/* =============================================
   6. TIRET-ROUGE — ornement enluminé
   ============================================= */
.tiret-rouge {
    position: relative;
    padding-left: 1.2em;
}
.tiret-rouge::before {
    content: '❧';
    position: absolute;
    left: 0;
    color: var(--feu-vermillon);
    font-size: 0.85em;
    transition: transform 0.3s;
    display: inline-block;
}
.tiret-rouge:hover::before {
    transform: scale(1.4) rotate(-12deg);
    color: var(--safran);
}

/* =============================================
   7. BOUTONS ET BADGES VIVANTS
   ============================================= */
.bc, span.bc {
    transition: all 0.2s ease;
    cursor: default;
}
.bc:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: var(--ombre-douce);
}

/* Boutons généraux */
button:not(.no-festif),
.btn,
.bouton {
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
button:not(.no-festif):hover,
.btn:hover,
.bouton:hover {
    transform: translateY(-1px);
    box-shadow: var(--ombre-marquee);
}

/* =============================================
   8. CARTES DE CONFESSION — relief
   ============================================= */
.confession-carte {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.confession-carte:hover {
    transform: translateY(-5px) rotate(-0.5deg);
    box-shadow: 0 10px 28px rgba(155, 28, 28, 0.18);
}

/* =============================================
   9. PORTAIL D'ACCUEIL — bannière vive
   ============================================= */
.accueil-titre,
.bandeau-titre,
h1.titre-principal {
    background: linear-gradient(135deg,
        #3a2820 0%,
        var(--pourpre) 35%,
        var(--feu-vermillon) 70%,
        var(--safran) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: apparait-doux 1s ease-out both;
}

/* =============================================
   10. FRISES CHRONOLOGIQUES VIVANTES
   ============================================= */
.frise-point {
    transition: all 0.3s;
    cursor: pointer;
}
.frise-item:hover .frise-point {
    transform: scale(1.5);
    box-shadow: 0 0 0 4px rgba(212, 71, 31, 0.25);
}
.frise-item:hover .frise-date {
    color: var(--feu-vermillon);
    font-weight: 600;
}

/* =============================================
   11. GLOSSAIRES INTERACTIFS
   ============================================= */
.glossaire-terme {
    transition: all 0.3s;
    border-left: 3px solid transparent;
}
.glossaire-terme:hover {
    border-left-color: var(--safran);
    transform: translateX(4px);
    background: linear-gradient(90deg,
        rgba(232, 165, 50, 0.08) 0%,
        transparent 50%);
}

/* =============================================
   12. PERSONNAGES MAGISTER — bond joyeux
   ============================================= */
.prof-avatar,
.magister-avatar,
.perso-avatar {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.prof-avatar:hover,
.magister-avatar:hover,
.perso-avatar:hover {
    transform: translateY(-6px) rotate(-3deg);
}

/* =============================================
   13. RUBRIQUES SECONDAIRES (h4)
   ============================================= */
h4 {
    position: relative;
    padding-left: 0.6em;
    border-left: 3px solid var(--safran);
    transition: border-color 0.3s;
}
h4:hover {
    border-left-color: var(--feu-vermillon);
}

/* =============================================
   14. CITATIONS / BLOCKQUOTES
   ============================================= */
blockquote {
    position: relative;
    transition: all 0.3s;
}
blockquote:hover {
    border-left-color: var(--feu-vermillon, #d4471f);
}
blockquote::before {
    content: '“';
    position: absolute;
    top: -0.2em;
    left: -0.1em;
    font-family: Georgia, serif;
    font-size: 2.5em;
    color: var(--safran, #e8a532);
    opacity: 0.35;
    line-height: 1;
    pointer-events: none;
}

/* =============================================
   15. ÉLÉMENTS DÉCORATIFS PUNCTUELS
   ============================================= */
/* Mini-séparateur en fin de section */
.section-sep::after {
    content: '✦ ◆ ✦';
    display: block;
    text-align: center;
    color: var(--safran, #e8a532);
    margin: 2rem 0;
    letter-spacing: 1.2em;
    animation: scintille-doux 4s ease-in-out infinite;
}

/* =============================================
   16. ACCESSIBILITÉ : respect des préférences
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =============================================
   17. TEXTES INTÉGRAUX ET TRADUCTIONS PARALLÈLES
   ============================================= */
.textes-paralleles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1.2rem;
    background: linear-gradient(135deg, #fefcf6 0%, #faf6ec 100%);
    border: 1px solid #d4c8a8;
    border-radius: 10px;
}

@media (min-width: 900px) {
    .textes-paralleles {
        grid-template-columns: repeat(2, 1fr);
    }
}

.texte-original,
.texte-traduction {
    background: #ffffff;
    border-left: 4px solid var(--bordeaux, #9b1c1c);
    padding: 1rem 1.2rem;
    border-radius: 0 6px 6px 0;
    transition: box-shadow 0.3s, transform 0.3s;
}

.texte-original {
    border-left-color: var(--bordeaux, #9b1c1c);
    background: linear-gradient(135deg, #ffffff 0%, #fef8eb 100%);
}

.texte-traduction {
    border-left-color: var(--safran, #e8a532);
}

.texte-original:hover,
.texte-traduction:hover {
    box-shadow: 0 4px 14px rgba(155, 28, 28, 0.12);
    transform: translateY(-1px);
}

.texte-original h4,
.texte-traduction h4 {
    margin: 0 0 0.6rem 0;
    color: var(--bordeaux, #9b1c1c);
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-left: none;
    padding-left: 0;
}

.texte-original p,
.texte-traduction p {
    margin: 0.4rem 0;
    line-height: 1.6;
    font-size: 0.98rem;
}

.texte-original [lang="grc"],
.texte-traduction [lang="grc"] {
    font-family: 'GFS Didot', 'New Athena Unicode', 'Times New Roman', serif;
    font-size: 1.08em;
}

.texte-original [lang="he"],
.texte-traduction [lang="he"] {
    font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
    direction: rtl;
    text-align: right;
    font-size: 1.15em;
}

.texte-original [lang="la"] em,
.texte-traduction [lang="la"] em {
    font-style: italic;
}

.translit {
    font-size: 0.85rem !important;
    color: #6b5544;
    font-style: italic;
    margin-top: 0.3rem !important;
    border-top: 1px dashed rgba(155, 28, 28, 0.2);
    padding-top: 0.4rem;
}

.apparat {
    font-size: 0.82rem !important;
    color: #6b5544;
    margin-top: 0.5rem !important;
    padding: 0.5rem 0.7rem;
    background: rgba(232, 165, 50, 0.08);
    border-radius: 4px;
    border-left: 3px solid var(--safran, #e8a532);
}

/* =============================================
   18. CONTENU LINÉARISÉ — remplacement des onglets cachants
   ============================================= */
.contenu-linearise {
    margin-top: 1rem;
}

.sections-linearisees {
    display: block;
}

.section-module {
    display: block;
    padding: 1.2rem 0;
    margin: 0;
    border-top: 2px solid #e0d4b8;
}

.section-module:first-of-type {
    border-top: none;
    padding-top: 0;
}

.section-module > h2:first-child {
    margin-top: 1.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 3px double var(--bordeaux, #9b1c1c);
    color: var(--bordeaux, #9b1c1c);
}

/* Sommaire visuel pour mieux orienter dans le contenu long */
.contenu-linearise::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--bordeaux, #9b1c1c) 0%, var(--safran, #e8a532) 100%);
    border-radius: 2px;
    margin-bottom: 1rem;
}

/* Override potentiel CSS .onglet-contenu pour le rendre toujours visible */
.onglet-contenu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Override potentiel des inputs radio cachés */
.onglets > input[type="radio"] { display: none !important; }
.onglets-barre { display: none !important; }

/* =============================================
   19. AVATAR UTILISATEUR — connexion / profil
   ============================================= */
.avatar-utilisateur {
    margin-top: 1rem;
    padding: 0.8rem;
    background: linear-gradient(135deg, rgba(232, 165, 50, 0.12) 0%, rgba(155, 28, 28, 0.08) 100%);
    border-radius: 10px;
    border: 1px solid rgba(232, 165, 50, 0.3);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: avatarApparition 0.5s ease;
}

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

.avatar-lien {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    transition: opacity 0.2s;
}

.avatar-lien:hover {
    opacity: 0.85;
}

.avatar-cercle {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bordeaux, #9b1c1c) 0%, #c84545 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.avatar-initiales {
    font-family: Georgia, serif;
    letter-spacing: 0.5px;
}

.avatar-glyphe {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--safran, #e8a532);
    color: var(--bordeaux, #9b1c1c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    border: 2px solid #fff;
}

.avatar-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    flex: 1;
}

.avatar-prenom {
    font-weight: 600;
    color: #f4ead4;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-niveau {
    font-size: 0.75rem;
    color: var(--safran, #e8a532);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.avatar-progression-lien {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(232, 165, 50, 0.2);
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.avatar-progression-lien:hover {
    background: rgba(232, 165, 50, 0.4);
    transform: scale(1.1);
}

/* =============================================
   20. FLASHCARDS INTERACTIVES — carte recto/verso
   ============================================= */

/* Grille aérée : 2 colonnes max sur desktop, 1 sur mobile */
.flashcards-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin: 1.2rem 0;
    padding: 1.2rem;
    background: linear-gradient(135deg, #fefcf6 0%, #faf6ec 100%);
    border-radius: 10px;
    border: 1px solid #d4c8a8;
}

/* Titre clair AVANT la grille pour identifier qu'on entre dans une section flashcards */
.flashcards-grille::before {
    content: "📚 Cartes de révision — cliquez sur une carte pour révéler la réponse";
    display: block;
    grid-column: 1 / -1;
    font-family: Georgia, serif;
    font-size: 0.95rem;
    color: var(--bordeaux, #9b1c1c);
    font-style: italic;
    text-align: center;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed rgba(155, 28, 28, 0.3);
    margin-bottom: 0.5rem;
}

/* Conteneur de carte avec perspective 3D */
.flashcards-grille .flashcard {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    min-height: 200px !important;
    perspective: 1000px;
    cursor: pointer;
    margin: 0 !important;
    display: block !important;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

/* Au clic ou survol, la carte se retourne */
.flashcard:hover .flashcard-inner,
.flashcard:focus .flashcard-inner,
.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

/* Faces de la carte (recto / verso) */
.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Face avant : question — fond bordeaux clair */
.flashcard-face:not(.flashcard-back) {
    background: linear-gradient(135deg, #ffffff 0%, #fef8eb 100%);
    border: 1px solid var(--bordeaux, #9b1c1c);
    color: var(--bordeaux, #9b1c1c);
}

.flashcard-face:not(.flashcard-back)::after {
    content: "🔄 cliquer";
    position: absolute;
    bottom: 0.5rem;
    right: 0.8rem;
    font-size: 0.7rem;
    color: rgba(155, 28, 28, 0.5);
    font-family: var(--sans-ui, sans-serif);
}

.flashcard-q {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

/* Face arrière : réponse — fond safran */
.flashcard-back {
    background: linear-gradient(135deg, #fef8eb 0%, #f8e8b8 100%);
    border: 1px solid var(--safran, #e8a532);
    transform: rotateY(180deg);
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
}

.flashcard-back p {
    font-family: Georgia, serif;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #4a3e30;
    margin: 0;
}

/* Sommaire automatique en début de module */
.sommaire-module {
    background: linear-gradient(135deg, #fefcf6 0%, #faf6ec 100%);
    border-left: 4px solid var(--bordeaux, #9b1c1c);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.5rem;
    margin: 1rem 0 2rem 0;
}

.sommaire-module-titre {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    color: var(--bordeaux, #9b1c1c);
    font-weight: 600;
    margin: 0 0 0.6rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sommaire-module ol {
    margin: 0;
    padding-left: 1.2rem;
    columns: 2;
    column-gap: 2rem;
}

@media (max-width: 720px) {
    .sommaire-module ol { columns: 1; }
}

.sommaire-module li {
    margin: 0.3rem 0;
    break-inside: avoid;
}

.sommaire-module a {
    color: #4a3e30;
    text-decoration: none;
    border-bottom: 1px dotted rgba(155, 28, 28, 0.4);
    transition: color 0.2s, border-color 0.2s;
}

.sommaire-module a:hover {
    color: var(--bordeaux, #9b1c1c);
    border-bottom-color: var(--bordeaux, #9b1c1c);
}


/* === ENCADRÉ DOCTRINAL (rubriques synthétiques) === */
.encadre-doctrinal {
    background: linear-gradient(135deg, #fdf6e3 0%, #faf0d8 100%);
    border-left: 4px solid #9b1c1c;
    padding: 1.5rem 1.8rem;
    margin: 2rem 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.encadre-doctrinal .encadre-titre {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #9b1c1c;
    margin: 0 0 0.8rem 0;
    border-bottom: 1px solid rgba(155,28,28,0.3);
    padding-bottom: 0.4rem;
}
.encadre-doctrinal ol {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}
.encadre-doctrinal ol > li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}
.encadre-doctrinal p {
    line-height: 1.65;
}
@media (max-width: 480px) {
    .encadre-doctrinal {
        padding: 1rem 1.1rem;
        margin: 1.5rem 0;
    }
}

/* === MENTION IA — transparence éditoriale === */
.mention-ia {
    font-size: 0.85rem;
    color: #5a4f3e;
    font-style: italic;
    padding: 0.6rem 0;
    line-height: 1.5;
    border-top: 1px dashed rgba(155, 28, 28, 0.2);
    margin-top: 0.8rem;
}
.mention-ia strong {
    font-style: normal;
    color: #9b1c1c;
}

.bandeau-mention-ia {
    background: linear-gradient(135deg, #fefcf6 0%, #faf6ec 100%);
    border-left: 4px solid #4a7c59;
    padding: 1.2rem 1.6rem;
    margin: 2rem 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.bandeau-mention-ia .bandeau-titre {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #4a7c59;
    margin: 0 0 0.6rem 0;
}
.bandeau-mention-ia p {
    margin: 0.4rem 0;
    line-height: 1.6;
    color: #3a3024;
}
@media (max-width: 480px) {
    .bandeau-mention-ia {
        padding: 0.9rem 1rem;
        margin: 1.5rem 0;
    }
}

/* === AVATAR MODE INVITÉ (apparaît dès l'ouverture du site) === */
.avatar-utilisateur.avatar-invite {
    background: linear-gradient(135deg, rgba(74, 124, 89, 0.10) 0%, rgba(232, 165, 50, 0.08) 100%);
    border: 1px dashed rgba(74, 124, 89, 0.4);
    animation: avatarApparition 0.6s ease;
}

.avatar-cercle.avatar-cercle-invite {
    background: linear-gradient(135deg, #6b7a85 0%, #8a9aa5 100%);
    font-size: 1.4rem;
    color: white;
}

.avatar-cercle.avatar-cercle-invite .avatar-initiales {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Emoji", sans-serif;
}

.avatar-niveau-creer {
    font-style: italic;
    color: #4a7c59 !important;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 2px;
    animation: pulseInvitation 2.5s ease-in-out infinite;
}

@keyframes pulseInvitation {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.avatar-lien.avatar-lien-invite:hover .avatar-niveau-creer {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .avatar-utilisateur.avatar-invite {
        padding: 0.6rem;
    }
}
