/* Manual Policial: hoja única. El color de cada sección sale del canto del libro (--sec / --c). */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); }

:root {
  --papel: #f3f5f9;
  --blanco: #ffffff;
  --tinta: #142033;
  --tinta-suave: #4b5567;
  --linea: #d9dee8;
  --cobalto: #1640b5;
  --cobalto-osc: #0e2c80;
  --amarillo: #ffd400;
  --sec: var(--cobalto);

  --titulos: "Barlow Condensed", "Arial Narrow", sans-serif;
  --texto: "Atkinson Hyperlegible", system-ui, sans-serif;

  --ancho: 72rem;
  --medida: 42rem;
  --hueco: clamp(1rem, 4vw, 2rem);
  --radio: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font: 400 1.0625rem/1.6 var(--texto);
}
img { max-width: 100%; height: auto; }
a { color: var(--cobalto); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--cobalto-osc); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; box-shadow: 0 0 0 5px var(--tinta); border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--titulos); font-weight: 700; line-height: 1.05; margin: 0 0 .5em; letter-spacing: .005em; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: 1rem; top: -4rem; background: var(--amarillo); color: var(--tinta); padding: .6rem 1rem; z-index: 50; }
.saltar:focus { top: 1rem; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 1.05rem/1 var(--titulos); letter-spacing: .02em;
  padding: .7rem 1.1rem; border-radius: var(--radio); text-decoration: none; border: 2px solid transparent; cursor: pointer;
}
.boton--comprar { background: var(--amarillo); color: var(--tinta); }
.boton--comprar:hover { background: #ffe24d; color: var(--tinta); }
.boton--claro { border-color: currentColor; color: var(--cobalto); background: transparent; }
.boton--claro:hover { background: var(--blanco); }
.boton--grande { font-size: 1.25rem; padding: .9rem 1.4rem; }

/* ---------- Cabecera ---------- */
.cabecera { background: var(--cobalto); color: var(--blanco); border-bottom: 5px solid var(--amarillo); position: relative; z-index: 20; }
.cabecera__fila { max-width: var(--ancho); margin: 0 auto; padding: .8rem var(--hueco); display: flex; align-items: center; gap: 1.5rem; }
.marca { color: inherit; text-decoration: none; display: grid; line-height: 1; margin-right: auto; }
.marca:hover { color: inherit; }
.marca__nombre { font: 700 1.9rem/1 var(--titulos); letter-spacing: .01em; }
.marca__lema { font-size: .8rem; opacity: .85; margin-top: .25rem; white-space: nowrap; }
.menu { display: flex; align-items: center; gap: 1rem; }
.menu ul { display: flex; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.menu a:not(.boton), .buscar-abrir {
  white-space: nowrap;
  color: var(--blanco); text-decoration: none; font: 600 1.15rem/1 var(--titulos); letter-spacing: .02em;
  padding: .55rem .6rem; border-radius: var(--radio); display: block;
}
.menu a:not(.boton):hover, .buscar-abrir:hover { background: rgb(255 255 255 / .12); color: var(--blanco); }
.menu a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--amarillo); border-radius: 0; }
.buscar-abrir { background: none; border: 1px solid rgb(255 255 255 / .5); cursor: pointer; }
.boton-menu { display: none; }

@media (max-width: 70rem) {
  .boton-menu {
    display: block; background: none; color: var(--blanco); border: 1px solid rgb(255 255 255 / .6);
    font: 600 1.1rem/1 var(--titulos); padding: .55rem .9rem; border-radius: var(--radio); cursor: pointer;
  }
  .menu { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--cobalto-osc);
    flex-direction: column; align-items: stretch; padding: .5rem var(--hueco) 1.2rem; gap: .6rem; border-bottom: 5px solid var(--amarillo); }
  .menu.is-abierto { display: flex; }
  .menu ul { flex-direction: column; }
  .menu a:not(.boton) { padding: .8rem .4rem; font-size: 1.3rem; border-bottom: 1px solid rgb(255 255 255 / .12); }
  .menu a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--amarillo); padding-left: .9rem; }
  .marca__lema { display: none; }
}

