/**
 * Homepage « Grimoire » — Style codex enluminé
 *
 * Design alternatif de la page d'accueil, activable via
 * le paramètre admin « homepage_theme = grimoire ».
 * Surcharge les variables globales pour obtenir une palette chaude/parchemin.
 */

/* ── SURCHARGE DES VARIABLES POUR LE THÈME GRIMOIRE ── */
body.home-grimoire {
    --gold: #d4af37;
    --gold-light: #f0c674;
    --gold-dark: #a68929;
    --gold-muted: #8b7023;
    --bg-deep: #0e0c08;
    --bg-card: #1a1612;
    --text: #e8e4dc;
    --text-secondary: #c8c0b4;
    --text-sec: #c8c0b4;
    --text-muted: #8a8070;
    background-color: var(--bg-deep);
}

/* ── RESET LIENS (pas de reset global dans base.css) ── */
.grimoire-wrap a {
    text-decoration: none;
    color: inherit;
}
.grimoire-wrap a:hover {
    text-decoration: none;
}

/* ── FIXED BG ── */
.grimoire-scroll-bg {
    position: fixed; inset: 0; z-index: -1;
}
.grimoire-scroll-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: sepia(.3) brightness(.12) contrast(1.1);
}

/* Ghost decorations */
.grimoire-deco-dragon,
.grimoire-deco-knight {
    position: fixed; pointer-events: none; z-index: 0; opacity: .025;
}
.grimoire-deco-dragon { width: 400px; right: -60px; top: 25%; }
.grimoire-deco-knight { width: 350px; left: -50px; bottom: 10%; transform: scaleX(-1); }
.grimoire-deco-dragon img,
.grimoire-deco-knight img { width: 100%; filter: sepia(.6); }

/* ── GRIMOIRE WRAPPER ── */
.grimoire-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 2rem 1.5rem;
    position: relative; z-index: 1;
}

