/* ========================================
   Styles pour la page d'accueil ISME
   Cours : Assurer le reporting
   ======================================== */

/* --- Variables CSS --- */
:root {
    --primary-color: #003366;
    --secondary-color: #004080;
    --accent-color: #E63946;
    --accent-hover: #D62839;
    --background-color: #F8F9FA;
    --card-background: #FFFFFF;
    --text-color: #2D3436;
    --text-light: #636E72;
    --border-color: #E0E0E0;
    --shadow-light: 0 2px 8px rgba(0, 51, 102, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 51, 102, 0.12);
    --shadow-hover: 0 8px 24px rgba(0, 51, 102, 0.16);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 8px;
}

/* --- Reset et base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Typographie --- */
h1, h2, h3 {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
}

/* --- Header --- */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: rgba(255, 255, 255, 0.03);
    transform: skewX(-15deg) translateX(100px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.logo-container {
    flex-shrink: 0;
}

.logo {
    width: 80px;
    height: auto;
    border-radius: var(--border-radius);
    background: white;
    padding: 0.5rem;
    box-shadow: var(--shadow-light);
    transition: var(--transition-smooth);
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.header-content {
    flex: 1;
}

.course-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.school-name {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Contenu principal --- */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    width: 100%;
}

/* --- Section d'introduction --- */
.intro-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.intro-section h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.intro-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.intro-section p {
    color: var(--text-light);
    max-width: 700px;
    margin: 1rem auto 0;
    font-size: 1.05rem;
}

/* --- Grille des chapitres --- */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 1rem 0;
}

/* --- Carte de chapitre --- */
.chapter-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
}

.chapter-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.chapter-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.chapter-card:hover .card-image img {
    transform: scale(1.08);
}

.card-content {
    padding: 1.5rem;
}

.chapter-number {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.card-content h3 {
    font-size: 1.15rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    transition: var(--transition-smooth);
}

.chapter-card:hover .card-content h3 {
    color: var(--accent-color);
}

.card-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.access-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.access-link::after {
    content: '→';
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.chapter-card:hover .access-link::after {
    transform: translateX(5px);
}

.chapter-card:hover .access-link {
    color: var(--accent-hover);
}

/* --- Footer --- */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0.25rem 0;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        width: 70px;
    }

    .course-title {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 2rem 1rem;
    }

    .chapters-grid {
        gap: 1.5rem;
    }

    .card-image {
        height: 180px;
    }
}

@media (max-width: 600px) {
    .chapters-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .intro-section {
        padding: 1.5rem;
    }

    .intro-section h2 {
        font-size: 1.25rem;
    }

    .card-content {
        padding: 1.25rem;
    }

    .card-content h3 {
        font-size: 1.05rem;
    }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chapter-card {
    animation: fadeInUp 0.5s ease forwards;
}

.chapter-card:nth-child(1) { animation-delay: 0.1s; }
.chapter-card:nth-child(2) { animation-delay: 0.2s; }
.chapter-card:nth-child(3) { animation-delay: 0.3s; }
.chapter-card:nth-child(4) { animation-delay: 0.4s; }

/* --- Accessibilité --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

.chapter-link:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

.chapter-link:focus .card-image {
    outline: 2px solid var(--accent-color);
}
