/* ==========================================================================
   FSJES FES - THEME ACADÉMIQUE 2025
   Style: Institutionnel, Grille Unifiée, Responsive
   ========================================================================== */

:root {
    /* Palette Académique FSJES */
    --color-primary: #003366;      /* Bleu Roi */
    --color-primary-dark: #002244;
    --color-accent: #bfa15f;       /* Or Universitaire */
    --color-accent-light: #e6dcc5;
    
    /* Couleurs structurelles */
    --color-text-dark: #1a1a1a;
    --color-text-grey: #555555;
    --color-bg-light: #f8f9fa;
    --color-white: #ffffff;
    
    /* UI Elements */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 30px rgba(0, 51, 102, 0.15);
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --font-heading: 'Lora', serif;
    --font-body: 'Inter', sans-serif;
}

/* Base */
body.fsjes-academic-theme {
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background-color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--color-primary-dark); margin: 0; }
a { text-decoration: none; transition: all 0.3s ease; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ============================
   1. HERO SECTION
   ============================ */
.hero-section {
    position: relative;
    height: 85vh; min-height: 600px;
    display: flex; flex-direction: column; justify-content: center;
    color: white; overflow: hidden;
}

.hero-bg-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.hero-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1.2s ease-in-out;
}
.hero-slide.active { opacity: 1; transform: scale(1.02); transition: opacity 1s, transform 6s; }
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(0,34,68,0.85) 0%, rgba(0,51,102,0.6) 100%);
    z-index: 1;
}

.hero-content { position: relative; z-index: 10; width: 100%; padding-bottom: 80px; }
.academic-badge {
    display: inline-flex; flex-direction: column;
    background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(5px);
    border-left: 4px solid var(--color-accent);
    padding: 0.5rem 1rem; margin-bottom: 1.5rem;
}
.badge-year { font-weight: 700; font-size: 1.1rem; color: var(--color-accent); }
.badge-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }

.hero-title { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1.5rem; font-weight: 700; }
.hero-title .text-highlight { color: var(--color-white); }
.hero-subtitle { font-size: 1.2rem; max-width: 600px; margin-bottom: 2.5rem; opacity: 0.9; font-weight: 300; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn { padding: 1rem 2rem; border-radius: 50px; font-weight: 600; display: inline-block; }
.btn-primary { background-color: var(--color-accent); color: var(--color-primary-dark); }
.btn-primary:hover { background-color: #d4b870; transform: translateY(-2px); }
.btn-outline-light { border: 2px solid rgba(255,255,255,0.3); color: white; }
.btn-outline-light:hover { background: white; color: var(--color-primary); }

/* Stats Banner */
.stats-banner {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
    border-top: 4px solid var(--color-accent); padding: 1.5rem 0;
    z-index: 15; box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
}
.stats-grid { display: flex; justify-content: space-around; align-items: center; }
.stat-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    gap: 0.5rem;
}
.stat-number { display: block; font-size: 2rem; font-weight: 700; color: var(--color-primary); line-height: 1; }
.stat-label { font-size: 0.85rem; text-transform: uppercase; color: var(--color-text-grey); letter-spacing: 0.5px; }
.stat-separator { width: 1px; height: 40px; background: #ddd; }

/* Controls */
.slider-controls {
    position: absolute; right: 2rem; bottom: 8rem; z-index: 20;
    display: flex; align-items: center; gap: 1rem;
}
.slider-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: all 0.3s;
}
.slider-btn:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-primary); }

/* ============================
   2. NEWS & AGENDA (Grille Unifiée)
   ============================ */
.news-agenda-section { padding: 5rem 0; background-color: var(--color-bg-light); }

.section-top-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 3rem; border-bottom: 2px solid rgba(0,0,0,0.05); padding-bottom: 1.5rem;
}
.sub-heading { color: var(--color-accent); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 2px; font-weight: 600; display: block; }
.section-top-header h2 { font-size: 2.2rem; color: var(--color-primary); line-height: 1.2; }
.btn-text { color: var(--color-accent); font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-text:hover { color: var(--color-primary); transform: translateX(5px); }

/* GRILLE 4 COLONNES */
.unified-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Colonnes Desktop */
    gap: 1.5rem;
}

/* Styles Communs Cartes */
.uni-card {
    background: white; border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-card); transition: all 0.3s ease;
    display: flex; flex-direction: column; height: 100%; position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}
.uni-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