/* ---------- Canto: pestañas de color ---------- */
.canto { display: flex; overflow-x: auto; background: var(--blanco); border-bottom: 1px solid var(--linea); scrollbar-width: none; }
.canto__pestana {
  flex: 1 0 auto; text-decoration: none; color: var(--tinta);
  font: 600 1rem/1 var(--titulos); letter-spacing: .02em;
  padding: .7rem .9rem .6rem; border-top: 5px solid var(--c); text-align: center; white-space: nowrap;
}
.canto__pestana:hover { background: color-mix(in srgb, var(--c) 10%, white); color: var(--tinta); }
.canto__pestana.is-activa { background: var(--c); color: var(--blanco); }

@media (min-width: 80rem) {
  .canto {
    position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 15;
    flex-direction: column; gap: 3px; background: none; border: 0; overflow: visible;
  }
  .canto__pestana {
    writing-mode: vertical-rl; transform: rotate(180deg);
    background: var(--c); color: var(--blanco); border: 0;
    width: 2.1rem; padding: 1rem 0; border-radius: 0 var(--radio) var(--radio) 0;
    font-size: .95rem; transition: width .15s ease;
  }
  .canto__pestana:hover { background: var(--c); color: var(--blanco); width: 2.6rem; }
  .canto__pestana.is-activa { width: 2.9rem; box-shadow: inset -4px 0 0 rgb(0 0 0 / .18); }
}

/* ---------- Portada ---------- */
.portada {
  max-width: var(--ancho); margin: 0 auto; padding: clamp(2.5rem, 7vw, 5rem) var(--hueco) clamp(3rem, 7vw, 5rem);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.portada__edicion { font: 700 1.2rem/1 var(--titulos); color: var(--cobalto); margin: 0 0 1rem;
  display: inline-block; background: var(--amarillo); color: var(--tinta); padding: .35rem .6rem; border-radius: 3px; }
.portada__titulo { font-size: clamp(2.8rem, 6.4vw, 5.2rem); line-height: .95; color: var(--cobalto-osc); margin-bottom: .35em; text-wrap: balance; }
.portada__entrada { font-size: 1.2rem; max-width: 34rem; margin: 0 0 1.8rem; }
.portada__acciones { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2rem; }
.portada__dato { color: var(--tinta-suave); max-width: 34rem; margin: 0; padding-top: 1.2rem; border-top: 1px solid var(--linea); }

/* El libro: tapa + canto de colores visto de lado */
.libro { margin: 0; justify-self: center; width: min(100%, 22rem); }
.libro__cuerpo { position: relative; padding-right: 3.4rem; }
.libro__tapa {
  display: block; width: 100%; position: relative; z-index: 2;
  border-radius: 3px 8px 8px 3px;
  box-shadow: 0 1px 0 rgb(0 0 0 / .1), 0 24px 40px -18px rgb(14 44 128 / .55);
}
.libro__canto {
  position: absolute; z-index: 1; top: 1.5%; bottom: 1.5%; right: .2rem; width: 3.6rem;
  display: flex; transform: perspective(600px) rotateY(-30deg); transform-origin: left center;
}
.libro__canto span { flex: 1; background: var(--c); border-right: 1px solid rgb(255 255 255 / .35); }
.libro__canto span:first-child { border-radius: 0 0 0 2px; }
@media (prefers-reduced-motion: no-preference) {
  .libro__canto span { animation: abre-canto .6s cubic-bezier(.2, .7, .2, 1) both; }
  .libro__canto span:nth-child(2) { animation-delay: .05s; }
  .libro__canto span:nth-child(3) { animation-delay: .1s; }
  .libro__canto span:nth-child(4) { animation-delay: .15s; }
  .libro__canto span:nth-child(5) { animation-delay: .2s; }
  .libro__canto span:nth-child(6) { animation-delay: .25s; }
  .libro__canto span:nth-child(7) { animation-delay: .3s; }
}
@keyframes abre-canto { from { transform: translateX(-140%); } }

@media (max-width: 52rem) {
  .portada { grid-template-columns: 1fr; }
  .libro { width: min(70%, 17rem); grid-row: 1; }
}

/* ---------- Bloques de portada ---------- */
.bloque { max-width: var(--ancho); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) var(--hueco); }
.bloque + .bloque { border-top: 1px solid var(--linea); }
.bloque__cabeza { max-width: var(--medida); margin-bottom: 2rem; }
.bloque__cabeza h2 { font-size: clamp(2rem, 4vw, 2.8rem); color: var(--cobalto-osc); }
.bloque__cabeza p { margin: 0; color: var(--tinta-suave); }
.colores { background: var(--blanco); max-width: none; }
.colores > * { max-width: calc(var(--ancho) - 2 * var(--hueco)); margin-left: auto; margin-right: auto; }

