/* Thème global via variables CSS */
:root {
    --bg-primary: #f3f4f6;       /* fond général clair */
    --bg-secondary: #ffffff;     /* cartes / sections */
    --text-primary: #111827;     /* texte principal */
    --text-secondary: #4b5563;   /* texte secondaire */
    --border-color: #e5e7eb;     /* bordures */
    --input-bg: #ffffff;         /* champs de formulaire */
}

html,
body {
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    width: 100%;
    margin: 0;
    padding: 0;
}

body.dark-mode {
    --bg-primary: #020617;      /* slate-950 */
    --bg-secondary: #020617;
    --text-primary: #e5e7eb;    /* gray-200 */
    --text-secondary: #9ca3af;  /* gray-400 */
    --border-color: #1f2937;    /* gray-800 */
    --input-bg: #020617;
}

/* Police manuscrite (uniquement pour le H1) */
.font-another {
    font-family: 'Gochi Hand', cursive;
}

/* Conteneur pour l'animation de saisie */
.typing-container {
    display: inline-block;
    position: relative;
}

/* Style du curseur (fin) */
.typing-cursor {
    display: inline-block;
    width: 3px; /* Curseur fin */
    background-color: #0D2A4F;
    animation: blink-caret .75s step-end infinite;
    opacity: 0; /* Caché par défaut */
}

@keyframes blink-caret {
    from, to { opacity: 0 }
    50% { opacity: 1; } /* Clignotement */
}

/* Classe pour activer le curseur via JS */
.cursor-active {
    opacity: 1;
}

/* Animation pour les éléments secondaires (fade-in simple) */
.simple-fade-in {
    opacity: 0;
    animation: fadeIn 1s forwards;
}
@keyframes fadeIn {
    to { opacity: 1; }
}

/* Fond flouté JMS */
.hero-bg {
    background-image: url("../images/bg.png"); /* mets ton fond JMS ici */
    background-size: cover;
    background-position: center;
}

/* Utilitaires génériques reliés au thème */
.bg-white {
    background-color: var(--bg-secondary) !important;
}

.bg-gray-50 {
    background-color: var(--bg-secondary) !important;
}

.text-gray-900 {
    color: var(--text-primary) !important;
}

.text-gray-700,
.text-gray-600,
.text-gray-500,
.text-gray-400 {
    color: var(--text-secondary) !important;
}

.border-gray-200,
.border-gray-300 {
    border-color: var(--border-color) !important;
}

/* Header spécifique page d'accueil : espacement vertical encore plus compact */
.home-header-compact {
    padding-top: 0.1rem !important;
    padding-bottom: 0.15rem !important;
}

/* Style pour les icônes du footer (transition douce) */
.social-icon {
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.social-icon:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

/* ========================================
   ANIMATION 3D DES LIVRES - BIBLIOTHÈQUE
   ======================================== */

.book-scene {
    perspective: 1000px;
    display: block;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    min-height: 200px; /* Force une hauteur minimale */
}

.book {
    position: relative;
    width: 100%;
    padding-bottom: 150%; /* Ratio 2:3 pour un livre */
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Effet 3D au survol */
.book-scene:hover .book {
    transform: rotateY(-15deg) rotateX(5deg) translateZ(20px);
}

.book-scene:hover .book-cover {
    box-shadow: 
        -15px 15px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Animation d'apparition progressive */
.book-scene {
    animation: bookAppear 0.6s ease-out backwards;
}

.book-scene:nth-child(1) { animation-delay: 0.1s; }
.book-scene:nth-child(2) { animation-delay: 0.2s; }
.book-scene:nth-child(3) { animation-delay: 0.3s; }
.book-scene:nth-child(4) { animation-delay: 0.4s; }
.book-scene:nth-child(5) { animation-delay: 0.5s; }
.book-scene:nth-child(6) { animation-delay: 0.6s; }
.book-scene:nth-child(7) { animation-delay: 0.7s; }
.book-scene:nth-child(8) { animation-delay: 0.8s; }
.book-scene:nth-child(9) { animation-delay: 0.9s; }
.book-scene:nth-child(10) { animation-delay: 1s; }
.book-scene:nth-child(11) { animation-delay: 1.1s; }
.book-scene:nth-child(12) { animation-delay: 1.2s; }

@keyframes bookAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Effet de brillance sur la couverture */
.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s;
}

.book-scene:hover .book-cover::before {
    left: 100%;
}

/* ========================================
   Mise en forme du contenu des programmes
   ======================================== */

.prog-section-title {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0D2A4F; /* jms-blue */
}

.prog-callout {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #0D2A4F;
    background-color: var(--bg-secondary);
    border-radius: 0.75rem;
}

.prog-callout-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0D2A4F;
}

.prog-callout-body p {
    margin: 0.25rem 0;
}

.prog-list {
    margin: 1rem 0 1rem 1.25rem;
    padding-left: 0;
}

.prog-list li {
    margin-bottom: 0.35rem;
}

/* ========================================
   Mise en forme éditoriale des contenus longs
   ======================================== */

.content-card {
    background-color: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 0.75rem; /* ~12px */
    box-shadow: 0 10px 25px -10px rgba(15, 23, 42, 0.25);
}

@media (min-width: 1024px) {
    .content-card {
        padding: 3rem;
    }
}

.content-body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    max-width: 70ch;
    margin: 0 auto; /* colonne centrée */
}

