/* Biblioteca NeuroRehab Academy — misma paleta que los materiales impresos */
:root {
  --navy: #0b1f4f;
  --teal: #1f8fa3;
  --teal-dark: #17707f;
  --teal-soft: #8fcdd1;
  --mint: #e6f4f5;
  --coral: #f28c6f;
  --coral-dark: #e0694a;
  --coral-soft: #fde7df;
  --ink: #1e2b4a;
  --muted: #5d6782;
  --line: #d6e7ea;
  --bg: #f7fbfb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 31, 79, .06), 0 4px 16px rgba(11, 31, 79, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-dark); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; text-wrap: balance; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.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: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-soft); }
.eyebrow--coral { color: var(--coral-dark); }

/* Portada */
.hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; }
.hero__waves span { position: absolute; border-radius: 50%; }
.hero__waves span:first-child { width: 420px; height: 420px; right: -140px; bottom: -200px; background: var(--teal); opacity: .35; }
.hero__waves span:last-child { width: 360px; height: 360px; right: 40px; bottom: -260px; background: var(--teal-soft); opacity: .22; }
.hero__inner { position: relative; padding-top: 40px; padding-bottom: 36px; }
.hero__logo { width: 84px; height: 84px; border-radius: 50%; margin-bottom: 20px; background: #fff; }
.hero h1 { color: #fff; font-size: clamp(28px, 6vw, 44px); margin: 0 0 12px; max-width: 18ch; }
.hero .lead { color: #cfe9eb; font-size: 18px; margin: 0 0 24px; max-width: 46ch; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick a {
  color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 10px 16px; border-radius: 999px; border: 1.5px solid rgba(143, 205, 209, .55);
  min-height: 44px; display: inline-flex; align-items: center;
}
.quick a:hover { background: rgba(143, 205, 209, .15); }

/* Barra de filtros */
.toolbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg); padding: 16px 0 12px;
  display: flex; flex-direction: column; gap: 12px;
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  min-height: 40px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
.tabs button[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.search {
  display: flex; align-items: center; gap: 8px; color: var(--muted);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px;
}
.search:focus-within { border-color: var(--teal); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; padding: 11px 0; background: transparent; color: var(--ink); }

.count { color: var(--muted); font-size: 14px; margin: 16px 0 12px; min-height: 1.5em; }

/* Tarjetas de recursos */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column;
}
.card__video { aspect-ratio: 16 / 9; background: var(--navy); }
.card__video iframe { width: 100%; height: 100%; border: 0; display: block; }
.card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--mint); color: var(--teal-dark); }
.pill--familias { background: var(--coral-soft); color: #a8452b; }
.pill--tipo { background: var(--navy); color: #fff; }
.card h3 { margin: 2px 0 0; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card__tags { font-size: 13px; color: var(--muted); }
.card__actions { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  font-weight: 700; font-size: 15px; text-decoration: none;
  background: var(--teal); color: #fff; border: 0;
}
.btn:hover { background: var(--teal-dark); }
.btn--ghost { background: transparent; color: var(--teal-dark); border: 1.5px solid var(--teal-soft); }
.btn--ghost:hover { background: var(--mint); }
.btn--coral { background: var(--coral); color: var(--navy); }
.btn--coral:hover { background: var(--coral-dark); color: #fff; }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }

/* Estado vacío */
.empty { text-align: center; padding: 40px 16px; background: #fff; border: 1.5px dashed var(--teal-soft); border-radius: var(--radius); }
.empty img { margin: 0 auto 12px; border-radius: 50%; }
.empty h2 { margin: 0 0 6px; }
.empty p { margin: 0 auto; color: var(--muted); max-width: 44ch; }

/* Suscripción opcional */
.subscribe {
  margin: 40px 0; padding: 24px; border-radius: var(--radius);
  background: var(--coral-soft); display: flex; flex-direction: column; gap: 16px; align-items: flex-start;
}
.subscribe h2 { margin: 0 0 8px; font-size: 22px; }
.subscribe p { margin: 0; color: var(--ink); max-width: 56ch; }

/* Pie */
.footer { background: var(--navy); color: #cfe9eb; padding: 32px 0; font-size: 14px; }
.footer__inner { display: flex; flex-direction: column; gap: 14px; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand img { border-radius: 50%; background: #fff; }
.footer__brand strong { color: #fff; display: block; }
.footer a { color: var(--teal-soft); }
.legal { margin: 0; max-width: 80ch; }
.noscript { padding: 16px; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .tabs { margin: 0; padding: 0; }
  .search { width: 280px; flex: none; }
  .subscribe { flex-direction: row; align-items: center; justify-content: space-between; padding: 32px; }
  .hero__inner { padding-top: 56px; padding-bottom: 48px; }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
