/* Blog de OpoCheck. Tokens de marca de opocheck.com (crema + ámbar, Satoshi / General Sans / Geist Mono).
   Movimiento: solo transform y opacity, ease-out, 150-250 ms, y todo se apaga con prefers-reduced-motion. */

@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Variable.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("fonts/GeneralSans-Variable.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }
/* Respaldos con las métricas de las fuentes reales: cuando llega la buena, el texto no salta. */
@font-face { font-family: "Satoshi Fallback"; src: local("Arial"); size-adjust: 134.1%; ascent-override: 75.3%; descent-override: 17.9%; line-gap-override: 7.5%; }
@font-face { font-family: "General Sans Fallback"; src: local("Arial"); size-adjust: 132.8%; ascent-override: 76.1%; descent-override: 18.1%; line-gap-override: 7.5%; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #fbf8f2;
  --surface: #ffffff;
  --surface-alt: #f6f0e5;
  --text: #202526;
  --text-2: #4d514d;
  --muted: #676a65;            /* 4.87:1 también sobre --surface-alt */
  --border: #dcc9ab;           /* filete cálido que se ve (el anterior daba 1.27:1) */
  --border-ui: #8a8d87;        /* borde de controles (input, chip, paginación): 3:1 sobre blanco y crema */
  --border-subtle: #f1e9dc;
  --primary: #b87b0c;          /* ámbar de marca un punto más oscuro: 3:1 como anillo de foco sobre todos los fondos */
  --primary-ink: #805004;      /* ámbar legible como texto sobre crema (7:1) */
  --primary-btn: #996405;      /* fondo de botón con texto blanco: 5.0:1 medido (#a96d05 se quedaba en 4.3) */
  --primary-btn-edge: #805004;
  --btn-text: #ffffff;
  --primary-50: #fff4dc;
  --primary-100: #f8dd9e;
  --mascot-body: #33291a; --mascot-belly: #faf1db; --mascot-ink: #23282a; --mascot-cap: #a3e635; --mascot-hat: #23282a;
  --shadow-sm: 0 2px 5px rgba(57, 41, 13, .07);
  --shadow-lg: 0 18px 32px rgba(57, 41, 13, .13), 0 4px 10px rgba(57, 41, 13, .07);

  --font-display: "Satoshi", "Satoshi Fallback", "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "General Sans", "General Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --t-fast: 150ms;
  --t: 220ms;

  --wrap: 1120px;
  --measure: 68ch;
  --radius: 14px;
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16191a;
    --surface: #1f2426;
    --surface-alt: #252b2d;
    --text: #f2f0ea;
    --text-2: #cbc8bf;
    --muted: #9c9e98;
    --border: #30373a;
    --border-ui: #6f777a;
    --border-subtle: #272d2f;
    --primary: #e5b553;
    --primary-ink: #e5b553;
    --primary-btn: #d9a02f;
    --primary-btn-edge: #8a5a08;
    --btn-text: #1b1405;        /* tinta oscura sobre ámbar: 8:1 (blanco se quedaba en 3:1) */
    --primary-50: #2c2514;
    --primary-100: #4a3a14;
    --mascot-body: #4a3c26; --mascot-ink: #121516; --mascot-hat: #efe9d9;   /* el birrete sale del cuerpo: en oscuro, claro */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, .3);
    --shadow-lg: 0 18px 32px rgba(0, 0, 0, .45), 0 4px 10px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body); overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--text); margin: 0; text-wrap: balance; letter-spacing: -.02em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--primary-100); color: var(--text); }
:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 3px; }
.prose a:focus-visible, .crumbs a:focus-visible, .toc a:focus-visible, .site-footer a:focus-visible, .more:focus-visible, .brand:focus-visible { border-radius: 6px; }
[hidden] { display: none !important; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; transition: transform var(--t) var(--ease-out); }
.skip:focus { transform: translateY(64px); }

