/* Sitio de libros — estilos base. Los colores de portada de cada libro los añade build.py al final. */

:root {
  --paper: #FAF8F4;
  --paper-2: #F1EDE5;
  --card: #FFFFFF;
  --ink: #1B1A18;
  --muted: #5E5952;
  --line: #E2DCD2;
  --btn-bg: #1B1A18;
  --btn-fg: #FAF8F4;
  --focus: #2F6FEB;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --cover-bg: #22333B;
  --cover-fg: #F4F1EA;
  --cover-accent: #E8833A;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121211;
    --paper-2: #1B1A18;
    --card: #1B1A18;
    --ink: #ECE8E1;
    --muted: #A59F96;
    --line: #2E2B28;
    --btn-bg: #ECE8E1;
    --btn-fg: #121211;
    --focus: #7AA7FF;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.8rem); }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 740px; }
.section { padding-top: 40px; padding-bottom: 8px; }
.lead { font-size: 1.2rem; color: var(--muted); }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .8em; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--btn-bg); color: var(--btn-fg); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 12px; top: 12px; }

/* ---- cabecera y pie ---- */
.top { border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.top nav a { font-size: .95rem; color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }

.foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.foot p { margin: 0 0 .4em; }
.foot__note { font-size: .82rem; }

/* ---- portada tipográfica (provisional hasta tener la definitiva) ---- */
.cover {
  display: flex;
  flex-direction: column;
  aspect-ratio: 2 / 3;
  width: 100%;
  border-radius: 3px 6px 6px 3px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 12px 32px -8px rgba(0,0,0,.35);
  container-type: inline-size;
}
.cover--type {
  background:
    linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(0,0,0,0) 5%, rgba(255,255,255,.06) 6%, rgba(0,0,0,0) 8%),
    var(--cover-bg);
  color: var(--cover-fg);
  /* en %, no en cqi: las unidades de contenedor en el propio contenedor se resuelven contra la ventana */
  padding: 11% 10% 9% 12%;
  font-family: var(--sans);
}
.cover--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover__kicker { font-size: 5.4cqi; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.cover__hl { font-size: 11cqi; font-weight: 800; line-height: 1; color: var(--cover-accent); margin-top: 2cqi; letter-spacing: -.01em; }
.cover__title { margin-top: auto; font-size: 15.5cqi; font-weight: 800; line-height: .98; letter-spacing: -.02em; hyphens: manual; }
.cover__rule { display: block; width: 22%; height: max(2px, 1.2cqi); background: var(--cover-accent); margin: 7cqi 0 5cqi; }
.cover__author { font-size: 5.2cqi; letter-spacing: .16em; text-transform: uppercase; opacity: .9; }
a.cover { transition: transform .15s ease, box-shadow .15s ease; }
a.cover:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 18px 40px -10px rgba(0,0,0,.4); }

/* ---- portada del sitio ---- */
.hero-site { padding: 64px 0 24px; }
.hero-site h1 { font-size: clamp(2.4rem, 1.6rem + 3.5vw, 3.6rem); margin-bottom: .2em; }
.hero-site .lead { font-family: var(--serif); font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); color: var(--ink); }
.hero-site p { max-width: 62ch; }
.hero-site p:last-child { color: var(--muted); }

