/* =========================================================================
   BASE.CSS — Bibles24.com
   Fundamentos del sistema de diseño: variables, reset, tipografía, layout.
   Cargar SIEMPRE primero, antes de components.css y cualquier CSS de página.
   ========================================================================= */

:root {
    /* ---- Color: paleta cálida, minimalista, alto contraste de lectura ---- */
    --ink: #1c1b1a;              /* texto principal */
    --ink-soft: #4a4640;         /* texto secundario */
    --muted: #837c72;            /* texto terciario / metadatos */

    --paper: #faf7f2;            /* fondo principal */
    --paper-alt: #f1ebe0;        /* fondo alterno (secciones, cards) */
    --paper-raised: #ffffff;     /* tarjetas sobre --paper */

    --accent: #a8763c;           /* dorado cálido — acento de marca */
    --accent-dark: #8a5f2e;
    --accent-soft: #f3e6d3;      /* fondo suave con el acento */

    --border: #e6ddcd;
    --border-strong: #d5c9b3;

    --success: #2f7d5c;
    --error: #b3432b;
    --info: #3a6ea5;

    /* ---- Tipografía ---- */
    --font-serif: 'Lora', Georgia, 'Iowan Old Style', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --fs-xs: 0.8rem;
    --fs-sm: 0.9rem;
    --fs-base: 1rem;
    --fs-md: 1.15rem;
    --fs-lg: 1.4rem;
    --fs-xl: 1.85rem;
    --fs-2xl: 2.35rem;

    /* ---- Espaciado (escala de 4px) ---- */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;

    /* ---- Forma ---- */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(28, 27, 26, 0.06);
    --shadow-md: 0 4px 16px rgba(28, 27, 26, 0.08);

    --transition: all 0.18s ease;
    --max-width: 1120px;
    --max-width-reading: 720px;
}

/* ---- Reset mínimo ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

img, svg { max-width: 100%; display: block; }

a {
    color: var(--accent-dark);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    color: var(--ink);
    line-height: 1.25;
    margin: 0 0 var(--sp-3);
    font-weight: 600;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0 0 var(--sp-4); color: var(--ink-soft); }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---- Layout utilitario ---- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--sp-5);
}

.container-reading {
    max-width: var(--max-width-reading);
    margin: 0 auto;
    padding: 0 var(--sp-5);
}

.section {
    padding: var(--sp-7) 0;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- Foco accesible visible (importante para SEO/UX y accesibilidad) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

[x-cloak] { display: none !important; }

@media (max-width: 640px) {
    :root {
        --fs-2xl: 1.85rem;
        --fs-xl: 1.5rem;
        --fs-lg: 1.2rem;
    }
    .section { padding: var(--sp-6) 0; }
    .container, .container-reading { padding: 0 var(--sp-4); }
}