.wrap { width: min(100% - 40px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px), var(--wrap)); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Cabecera ─────────────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); }
.site-header::after { content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: var(--border); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: baseline; gap: 8px; font: 900 21px/1 var(--font-display); letter-spacing: -.03em; padding: 10px 0; }
.brand small { font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--primary-ink); }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { padding: 10px 12px; border-radius: 10px; font-weight: 500; font-size: 15px; color: var(--text-2); transition: color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.site-nav a[aria-current="page"] { color: var(--text); }
.progress { position: absolute; inset: auto 0 0 0; height: 2px; background: var(--primary); transform-origin: 0 50%; transform: scaleX(0); }

/* ── Botón "pulsable" de la marca ─────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; background: var(--primary-btn); color: var(--btn-text); font: 600 15px/1 var(--font-body); box-shadow: 0 4px 0 0 var(--primary-btn-edge); transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--primary-btn-edge); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; box-shadow: 0 3px 0 0 var(--primary-btn-edge); }
.btn--ghost { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-ui), 0 3px 0 0 var(--border-ui); }
.btn--ghost:active { box-shadow: 0 0 0 1px var(--border-ui), 0 1px 0 0 var(--border-ui); }

/* ── Portada ──────────────────────────────────────────────────────────── */
.hero { padding: clamp(40px, 7vw, 84px) 0 clamp(28px, 4vw, 44px); }
.hero h1 { font-weight: 900; font-size: clamp(2.2rem, 5.6vw, 3.9rem); line-height: 1.02; letter-spacing: -.035em; max-width: 17ch; margin-top: 14px; }
.hero h1 em { font-style: normal; color: var(--primary-ink); }
.lede { margin-top: 18px; max-width: 58ch; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-2); }

.search { margin-top: 28px; display: flex; gap: 10px; max-width: 560px; }
.search-campo { position: relative; flex: 1; min-width: 0; display: flex; }
.search-campo kbd { display: none; }
.search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-ui); background: var(--surface); color: var(--text); font: 400 16px/1 var(--font-body); transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--primary-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-ink) 28%, transparent); }

.chips { display: flex; gap: 8px; margin-top: 19px; overflow-x: auto; scrollbar-width: none; padding: 7px 20px; margin-inline: -20px; scroll-snap-type: x proximity; scroll-padding-inline: 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-ui); background: var(--surface); font-size: 14.5px; font-weight: 500; color: var(--text-2); transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.chip span { font: 500 11.5px/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:active { transform: scale(.97); }
.chip[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip[aria-current="page"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.section { padding: clamp(28px, 4vw, 48px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-weight: 800; font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.section-head p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.more { flex: none; font-weight: 600; font-size: 15px; color: var(--primary-ink); padding: 10px 0; }
.more span { display: inline-block; transition: transform var(--t) var(--ease-out); }

/* Tarjetas de guía */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px; min-height: 100%; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-subtle); box-shadow: 0 3px 0 0 var(--border), var(--shadow-sm); transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), border-color var(--t) var(--ease-out); }
.card h3 { font-weight: 700; font-size: 1.16rem; line-height: 1.25; letter-spacing: -.015em; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* toda la tarjeta es el enlace */
.card p { color: var(--text-2); font-size: 15.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; display: flex; gap: 10px; align-items: center; }
.card:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--border), var(--shadow-sm); }
/* El enlace real es el titular, pero el foco se enseña en toda la tarjeta o fila (y solo con teclado). */
.card h3 a:focus-visible, .row h3 a:focus-visible { outline: none; }
.card:has(a:focus-visible) { outline: 2px solid var(--primary-ink); outline-offset: 3px; }
.row:has(a:focus-visible)::before { opacity: 1; outline: 2px solid var(--primary-ink); }
.card--lead { grid-column: 1 / -1; padding: clamp(24px, 4vw, 38px); background: linear-gradient(135deg, var(--primary-50), var(--surface) 62%); border-color: var(--border); }
.card--lead h3 { font-weight: 800; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.12; letter-spacing: -.025em; max-width: 24ch; }
.card--lead p { font-size: 1.05rem; max-width: 64ch; -webkit-line-clamp: 4; }
.card--lead .go { font-weight: 600; font-size: 15px; color: var(--primary-ink); }
.card--lead .go::after { content: " →"; display: inline-block; transition: transform var(--t) var(--ease-out); }
@media (min-width: 900px) {
  .card--lead { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: auto 1fr auto; column-gap: 56px; align-items: start; }
  .card--lead .tag  { grid-area: 1 / 1 / 2 / -1; }
  .card--lead h3    { grid-area: 2 / 1 / 4 / 2; }
  .card--lead p     { grid-area: 2 / 2 / 3 / 3; }
  .card--lead .meta { grid-area: 3 / 2 / 4 / 3; margin-top: 0; align-self: end; justify-content: space-between; }
}

.tag { display: inline-flex; align-items: center; gap: 7px; font: 500 11.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--primary-ink); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: .6; }

