/* =========== VARIABLES ET STYLES DE BASE =========== */
:root {
    --primary-color: #b1bac1;
    --secondary-color: #4b5563;
    --background-light: #f9fafb;
    --background-dark:rgb(72 129 171);
    --header-bg: rgb(217, 217, 217);
    --section-bg: rgb(112 167 213);
    --text-light: #f9fafb;
    --text-dark: #111827;
    --font-title: 'Spectral', serif; /* Police modifiée */
    --font-body: 'Montserrat', sans-serif;
    --shadow: 2px 4px 10px rgba(0, 0, 0, 0.6);
    --success-bg: #004d1ded;
    --success-text: #166534;
    --error-bg: #490000ed;
    --error-text: #991b1b;
    --info-bg: #004e64ed;
    --info-text: #075985;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-body); line-height: 1.6; color: var(--text-dark); background-color: #fff; }
body.noscroll { overflow: hidden; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.container-fluid { width: 100%; padding: 4rem 0; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; line-height: 1.2; margin-bottom: 1.5rem; }
h2 { font-size: 2.5rem; text-align: center; color: var(--secondary-color); }
section { padding: 4rem 0; }
.btn { display: inline-block; padding: 0.8rem 2rem; border-radius: 20px; text-decoration: none; font-weight: 700; transition: all 0.3s ease; border: none; cursor: pointer; }
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: #374151; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary { background-color: var(--secondary-color); color: #fff; }
.btn-secondary:hover { background-color: #374151; transform: translateY(-2px); box-shadow: var(--shadow); }

.title-container {
    display: flex; /* Active Flexbox */
    align-items: center; /* Centre les éléments verticalement */
    justify-content: center; /* Centre le titre et les lignes horizontalement */
    width: 100%; /* S'assure que le conteneur prend toute la largeur disponible */
    margin: 2rem 0 2rem 0; /* Juste pour un peu d'espacement sur la page */
}

.title-container h2 {
    white-space: nowrap; /* Empêche le titre de passer à la ligne */
    padding: 0.5rem 1rem; /* Ajoute un espace entre le titre et les lignes */
    font-family: var(--font-title); /* Exemple de police */
    color: white; /* Couleur du titre */
    margin-bottom: 0;
    background-color: var(--background-dark);
    border-radius: 20px;
    font-weight: lighter;
    box-shadow: var(--shadow);
}

/* Pseudo-élément pour la ligne de gauche */
.title-container::before {
    content: ""; /* Essentiel pour les pseudo-éléments */
    flex-grow: 1; /* Permet à la ligne de prendre l'espace disponible */
    height: 3px; /* Épaisseur de la ligne */
    background-color: black; /* Couleur de la ligne */
    margin-right: 20px; /* Espace entre la ligne et le titre */
}

/* Pseudo-élément pour la ligne de droite */
.title-container::after {
    content: ""; /* Essentiel pour les pseudo-éléments */
    flex-grow: 1; /* Permet à la ligne de prendre l'espace disponible */
    height: 3px; /* Épaisseur de la ligne */
    background-color: black; /* Couleur de la ligne */
    margin-left: 20px; /* Espace entre la ligne et le titre */
}


/* =========== HEADER & NAVIGATION =========== */
header {
    background-color: var(--header-bg); /* Fond gris clair */
    color: var(--text-dark); /* Texte noir */
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, padding 0.4s ease;
}

.header-container.scrolled {
    background: linear-gradient(to bottom, rgba(241, 241, 241, 1), rgba(241, 241, 241, 0.6), rgba(0, 0, 0, 0));
    padding: 0.5rem 2rem;
    /* box-shadow: var(--shadow); */
}
/* .header-container.scrolled .nav-links a,
.header-container.scrolled .burger-menu {
    color: var(--text-light); 
}
*/

.header-container.scrolled .logo-small {
    opacity: 1;
    transform: translateY(0);
}

.logo-small {
    text-decoration: none;
    color: var(--text-dark);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.logo-small .logo-jessica { font-family: var(--font-title); font-size: 1.5rem; }
.logo-small .logo-chaumeil { font-family: var(--font-body); font-size: 0.9rem; font-weight: 700; letter-spacing: 1px; display: block; margin-top: -8px; }

.nav-links { list-style: none; display: flex; }
.nav-links li { margin-left: 2rem; }
.nav-links a { color: var(--text-dark); text-decoration: none; font-weight: 700; position: relative; padding-bottom: 5px; transition: color 0.4s ease; }
.nav-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--secondary-color); transition: width 0.3s ease; }
.nav-links a:hover::after { width: 100%; }

.burger-menu { display: none; background: none; border: none; color: var(--text-dark); font-size: 1.8rem; cursor: pointer; z-index: 1001; transition: color 0.4s ease; }

.hero {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.logo-large { margin-bottom: 6rem; }
.logo-large img {
    width: 100%;
    padding: 0 1rem;
 }

/* =========== SECTION QUI SUIS-JE ? =========== */
#about { background-color: var(--section-bg); }
.about-content { display: flex; align-items: center; gap: 3rem; }
.about-photo { width: 250px; height: auto; border-radius: 10px; box-shadow: var(--shadow); }
.about-text p { margin-bottom: 1rem; font-size: larger;}
.about-text .btn { margin-top: 1rem; }

/* =========== SECTION MES ROMANS =========== */
#novels { background-color: var(--section-bg); }
.novels-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.novel-card { cursor: pointer; overflow: hidden; border-radius: 10px; box-shadow: var(--shadow); }
.novel-cover { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.novel-card:hover .novel-cover { transform: scale(1.05); }

.novel-details-container {
    background-color: #fff;
    margin-top: 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.7s cubic-bezier(0.65, 0, 0.35, 1), padding 0.7s ease, margin 0.7s ease;
    border-radius: 10px;
}
.novel-details-container.open {
    box-shadow: var(--shadow);
    padding: 2rem;
}
.details-content { display: flex; gap: 2rem; align-items: center; }
.details-cover { width: 150px; height: auto; border-radius: 5px; box-shadow: var(--shadow); flex-shrink: 0; }
.details-text h3 { font-size: 1.8rem; color: var(--primary-title); text-align: center; }
.details-text p { margin-bottom: 1.5rem; font-style: italic; text-align: center;
    padding: 0 2rem; }

/* =========== MODAL ROMANS (Mobile) =========== */
.novel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow-y: auto;
    padding: 0.5rem;
}
.novel-modal.open { opacity: 1; visibility: visible; }
.modal-content { background-color: #fff; padding: 1rem 0; border-radius: 10px; max-width: 500px; position: relative; transform: scale(0.9); transition: transform 0.5s ease; margin: auto;}
.novel-modal.open .modal-content { transform: scale(1); }
.modal-close-btn { position: fixed; top: 10px; right: 20px; font-size: 2.5rem; color: #fff; background: none; border: none; cursor: pointer; text-shadow: 0px 0px 7px black; z-index: 1;}
.modal-content .details-content { flex-direction: column; text-align: center; }

/* =========== SECTION AVIS LECTEUR =========== */
#reviews { background-color: var(--section-bg); }
/* 
.reviews-container { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.review-card { background-color: var(--background-light); padding: 2rem; border-radius: 10px; box-shadow: var(--shadow); }
 */
.reviews-container {
    column-count: 2; /* columns-1 */
    column-gap: 1.5rem; /* gap-6 */
}
.review-card { 
    background-color: var(--background-light); 
    padding: 2rem; 
    margin-bottom: 1.5rem;
    border-radius: 10px; 
    box-shadow: var(--shadow); 
    break-inside: avoid-column;
    display: flex; /* flex */
    flex-direction: column; /* flex-col */
    justify-content: space-between; /* justify-between */
}

.review-author { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.review-author .fa-user-circle { font-size: 2.5rem; color: var(--secondary-color); }
.review-rating { color: #f59e0b; }
#reviews .btn { display: block; width: fit-content; margin: 2rem auto 0; }

/* =========== SECTION CONTACT =========== */
#contact { background-color: var(--secondary-color); color: var(--text-light); 
    background-image: url('img/carte.jpg');
    background-attachment: fixed;
    background-blend-mode: color-burn;
}
#contact h2 { color: var(--text-light); box-shadow: 2px 4px 10px 0px rgba(73, 157, 226, 0.6);}
#contact .title-container::before, #contact .title-container::after {
    background-color: white;
}

.contact-form { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; }
.form-group input, .form-group textarea { width: 100%; padding: 0.8rem; border-radius: 5px; border: 1px solid #ccc; font-family: var(--font-body); }
.honeypot { position: absolute; left: -5000px; }

/* Styles pour les messages du formulaire */
#form-messages {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    text-align: center;
    display: none; /* Caché par défaut */
}
#form-messages.success { 
    background-color: var(--success-bg);
    color: white;
    display: block;
    border: 5px solid var(--success-text);
}
#form-messages.error { 
    background-color: var(--error-bg);
    color: white;
    display: block;
    border: 5px solid var(--error-text);
}
#form-messages.info { 
    background-color: var(--info-bg);
    color: white;
    display: block;
    border: 5px solid var(--info-text);
}

/* =========== FOOTER =========== */
footer { background-color: var(--background-dark); color: var(--text-light); padding: 2rem 0; }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-logo .logo-jessica, .footer-logo .logo-chaumeil { color: var(--text-light); }
.social-links a { color: var(--text-light); font-size: 1.5rem; margin: 0 0.5rem; transition: color 0.3s ease; }
.social-links a:hover { color: var(--primary-color); }
.footer-legal a { color: #9ca3af; text-decoration: none; }

/* =========== RESPONSIVE DESIGN =========== */
/* @media (max-width: 992px) {
    .novels-grid { grid-template-columns: repeat(2, 1fr); }
    .about-content { flex-direction: column; text-align: center; }
} */

@media (max-width: 768px) {
    h2 { font-size: 2rem; }
    .logo-large .logo-jessica { font-size: 4rem; }
    .logo-large .logo-chaumeil { font-size: 2rem; }

    .nav-links { opacity: 0; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background-color: rgba(31, 41, 55, 0.98); padding: 1rem 0; transition: all 0.5s ease-in-out;}
    .main-nav.active .nav-links { display: flex; opacity: 1; }
    .nav-links li { margin: 1rem 0; text-align: center; }
    .nav-links a { color: var(--text-light); }
    .burger-menu { display: block; }
    .reviews-container {
        column-count: 1;
    }

    .footer-content { flex-direction: column; gap: 1.5rem; }
    .novels-grid { grid-template-columns: repeat(2, 1fr); }
    /* .novel-cover{
        max-height: 360px;
    } */
}

@media (max-width: 576px) {
    .novels-grid { grid-template-columns: 1fr; }
}
