/*
 * Styles specifically for the Front Page (home)
 */

/* --- 1. Hero Section --- */
.hero-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    /* Slightly increased height */
    padding: 2rem;
    background-image: url('https://placehold.co/1920x1080/4F2C6C/EBDCF2?text=Old+Library+Background');
    background-size: cover;
    background-position: center;
    text-align: center;
    color: var(--color-text-light);
    overflow: hidden;
}

/* Filtre sombre par-dessus l'image */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-primary-accent);
    opacity: 0.65;
    z-index: 1;
}

/* Contenu centré */
.hero-section .hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section h1 {
    font-size: 4.5rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeUp 1s ease-out forwards 0.2s;
}

.hero-section .hero-subtitle {
    font-family: var(--font-script);
    font-size: 2.2rem;
    color: var(--color-secondary-accent);
    margin-top: 0;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 1s ease-out forwards 0.4s;
}

.hero-section .hero-description {
    font-family: var(--font-sans-serif);
    font-size: 1.2rem;
    color: var(--color-text-light);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
    opacity: 0;
    animation: fadeUp 1s ease-out forwards 0.6s;
}

/* --- 2. Services Overview (Option Littéraire) --- */
.services-overview {
    text-align: center;
    padding: 6rem 2rem 4rem 2rem;
    background-color: #ffffff;
    border-bottom: none;
    /* On supprime la ligne classique */
    position: relative;
    /* Obligatoire pour placer les décorations */
}

/* Le trait doré élégant qui s'estompe sur les côtés */
.services-overview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-secondary-accent), transparent);
    opacity: 0.5;
}

/* Le petit symbole au centre */
.services-overview::before {
    content: '✦';
    /* Tu peux remplacer par ❦, ✧ ou ♡ */
    position: absolute;
    bottom: -16px;
    /* Place l'étoile exactement sur la ligne */
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    color: var(--color-secondary-accent);
    background-color: var(--color-background);
    /* Se fond avec le fond de la page */
    padding: 0 20px;
    z-index: 2;
}

.services-overview .section-title {
    margin-bottom: 1rem;
    font-size: 2.8rem;
}

.services-overview .section-description {
    max-width: 700px;
    margin: 0 auto 4rem auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #666;
}

.services-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

/* Card Link Wrapper Style - Adaptive width */
.card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    width: auto;
    /* Let it adapt to content */
    min-width: 250px;
    /* Prevents it from being too skinny */
    max-width: 400px;
    /* Prevents it from being too wide */
    transition: transform 0.3s ease;
}

/* --- Style des Cartes (Utilisation des couleurs du thème) --- */
.services-cards .card {
    background-color: var(--color-background);
    /* Le fond crème chaud du thème */
    border: 1px solid rgba(107, 76, 139, 0.1);
    /* Une bordure ultra-fine teintée de ton violet principal */
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(107, 76, 139, 0.06);
    /* Ombre douce violette au lieu de noire */
    text-align: center;
    padding: 2.5rem 1.5rem;
    /* J'ai légèrement augmenté le padding haut/bas pour aérer */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    /* S'assure que toutes les cartes ont la même hauteur */
    box-sizing: border-box;
}

/* Effet au survol de la carte */
.card-link-wrapper:hover .card {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(107, 76, 139, 0.15);
    /* L'ombre violette s'intensifie */
    border-color: var(--color-violet-light);
    /* La bordure prend la couleur de ton violet clair */
}

.services-cards .card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.card-link-wrapper:hover .card-icon {
    transform: scale(1.1);
}

.services-cards .card-icon img {
    max-width: 50%;
    height: auto;
}

/* Specific Colors for Icons - Targeting the wrapper nth-child */
.services-cards .card-link-wrapper:nth-child(1) .card-icon {
    background-color: var(--color-primary-accent);
}

.services-cards .card-link-wrapper:nth-child(2) .card-icon {
    background-color: var(--color-sage-green);
}

.services-cards .card-link-wrapper:nth-child(3) .card-icon {
    background-color: var(--color-secondary-accent);
}

.services-cards .card h3 {
    font-size: 1.4rem;
    margin: 0;
    color: var(--color-text-dark);
}

.services-cards .card .card-description {
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #666;
}

/* --- 3. About Section --- */
.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 5rem;
    padding: 8rem 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

.about-section .about-image {
    width: 100%;
    height: 550px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 20px 20px 0px rgba(107, 76, 139, 0.1);
}

.about-section .about-text h2 {
    font-size: 3rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.about-section .about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #555;
}

/* --- 4. Values Section --- */
.values-section {
    background-color: var(--color-primary-accent);
    padding: 6rem 2rem;
    text-align: center;
    color: var(--color-text-light);
}

.values-section .section-title {
    color: var(--color-text-light);
    font-size: 2.5rem;
    margin-bottom: 4rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

.value-item h3 {
    color: var(--color-secondary-accent);
    font-family: var(--font-serif);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.value-item p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.value-item .value-icon {
    margin: 0 auto 1.5rem;
    width: 60px;
}

.value-item .value-icon img {
    filter: invert(50%) sepia(90%) saturate(600%) hue-rotate(-10deg) brightness(120%) contrast(100%);
    transition: transform 0.3s ease;
}

.value-item:hover .value-icon img {
    transform: scale(1.2) rotate(5deg);
}

/* --- 5. Latest Posts --- */
.latest-posts-section {
    padding: 2rem 2rem 4rem 2rem;
    /* Reduced top padding */
    margin: 4rem auto;
    /* CENTERED: auto left/right margins */
    background-color: transparent;
    /* Remove gray background */
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.all-posts-link-container {
    text-align: center;
    margin-top: 3rem;
}

/* Fix visibility of "Voir Tous Les Articles" button */
.all-posts-link-container .btn {
    background-color: var(--color-primary-accent);
    color: var(--color-text-light);
    border: 2px solid var(--color-primary-accent);
}

.all-posts-link-container .btn:hover {
    background-color: transparent;
    color: var(--color-primary-accent);
}


/* --- 6. CTA Section --- */
.cta-section {
    background-color: var(--color-primary-accent);
    padding: 6rem 2rem;
    text-align: center;
    color: var(--color-text-light);
}

.cta-section .section-title {
    color: var(--color-text-light);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-size: 1.2rem;
    opacity: 0.9;
}

.cta-section .cta-buttons .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cta-section .cta-buttons .btn:first-child {
    background-color: var(--color-secondary-accent);
    color: var(--color-primary-accent);
    margin-right: 1.5rem;
}

.cta-section .cta-buttons .btn:first-child:hover {
    background-color: #fff;
    transform: translateY(-3px);
}

.cta-section .cta-buttons .btn.btn-secondary {
    border: 2px solid var(--color-text-light);
    color: var(--color-text-light);
    background-color: transparent;
}

.cta-section .cta-buttons .btn.btn-secondary:hover {
    background-color: var(--color-text-light);
    color: var(--color-primary-accent);
    transform: translateY(-3px);
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 3.5rem;
    }

    .about-section {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-section .about-image {
        height: 400px;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-cards {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .values-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        width: 100%;
    }

    .cta-section .cta-buttons .btn:first-child {
        margin-right: 0;
    }
}