/* ============================================================
   CCSE 2026 · Directorio de recursos
   HTML + CSS puro. Sin dependencias externas.
   Fuentes del sistema (cero descargas) → mejor rendimiento.
   ============================================================ */

:root {
  /* Paleta (bandera de España, en tono editorial) */
  --rojo: #c8102e;
  --rojo-700: #9e0c24;
  --gualda: #f4b400;
  --gualda-600: #d99a00;
  --ink: #1c1726;
  --muted: #645c72;
  --line: #ece7f1;
  --bg: #fdfbf7;
  --surface: #ffffff;
  --surface-2: #f7f3ee;
  --ok: #1f8a4c;
  --warn: #b4691a;

  --radius: 18px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(28, 23, 38, .06), 0 2px 8px rgba(28, 23, 38, .05);
  --shadow-md: 0 8px 30px rgba(28, 23, 38, .10);
  --shadow-lg: 0 24px 60px rgba(28, 23, 38, .16);

  --maxw: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--rojo-700); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Enlaces en línea dentro de texto: subrayado para no depender solo del color (a11y) */
.prose a, .disclaimer a, .verdict a, .faq p a {
  text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
ul { list-style: none; padding: 0; }

/* ---------- Accesibilidad ---------- */
:focus-visible {
  outline: 3px solid var(--rojo);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 999;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; text-decoration: none; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
section { padding-block: clamp(48px, 7vw, 92px); }
.section-head { max-width: 720px; margin-bottom: 42px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--rojo-700);
  background: #fbe9ec; padding: 6px 13px; border-radius: 999px;
  margin-bottom: 16px;
}
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 1.08rem; }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253, 251, 247, .82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand b { font-size: 1.12rem; }
.brand span { display: block; font-size: .7rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--ink); font-weight: 600; font-size: .96rem;
  padding: 9px 14px; border-radius: 10px; transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-links a:hover { background: var(--surface-2); text-decoration: none; }
.nav-cta {
  background: var(--rojo) !important; color: #fff !important;
  box-shadow: var(--shadow-sm);
}
.nav-cta:hover { background: var(--rojo-700) !important; }
@media (max-width: 760px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding-block: clamp(56px, 9vw, 110px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 720px; z-index: -1;
  background:
    radial-gradient(46% 50% at 18% 22%, rgba(200, 16, 46, .16), transparent 70%),
    radial-gradient(40% 46% at 84% 14%, rgba(244, 180, 0, .20), transparent 70%),
    radial-gradient(50% 50% at 60% 80%, rgba(200, 16, 46, .07), transparent 70%);
  filter: blur(8px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.08); }
}
.hero-inner { max-width: 760px; }
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.85rem);
  letter-spacing: -.03em;
}
.hero h1 .hl {
  background: linear-gradient(120deg, var(--rojo), var(--gualda-600));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(1.08rem, 2.2vw, 1.32rem); color: var(--muted); margin-top: 20px; max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1rem; padding: 14px 24px;
  border-radius: 12px; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--rojo); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--rojo-700); box-shadow: var(--shadow-lg); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--rojo); }

/* Tarjetas de datos clave */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 52px;
}
.fact {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: var(--shadow-sm);
}
.fact b { display: block; font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--rojo); letter-spacing: -.03em; }
.fact span { color: var(--muted); font-size: .92rem; font-weight: 600; }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   "Qué es" + estructura
   ============================================================ */
.about { background: var(--surface); border-block: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.prose p { color: var(--muted); margin-top: 16px; }
.prose strong { color: var(--ink); }

/* Tareas del examen */
.tasks { display: grid; gap: 12px; }
.task {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.task:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); }
.task .num {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--rojo), var(--rojo-700));
}
.task .t-body b { font-size: 1rem; }
.task .t-body small { color: var(--muted); display: block; }
.task .q-count { font-weight: 800; color: var(--rojo); font-size: 1.05rem; white-space: nowrap; }
.task .q-count em { font-style: normal; font-weight: 600; color: var(--muted); font-size: .8rem; display: block; }

/* ============================================================
   Directorio
   ============================================================ */