.colores__grupos { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grupo { border-left: 8px solid var(--c); padding: .2rem 0 .2rem 1.2rem; }
.grupo__titulo { font-size: 1.8rem; margin-bottom: .6rem; }
.grupo__titulo a { color: var(--tinta); text-decoration: none; }
.grupo__titulo a:hover { color: var(--c); }
.grupo__leyes { list-style: none; margin: 0; padding: 0; }
.grupo__leyes li { border-top: 1px solid var(--linea); }
.grupo__leyes a { display: block; padding: .5rem 0; color: var(--tinta); text-decoration: none; }
.grupo__leyes a:hover { color: var(--c); text-decoration: underline; }

.novedades__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem 2rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.novedades__lista li { padding-left: 1.4rem; position: relative; font-size: 1.1rem; }
.novedades__lista li::before { content: ""; position: absolute; left: 0; top: .5em; width: .65rem; height: .65rem; background: var(--amarillo); border: 2px solid var(--tinta); border-radius: 1px; }

.al-dia { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.tarjeta { display: block; background: var(--blanco); border-top: 6px solid var(--c); border-radius: 0 0 var(--radio) var(--radio); padding: 1.4rem 1.4rem 1.2rem; color: var(--tinta); text-decoration: none; }
a.tarjeta:hover { color: var(--tinta); outline: 2px solid var(--c); outline-offset: -2px; }
.tarjeta__titulo { font-size: 1.7rem; }
.tarjeta__titulo a { color: inherit; text-decoration: none; }
.tarjeta p { margin: 0; color: var(--tinta-suave); }
.tarjeta--lista ul { margin: 0; padding: 0; list-style: none; }
.tarjeta--lista li + li { border-top: 1px solid var(--linea); }
.tarjeta--lista li a { display: block; padding: .45rem 0; }

/* ---------- Páginas interiores ---------- */
.pagina { max-width: calc(var(--medida) + 2 * var(--hueco)); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--hueco) 4rem; }
.pagina--ancha { max-width: calc(var(--ancho) + 2 * var(--hueco)); }
.pagina__cabecera { margin-bottom: 2rem; padding-left: 1.1rem; border-left: 8px solid var(--sec); }
.pagina__cabecera h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--tinta); margin-bottom: .2em; text-wrap: balance; }
.pagina__fecha { margin: 0; color: var(--tinta-suave); font-size: .95rem; }
.pagina__intro { margin: .4rem 0 0; max-width: var(--medida); font-size: 1.15rem; color: var(--tinta-suave); }
.migas { font: 600 1.1rem/1 var(--titulos); margin-bottom: .6rem; display: flex; gap: .5rem; }
.migas a { color: var(--sec); text-decoration: none; }
.migas a:hover { text-decoration: underline; }
.migas span { color: var(--tinta-suave); }