/* ── HEADER ── */
.grimoire-header {
    text-align: center;
    padding: 2rem 0 1.2rem;
    position: relative;
}
.grimoire-header::after {
    content: ''; position: absolute; bottom: 0; left: 15%; right: 15%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dark, #a68929), transparent);
}
.gh-ornament {
    color: var(--gold-dark, #a68929); font-size: .5rem;
    letter-spacing: 1.2rem; opacity: .4; margin-bottom: .6rem;
}
.gh-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    font-weight: 700; line-height: 1.1; margin-bottom: .15rem;
}
.gh-title .gold { color: var(--gold, #d4af37); }
.gh-greeting {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(1.1rem, 3vw, 1.7rem);
    color: var(--gold-dark, #a68929);
}

/* ── ORNAMENTS ── */
.grimoire-divider {
    display: flex; align-items: center; justify-content: center; gap: .8rem;
    margin: 1.2rem 0;
}
.grimoire-divider::before,
.grimoire-divider::after {
    content: ''; flex: 1; max-width: 160px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,.2), transparent);
}
.grimoire-divider .dia {
    color: var(--gold-dark, #a68929); font-size: .5rem; opacity: .5;
}

/* ── SECTION HEADS ── */
.grim-sec-head {
    display: flex; align-items: baseline; gap: .6rem;
    margin-bottom: .8rem;
}
.grim-sec-chapter {
    font-family: 'Cinzel', serif; font-size: .55rem;
    color: var(--gold-muted, #8b7023);
    text-transform: uppercase; letter-spacing: .2em; white-space: nowrap;
}
.grim-sec-title {
    font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 700;
}
.grim-sec-title .gold { color: var(--gold, #d4af37); }
.grim-sec-line {
    flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(212,175,55,.2), transparent);
}

/* ── LETTRINE + INTRO ── */
.grimoire-intro-text {
    font-size: .88rem; color: var(--text-secondary, #c8c0b4); line-height: 1.75;
    font-style: italic; max-width: 750px;
    margin: 0 auto; text-align: center;
}
.grimoire-intro-text strong { color: var(--gold, #d4af37); font-style: normal; }
.grim-intro-block { margin-bottom: .5rem; }
.grimoire-lettrine {
    font-family: 'Uncial Antiqua', serif;
    font-size: 2.4rem;
    color: var(--gold, #d4af37);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 2.8rem; height: 2.8rem;
    margin-right: .3rem;
    padding-top: .15rem;
    border: 1px solid rgba(212,175,55,.15); border-radius: 3px;
    background: rgba(212,175,55,.04);
    text-shadow: 0 0 20px rgba(212,175,55,.2);
}

/* ── COLUMNS ── */
.grimoire-columns {
    display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start;
}

/* ── CAMPAIGN CARDS ── */
.grim-camp-card {
    display: flex; gap: 1rem;
    border: 1px solid rgba(212,175,55,.1); border-radius: 5px;
    overflow: hidden; background: var(--bg-card, #1a1612);
    transition: all .3s; margin-bottom: .8rem;
    min-height: 0;
}
.grim-camp-card:hover {
    border-color: rgba(212,175,55,.3);
    box-shadow: 0 6px 25px rgba(0,0,0,.4);
    transform: translateY(-2px);
}
.grim-camp-img {
    width: 120px; flex-shrink: 0;
    position: relative; overflow: hidden;
}

.grim-camp-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left top;
    filter: sepia(.15) brightness(.65) contrast(1.1);
    transition: .4s;
}
.grim-camp-card:hover .grim-camp-img img {
    filter: sepia(.05) brightness(.75) contrast(1.05);
    transform: scale(1.03);
}
.grim-camp-img::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to right, transparent 50%, var(--bg-card, #1a1612) 100%);
}
.grim-camp-role {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .58rem;
    line-height: 1;
    padding: .2rem .5rem;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    font-family: 'Cinzel', serif;
    background: var(--gold, #d4af37);
    color: var(--bg-deep, #0e0c08);
    border: 1px solid rgba(212,175,55,.3);
}
.grim-camp-role.mj,
.grim-camp-role.joueur {
    background: var(--gold, #d4af37);
    color: var(--bg-deep, #0e0c08);
}
.grim-camp-body {
    padding: .5rem .8rem .5rem 0; flex: 1;
    display: flex; flex-direction: column; justify-content: center;
    gap: .1rem;
}
.grim-camp-title {
    font-family: 'Cinzel', serif; font-size: 1.05rem; font-weight: 700;
    line-height: 1.2;
}
.grim-camp-sub {
    font-family: 'Cinzel', serif; font-size: .75rem;
    color: var(--gold-dark, #a68929);
    letter-spacing: .03em;
}
.grim-camp-desc {
    font-size: .8rem; font-style: italic;
    color: var(--text-muted, #8a8070);
    line-height: 1.35;
}
.grim-camp-ornament {
    text-align: center; font-size: .7rem;
    color: rgba(212,175,55,.2);
    letter-spacing: .3em;
    line-height: 1;
}
.grim-camp-meta {
    display: flex; gap: .6rem; flex-wrap: wrap;
    font-size: .8rem; color: var(--text-muted, #8a8070);
}
.grim-camp-meta span { display: flex; align-items: center; gap: .3rem; }
.grim-camp-meta i { color: var(--gold-dark, #a68929); font-size: .65rem; }
.grim-camp-meta .grim-camp-role i { color: inherit; }
.grim-camp-hero {
    display: flex; align-items: center; gap: .4rem;
    margin-bottom: .15rem;
    font-size: .8rem;
}
.grim-camp-hero-seal {
    color: var(--gold, #d4af37); font-size: .65rem;
    filter: drop-shadow(0 0 3px rgba(212,175,55,.3));
}
.grim-camp-hero-name {
    font-family: 'Cinzel', serif; font-weight: 700;
    color: var(--gold-light, #f0c674);
    text-transform: uppercase; letter-spacing: .05em;
}
.grim-camp-hero-sep {
    color: rgba(212,175,55,.3); font-size: .6rem;
}
.grim-camp-hero-desc {
    font-style: italic; color: var(--text-muted, #8a8070);
    font-size: .75rem;
}
.grim-camp-progress-bar {
    margin-top: .35rem; height: 3px;
    background: rgba(255,255,255,.04); border-radius: 2px; overflow: hidden;
}
.grim-camp-progress-fill {
    height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, var(--gold-dark, #a68929), var(--gold, #d4af37));
}

/* ── CHARACTER ROWS ── */
.grim-chars-grid { display: flex; flex-direction: column; gap: .7rem; }
.grim-char-row {
    display: flex; align-items: center; gap: 1rem;
    padding: .8rem 1rem;
    border: 1px solid rgba(212,175,55,.08); border-radius: 5px;
    background: var(--bg-card, #1a1612); transition: all .3s;
}
.grim-char-row:hover {
    border-color: rgba(212,175,55,.25);
    transform: translateX(4px);
    background: rgba(212,175,55,.03);
}
.grim-char-avatar {
    width: 60px; height: 60px; flex-shrink: 0;
    border: 2px solid rgba(212,175,55,.2); border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(212,175,55,.15); font-size: 1.3rem;
    background: rgba(0,0,0,.2); position: relative;
}
.grim-char-avatar img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 5px;
}
.grim-char-row:hover .grim-char-avatar { border-color: var(--gold-dark, #a68929); }
.grim-char-lvl {
    position: absolute; bottom: -6px; right: -6px;
    font-family: 'Cinzel', serif; font-size: .55rem; font-weight: 700;
    color: var(--bg-deep, #0e0c08); background: var(--gold-dark, #a68929);
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--bg-card, #1a1612);
    display: flex; align-items: center; justify-content: center;
    z-index: 1;
    line-height: 1;
}
.grim-char-details { flex: 1; min-width: 0; }
.grim-char-name {
    font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grim-char-desc { font-size: .75rem; color: var(--text-muted, #8a8070); }
.grim-char-stats-mini { display: flex; gap: .4rem; flex-shrink: 0; }
.grim-char-stat-pill {
    font-size: .65rem; padding: .2rem .4rem;
    border: 1px solid rgba(212,175,55,.1); border-radius: 3px;
    background: rgba(212,175,55,.03); color: var(--text-secondary, #c8c0b4);
    text-align: center; line-height: 1.2;
}
.grim-char-stat-pill strong {
    display: block; color: var(--gold, #d4af37);
    font-size: .8rem; font-family: 'Cinzel', serif;
}
.grim-char-row.new-char {
    border-style: dashed; opacity: .4;
    justify-content: center; gap: .5rem;
    font-family: 'Cinzel', serif; font-size: .8rem;
    color: var(--text-muted, #8a8070);
}
.grim-char-row.new-char:hover { opacity: .85; border-style: solid; }
.grim-char-row.new-char i { color: var(--gold-muted, #8b7023); }

/* ── NO-DATA STATES ── */
.grim-empty-state {
    text-align: center; padding: 1.5rem 1rem;
    border: 1px dashed rgba(212,175,55,.1); border-radius: 5px;
    color: var(--text-muted, #8a8070); font-style: italic;
}
.grim-empty-state i { display: block; font-size: 1.5rem; margin-bottom: .5rem; color: var(--gold, #d4af37); }
.grimoire-wrap a.grim-empty-link {
    display: inline-block; margin-top: .6rem;
    font-family: 'Cinzel', serif; font-size: .75rem; font-style: normal;
    color: var(--gold, #d4af37);
    transition: opacity .3s;
}
.grimoire-wrap a.grim-empty-link:hover { opacity: .8; }

/* ── NEWS ── */
.grim-news-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .7rem;
}
.grim-news-item {
    display: flex; align-items: flex-start; gap: .6rem;
    padding: .6rem .8rem;
    border: 1px solid rgba(212,175,55,.06); border-radius: 4px;
    background: var(--bg-card, #1a1612); transition: all .3s;
}
.grim-news-item:hover { border-color: rgba(212,175,55,.2); transform: translateX(3px); }
.grim-news-dot {
    width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%;
    background: var(--gold-dark, #a68929); margin-top: .35rem;
    box-shadow: 0 0 8px rgba(212,175,55,.2);
}
.grim-news-body { flex: 1; min-width: 0; }
.grim-news-title {
    font-family: 'Cinzel', serif; font-size: .75rem;
    font-weight: 600; margin-bottom: .1rem;
}
.grim-news-excerpt {
    font-size: .7rem;
    color: var(--text-muted, #8a8070);
    line-height: 1.5;
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.grim-news-excerpt * { font-size: inherit; line-height: inherit; }
.grim-news-date { font-size: .55rem; color: var(--gold-muted, #8b7023); margin-top: .2rem; }

/* ── GUEST HERO ── */
.grim-guest-hero {
    text-align: center;
    padding: 4rem 2rem;
}
.grim-guest-emblem {
    width: 80px; height: 80px; margin: 0 auto 1.5rem;
    clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
    background: linear-gradient(135deg, var(--gold-dark, #a68929), var(--gold, #d4af37));
    display: flex; align-items: center; justify-content: center;
}
.grim-guest-emblem-inner {
    width: 72px; height: 72px;
    clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
    background: var(--bg-deep, #0e0c08);
    display: flex; align-items: center; justify-content: center;
}
.grim-guest-emblem-inner i {
    font-size: 1.8rem; color: var(--gold, #d4af37);
    text-shadow: 0 0 15px rgba(212,175,55,.4);
}
.grim-guest-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 700; margin-bottom: .3rem;
}
.grim-guest-title .gold { color: var(--gold, #d4af37); }
.grim-guest-subtitle {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--gold-dark, #a68929);
    margin-bottom: 2rem;
}
.grim-guest-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.grim-guest-btn {
    font-family: 'Cinzel', serif;
    font-size: .8rem; font-weight: 600;
    padding: .6rem 1.8rem;
    border: 1px solid var(--gold, #d4af37);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .1em;
    cursor: pointer;
    transition: all .3s;
}
.grim-guest-btn.primary {
    background: var(--gold, #d4af37);
    color: var(--bg-deep, #0e0c08);
}
.grim-guest-btn.primary:hover {
    background: var(--gold-light, #f0c674);
    box-shadow: 0 0 20px rgba(212,175,55,.3);
}
.grim-guest-btn.secondary {
    background: transparent;
    color: var(--gold, #d4af37);
}
.grim-guest-btn.secondary:hover {
    background: rgba(212,175,55,.08);
}

/* ── FOOTER ── */
.grimoire-footer {
    text-align: center; padding: 1rem 0 1.5rem; margin-top: .5rem;
}
.grimoire-footer--guest { margin-top: 3rem; }
.grimoire-footer::before {
    content: ''; display: block; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,.15), transparent);
    margin-bottom: 1rem;
}
.grimoire-footer-quote {
    font-family: 'Cinzel', serif; font-size: 1rem; font-style: italic;
    color: var(--gold-dark, #a68929); margin-bottom: .3rem;
}
.grimoire-footer-ornament {
    color: var(--gold-dark, #a68929); font-size: .45rem;
    letter-spacing: .8rem; opacity: .3; margin-bottom: .4rem;
}
.grimoire-footer-copy { font-size: .55rem; color: rgba(255,255,255,.2); }

/* ── REVEAL ── */
.grim-reveal {
    opacity: 0; transform: translateY(20px);
    transition: opacity .7s ease, transform .7s ease;
}
.grim-reveal.visible { opacity: 1; transform: translateY(0); }
.grim-d1 { transition-delay: .05s; }
.grim-d2 { transition-delay: .1s; }
.grim-d3 { transition-delay: .15s; }
.grim-d4 { transition-delay: .2s; }

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
    .grimoire-columns { grid-template-columns: 1fr; gap: 1.2rem; }
    .grimoire-deco-dragon, .grimoire-deco-knight { display: none; }
    .grimoire-wrap { padding: 1.5rem 1rem 1rem; }
}
@media (max-width: 500px) {
    .grim-camp-img { width: 90px; }
    .grim-char-stats-mini { display: none; }
    .grim-news-list { grid-template-columns: 1fr; }
}
