/* ============================================================
   IdBook - Styles page d'accueil
   Ce fichier ne redéfinit QUE ce qui est spécifique à l'accueil.
   Toutes les couleurs/espacements de base viennent de global.css
   via les variables CSS (--primary-color, --card-bg, etc.).
============================================================ */


/* ========= HERO ACCUEIL ========= */

/* main{padding:10px} (global.css) laisse apparaître le fond clair du body
   autour du hero. On neutralise ce padding uniquement ici avec des marges
   négatives, pour que le hero occupe 100% de la largeur/hauteur visible. */
.hero-accueil {
    position: relative;
    width: 100%;
    margin: -10px 0 0 0;
    box-sizing: border-box;
    min-height: calc(100vh - 70px); /* plein écran sous la navbar */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    overflow: hidden;
    color: #fff;

    /* Dégradé large, animé en fondu (cf. keyframes hero-drift plus bas) */
    background: linear-gradient(
        120deg,
        var(--primary-color),
        #6dd5fa,
        var(--select-background),
        var(--primary-color)
    );
    background-size: 300% 300%;
    animation: hero-drift 18s ease-in-out infinite;
}

/* Dérive lente du dégradé, façon fond d'écran dynamique (type PS4) */
@keyframes hero-drift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Respect des préférences d'accessibilité : pas d'animation si demandé */
@media (prefers-reduced-motion: reduce) {
    .hero-accueil {
        animation: none;
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15));
    pointer-events: none;
}

/* row-reverse : couverture à droite, texte à gauche sur desktop */
.hero-inner {
    position: relative;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
    z-index: 1;

    /* Habillage type "carte" du contenu, sans hériter du margin/background
       de .container (global.css) qui provoquait les bords blancs. */
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.hero-text {
    flex: 1 1 400px;
}

.hero-cover {
    flex: 0 0 300px;
    text-align: center;
}

.hero-title {
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-author {
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: #ecf0f1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-author i {
    color: var(--secondary-color);
}

.hero-subtitle {
    color: #ecf0f1;
    margin-bottom: 18px;
    font-size: 1rem;
    line-height: 1.6;
}

.hero-meta {
    font-size: 0.9rem;
    color: #ecf0f1;
    margin-top: 12px;
}

/* Badge "Nouveau" : pastille jaune, texte en capitales */
.badge-nouveau {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background-color: var(--secondary-color);
    color: var(--select-background);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* Deux instances du badge existent dans le HTML (desktop / mobile) ;
   une seule est visible à la fois selon la largeur d'écran. */
.badge-desktop {
    display: inline-flex;
}

.badge-mobile {
    display: none;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px; /* espacement entre les 3 CTA */
    margin-top: 5px;
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-secondary {
    background-color: var(--select-background);
}

.btn-secondary:hover {
    background-color: var(--button-hover-color);
}

.btn-teaser {
    background-color: #2ecc71;
    color: #fff;
}

.btn-teaser:hover {
    background-color: #27ae60;
}

.hero-cover .book-cover {
    max-width: 280px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-cover .book-cover:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.75);
}

/* ========= SECTIONS ACCUEIL (présentation IdBook) ========= */

.accueil-section {
    padding: 25px 10px;
}

.accueil-section .container {
    align-items: stretch;
}

.intro-text {
    max-width: 700px;
    text-align: center;
    margin: 0 auto 25px auto;
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

.feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 5px var(--container-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
}

.feature-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-card h3 i {
    color: var(--primary-color);
}

.feature-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px var(--container-shadow);
}

/* ========= RESPONSIVE HERO (mobile) ========= */

@media (max-width: 830px) and (min-width: 770px) {
    .hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: left;
    }

    .hero-actions {
        width: 100%;
        text-align: left;
        margin-top: 20px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-cover {
        flex: 1 1 auto;
        order: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .hero-cover .book-cover {
        max-width: 200px;
    }

    .hero-text {
        order: 2;
        flex: 1 1 auto;
    }

    .badge-desktop {
        display: none;
    }

    .badge-mobile {
        display: inline-flex;
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    .hero-accueil {
        min-height: auto;
        padding-top: 40px;
        padding-bottom: 40px;
        margin: 0;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }

    .hero-inner {
        margin: 20px auto;
        flex-direction: column;
        align-items: center;
        text-align: left;
    }

    .hero-actions {
        width: 100%;
        text-align: left;
        margin-top: 20px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-cover {
        flex: 1 1 auto;
        order: 1; /* badge -> couverture -> texte */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .hero-cover .book-cover {
        max-width: 160px; /* couverture réduite pour laisser de la place au texte */
    }

    .hero-text {
        order: 2;
        flex: 1 1 auto;
    }

    .badge-desktop {
        display: none;
    }

    .badge-mobile {
        display: inline-flex;
        margin-bottom: 8px;
    }

    .hero-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

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