/*
Theme Name: Affatus Theme
Theme URI: https://affatus.com.br
Author: Affatus
Description: Tema oficial do sistema de RPG de narrativa bíblica Affatus. Requer o plugin Affatus Engine.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: affatus-theme
Tags: rpg, biblical, dark, gaming
*/

/* ══════════════════════════════════════════════════════════════
   DESIGN TOKENS — Affatus
   Paleta: Oriente Médio antigo à luz de vela
   Tipografia: épico bíblico, não fantasia genérica
══════════════════════════════════════════════════════════════ */
:root {
    /* Fundos */
    --aff-fundo:        #0c0905;
    --aff-fundo-2:      #1a1208;
    --aff-fundo-3:      #241a0e;
    --aff-fundo-card:   rgba(26, 18, 8, 0.92);
    --aff-borda:        rgba(212, 169, 106, 0.18);
    --aff-borda-hover:  rgba(212, 169, 106, 0.40);

    /* Acentos */
    --aff-ouro:         #d4a96a;
    --aff-ouro-dim:     #8b6332;
    --aff-ouro-brilho:  #f0cc8a;
    --aff-carmim:       #8b1a1a;
    --aff-ocre:         #8b5e3c;

    /* Texto */
    --aff-texto:        #f0e6d0;
    --aff-texto-2:      #c4a87c;
    --aff-texto-3:      #7a6040;
    --aff-texto-inv:    #0c0905;

    /* Tipografia */
    --aff-ft:  'Cinzel Decorative', serif;   /* Títulos épicos H1 */
    --aff-fu:  'Cinzel', serif;              /* UI labels, H2-H3 */
    --aff-fb:  'Crimson Text', Georgia, serif; /* Corpo narrativo */
    --aff-fq:  'IM Fell English', serif;     /* Citações bíblicas */

    /* Raios */
    --aff-r-sm: 4px;
    --aff-r-md: 8px;
    --aff-r-lg: 14px;

    /* Z-index */
    --z-base:    1;
    --z-nav:   100;
    --z-modal: 500;
    --z-toast: 9999;

    /* Transições */
    --aff-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Reset base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--aff-fundo);
    color: var(--aff-texto);
    font-family: var(--aff-fb);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--aff-ouro-dim); border-radius: 2px; }

/* ── Foco acessível ─────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--aff-ouro);
    outline-offset: 3px;
}

/* ── Animações globais ───────────────────────────────────────── */
@keyframes aff-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes aff-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes aff-flicker {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}
@keyframes aff-pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212,169,106,0); }
    50%       { box-shadow: 0 0 0 6px rgba(212,169,106,0.12); }
}
@keyframes aff-ember {
    0%   { opacity: 0; transform: translateY(0) scale(0.6); }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.2; }
    100% { opacity: 0; transform: translateY(-80px) scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Botão base ─────────────────────────────────────────────── */
.aff-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--aff-fu);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 14px 32px;
    border-radius: var(--aff-r-sm);
    border: 1px solid var(--aff-ouro-dim);
    background: transparent;
    color: var(--aff-ouro);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s var(--aff-ease);
}
.aff-btn:hover {
    background: rgba(212,169,106,0.10);
    border-color: var(--aff-ouro);
    color: var(--aff-ouro-brilho);
}
.aff-btn-primary {
    background: var(--aff-ouro);
    color: var(--aff-texto-inv);
    border-color: var(--aff-ouro);
    font-weight: 700;
}
.aff-btn-primary:hover {
    background: var(--aff-ouro-brilho);
    color: var(--aff-texto-inv);
    border-color: var(--aff-ouro-brilho);
}
.aff-btn:disabled, .aff-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Grain overlay (aplicado nas pages do Affatus) ─────────── */
.aff-grain::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}
