/* Gaceta de las Cuotas — hoja de estilos
   Estética editorial vintage: papel, tinta, petróleo, oliva, ladrillo y mostaza. */

:root {
  --papel: #F4ECDA;
  --papel-2: #E8DCC0;
  --papel-3: #EFE4CC;
  --tinta: #2B2620;
  --sepia: #5C4330;
  --petroleo: #2F5560;
  --petroleo-osc: #1F3D45;
  --oliva: #4F5A2F;
  --ladrillo: #9E3B26;
  --mostaza: #C8962E;
  --linea: #3A2E22;
  --f-titulo: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-cuerpo: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ancho: 72rem;
  --texto: 44rem;
  --radio: 3px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background-color: var(--papel);
  /* textura de papel muy sutil (ruido SVG en línea, < 1 KB) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.27 0 0 0 0 0.18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--tinta);
  font-family: var(--f-cuerpo);
  font-size: 1.125rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--petroleo); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ladrillo); }
:focus-visible { outline: 3px solid var(--mostaza); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--f-titulo); color: var(--petroleo-osc); line-height: 1.2; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.3rem); font-weight: 900; margin-top: .3em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: .35em; }
strong { color: inherit; }
abbr[title] { text-decoration: underline dotted; }

.saltar {
  position: absolute; left: -999px; top: 0; background: var(--tinta); color: var(--papel);
  padding: .6rem 1rem; z-index: 100;
}
.saltar:focus { left: 1rem; top: 1rem; }

.contenedor { max-width: var(--ancho); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .contenedor { padding: 0 2rem; } }

/* ------- Cabecera tipo periódico ------- */
.cabecera { border-bottom: 3px double var(--linea); background: var(--papel-3); }
.cabecera__fila {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 0 .7rem;
}
.marca { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--tinta); }
.marca img { width: 42px; height: 42px; }
.marca__nombre { font-family: var(--f-titulo); font-weight: 900; font-size: 1.35rem; line-height: 1.05; display: block; }
.marca__lema { font-size: .82rem; font-style: italic; color: var(--sepia); display: block; }
@media (min-width: 48rem) { .marca__nombre { font-size: 1.75rem; } .marca img { width: 52px; height: 52px; } }

.menu-boton {
  font: inherit; font-size: .95rem; background: var(--petroleo); color: var(--papel);
  border: 0; border-radius: var(--radio); padding: .55rem .9rem; cursor: pointer; min-height: 44px;
}
.menu-boton[hidden] { display: none; }

.nav { border-top: 1px solid var(--linea); }
.nav ul { list-style: none; margin: 0; padding: .3rem 0; display: flex; flex-wrap: wrap; gap: 0 .2rem; justify-content: center; }
.nav li { margin: 0; }
.nav a {
  display: block; padding: .5rem .65rem; text-decoration: none; color: var(--tinta);
  font-family: var(--f-titulo); font-size: .98rem; letter-spacing: .02em; min-height: 44px; line-height: 1.6;
}
.nav a:hover { color: var(--ladrillo); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--ladrillo); text-decoration: underline; text-decoration-thickness: 2px; }

.js .nav.cerrada { display: none; }
@media (max-width: 56rem) {
  .nav ul { flex-direction: column; align-items: stretch; }
  .nav a { border-bottom: 1px dotted rgba(58,46,34,.35); }
}
@media (min-width: 56.01rem) {
  .menu-boton { display: none; }
  .js .nav.cerrada { display: block; }
}

