/* --- Variables et Style de Base --- */
:root {
    --primary-color: #1a2a40; /* Bleu spatial profond */
    --secondary-color: #f0f4f8; /* Blanc lunaire */
    --accent-color: #00aeff; /* Bleu néon technologique */
    --text-color: #333; /* Gris anthracite */
    --light-gray: #dfe6e9;
    --font-heading: 'Orbitron', sans-serif; /* Police futuriste */
    --font-body: 'Lato', sans-serif;
    --nav-height: 60px; /* Hauteur de la barre de navigation */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--secondary-color);
    line-height: 1.7;
    padding-top: var(--nav-height); /* Espace pour la nav fixe */
}

/* --- Barre de Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: rgba(26, 42, 64, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 35px;
}
.nav-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}
.nav-links a:hover {
    color: var(--accent-color);
}

/* --- Mise en Page et Conteneurs --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
    overflow: hidden;
}

/* --- Typographie --- */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 700;
}

h1 { font-size: 3.5rem; margin-bottom: 1rem; text-shadow: 0 0 10px rgba(0, 174, 255, 0.3); }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; position: relative; }
h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}
p { margin-bottom: 1rem; max-width: 700px; margin-left: auto; margin-right: auto; }

/* --- Header et Hero Section --- */
.hero {
    background: linear-gradient(rgba(26, 42, 64, 0.85), rgba(26, 42, 64, 0.85)), url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?q=80&w=2071&auto=format&fit=crop') no-repeat center center/cover;
    color: var(--secondary-color);
    height: calc(80vh - var(--nav-height));
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-content {
    animation: fadeInDown 1s ease-in-out;
}

.hero h1 {
    color: var(--secondary-color);
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    font-family: var(--font-body);
}

/* --- Section Auteur --- */
#auteur {
    background-color: #fff;
}
.author-content {
    display: flex;
    align-items: center;
    gap: 40px;
}
.author-image {
    flex: 1;
    max-width: 300px;
    height: 300px;
    background-color: var(--light-gray);
    border-radius: 50%;
    background-image: url('../images/portrait-auteur.jpg'); /* Note: le chemin est ../images/ car le CSS est dans un sous-dossier */
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.author-bio {
    flex: 2;
}
.author-bio p {
    text-align: left;
}

/* --- Section Livres --- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    justify-content: center;
}

.book-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(26, 42, 64, 0.15);
}

.book-cover {
    height: 450px;
    background-size: cover;
    background-position: center;
    pointer-events: none;
}

.book-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.book-info h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin-top: auto;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    font-weight: bold;
    pointer-events: all;
}

.btn:hover {
    background-color: #008cdd;
    transform: scale(1.05);
}

/* --- Style de la Fenêtre Modale --- */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 42, 64, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    display: flex;
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 800px;
    position: relative;
    gap: 30px;
    transform: scale(0.95);
    transition: transform 0.4s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-cover {
    flex: 1;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
}

.modal-info {
    flex: 2;
}

.modal-info h3 {
    margin-top: 0;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}
.modal-close:hover {
    color: var(--primary-color);
}

/* Section Réseaux Sociaux */
#contact {
    background-color: #fff;
}
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}
.social-links a {
    color: var(--primary-color);
    transition: transform 0.3s ease, color 0.3s ease;
}
.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-5px);
}
.social-links svg {
    width: 55px;
    height: 55px;
    fill: currentColor;
}

/* --- Footer --- */
footer {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    text-align: center;
    padding: 40px 20px;
}
footer p {
    margin: 0;
    color: var(--light-gray);
}

/* --- Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2rem; }
    
    .navbar {
        justify-content: space-around;
    }
    .nav-links {
        gap: 15px;
    }
    .nav-links a {
        font-size: 0.75rem;
    }

    .author-content {
        flex-direction: column;
        text-align: center;
    }
    .author-bio p {
        text-align: center;
    }
    .author-image {
        margin-bottom: 30px;
        width: 200px;
        height: 200px;
    }
    .books-grid {
        grid-template-columns: 1fr;
    }
    .modal-content {
        flex-direction: column;
        padding: 20px;
        max-height: 80vh;
        overflow-y: auto;
    }
    .modal-cover {
        max-width: 100%;
        height: 300px;
        object-fit: cover;
    }
    .social-links svg {
        width: 45px;
        height: 45px;
    }
}