/* ============================================
   IFLISS GAMES — Styles pages Guides (index + articles)
   Même thème que l'accueil et /jeux : blanc cassé, taupe, violet, boutons bleus.
   Fichier autonome (les articles ne chargent que lui) : les couleurs sont définies ici.
   ============================================ */

.guide-page {
    --gd-paper: #f3eee6;
    --gd-card: #fbf8f3;
    --gd-ink: #221a36;
    --gd-text: #3f3650;
    --gd-ink-soft: #5f587a;
    --gd-line: #e0d7cb;
    --gd-taupe-line: #cdbfae;
    --gd-taupe-ink: #4a3f36;
    --gd-violet-100: #e9e1fd;
    --gd-violet-200: #d6c8fb;
    --gd-violet-400: #a78bfa;
    --gd-violet-600: #7c5bd8;
    --gd-violet-800: #4a2f94;
    --gd-red: #d7263d;
    --gd-red-50: #fdecef;
    --gd-bordeaux: #8e1b2c;
    --gd-blue: linear-gradient(90deg, #1c1948, #2a2173 50%, #1a2c68);
    --gd-blue-hover: linear-gradient(90deg, #262260, #372c93 50%, #243a85);

    display: block;
    padding: 1.5rem 0 0;
    background: var(--gd-paper);
    color: var(--gd-ink);
    font-family: 'Lexend', sans-serif;
}
.guide-page *, .guide-page *::before, .guide-page *::after { box-sizing: border-box; }
.guide-page .bi { line-height: 1; vertical-align: -0.125em; }

/* Barre de progression de lecture */
.guide-progress {
    position: fixed; top: 0; left: 0; height: 3px;
    background: linear-gradient(90deg, #7c5bd8, #d7263d);
    z-index: 2000; width: 0%; transition: width .1s linear;
}

/* Wrapper */
.guide-wrap { width: min(860px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 4.5rem; }

/* Breadcrumb */
.guide-breadcrumb { padding: 0 0 1rem; font-size: .8rem; color: var(--gd-ink-soft); }
.guide-breadcrumb a { color: var(--gd-ink-soft); text-decoration: none; transition: color .2s; }
.guide-breadcrumb a:hover { color: var(--gd-red); }
.guide-breadcrumb .sep { margin: 0 .45rem; }

/* Bandeau (taupe, comme l'accueil) */
.guide-hero {
    text-align: center; padding: 2.4rem 1.5rem 2rem; margin-bottom: 2.5rem;
    border: 1px solid var(--gd-taupe-line); border-radius: 24px;
    background:
        radial-gradient(520px 260px at 85% 0%, rgb(255 250 243 / .5), transparent 70%),
        linear-gradient(135deg, #ddd1c3, #cfc0ae 55%, #c3b19d);
    box-shadow: 0 20px 40px -30px rgb(70 50 35 / .6);
}
.guide-badge {
    display: inline-flex; align-items: center; gap: .4rem; padding: .35rem 1rem;
    background: var(--gd-card); border: 1px solid var(--gd-line);
    border-radius: 50px; color: var(--gd-violet-800); font-size: .72rem;
    font-weight: 700; letter-spacing: .04em; margin-bottom: 1rem;
}
.guide-hero h1 {
    position: relative; z-index: 0;
    font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 900; line-height: 1.15;
    margin: 0 0 1rem; color: var(--gd-ink); letter-spacing: -0.01em;
}
.guide-hero .lead {
    font-size: 1rem; color: var(--gd-taupe-ink); line-height: 1.8;
    max-width: 640px; margin: 0 auto 1.4rem;
}
.guide-meta-row {
    display: flex; justify-content: center; gap: .6rem 1.4rem;
    flex-wrap: wrap; color: var(--gd-taupe-ink); font-size: .8rem; font-weight: 600;
}
.guide-meta-row span { display: flex; align-items: center; gap: .4rem; }
.guide-meta-row .bi { color: var(--gd-violet-800); }

/* Index : texte à gauche, photo détourée posée dans l'angle bas-droit du bandeau.
   La photo est coupée en bas et à droite : ces bords tombent sur le cadre arrondi. */
.guide-hero.guide-hero-avec-visuel {
    display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: end; gap: 1rem;
    overflow: hidden; padding: 2.2rem 0 0 2.2rem; text-align: left;
}
.guide-hero-avec-visuel .guide-hero-texte { align-self: center; padding-bottom: 2.2rem; }
.guide-hero-avec-visuel .lead { margin: 0 0 1.4rem; }
.guide-hero-avec-visuel .guide-meta-row { justify-content: flex-start; }
.guide-hero-visuel { display: block; }
.guide-hero-visuel img { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 20px rgb(70 50 35 / .22)); }
@media (max-width: 920px) {
    .guide-hero.guide-hero-avec-visuel { grid-template-columns: minmax(0, 1fr) 320px; }
}

/* Table des matières */
.guide-toc {
    background: var(--gd-card); border: 1px solid var(--gd-line);
    border-left: 5px solid var(--gd-violet-400); border-radius: 16px;
    padding: 1.4rem 1.8rem; margin-bottom: 3rem;
    box-shadow: 0 14px 30px -24px rgb(70 50 35 / .5);
}
.guide-toc h3 {
    color: var(--gd-violet-800); font-size: .82rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .08em; margin: 0 0 1rem;
}
.guide-toc ol { margin: 0 0 0 1.2rem; padding: 0; color: var(--gd-text); }
.guide-toc li { margin-bottom: .5rem; font-size: .92rem; line-height: 1.5; }
.guide-toc a { color: var(--gd-text); text-decoration: none; transition: color .2s; }
.guide-toc a:hover { color: var(--gd-red); }

/* Sections article */
.guide-section { margin-bottom: 3.2rem; scroll-margin-top: 80px; }
.guide-section h2 {
    font-size: 1.55rem; font-weight: 900; color: var(--gd-ink);
    margin: 0 0 1.2rem; padding-bottom: .7rem;
    border-bottom: 2px solid var(--gd-line);
    display: flex; align-items: center; gap: .6rem;
}
.guide-section h3 { font-size: 1.1rem; font-weight: 800; color: var(--gd-bordeaux); margin: 1.6rem 0 .7rem; }
.guide-section p { color: var(--gd-text); line-height: 1.9; margin: 0 0 1rem; font-size: 1rem; }
.guide-section ul, .guide-section ol { margin: 0 0 1rem 1.4rem; padding: 0; color: var(--gd-text); font-size: 1rem; line-height: 1.9; }
.guide-section li { margin-bottom: .45rem; }
.guide-section strong { color: var(--gd-ink); }
.guide-section a, .tip-box a, .warn-box a, .success-box a {
    color: var(--gd-violet-800); font-weight: 600;
    text-decoration: underline; text-decoration-color: rgb(74 47 148 / .3); text-underline-offset: 3px;
}
.guide-section a:hover, .tip-box a:hover, .warn-box a:hover, .success-box a:hover { color: var(--gd-red); text-decoration-color: var(--gd-red); }

/* Encadrés */
.tip-box {
    background: var(--gd-violet-100); border: 1px solid var(--gd-violet-200);
    border-radius: 14px; padding: 1.1rem 1.4rem; margin: 1.4rem 0;
}
.tip-label { font-size: .72rem; font-weight: 800; color: var(--gd-violet-800); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem; }
.tip-box p, .warn-box p { margin: 0; font-size: .95rem; line-height: 1.7; color: var(--gd-text); }
.warn-box {
    background: var(--gd-red-50); border: 1px solid #f5c6cf;
    border-radius: 14px; padding: 1.1rem 1.4rem; margin: 1.4rem 0;
}
.warn-box .tip-label { color: var(--gd-red); }
.success-box {
    background: #e9f3eb; border: 1px solid #c3e0ca;
    border-radius: 14px; padding: 1.1rem 1.4rem; margin: 1.4rem 0;
}
.success-box .tip-label { color: #2f6b3c; }
.success-box p { margin: 0; font-size: .95rem; line-height: 1.7; color: var(--gd-text); }

/* Citation */
.guide-quote {
    border-left: 5px solid var(--gd-violet-400); padding: 1rem 1.5rem; margin: 1.5rem 0;
    background: var(--gd-card); border-radius: 0 14px 14px 0;
    font-style: italic; color: var(--gd-text); font-size: 1.02rem; line-height: 1.8;
}

/* Grille de conseils */
.tip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.tip-card {
    background: var(--gd-card); border: 1px solid var(--gd-line);
    border-radius: 16px; padding: 1.2rem; transition: transform .25s, border-color .25s, box-shadow .25s;
    box-shadow: 0 10px 24px -20px rgb(70 50 35 / .5);
}
.tip-card:hover { border-color: var(--gd-violet-400); transform: translateY(-4px); box-shadow: 0 18px 32px -22px rgb(74 47 148 / .45); }
.tip-card .tc-icon { font-size: 1.8rem; margin-bottom: .6rem; }
.tip-card h4 { font-size: .92rem; font-weight: 800; color: var(--gd-ink); margin: 0 0 .4rem; }
.tip-card p { font-size: .86rem; color: var(--gd-ink-soft); margin: 0; line-height: 1.6; }

/* Jeux en avant */
.game-spotlight {
    margin: 2rem 0; padding: 1.5rem;
    background: linear-gradient(180deg, #e1d6c9, #d8cbbb); border: 1px solid var(--gd-taupe-line);
    border-radius: 18px;
}
.spotlight-title {
    font-size: .76rem; font-weight: 800; color: var(--gd-bordeaux);
    text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem;
}
.game-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.game-card-link {
    display: flex; align-items: center; gap: .8rem;
    background: var(--gd-card); border: 1px solid var(--gd-line);
    border-radius: 14px; padding: .8rem 1rem; text-decoration: none; transition: transform .25s, border-color .25s;
}
.game-card-link:hover { border-color: var(--gd-violet-400); transform: translateX(4px); }
.game-card-link .gc-icon { font-size: 1.4rem; flex-shrink: 0; }
.gc-info .gc-name { font-size: .88rem; font-weight: 800; color: var(--gd-ink); }
.gc-info .gc-sub  { font-size: .76rem; color: var(--gd-ink-soft); }

/* Appel final (violet foncé, comme l'accueil) */
.guide-cta {
    text-align: center; color: #fff;
    background:
        radial-gradient(420px 260px at 100% 100%, rgb(215 38 61 / .28), transparent 70%),
        linear-gradient(120deg, #2b1850, #472a84 55%, #673a9a);
    border-radius: 24px; padding: 2.8rem 2rem; margin-top: 4rem;
}
.guide-cta h2 { display: flex; align-items: center; justify-content: center; gap: .6rem; font-size: 1.9rem; font-weight: 900; margin: 0 0 1rem; color: #fff; }
.guide-cta p { color: #e3dbf3; font-size: .98rem; margin: 0 auto 1.6rem; max-width: 520px; line-height: 1.8; }
.guide-cta-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-cta-primary, .btn-cta-secondary {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 50px; padding: .8rem 2rem;
    border-radius: 50px; text-decoration: none; font-weight: 700; font-size: .95rem;
    transition: transform .18s, background-color .18s, border-color .18s;
}
.btn-cta-primary { background: var(--gd-blue); color: #fff; border: 2px solid rgb(255 255 255 / .4); }
.btn-cta-primary:hover { background: var(--gd-blue-hover); transform: translateY(-2px); }
.btn-cta-secondary { background: transparent; color: #fff; border: 2px solid rgb(255 255 255 / .65); }
.btn-cta-secondary:hover { background: rgb(255 255 255 / .12); transform: translateY(-2px); }

/* Navigation entre guides */
.guide-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; flex-wrap: wrap; }
.guide-nav a {
    display: flex; align-items: center; gap: .6rem; padding: .9rem 1.2rem;
    background: var(--gd-card); border: 1px solid var(--gd-line);
    border-radius: 14px; color: var(--gd-violet-800); text-decoration: none;
    font-size: .88rem; font-weight: 700; transition: border-color .2s, color .2s; flex: 1; min-width: 150px;
}
.guide-nav a:hover { border-color: var(--gd-violet-400); color: var(--gd-red); }
.guide-nav .nav-next { justify-content: flex-end; text-align: right; }

/* Encart « Explorateur de mots » (index des guides) */
.guide-tool {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.2rem;
    margin: 0 0 2rem; padding: 1.3rem 1.5rem;
    border: 1px solid var(--gd-violet-200); border-radius: 20px;
    background: linear-gradient(135deg, var(--gd-violet-100), #f4effd 60%, var(--gd-card));
    box-shadow: 0 18px 36px -26px rgb(74 47 148 / .5);
    color: var(--gd-ink); text-decoration: none;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.guide-tool:hover { transform: translateY(-3px); border-color: var(--gd-violet-400); box-shadow: 0 24px 40px -26px rgb(74 47 148 / .6); }
.guide-tool-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 58px; height: 58px; border-radius: 18px;
    background: var(--gd-blue); color: #fff; font-size: 1.6rem;
    box-shadow: 0 12px 22px -12px rgb(28 25 72 / .9);
}
.guide-tool-text { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.guide-tool-title { font-size: 1.15rem; font-weight: 900; color: var(--gd-ink); }
.guide-tool-desc { font-size: .9rem; color: var(--gd-ink-soft); line-height: 1.55; }
.guide-tool-btn {
    display: inline-flex; align-items: center; gap: .45rem; min-height: 46px; padding: .7rem 1.3rem;
    border-radius: 999px; background: var(--gd-blue); color: #fff; font-size: .9rem; font-weight: 700; white-space: nowrap;
}
.guide-tool:hover .guide-tool-btn { background: var(--gd-blue-hover); }

/* Index des guides */
.guides-index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.guide-index-card {
    background: var(--gd-card); border: 1px solid var(--gd-line);
    border-radius: 20px; padding: 1.6rem 1.5rem; text-decoration: none;
    display: flex; flex-direction: column; gap: .6rem; transition: transform .3s, border-color .3s, box-shadow .3s;
    position: relative; overflow: hidden;
    box-shadow: 0 14px 30px -24px rgb(70 50 35 / .55);
}
.guide-index-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--gd-violet-400), var(--gd-red)); transform: scaleX(0); transform-origin: left; transition: transform .35s;
}
.guide-index-card:hover { border-color: var(--gd-violet-200); transform: translateY(-5px); box-shadow: 0 22px 40px -26px rgb(74 47 148 / .5); }
.guide-index-card:hover::before { transform: scaleX(1); }
.gic-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; margin-bottom: .3rem; border-radius: 16px;
    background: var(--gd-violet-100); color: var(--gd-violet-800); font-size: 1.5rem;
}
.guide-index-card:nth-child(3n+2) .gic-icon { background: #eee5da; color: #6b5a4c; }
.guide-index-card:nth-child(3n) .gic-icon { background: var(--gd-red-50); color: var(--gd-bordeaux); }
.gic-title { font-size: 1.02rem; font-weight: 900; color: var(--gd-ink); line-height: 1.3; }
.gic-desc  { font-size: .88rem; color: var(--gd-ink-soft); line-height: 1.6; flex: 1; }
.gic-arrow { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; color: var(--gd-violet-800); font-weight: 700; margin-top: .4rem; }
.guide-index-card:hover .gic-arrow { color: var(--gd-red); }

/* Animations d'apparition au défilement */
.wow { opacity: 0; transition: opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1); }
.wow-up    { transform: translateY(35px); }
.wow-left  { transform: translateX(-25px); }
.wow-right { transform: translateX(25px); }
.wow-scale { transform: scale(.95); }
.wow.wow-visible { opacity: 1 !important; transform: none !important; }

@media (max-width: 768px) {
    .tip-grid, .game-cards-grid, .guides-index-grid { grid-template-columns: 1fr; }
    /* Encart explorateur : icône + texte, puis bouton pleine largeur en dessous */
    .guide-tool { grid-template-columns: auto minmax(0, 1fr); gap: .9rem 1rem; padding: 1.1rem; }
    .guide-tool-icon { width: 48px; height: 48px; border-radius: 15px; font-size: 1.3rem; }
    .guide-tool-btn { grid-column: 1 / -1; justify-content: center; }
    .guide-hero { padding: 1.8rem 1.1rem 1.6rem; border-radius: 20px; }
    .guide-hero h1 { font-size: 1.7rem; }
    /* Photo sous le texte, toujours calée dans l'angle bas-droit */
    .guide-hero.guide-hero-avec-visuel { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.8rem 0 0; text-align: center; }
    .guide-hero-avec-visuel .guide-hero-texte { padding: 0 1.1rem; }
    .guide-hero-avec-visuel .lead { margin: 0 auto 1.2rem; }
    .guide-hero-avec-visuel .guide-meta-row { justify-content: center; }
    .guide-hero-visuel { justify-self: end; width: min(100%, 340px); }
    .guide-toc { padding: 1.2rem 1.2rem; }
    .guide-cta { padding: 2.2rem 1.2rem; }
    .guide-cta h2 { font-size: 1.5rem; }
    .guide-nav { flex-direction: column; }
    .guide-nav a { min-width: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .wow { opacity: 1; transform: none; transition: none; }
    .tip-card, .game-card-link, .guide-index-card, .guide-index-card::before { transition: none; }
}