.aviso {
  background: var(--petroleo-osc); color: var(--papel); font-size: .92rem; text-align: center; padding: .55rem 1rem;
}
.aviso a { color: #F4ECDA; text-decoration: underline; }
.aviso a:hover { color: #FFE7A8; }

/* ------- Migas de pan ------- */
.migas { font-size: .9rem; color: var(--sepia); padding-top: 1.2rem; }
.migas ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.migas li { margin: 0; }
.migas li + li::before { content: "›"; margin-right: .3rem; color: var(--sepia); }

/* ------- Contenido ------- */
main { display: block; padding-bottom: 3rem; }
.prosa { max-width: var(--texto); }
.prosa--ancha { max-width: none; }
.entradilla { font-size: 1.22rem; color: var(--sepia); font-style: italic; }
.fecha { display: inline-block; font-size: .9rem; color: var(--oliva); border: 1px solid var(--oliva); padding: .15rem .6rem; border-radius: 2px; letter-spacing: .02em; }

.separador {
  border: 0; height: 22px; margin: 2.2rem auto; max-width: 24rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 22'%3E%3Cpath d='M0 11h95M145 11h95' stroke='%233A2E22' stroke-width='1'/%3E%3Cpath d='M120 3l8 8-8 8-8-8z' fill='%23C8962E' stroke='%233A2E22'/%3E%3Ccircle cx='103' cy='11' r='2.5' fill='%233A2E22'/%3E%3Ccircle cx='137' cy='11' r='2.5' fill='%233A2E22'/%3E%3C/svg%3E") center / contain no-repeat;
}

.marco {
  border: 1px solid var(--linea); outline: 1px solid var(--linea); outline-offset: 4px;
  background: var(--papel-3); padding: 1.2rem 1.3rem; margin: 2rem 4px;
}
.marco > :last-child { margin-bottom: 0; }
.marco--alerta { border-left: 6px solid var(--ladrillo); }
.etiqueta {
  display: inline-block; font-family: var(--f-titulo); font-variant: small-caps; letter-spacing: .08em;
  color: var(--ladrillo); font-size: 1.05rem; font-weight: 700; margin-bottom: .2rem;
}

.pendiente { background: #FBE3B0; color: #5A3A00; padding: 0 .25em; border-radius: 2px; font-size: .92em; white-space: nowrap; }

/* ------- Portada ------- */
.portada { display: grid; gap: 1.5rem; align-items: center; padding: 1.5rem 0 1rem; }
@media (min-width: 56rem) { .portada { grid-template-columns: 1.05fr 1fr; gap: 2.5rem; padding-top: 2.5rem; } }
.portada figure { margin: 0; }
.volanta { font-family: var(--f-titulo); font-variant: small-caps; letter-spacing: .12em; color: var(--ladrillo); font-weight: 700; margin: 0; }

.rejilla { display: grid; gap: 1.2rem; grid-template-columns: 1fr; margin: 1.5rem 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .rejilla { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .rejilla--3 { grid-template-columns: repeat(3, 1fr); } }

.ficha {
  background: var(--papel-3); border: 1px solid var(--linea); padding: 1.1rem 1.2rem 1.2rem; position: relative; margin: 0;
  display: flex; flex-direction: column;
}
.ficha::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(58,46,34,.35); pointer-events: none; }
.ficha h3 { margin: .2rem 0 .4rem; font-size: 1.2rem; }
.ficha h3 a { color: var(--petroleo-osc); text-decoration: none; }
.ficha h3 a::after { content: ""; position: absolute; inset: 0; }
.ficha:hover { background: var(--papel-2); }
.ficha:focus-within { outline: 3px solid var(--mostaza); outline-offset: 2px; }
.ficha p { margin: 0; font-size: 1rem; color: var(--sepia); }
.ficha img { margin: -.2rem auto .6rem; max-height: 140px; width: auto; }

.cifras { display: grid; gap: 1rem; grid-template-columns: 1fr; list-style: none; padding: 0; margin: 1.5rem 0; }
@media (min-width: 48rem) { .cifras { grid-template-columns: repeat(3, 1fr); } }
.cifras li { border-top: 3px double var(--linea); padding-top: .7rem; margin: 0; }
.cifras b { display: block; font-family: var(--f-titulo); font-size: 1.9rem; color: var(--ladrillo); line-height: 1.1; }
.cifras small { display: block; color: var(--sepia); font-size: .88rem; margin-top: .3rem; }

/* ------- Figuras ------- */
.figura { margin: 2rem 0; }
.figura img { border: 1px solid var(--linea); background: var(--papel-3); }
.figura figcaption { font-size: .92rem; color: var(--sepia); font-style: italic; margin-top: .5rem; }
.figura--lateral { max-width: 260px; }
@media (min-width: 48rem) { .figura--derecha { float: right; margin: .3rem 0 1rem 2rem; max-width: 240px; } }
.limpiar::after { content: ""; display: table; clear: both; }

/* ------- Pasos ------- */
.pasos { counter-reset: paso; list-style: none; padding: 0; }
.pasos li { counter-increment: paso; position: relative; padding-left: 3.2rem; margin-bottom: 1.1rem; }
.pasos li::before {
  content: counter(paso); position: absolute; left: 0; top: .05rem; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 2px solid var(--linea); background: var(--mostaza); color: var(--tinta);
  font-family: var(--f-titulo); font-weight: 900; display: grid; place-items: center; font-size: 1.05rem;
}

/* ------- Línea de tiempo ------- */
.tiempo { list-style: none; padding: 0; margin: 2rem 0; position: relative; }
.tiempo::before { content: ""; position: absolute; left: 1rem; top: 0; bottom: 0; border-left: 3px double var(--linea); }
.hito { position: relative; padding-left: 2.8rem; margin: 0 0 2.2rem; }
.hito::before {
  content: ""; position: absolute; left: .45rem; top: .5rem; width: 1.15rem; height: 1.15rem; transform: rotate(45deg);
  background: var(--mostaza); border: 2px solid var(--linea);
}
.hito__ano { font-family: var(--f-titulo); font-weight: 900; font-size: 1.7rem; color: var(--ladrillo); margin: 0; line-height: 1.2; }
.hito__nota { background: var(--papel-3); border: 1px solid var(--linea); padding: 1rem 1.1rem; display: grid; gap: 1rem; }
.hito__nota h3 { margin: 0 0 .3rem; font-size: 1.25rem; }
.hito__nota p:last-child { margin-bottom: 0; }
.hito__nota img { border: 1px solid var(--linea); width: 100%; max-width: 320px; }
.hito__fuente { font-size: .85rem; color: var(--sepia); }
@media (min-width: 48rem) {
  .tiempo::before { left: 50%; }
  .hito { width: 50%; padding-left: 0; padding-right: 2.4rem; }
  .hito::before { left: auto; right: -.6rem; }
  .hito:nth-child(even) { margin-left: 50%; padding-right: 0; padding-left: 2.4rem; }
  .hito:nth-child(even)::before { right: auto; left: -.55rem; }
  .hito:nth-child(odd) .hito__ano { text-align: right; }
}

/* ------- Tablas tipo libro contable ------- */
.tabla-envoltura { overflow-x: auto; margin: 1.5rem 0 2rem; border: 2px solid var(--linea); background: #F7F0E0; -webkit-overflow-scrolling: touch; }
.tabla-envoltura:focus-visible { outline-offset: 0; }
table.libro { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: 1rem; }
table.libro caption { caption-side: top; text-align: left; padding: .8rem 1rem; font-family: var(--f-titulo); font-size: 1.15rem; font-weight: 700; color: var(--petroleo-osc); border-bottom: 2px solid var(--linea); background: var(--papel-2); }
table.libro th, table.libro td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid #C9B996; }
table.libro thead th { font-family: var(--f-titulo); background: var(--petroleo); color: #F7F0E0; border-bottom: 3px double var(--linea); font-weight: 700; }
table.libro tbody th { font-family: var(--f-titulo); color: var(--petroleo-osc); width: 22%; background: rgba(232,220,192,.55); }
table.libro tbody tr:nth-child(even) td { background: rgba(232,220,192,.35); }
table.libro td + td, table.libro th + td, table.libro thead th + th { border-left: 1px solid #B9533C; }
@media (max-width: 40rem) {
  table.libro { min-width: 34rem; font-size: .95rem; }
  table.libro caption::after { content: " · deslice para ver más →"; font-family: var(--f-cuerpo); font-weight: 400; font-size: .85rem; color: var(--sepia); }
}
.tabla-nota { font-size: .88rem; color: var(--sepia); margin-top: -1.3rem; }

/* ------- Glosario y FAQ ------- */
.glosario dt { font-family: var(--f-titulo); font-weight: 700; font-size: 1.15rem; color: var(--petroleo-osc); margin-top: 1.2rem; }
.glosario dd { margin: .2rem 0 0; padding-left: 1rem; border-left: 3px solid var(--papel-2); }
.indice-letras { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; }
.indice-letras a { display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; text-align: center; border: 1px solid var(--linea); text-decoration: none; font-family: var(--f-titulo); font-weight: 700; background: var(--papel-3); }

.faq details { border-bottom: 1px solid var(--linea); padding: .2rem 0; }
.faq summary { cursor: pointer; font-family: var(--f-titulo); font-weight: 700; font-size: 1.15rem; color: var(--petroleo-osc); padding: .8rem 2rem .8rem 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .3rem; top: .65rem; font-size: 1.4rem; color: var(--ladrillo); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding-bottom: .8rem; }

.lista-check { list-style: none; padding: 0; }
.lista-check li { padding-left: 2rem; position: relative; }
.lista-check li::before { content: ""; position: absolute; left: .2rem; top: .45rem; width: 1rem; height: 1rem; border: 2px solid var(--oliva); }
.lista-check li::after { content: ""; position: absolute; left: .5rem; top: .5rem; width: .4rem; height: .7rem; border: solid var(--oliva); border-width: 0 3px 3px 0; transform: rotate(45deg); }

.dos-col { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .dos-col { grid-template-columns: 1fr 1fr; } }

.fuentes { font-size: .95rem; border-top: 3px double var(--linea); margin-top: 2.5rem; padding-top: 1rem; max-width: var(--texto); }
.fuentes h2 { font-size: 1.25rem; margin-top: 0; }
.fuentes ol { padding-left: 1.3rem; }
.fuentes li { word-break: break-word; }

/* ------- Pie ------- */
.pie { background: var(--petroleo-osc); color: #EFE4CC; padding: 2.5rem 0 1.5rem; font-size: .98rem; border-top: 4px double var(--mostaza); }
.pie a { color: #F4ECDA; }
.pie a:hover { color: #FFE7A8; }
.pie h2 { color: #F4ECDA; font-size: 1.15rem; margin: 0 0 .6rem; }
.pie__rejilla { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .pie__rejilla { grid-template-columns: 1.3fr 1fr 1fr; } }
.pie ul { list-style: none; padding: 0; margin: 0; }
.pie li { margin-bottom: .1rem; }
.pie li a { display: inline-block; padding: .3rem 0; min-height: 44px; line-height: 1.9; }
.pie address { font-style: normal; }
.pie__legal { border-top: 1px solid rgba(239,228,204,.35); margin-top: 2rem; padding-top: 1rem; font-size: .88rem; }
.pie__legal p { margin-bottom: .5rem; }
.boton-texto { font: inherit; color: #F4ECDA; background: none; border: 0; padding: .3rem 0; text-decoration: underline; cursor: pointer; min-height: 44px; }
.pie .pendiente { color: #5A3A00; }

/* ------- Botones ------- */
.boton {
  display: inline-block; font-family: var(--f-titulo); font-weight: 700; font-size: 1rem;
  background: var(--petroleo); color: #F7F0E0; border: 2px solid var(--linea); border-radius: var(--radio);
  padding: .65rem 1.2rem; text-decoration: none; cursor: pointer; min-height: 44px; box-shadow: 3px 3px 0 var(--linea);
}
.boton:hover { background: var(--petroleo-osc); color: #F7F0E0; }
.boton--claro { background: var(--papel); color: var(--tinta); }
.boton--claro:hover { background: var(--papel-2); color: var(--tinta); }

/* ------- Volver arriba ------- */
.arriba {
  position: fixed; right: 1rem; bottom: 1rem; width: 48px; height: 48px; border-radius: 50%;
  background: var(--ladrillo); color: #F7F0E0; border: 2px solid var(--linea); display: grid; place-items: center;
  text-decoration: none; font-size: 1.4rem; box-shadow: 2px 2px 0 var(--linea); z-index: 40;
}
.arriba:hover { color: #F7F0E0; background: #842F1D; }
.js .arriba { opacity: 0; pointer-events: none; transition: opacity .2s; }
.js .arriba.visible { opacity: 1; pointer-events: auto; }

/* ------- Banner de cookies ------- */
.cookies {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; max-width: 40rem; margin: 0 auto; z-index: 60;
  background: var(--papel); border: 2px solid var(--linea); box-shadow: 5px 5px 0 var(--linea); padding: 1.1rem 1.2rem;
  font-size: 1rem;
}
.cookies[hidden] { display: none; }
.cookies h2 { margin: 0 0 .4rem; font-size: 1.2rem; }
.cookies p { margin-bottom: .8rem; }
.cookies__acciones { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ------- Impresión ------- */
@media print {
  .cabecera nav, .aviso, .arriba, .cookies, .menu-boton { display: none !important; }
  body { background: #fff; }
  a { color: #000; }
}