.cards { list-style: none; display: grid; gap: 28px; }
.card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 24px;
  align-items: start;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 860px;
}
.card h3 { font-family: var(--serif); font-size: 1.5rem; margin: .45em 0 .15em; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card__by { color: var(--muted); font-size: .95rem; margin-bottom: .7em; }
.card p:last-child { margin: 0; }

.badge {
  display: inline-block;
  font: 600 .72rem/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
}
.badge--on { border-color: transparent; background: color-mix(in srgb, var(--cover-accent) 20%, transparent); color: var(--ink); }

/* ---- ficha del libro ---- */
.hero { padding: 48px 0 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
.hero__in { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 56px; align-items: start; }
.hero .cover--lg { max-width: 300px; }
.hero h1 { margin-bottom: .25em; }
.subtitle { font-family: var(--serif); font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.45; color: var(--muted); max-width: 60ch; }
.byline { font-size: 1rem; margin-bottom: 1.4em; }
.byline .badge { margin-left: 8px; }

.buy__btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  border: 1.5px solid var(--btn-bg);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(0,0,0,.45); text-decoration: none; }
.btn__sub { font-weight: 400; font-size: .88em; opacity: .78; }
.btn--off { background: transparent; color: var(--muted); border: 1.5px dashed var(--line); cursor: default; }
.btn--off:hover { transform: none; box-shadow: none; }
.btn--big { padding: 16px 24px; font-size: 1.05rem; }
.buy__more { margin-top: 14px; font-size: .92rem; color: var(--muted); }
.buy__more p { margin: 0 0 4px; }
.buy__more ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.buy__more li span { font-weight: 600; margin-right: 4px; }
.buy__note { margin-top: 14px; font-size: .92rem; color: var(--muted); max-width: 52ch; }

.pitch p { font-family: var(--serif); font-size: 1.22rem; line-height: 1.6; }
.pitch p:first-child::first-letter { font-weight: 700; }

.checks { list-style: none; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before {
  content: "";
  position: absolute; left: 2px; top: .5em;
  width: 14px; height: 8px;
  border-left: 2.5px solid var(--cover-accent);
  border-bottom: 2.5px solid var(--cover-accent);
  transform: rotate(-45deg);
}

.grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 20px 6px; }
.grid li h3 { margin-bottom: .4em; }
.grid li p { color: var(--muted); font-size: .98rem; }

.callout { border-left: 4px solid var(--cover-accent); background: var(--paper-2); padding: 20px 24px 6px; border-radius: 0 12px 12px 0; }
.callout h2 { font-size: 1.25rem; }
.callout p { font-family: var(--serif); font-size: 1.15rem; }
.callout.mini { display: flex; gap: 20px; align-items: center; margin-top: 40px; padding-bottom: 20px; }
.callout.mini p { font-family: var(--sans); font-size: 1rem; margin: 0; }
.callout.mini h2 { font-size: 1.1rem; margin-bottom: .3em; }
.cover--xs { width: 64px; flex: none; box-shadow: 0 6px 14px -6px rgba(0,0,0,.4); }
.cover--xs > * { display: none; }

.res-list { list-style: none; display: grid; gap: 12px; }
.res {
  display: grid; gap: 4px;
  padding: 18px 48px 18px 20px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  position: relative;
}
.res::after { content: "→"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--muted); transition: transform .12s ease; }
.res:hover::after { transform: translate(3px, -50%); }
.res span { color: var(--muted); font-size: .96rem; }

.toc summary { display: flex; align-items: baseline; gap: 14px; cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary h2 { margin: 0; }
.toc summary span { color: var(--muted); font-size: .92rem; }
.toc summary::after { content: "+"; margin-left: auto; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.toc[open] summary::after { content: "−"; }
.toc ol { margin-top: 16px; padding-left: 0; list-style: none; counter-reset: ch; columns: 2; column-gap: 32px; }
.toc li { counter-increment: ch; padding: 6px 0 6px 36px; position: relative; break-inside: avoid; border-bottom: 1px solid var(--line); }
.toc li::before { content: counter(ch); position: absolute; left: 0; width: 26px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.author { margin-bottom: .3em; }
.buy-end { padding-bottom: 24px; }

.steps { padding-left: 1.4em; display: grid; gap: 10px; margin-bottom: 1.2em; }
.steps li::marker { color: var(--muted); font-weight: 600; }
.prose h2 { margin-top: 1.4em; font-size: 1.35rem; }

/* ---- móvil ---- */
@media (max-width: 760px) {
  .hero { padding-top: 32px; }
  .hero__in { grid-template-columns: 1fr; gap: 32px; }
  .hero .cover--lg { max-width: 220px; }
  .grid { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  .card { grid-template-columns: 96px 1fr; gap: 18px; padding: 18px; }
  .card h3 { font-size: 1.3rem; }
  .hero-site { padding-top: 40px; }
  .btn { width: 100%; justify-content: center; }
}

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

/* generado por build.py: colores de cada libro */
.b-opositar-trabajando{--cover-bg:#22333B;--cover-fg:#F4F1EA;--cover-accent:#E8833A}
