/* caminocondios.org · theme moderno: variables, grid, modo oscuro, sin dependencias */
:root {
    --bg: #faf8f4;
    --surface: #ffffff;
    --text: #1f2430;
    --muted: #666d7c;
    --primary: #2b3a67;
    --accent: #b8860b;
    --border: #e6e1d7;
    --radius: 14px;
    --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 20px rgb(0 0 0 / .05);
    --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161c; --surface: #1c1f27; --text: #e9e6df; --muted: #9aa0ad;
        --primary: #9db2ff; --accent: #e0b84c; --border: #2b303b;
        --shadow: 0 1px 2px rgb(0 0 0 / .4);
    }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 1.0625rem/1.7 var(--sans); color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: .5em 0 .3em; }
h2 { font-size: 1.6rem; margin: 2em 0 .6em; }
h3 { font-size: 1.15rem; margin: 0 0 .25em; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.brand { font: 700 1.2rem var(--serif); text-decoration: none; color: var(--text); }
.brand-mark { color: var(--accent); }
.nav { display: flex; gap: 1.25rem; }
.nav a { text-decoration: none; color: var(--muted); padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--text); border-color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--text); cursor: pointer; }
@media (max-width: 640px) {
    .nav-toggle { display: block; }
    .nav { display: none; position: absolute; inset: 60px 0 auto 0; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem 1rem; }
    .nav.open { display: flex; }
    .nav a { padding: .75rem 0; }
}

/* home */
.hero { text-align: center; padding: 3.5rem 0 1rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 40rem; margin: 0 auto 1.5rem; }
.btn { display: inline-block; background: var(--primary); color: var(--bg); padding: .75rem 1.5rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.btn:hover { filter: brightness(1.1); }

/* tarjetas */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cards-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.card a:hover { transform: translateY(-3px); border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--border); }
.card-body { display: block; padding: .75rem .9rem 1rem; }
.card-body strong { display: block; font-family: var(--serif); font-size: 1.1rem; }
.card-body small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; margin-top: .2rem; }

/* listado */
.buscador input { width: 100%; max-width: 420px; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; margin-bottom: 1.5rem; }
.paginacion { display: flex; gap: 1.5rem; justify-content: center; align-items: center; margin: 2.5rem 0; }

/* personaje */
.migas { font-size: .9rem; color: var(--muted); margin: 1.25rem 0 0; }
.migas a { color: var(--muted); }
.layout { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.personaje-head { display: grid; grid-template-columns: 220px 1fr; gap: 1.75rem; align-items: center; margin: 1rem 0 0; }
.personaje-head img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--border); }
.personaje-head h1 { margin-top: 0; }
@media (max-width: 560px) { .personaje-head { grid-template-columns: 1fr; } .personaje-head img { max-width: 260px; } }
.subtitulo { font: italic 1.25rem var(--serif); color: var(--muted); margin: 0 0 .5rem; }
.libros { font-size: .95rem; margin: 0; }
.libros span { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; margin-right: .4rem; }
.prosa p { max-width: 68ch; }

/* logros como línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 1.5rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -1.5rem; top: .45rem; width: 12px; height: 12px; margin-left: -7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.timeline p { margin: .2rem 0 .4rem; color: var(--muted); }
.cita { display: inline-block; font-size: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .7rem; color: var(--primary); }

/* historias: un solo texto con sus propios títulos */
.historia { max-width: 820px; margin-inline: auto; }
.relato-completo { font-family: var(--serif); font-size: 1.15rem; }
.relato-completo p { max-width: 68ch; }
.relato-completo h2 { margin-top: 2.2rem; }
.lead-izq { margin-left: 0; text-align: left; }
.btn-sec { background: transparent; color: var(--primary); border: 2px solid var(--primary); margin-left: .5rem; padding: calc(.75rem - 2px) calc(1.5rem - 2px); }

/* preguntas y respuestas */
.pregunta h1 { margin-bottom: .4em; }
.respuesta-corta { margin: 1.25rem 0 0; padding: 1rem 1.25rem; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid var(--accent); font-size: 1.15rem; max-width: 68ch; }
.respuesta { margin-top: 2rem; }
.respuesta h2 { margin-top: 0; }
.mas-preguntas { margin-top: 3rem; }
.lista-q { list-style: none; margin: 0; padding: 0; }
.lista-q li { padding: .6rem 0; border-top: 1px solid var(--border); }
.lista-q li:first-child { border-top: 0; }
.lista-q-detalle li { padding: 1rem 0; }
.lista-q-detalle strong { font: 700 1.15rem/1.3 var(--serif); }
.lista-q-detalle p { margin: .3rem 0 .4rem; color: var(--muted); max-width: 68ch; }

/* sidebar */
.sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 1rem; position: sticky; top: 80px; }
.sidebar h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: .5rem 0; border-top: 1px solid var(--border); }
.sidebar li:first-child { border-top: 0; }
.sidebar small { display: block; color: var(--muted); font-size: .8rem; }

/* footer */
.site-footer { margin-top: 4rem; padding: 2rem 0; border-top: 1px solid var(--border); background: var(--surface); text-align: center; }
.site-footer p { margin: .2rem 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
