/* ════════════════════════════════════════════════════════════════════════
   LIBROS CREANDO PATRIA — base.css
   Variables, reset, tipografía y utilidades base.
   ════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── PALETA EDITORIAL ─────────────────────────────────────────────── */
    --negro:        #0a0a0a;        /* Fondo principal, profundo cálido     */
    --negro-suave:  #141414;        /* Variantes de superficie              */
    --negro-card:   #1a1a1a;        /* Tarjetas y zonas elevadas            */
    --negro-line:   #2a2a2a;        /* Separadores, bordes sutiles          */

    --oro:          #c9a961;        /* Oro envejecido, acentos editoriales  */
    --oro-claro:    #e8c468;        /* Hover, énfasis dorado                */
    --oro-tenue:    rgba(201, 169, 97, 0.15);
    --oro-glow:     rgba(201, 169, 97, 0.4);

    --verde-cp:     #39ff14;        /* Verde marca Creando Patria (sutil)   */
    --verde-tenue:  rgba(57, 255, 20, 0.18);

    --crema:        #f5f1e8;        /* Texto principal, color papel         */
    --crema-tenue:  rgba(245, 241, 232, 0.7);
    --crema-mute:   rgba(245, 241, 232, 0.45);

    --gris-ceniza:  #8a8a8a;        /* Texto secundario                     */
    --gris-mute:    #5a5a5a;        /* Texto muy secundario                 */

    --rojo-acento:  #a83232;        /* Para alertas / acentos puntuales     */

    /* ── TIPOGRAFÍA ───────────────────────────────────────────────────── */
    --font-titular:  'Cinzel', Georgia, serif;            /* Romano clásico   */
    --font-display:  'Playfair Display', Georgia, serif;  /* Editorial elegante */
    --font-cuerpo:   'Crimson Pro', Georgia, serif;       /* Lectura larga    */
    --font-meta:     'Bebas Neue', sans-serif;            /* Etiquetas        */
    --font-sistema:  -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* ── DIMENSIONES ──────────────────────────────────────────────────── */
    --max-ancho:    1200px;
    --max-lectura:  720px;          /* Ancho ideal para textos largos       */

    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 14px;
    --r-pill: 999px;

    /* ── SOMBRAS Y EFECTOS ────────────────────────────────────────────── */
    --sombra-sutil:    0 1px 3px rgba(0,0,0,0.4);
    --sombra-tarjeta:  0 4px 16px rgba(0,0,0,0.5);
    --sombra-elevada:  0 12px 32px rgba(0,0,0,0.6);
    --sombra-dorada:   0 0 24px rgba(201, 169, 97, 0.25);

    --transicion-rapida: 0.2s ease;
    --transicion-media:  0.35s ease;
    --transicion-lenta:  0.6s ease;
}

/* ── RESET CONTROLADO ────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--negro);
    color: var(--crema);
    font-family: var(--font-cuerpo);
    font-size: 1.05rem;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── FONDO EDITORIAL CON TEXTURA SUTIL ──────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(201,169,97,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(57,255,20,0.025) 0%, transparent 55%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(201, 169, 97, 0.008) 2px,
        rgba(201, 169, 97, 0.008) 3px
    );
}

/* ── TIPOGRAFÍA GLOBAL ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-titular);
    font-weight: 600;
    line-height: 1.25;
    color: var(--crema);
    margin-bottom: 0.6em;
    letter-spacing: 0.01em;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: 0.02em;
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    color: var(--oro);
}

h3 {
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
}

h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.1em; }

p {
    margin-bottom: 1.1em;
    color: var(--crema);
}

p:last-child { margin-bottom: 0; }

/* ── ENLACES ────────────────────────────────────────────────────────── */
a {
    color: var(--oro);
    text-decoration: none;
    transition: color var(--transicion-rapida);
}

a:hover {
    color: var(--oro-claro);
}

/* ── LISTAS ─────────────────────────────────────────────────────────── */
ul, ol {
    margin-left: 1.4em;
    margin-bottom: 1.1em;
}

li {
    margin-bottom: 0.4em;
}

/* ── CITAS ──────────────────────────────────────────────────────────── */
blockquote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--oro);
    border-left: 3px solid var(--oro);
    padding: 0.6em 1.4em;
    margin: 1.6em 0;
    background: rgba(201, 169, 97, 0.04);
}

/* ── IMÁGENES RESPONSIVE POR DEFECTO ────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── BOTONES BASE ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.7em 1.6em;
    font-family: var(--font-meta);
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--transicion-rapida);
    text-decoration: none;
    user-select: none;
}

.btn-oro {
    background: var(--oro);
    color: var(--negro);
    box-shadow: var(--sombra-sutil);
}

.btn-oro:hover {
    background: var(--oro-claro);
    color: var(--negro);
    box-shadow: var(--sombra-dorada);
    transform: translateY(-1px);
}

.btn-borde {
    background: transparent;
    color: var(--oro);
    border: 1px solid var(--oro);
}

.btn-borde:hover {
    background: var(--oro);
    color: var(--negro);
}

.btn-fantasma {
    background: transparent;
    color: var(--crema);
    border: 1px solid var(--negro-line);
}

.btn-fantasma:hover {
    border-color: var(--oro);
    color: var(--oro);
}

/* ── CONTENEDORES BASE ─────────────────────────────────────────────── */
.contenedor {
    width: 100%;
    max-width: var(--max-ancho);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.contenedor-lectura {
    width: 100%;
    max-width: var(--max-lectura);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── UTILIDADES ────────────────────────────────────────────────────── */
.texto-centro    { text-align: center; }
.texto-derecha   { text-align: right; }
.texto-oro       { color: var(--oro); }
.texto-crema     { color: var(--crema); }
.texto-tenue     { color: var(--crema-tenue); }
.texto-mute      { color: var(--gris-ceniza); }
.texto-mayus     { text-transform: uppercase; letter-spacing: 0.15em; }

.linea-oro {
    width: 60px;
    height: 2px;
    background: var(--oro);
    margin: 1.2rem auto;
    border: none;
}

.divisor {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--negro-line), transparent);
    margin: 2.4rem 0;
}

/* ── ACCESIBILIDAD ─────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--oro);
    outline-offset: 3px;
}

.solo-lectores {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ── SELECCIÓN DE TEXTO ────────────────────────────────────────────── */
::selection {
    background: var(--oro);
    color: var(--negro);
}

/* ── SCROLLBAR PERSONALIZADO (WEBKIT) ──────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--negro-suave); }
::-webkit-scrollbar-thumb {
    background: var(--negro-line);
    border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--oro); }