.directory { background: var(--bg); }
.group-title {
  display: flex; align-items: center; gap: 14px; margin: 8px 0 26px;
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.group-title .pill {
  font-size: .78rem; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); padding: 4px 11px; border-radius: 999px;
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #e2d9ea; }
.card.featured { border-color: var(--gualda); box-shadow: 0 0 0 1px var(--gualda), var(--shadow-md); }
.card.featured::before {
  content: "★ Imprescindible"; position: absolute; top: -12px; left: 24px;
  background: linear-gradient(120deg, var(--gualda), var(--gualda-600)); color: #3a2a00;
  font-size: .74rem; font-weight: 800; letter-spacing: .03em;
  padding: 5px 12px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
/* Variante destacada (cervantes.training) con acento rojo y etiqueta propia */
.card.featured.pick { border-color: var(--rojo); box-shadow: 0 0 0 1px var(--rojo), var(--shadow-md); }
.card.featured.pick::before { content: "★ La más completa"; background: linear-gradient(120deg, var(--rojo), var(--rojo-700)); color: #fff; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card h3 { font-size: 1.22rem; letter-spacing: -.02em; }
.card .url { color: var(--muted); font-size: .85rem; font-weight: 600; word-break: break-word; }

/* Rating editorial */
.rating { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.rating .stars { color: var(--gualda-600); letter-spacing: 1px; font-size: 1rem; }
.rating .num { font-weight: 800; font-size: .9rem; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 4px; }
.badge {
  font-size: .74rem; font-weight: 700; letter-spacing: .01em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted);
}
.badge.gratis { background: #e9f7ee; color: var(--ok); border-color: #c7ecd4; }
.badge.pago   { background: #fff3e2; color: var(--warn); border-color: #f3dcb8; }
.badge.oficial{ background: #fbe9ec; color: var(--rojo-700); border-color: #f3c9d2; }
.badge.plat   { background: #eef0fb; color: #3d46a8; border-color: #d5d9f3; }
.badge.banco  { background: #eef9f3; color: var(--ok); border-color: #cfeede; }

/* Pros / contras */
.pc { margin-top: 16px; display: grid; gap: 12px; }
.pc h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
.pc ul { display: grid; gap: 6px; }
.pc li { position: relative; padding-left: 24px; font-size: .94rem; color: #36303f; }
.pc li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.pros li::before { content: "＋"; color: var(--ok); }
.cons li::before { content: "−"; color: var(--rojo); }

.verdict {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--line);
  font-size: .9rem; color: #36303f;
}
.verdict b { color: var(--ink); }

.card-foot { margin-top: auto; padding-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.card-foot .btn { padding: 11px 18px; font-size: .92rem; flex: 1; justify-content: center; }
.link-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 700; font-size: .92rem; padding: 11px 16px; border-radius: 11px;
  background: var(--ink); color: #fff; flex: 1; min-width: 130px;
  transition: transform .18s var(--ease), background .2s var(--ease);
}
.link-btn:hover { text-decoration: none; background: #000; transform: translateY(-2px); }
.link-btn.alt { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.link-btn.alt:hover { background: var(--surface-2); border-color: var(--rojo); }

/* ============================================================
   FAQ
   ============================================================ */
.faq { background: var(--surface); border-top: 1px solid var(--line); }
.faq-grid { display: grid; gap: 14px; max-width: 820px; }
details.qa {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 20px; transition: box-shadow .2s var(--ease);
}
details.qa[open] { box-shadow: var(--shadow-sm); }
details.qa summary {
  cursor: pointer; list-style: none; font-weight: 700; font-size: 1.05rem;
  padding: 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after {
  content: "+"; font-size: 1.5rem; font-weight: 400; color: var(--rojo);
  transition: transform .25s var(--ease);
}
details.qa[open] summary::after { transform: rotate(45deg); }
details.qa p { color: var(--muted); padding-bottom: 18px; }

/* ============================================================
   CTA / Disclaimer / Footer
   ============================================================ */
.cta-band {
  background: linear-gradient(120deg, var(--rojo), var(--rojo-700));
  color: #fff; text-align: center; border-radius: var(--radius); padding: clamp(36px, 6vw, 60px);
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.cta-band p { opacity: .92; margin-top: 12px; max-width: 560px; margin-inline: auto; }
.cta-band .btn { margin-top: 26px; background: #fff; color: var(--rojo-700); }
.cta-band .btn:hover { background: var(--gualda); color: #3a2a00; }

.disclaimer {
  margin-top: 28px; font-size: .88rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.site-footer { background: var(--ink); color: #cfc7da; padding-block: 48px; }
.site-footer a { color: #fff; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.foot-brand { max-width: 320px; }
.foot-brand p { color: #9a92aa; font-size: .9rem; margin-top: 10px; }
.foot-col h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: #9a92aa; margin-bottom: 12px; font-weight: 800; }
.foot-col li { margin-bottom: 8px; }
.foot-bottom { border-top: 1px solid #332c40; margin-top: 36px; padding-top: 22px; font-size: .85rem; color: #9a92aa; }

/* ============================================================
   Animaciones de aparición (scroll-driven, CSS puro)
   Solo si el navegador lo soporta y el usuario no pide menos movimiento.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 22%;
    }
    @keyframes reveal-up {
      from { opacity: 0; transform: translateY(28px); }
      to   { opacity: 1; transform: translateY(0); }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   BLOG · índice y artículos
   ============================================================ */
.page-hero { position: relative; padding-block: clamp(48px, 7vw, 82px); overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 540px; z-index: -1;
  background:
    radial-gradient(44% 50% at 22% 18%, rgba(200, 16, 46, .14), transparent 70%),
    radial-gradient(38% 44% at 82% 12%, rgba(244, 180, 0, .18), transparent 70%);
}
.page-hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); max-width: 760px; }
.page-hero p.lead { color: var(--muted); font-size: 1.12rem; margin-top: 16px; max-width: 640px; }

/* Migas de pan */
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--rojo-700); }
.breadcrumb span { margin: 0 8px; opacity: .5; }

/* Listado de posts */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
@media (max-width: 520px) { .post-grid { grid-template-columns: 1fr; } }
.post-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease);
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #e2d9ea; }
.post-card a.cover { display: block; aspect-ratio: 16 / 8; position: relative; }
.post-card a.cover:hover { text-decoration: none; }
.post-card .cover .tag {
  position: absolute; left: 16px; bottom: 14px; z-index: 2;
  background: rgba(255,255,255,.92); color: var(--rojo-700);
  font-size: .74rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
}
.cover-grad-1 { background: linear-gradient(125deg, #c8102e, #9e0c24); }
.cover-grad-2 { background: linear-gradient(125deg, #d99a00, #c8102e); }
.cover-grad-3 { background: linear-gradient(125deg, #1c1726, #4a3d63); }
.post-card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card h2 { font-size: 1.2rem; letter-spacing: -.02em; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--rojo-700); text-decoration: none; }
.post-card p { color: var(--muted); font-size: .96rem; margin-top: 10px; flex: 1; }
.post-meta { display: flex; gap: 14px; align-items: center; font-size: .82rem; color: var(--muted); font-weight: 600; margin-top: 16px; }
.post-meta time { display: inline-flex; align-items: center; gap: 6px; }

/* Artículo */
.article { max-width: 740px; margin-inline: auto; }
.article .post-meta { margin: 0 0 28px; }
.article-cover { height: 8px; border-radius: 999px; margin-bottom: 36px; }
.article-body { font-size: 1.08rem; }
.article-body > * + * { margin-top: 1.15em; }
.article-body h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); margin-top: 2em; letter-spacing: -.02em; scroll-margin-top: 86px; }
.article-body h3 { font-size: 1.22rem; margin-top: 1.6em; }
.article-body p, .article-body li { color: #36303f; }
.article-body strong { color: var(--ink); }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body ul li { list-style: disc; margin-top: .4em; }
.article-body ol li { list-style: decimal; margin-top: .4em; }
.article-body a { color: var(--rojo-700); text-decoration: underline; text-underline-offset: 2px; }

/* Tabla de contenidos / datos */
.data-table { width: 100%; border-collapse: collapse; font-size: .98rem; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.data-table caption { text-align: left; font-weight: 700; color: var(--muted); padding-bottom: 10px; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--surface-2); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }

/* Callout / aviso destacado */
.callout {
  border-left: 4px solid var(--rojo); background: #fbe9ec;
  padding: 16px 20px; border-radius: 10px; color: #5a1320; font-size: 1rem;
}
.callout.tip { border-color: var(--ok); background: #e9f7ee; color: #14532b; }
.callout.warn { border-color: var(--gualda-600); background: #fff3e2; color: #5a3c0a; }
.callout b { display: block; margin-bottom: 4px; }

/* TOC */
.toc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 22px; }
.toc b { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc ol { margin-top: 10px; padding-left: 1.2em; }
.toc li { list-style: decimal; margin-top: 6px; }
.toc a { color: var(--ink); font-weight: 600; }

.author-row { display: flex; align-items: center; gap: 12px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 40px; }
.author-row img { width: 44px; height: 44px; border-radius: 10px; }
.author-row b { display: block; }
.author-row span { color: var(--muted); font-size: .88rem; }

@media print {
  .site-header, .hero-actions, .cta-band, .link-btn { display: none; }
}