/* Feed de convocatorias: filas densas, tipo boletín */
.feed { border-top: 1px solid var(--border); }
.row { position: relative; isolation: isolate; display: grid; grid-template-columns: 112px 1fr; gap: 6px 24px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.row::before { content: ""; position: absolute; z-index: -1; inset: 4px -14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); opacity: 0; transition: opacity var(--t-fast) var(--ease-out); }
.row time { padding-top: 4px; }
.row h3 { font-weight: 700; font-size: 1.08rem; line-height: 1.3; letter-spacing: -.012em; }
.row h3 a::after { content: ""; position: absolute; inset: 0; }
.row p { grid-column: 2; color: var(--text-2); font-size: 15.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .boe-id { grid-column: 2; }

/* Oposiciones */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); transition: transform var(--t) var(--ease-out), border-color var(--t) var(--ease-out); }
.tile strong { font: 700 1.02rem/1.25 var(--font-display); letter-spacing: -.01em; }
.tile:active { transform: scale(.985); }

/* Paginación */
.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 36px; }
.pager a, .pager span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 10px; font: 500 15px/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--text-2); }
.pager a { border: 1px solid var(--border-ui); background: var(--surface); transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.pager a:active { transform: scale(.96); }
.pager [aria-current="page"] { background: var(--text); color: var(--bg); font-weight: 600; }
.pager .gap { min-width: 24px; color: var(--muted); }

/* ── Artículo ─────────────────────────────────────────────────────────── */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 28px; }
.crumbs a { color: var(--text-2); padding: 6px 0; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color var(--t-fast) var(--ease-out), text-decoration-color var(--t-fast) var(--ease-out); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: color-mix(in srgb, var(--muted) 60%, transparent); }
.crumbs li { display: inline-flex; align-items: center; }

.post-head { padding: 18px 0 30px; max-width: 860px; }
.post-head h1 { font-weight: 900; font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.06; letter-spacing: -.032em; margin-top: 14px; }
.post-head .lede { margin-top: 16px; max-width: 62ch; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 22px; }
.byline strong { font-family: var(--font-body); color: var(--text-2); font-weight: 600; }

.post-grid { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); padding-bottom: 40px; }
@media (min-width: 1080px) { .post-grid { grid-template-columns: minmax(0, 720px) 250px; justify-content: space-between; } }

.facts { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 34px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
/* El filete entre celdas lo pinta cada celda: con 3 datos en 2 columnas, la cuarta queda en blanco y no como un bloque de color. */
.facts > div { background: var(--surface); box-shadow: 0 0 0 1px var(--border); padding: 14px 16px; }
.facts dt { font: 500 11px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.facts a { color: var(--primary-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.tldr { margin-bottom: 34px; padding: 18px 20px; border-radius: var(--radius); background: var(--primary-50); border: 1px solid var(--primary-100); font-size: 1.04rem; }
.tldr strong { font: 600 11.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--primary-ink); display: block; margin-bottom: 8px; }

.prose { max-width: var(--measure); font-size: clamp(1.06rem, 1.2vw, 1.14rem); line-height: 1.75; color: var(--text); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 1.7rem); line-height: 1.2; margin-top: 2.1em; }
.prose h3 { font-weight: 700; font-size: 1.22rem; line-height: 1.3; margin-top: 1.7em; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose a { color: var(--primary-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--primary-ink) 45%, transparent); transition: text-decoration-color var(--t-fast) var(--ease-out); }
.prose a.boe { font-family: var(--font-mono); font-size: .88em; white-space: nowrap; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -1.05em; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.prose ol { list-style: decimal; }
.prose ol > li::marker { font: 500 .85em var(--font-mono); color: var(--primary-ink); }
.prose li + li { margin-top: .5em; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--primary); color: var(--text-2); font-size: 1.08em; }
.tabla { overflow-x: auto; margin-inline: -20px; padding-inline: 20px; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(90deg, var(--bg) 40%, transparent) 0 0 / 28px 100% no-repeat local,
    linear-gradient(270deg, var(--bg) 40%, transparent) 100% 0 / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--text) 16%, transparent), transparent) 0 0 / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--text) 16%, transparent), transparent) 100% 0 / 12px 100% no-repeat scroll; }