.prosa { max-width: var(--medida); overflow-wrap: anywhere; }
.prosa h2 { font-size: 2rem; margin-top: 1.6em; color: var(--cobalto-osc); }
.prosa h3 { font-size: 1.55rem; margin-top: 1.4em; }
.prosa h4 { font-size: 1.3rem; margin-top: 1.2em; }
.prosa p, .prosa ul, .prosa ol { margin: 0 0 1em; }
.prosa li { margin-bottom: .35em; }
.prosa li > p { margin: 0; }
.prosa ul ul, .prosa ol ul { margin: .4em 0; }
.prosa img { border-radius: 4px; vertical-align: middle; }
.prosa > p > img:only-child, .prosa > p > strong > img:only-child { display: block; margin: 1rem 0; }
.prosa a.doc { font-weight: 700; }
.prosa a.doc::after { content: " PDF"; font: 700 .7rem/1 var(--texto); background: var(--sec); color: var(--blanco); padding: .15rem .3rem; border-radius: 2px; margin-left: .35rem; vertical-align: .15em; }
.prosa a.doc[href$=".doc" i]::after, .prosa a.doc[href$=".docx" i]::after { content: " DOC"; }
.prosa a.doc[href$=".ppt" i]::after, .prosa a.doc[href$=".pptx" i]::after { content: " PPT"; }
.prosa strong { font-weight: 700; }
.tabla { overflow-x: auto; margin: 1.2rem 0; }
.prosa table { border-collapse: collapse; min-width: 100%; font-size: .95rem; background: var(--blanco); }
.prosa td, .prosa th { border: 1px solid var(--linea); padding: .45rem .6rem; vertical-align: top; }

/* Galería de portadas personalizadas */
.prosa--galeria { max-width: none; }
.prosa--galeria > p, .prosa--galeria > ul, .prosa--galeria > h2 { max-width: var(--medida); }
.prosa--galeria a:has(> img) { display: inline-block; margin: 0 .4rem .4rem 0; border-radius: 4px; }
.prosa--galeria a:has(> img) img { height: 140px; width: auto; box-shadow: 0 6px 14px -8px rgb(20 32 51 / .5); }
.prosa--galeria a:has(> img):hover img { outline: 3px solid var(--cobalto); outline-offset: 2px; }

.vecinos { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--linea); max-width: var(--medida); }
.vecinos a { text-decoration: none; color: var(--tinta); font: 600 1.3rem/1.1 var(--titulos); }
.vecinos a span { display: block; font: 400 .9rem/1.4 var(--texto); color: var(--tinta-suave); margin-bottom: .2rem; }
.vecinos a:hover { color: var(--sec); }
.vecinos__sig { grid-column: 2; text-align: right; }