/* Styles Cartes Actualités (1, 2, 3) */
.news-card-img { height: 180px; width: 100%; object-fit: cover; }
.news-card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.news-meta { font-size: 0.75rem; color: var(--color-accent); font-weight: 700; margin-bottom: 0.5rem; text-transform: uppercase; }
.news-title {
    font-size: 1.1rem; font-weight: 700; color: var(--color-primary-dark);
    margin-bottom: 0.75rem; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-excerpt {
    font-size: 0.9rem; color: #666; margin-bottom: 1.5rem; flex-grow: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.read-more-btn { align-self: flex-start; font-size: 0.85rem; font-weight: 600; color: var(--color-primary); }

/* Style Carte Agenda (4ème) */
.agenda-highlight-card {
    background: linear-gradient(135deg, rgba(17, 80, 150, 0.9) 0%, rgba(10, 50, 100, 0.95) 100%), url('../../../img/bac5.jpg');
    background-size: cover;
    background-position: center;
    color: white; border: none; text-align: center;
    align-items: center; justify-content: center; padding: 2rem;
}
.agenda-icon {
    font-size: 2.5rem; margin-bottom: 1.5rem; background: rgba(255,255,255,0.1);
    width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.agenda-date { display: block; font-size: 3rem; font-weight: 800; line-height: 1; color: var(--color-accent); }
.agenda-month { text-transform: uppercase; letter-spacing: 2px; font-size: 0.9rem; margin-bottom: 1.5rem; opacity: 0.9; }
.agenda-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.5rem; color: white; }
.agenda-link {
    background: white; color: var(--color-primary); padding: 0.6rem 1.2rem;
    border-radius: 20px; font-weight: 600; font-size: 0.9rem; transition: all 0.3s;
}
.agenda-link:hover { background: var(--color-accent); color: white; }

/* Loaders */
.card-loader { background: #eee; height: 350px; border-radius: var(--radius-lg); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% {opacity: 0.6;} 50% {opacity: 1;} }

/* ============================
   3. SERVICES NUMÉRIQUES (Hub)
   ============================ */
.digital-hub-section { 
    padding: 4rem 0; 
    background: white; 
}

.section-header { 
    margin-bottom: 3rem; 
    position: relative; 
}

.header-divider { 
    width: 60px; 
    height: 3px; 
    background: var(--color-primary); 
    margin: 1rem auto; 
}

/* --- GRILLE SERVICES : CONFIGURATION STRICTE --- */
.services-grid {
    display: grid;
    /* Par défaut (Mobile first ou fallback) */
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* Tablette : 2 colonnes */
@media (min-width: 600px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (Écrans > 992px) : STRICTEMENT 3 COLONNES */
@media (min-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* !important force l'application */
    }
}

/* --- CARTE SERVICE (Design Horizontal Compact) --- */
.service-card {
    display: flex;
    flex-direction: row; /* Alignement horizontal (Icône gauche / Texte droite) */
    align-items: center;
    text-align: left;
    padding: 1rem;       /* Padding réduit */
    background: white;
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    gap: 1rem;
    height: 100%;        /* Hauteur uniforme */
}

.service-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.icon-box {
    font-size: 1.5rem;
    margin: 0;
    background: var(--color-bg-light);
    width: 45px;         /* Taille réduite */
    height: 45px;        /* Taille réduite */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;      /* Empêche l'écrasement */
    transition: background 0.3s;
}

.service-card:hover .icon-box { background: var(--color-accent-light); }

.service-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-info h3 {
    font-size: 0.95rem;  /* Titre compact */
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.service-info p {
    font-size: 0.8rem;   /* Description discrète */
    color: var(--color-text-grey);
    margin: 0;
    line-height: 1.3;
}

.service-card.special { background: #f0fdf4; border-color: #dcfce7; }
/* Tabs */
.formations-section { padding: 5rem 0; background: var(--color-bg-light); border-top: 1px solid #eee; }
.tabs-nav { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.tab-btn {
    background: transparent; border: none; padding: 1rem 2rem; font-size: 1.1rem;
    font-family: var(--font-heading); color: var(--color-text-grey); cursor: pointer;
    border-bottom: 3px solid transparent; transition: all 0.3s;
}
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 700; }
.tab-panel { display: none; animation: fadeIn 0.5s ease; }
.tab-panel.active { display: block; }

.panel-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card);
}
.panel-visual { position: relative; height: 100%; min-height: 400px; }
.panel-visual img { width: 100%; height: 100%; object-fit: cover; }
.panel-caption {
    position: absolute; bottom: 2rem; left: 2rem; background: white; padding: 0.5rem 1.5rem;
    font-weight: 700; color: var(--color-primary); border-radius: 50px;
}
.panel-links { padding: 4rem; display: flex; flex-direction: column; justify-content: center; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin-bottom: 1rem; }
.link-list a {
    display: block; padding: 1.2rem; background: var(--color-bg-light);
    border-radius: var(--radius-md); color: var(--color-text-dark); font-weight: 500;
}
.link-list a:hover {
    background: white; border-color: var(--color-accent); color: var(--color-primary);
    transform: translateX(10px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); border: 1px solid var(--color-accent);
}
.panel-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

/* Responsive */
@media (max-width: 1100px) {
    .unified-grid { grid-template-columns: repeat(2, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
    .panel-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.5rem; }
    .stats-grid { flex-wrap: wrap; gap: 1rem; } .stat-separator { display: none; }
}
@media (max-width: 600px) {
    .unified-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; }
    .btn { width: 100%; text-align: center; }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-up { animation: fadeIn 1s ease-out forwards; }

/* ============================
   4. TITRES DE SECTION (Centrage)
   ============================ */
.section-header.text-center,
.section-header-center,
.section-header {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.section-header h2,
.section-header-center h2,
.section-header.text-center h2 {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}