.tabla:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: -2px; }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .92em; line-height: 1.45; font-variant-numeric: tabular-nums; }
.prose th { text-align: left; font: 500 11.5px/1.3 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); text-wrap: balance; }
.prose thead th:not(:first-child), .prose tbody td:not(:first-child) { text-align: right; }
.prose th:first-child, .prose td:first-child { min-width: 11ch; }
.prose table { hyphens: manual; overflow-wrap: normal; }
.prose td { padding: 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }

/* Índice. En móvil, un desplegable de una línea justo antes del texto (los datos clave
   mandan); en escritorio, fijo a la derecha. Son dos elementos: solo uno está en pantalla. */
.toc { display: none; }
.toc-m { max-width: var(--measure); margin-bottom: 30px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.toc-m summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; }
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform var(--t) var(--ease-out); }
.toc-m[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.toc-m ol { padding: 0 16px 12px; display: grid; }
.toc-m a { display: block; padding: 10px 0; font-size: 15.5px; line-height: 1.35; color: var(--text-2); border-top: 1px solid var(--border-subtle); }
@media (min-width: 1080px) {
  .toc-m { display: none; }
  .toc { display: block; position: sticky; top: calc(var(--header-h) + 28px); align-self: start; max-height: calc(100dvh - var(--header-h) - 56px); overflow: auto; padding-left: 18px; border-left: 1px solid var(--border); }
  .toc ol { margin-top: 12px; display: grid; gap: 2px; }
  .toc a { display: block; padding: 6px 0; font-size: 14.5px; line-height: 1.35; color: var(--muted); transition: color var(--t-fast) var(--ease-out); }
}

.faq { max-width: var(--measure); margin-top: 52px; }
.faq h2, .related h2, .source-box h2 { font-weight: 800; font-size: 1.5rem; margin-bottom: 16px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-weight: 600; font-size: 1.05rem; line-height: 1.35; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-3px) rotate(45deg); transition: transform var(--t) var(--ease-out); }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { padding: 0 0 20px; color: var(--text-2); }

.source-box { max-width: var(--measure); margin-top: 40px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--primary-100); background: color-mix(in srgb, var(--primary-50) 55%, transparent); font-size: 15.5px; color: var(--text-2); }
.source-box a { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 3px; }

.share { max-width: var(--measure); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 32px; }
.share .btn--ghost { min-height: 40px; min-width: 10.5em; font-size: 14px; padding: 0 14px; }

.cta { margin: 56px 0 8px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(16px, 4vw, 40px); padding: clamp(24px, 4vw, 40px); border-radius: 20px; background: linear-gradient(135deg, var(--primary-50), var(--surface-alt)); border: 1px solid var(--border); }
.cta svg { width: clamp(84px, 14vw, 132px); height: auto; }
.cta h2 { font-weight: 900; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.1; letter-spacing: -.03em; }
.cta p { margin: 10px 0 20px; color: var(--text-2); max-width: 52ch; }
@media (max-width: 560px) { .cta { grid-template-columns: 1fr; } .cta svg { width: 88px; } }

.related { padding: 40px 0 8px; border-top: 1px solid var(--border); margin-top: 56px; }

/* ── Estados vacíos / 404 ─────────────────────────────────────────────── */
.empty { padding: clamp(48px, 9vw, 110px) 0; text-align: center; display: grid; justify-items: center; gap: 14px; }
.empty svg { width: 120px; height: auto; }
.empty h1 { font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; }
.empty p { color: var(--text-2); max-width: 46ch; }
.empty .search { width: min(100%, 520px); margin-top: 10px; }