/* Listados */
.lista-entradas { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.entrada a { display: block; height: 100%; background: var(--blanco); padding: 1.3rem 1.4rem; border-top: 5px solid var(--sec); border-radius: 0 0 var(--radio) var(--radio); color: var(--tinta); text-decoration: none; }
.entrada a:hover { outline: 2px solid var(--sec); outline-offset: -2px; color: var(--tinta); }
.entrada__titulo { font-size: 1.6rem; margin-bottom: .3rem; }
.entrada__fecha { margin: 0 0 .5rem; font-size: .9rem; color: var(--tinta-suave); }
.entrada__resumen { margin: 0; color: var(--tinta-suave); font-size: .98rem; }
.lista-simple { font-size: 1.15rem; }

/* Contacto */
.contacto { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 52rem) { .contacto { grid-template-columns: 1fr; } }
.formulario { background: var(--blanco); padding: clamp(1.2rem, 3vw, 2rem); border-radius: var(--radio); border-top: 6px solid var(--cobalto); }
.campo { margin-bottom: 1.1rem; }
.campo label { display: block; font-weight: 700; margin-bottom: .3rem; }
.campo input:not([type="checkbox"]), .campo select, .campo textarea {
  width: 100%; font: inherit; color: inherit; padding: .65rem .75rem; border: 1px solid #a9b2c3; border-radius: 4px; background: var(--blanco);
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--cobalto); }
.campo--check { display: flex; gap: .6rem; align-items: flex-start; }
.campo--check input { width: 1.2rem; height: 1.2rem; margin-top: .25rem; accent-color: var(--cobalto); }
.campo--check label { font-weight: 400; }
.campo--trampa { position: absolute; left: -9999px; }
.aviso { padding: .8rem 1rem; border-radius: 4px; margin: 0 0 1.2rem; font-weight: 700; }
.aviso--ok { background: #e3f4e9; border-left: 5px solid #2f9e57; }
.aviso--error { background: #fde8ea; border-left: 5px solid #d62839; }
.contacto__datos h2 { font-size: 1.8rem; }
.contacto__datos dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .6rem 1rem; }
.contacto__datos dt { font-weight: 700; }
.contacto__datos dd { margin: 0; }

/* Pie */
.pie { background: var(--tinta); color: #d5dbe6; margin-top: 2rem; border-top: 5px solid var(--amarillo); }
.pie a { color: var(--blanco); }
.pie__rejilla { max-width: var(--ancho); margin: 0 auto; padding: 3rem var(--hueco) 2rem; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.pie__marca { font: 700 1.9rem/1 var(--titulos); color: var(--blanco); margin: 0 0 .6rem; }
.pie__titulo { font-size: 1.35rem; color: var(--blanco); }
.pie__lista { list-style: none; margin: 0; padding: 0; }
.pie__lista li { margin-bottom: .4rem; }
.pie__legal { max-width: var(--ancho); margin: 0 auto; padding: 1rem var(--hueco) 2rem; font-size: .9rem; border-top: 1px solid rgb(255 255 255 / .12); }

/* Aviso de cookies */
.cookies {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 40; max-width: 44rem; margin: 0 auto;
  background: var(--blanco); color: var(--tinta); border-top: 5px solid var(--amarillo); border-radius: var(--radio);
  padding: 1rem 1.2rem; box-shadow: 0 18px 40px -16px rgb(20 32 51 / .5);
  display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center;
}
.cookies[hidden] { display: none; }
.cookies p { margin: 0; flex: 1 1 22rem; font-size: .98rem; }
.cookies__botones { display: flex; gap: .6rem; }
.pie__cookies { background: none; border: 0; padding: 0; font: inherit; color: var(--blanco); text-decoration: underline; cursor: pointer; }

/* Buscador */
.buscador { width: min(40rem, calc(100% - 2rem)); max-height: min(36rem, 85vh); border: 0; border-radius: 8px; padding: 0; margin-top: 8vh; box-shadow: 0 30px 60px -20px rgb(0 0 0 / .45); }
.buscador::backdrop { background: rgb(20 32 51 / .6); }
.buscador__caja { display: flex; border-bottom: 1px solid var(--linea); }
.buscador__caja input { flex: 1; font: inherit; font-size: 1.2rem; padding: 1rem 1.1rem; border: 0; outline: none; min-width: 0; }
.buscador__cerrar { background: none; border: 0; padding: 0 1.1rem; font: 600 1.05rem/1 var(--titulos); color: var(--tinta-suave); cursor: pointer; }
.buscador__resultados { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; max-height: calc(min(36rem, 85vh) - 4rem); }
.buscador__resultados a { display: block; padding: .6rem .8rem; border-radius: 4px; text-decoration: none; color: var(--tinta); border-left: 5px solid var(--c, var(--linea)); }
.buscador__resultados a:hover, .buscador__resultados a:focus { background: var(--papel); }
.buscador__resultados strong { display: block; font: 700 1.2rem/1.2 var(--titulos); }
.buscador__resultados small { color: var(--tinta-suave); }
.buscador__vacio { padding: 1rem; color: var(--tinta-suave); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .cabecera, .canto, .pie, .vecinos { display: none; } body { background: #fff; } }