.content-body p {
    margin-bottom: 1.1rem;
}

/* Paragraphes d'introduction des programmes (premiers paragraphes) */
.prog-intro-paragraph {
    background-color: #eff6ff;           /* même teinte que bg-blue-50 */
    border-left: 4px solid #0D2A4F;      /* bleu JMS */
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}

/* Sécurité : applique aussi le fond bleu aux deux premiers paragraphes 
   du texte principal, même sans classe spécifique */
.content-card .content-body > p:nth-of-type(-n + 2) {
    background-color: #eff6ff;           /* bleu clair programmes */
    border-left: 4px solid #0D2A4F;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}

.content-body h2,
.content-body h3 {
    color: #0D2A4F; /* jms-blue */
    font-weight: 700;
    margin-top: 2.25rem;
    margin-bottom: 0.9rem;
    position: relative;
}

.content-body h2::before,
.content-body h3::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.35rem;
    width: 3rem;
    height: 3px;
    border-radius: 9999px;
    background: linear-gradient(90deg, #DC2626, #0D2A4F);
}

.content-body ul,
.content-body ol {
    margin: 1rem 0 1rem 1.5rem;
}

.content-body li {
    margin-bottom: 0.4rem;
}

/* ========================================
   Mode sombre global (body.dark-mode ...)
   ======================================== */

.bg-slate-950 {
    background-color: #020617 !important;
}

body.dark-mode {
    background-color: #020617; /* slate-950 */
    color: #e5e7eb; /* gray-200 */
}

body.dark-mode main,
body.dark-mode .content-card {
    background-color: #020617;
    color: #e5e7eb;
}

body.dark-mode header {
    background-color: rgba(15, 23, 42, 0.9) !important; /* slate-900 */
    color: #e5e7eb;
}

body.dark-mode .w-full.bg-white.border-b,
body.dark-mode .w-full.bg-white.border-b .container {
    background-color: #020617 !important;
    border-color: #1f2937 !important; /* gray-800 */
}

body.dark-mode .marquee {
    color: #f97316 !important; /* orange-500 */
}

/* Cartes et blocs principaux (bg-white) */
body.dark-mode .bg-white {
    background-color: #020617 !important;
}

body.dark-mode .text-gray-900 {
    color: #e5e7eb !important;
}

body.dark-mode .text-gray-800,
body.dark-mode .text-gray-700,
body.dark-mode .text-gray-600,
body.dark-mode .text-gray-500 {
    color: #9ca3af !important; /* gray-400 */
}

body.dark-mode .border-gray-200,
body.dark-mode .border-gray-300 {
    border-color: #1f2937 !important; /* gray-800 */
}

body.dark-mode .shadow,
body.dark-mode .shadow-sm,
body.dark-mode .shadow-md,
body.dark-mode .shadow-lg,
body.dark-mode .shadow-xl {
    box-shadow: 0 10px 25px -10px rgba(15, 23, 42, 0.9) !important;
}

/* Liens principaux */
body.dark-mode a {
    color: #93c5fd;
}

body.dark-mode a:hover {
    color: #bfdbfe;
}

/* Boutons pill-appear en mode sombre */
body.dark-mode .pill-appear {
    border-color: #e5e7eb !important;
}

body.dark-mode .pill-appear span.relative.z-10 {
    color: #e5e7eb !important;
}

/* Menu mobile en mode sombre */
body.dark-mode #mobile-menu {
    background: rgba(15, 23, 42, 0.96) !important;
}

/* Sections initiative / équipe : titres */
body.dark-mode .text-jms-blue {
    color: #bfdbfe !important;
}

body.dark-mode .border-jms-blue {
    border-color: #1d4ed8 !important;
}

/* Encadrés d'information (bg-blue-50 / bg-green-50) en mode sombre */
body.dark-mode .bg-blue-50,
body.dark-mode .bg-green-50 {
    background-color: var(--bg-secondary) !important;
}

/* Rectangles clairs (bg-gray-200) en mode sombre : gris/bleu plus profond et texte lisible */
body.dark-mode .bg-gray-200 {
    background-color: rgba(148, 163, 184, 0.18) !important; /* slate/gray doux */
    color: var(--text-primary) !important;
}

/* Boutons pilules en mode sombre : halo bleu/rouge animé */
body.dark-mode .pill-appear {
    position: relative;
    overflow: hidden;
    background-color: #020617 !important;
}

body.dark-mode .pill-appear::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 9999px;
    background: linear-gradient(120deg, #0D2A4F, #E53E3E, #0D2A4F);
    background-size: 200% 200%;
    animation: jmsGlow 3s linear infinite;
    z-index: -1;
}

body.dark-mode .pill-appear::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background-color: #020617;
    z-index: -1;
}

@keyframes jmsGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   Tables & formulaires (front + admin)
   ======================================== */

table {
    border-collapse: collapse;
}

th,
td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
}

thead th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

tbody tr:nth-child(odd) {
    background-color: var(--bg-secondary);
}

tbody tr:nth-child(even) {
    background-color: rgba(148, 163, 184, 0.05); /* léger contraste, ok clair/sombre */
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
}


/* ========================================
   Photos de l'équipe / stagiaires
   Recadrage centré des portraits
   ======================================== */

/* Vignettes des membres (grille de gauche) */
.js-team-member img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Portrait détaillé (panneau de droite) */
#team-member-detail-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