/* ── Pie ──────────────────────────────────────────────────────────────── */
.site-footer { margin-top: 64px; padding: 40px 0 calc(56px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font: 500 11.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.site-footer li a { display: inline-block; padding: 6px 0; color: var(--text-2); transition: color var(--t-fast) var(--ease-out); }
.site-footer .legal { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--border-subtle); font-size: 14px; }

/* ── Hover: solo donde hay puntero de verdad ──────────────────────────── */
@media (hover: hover) and (pointer: fine) {
  .site-nav a:not(.btn):hover { color: var(--text); background: var(--surface-alt); }
  .btn:hover { background: color-mix(in srgb, var(--primary-btn) 90%, #000); }
  .btn--ghost:hover { background: var(--surface-alt); }
  .chip:hover { border-color: var(--text-2); color: var(--text); }
  .chip[aria-current="page"]:hover { color: var(--bg); }
  .card:hover { box-shadow: 0 5px 0 0 var(--primary-100), var(--shadow-lg); border-color: var(--border); }
  .row:hover::before { opacity: 1; }
  .tile:hover { transform: translateY(-2px); border-color: var(--primary); }
  .more:hover span, .card--lead:hover .go::after { transform: translateX(4px); }
  .pager a:hover { border-color: var(--text-2); }
  .crumbs a:hover, .toc a:hover, .site-footer li a:hover { color: var(--text); }
  .crumbs a:hover { text-decoration-color: currentColor; }
  .search-campo kbd { display: grid; place-items: center; position: absolute; right: 10px; top: 50%; translate: 0 -50%; min-width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-alt); font: 500 13px/1 var(--font-mono); color: var(--muted); pointer-events: none; transition: opacity var(--t-fast) var(--ease-out); }
  .search-campo:focus-within kbd { opacity: 0; }
  .prose a:hover { text-decoration-color: currentColor; }
}

/* ── Movimiento ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Entrada escalonada de lo primero que se ve. `backwards` para no dejar nada invisible si falla. */
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
  /* Tope en CSS: venga el --i que venga, nada espera más de 160 ms ni tarda más de 300. */
  .rise { animation: rise 300ms var(--ease-out) backwards; animation-delay: calc(min(var(--i, 0), 4) * 40ms); }

  /* Transición entre páginas sin JS (navegadores con View Transitions entre documentos). */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 140ms var(--ease-out) both vt-out; }
  ::view-transition-new(root) { animation: 260ms var(--ease-out) both vt-in; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
  .site-header { view-transition-name: header; }

  /* Acordeón de preguntas: altura animada donde el navegador lo permite. */
  .faq details, .toc-m { interpolate-size: allow-keywords; }
  .faq details::details-content, .toc-m::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size var(--t) var(--ease-out), opacity var(--t) var(--ease-out), content-visibility var(--t) allow-discrete; }
  .faq details[open]::details-content, .toc-m[open]::details-content { block-size: auto; opacity: 1; }
}

/* Ligadas a la posición del scroll, sin JS: son indicadores, no animaciones. Sin soporte,
   la cabecera tiene su filete siempre y la barra de lectura simplemente no aparece. */
@supports (animation-timeline: scroll()) {
  @keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
  .site-header::after { animation: reveal linear both; animation-timeline: scroll(root); animation-range: 0 80px; }
  @keyframes grow { to { transform: scaleX(1); } }
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
}

/* Quien pide menos movimiento no recibe ninguno: tampoco el de hover y pulsación. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .card:active, .btn:active, .chip:active, .tile:active, .pager a:active { transform: none; }
}

@media (max-width: 720px) {
  body { font-size: 1.03rem; }
  .site-nav a:not(.btn) { display: none; }
  .row { grid-template-columns: 1fr; gap: 4px; padding: 18px 0; }
  .row p, .row .boe-id { grid-column: 1; }
  .search { flex-direction: column; }
  .search-campo { flex: none; }
  .byline .dot { display: none; }
  .byline { gap: 4px 16px; }
  .section-head { align-items: start; flex-direction: column; gap: 4px; }
}

/* Dedo, no ratón: nada por debajo de 44 px. */
@media (max-width: 350px) { .brand { font-size: 19px; } .brand small { display: none; } }

@media (pointer: coarse) {
  .btn--sm, .chip, .share .btn--ghost { min-height: 44px; }
  .more { padding: 12px 0; }
  .site-footer li a { padding: 12px 0; }
  .crumbs a { padding: 12px 0; }
  .toc-m a { padding: 12px 0; }
}

/* Alto contraste de Windows: lo que solo se distinguía por el fondo o la sombra, con borde. */
@media (forced-colors: active) {
  .chip[aria-current="page"], .pager [aria-current="page"] { border: 2px solid Highlight; }
  .btn, .btn--ghost { border: 1px solid ButtonText; }
  .card:focus-within, :focus-visible { outline-color: Highlight; }
}

@media print {
  .site-header, .site-footer, .cta, .share, .related, .toc, .toc-m, .chips, .search { display: none !important; }
  body { background: #fff; color: #000; font-size: 11.5pt; }
  .prose a { color: inherit; }
}
