/* =========================================================
   OpoCitores — portada, guías por bloque y páginas de texto
   Se carga después de styles.css y reutiliza sus variables.
   ========================================================= */

main { flex: 1; }

/* Anchos alineados: cabecera, hero, secciones y pie comparten 1120 px */
.topbar-inner.container,
.hero-grid,
.hero-stats .container,
.footer.container,
.site-footer .container,
#resume { max-width: 1900px; }

.home-section { max-width: 1900px; }

a.btn { text-decoration: none; }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; }

h1 {
  font-size: 56px;
  font-weight: 700;
}

/* ---------- Portada ---------- */
.home-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(540px, 44vw, 680px);
  padding: 72px 0;
  background: var(--bg);
  overflow: hidden;
}

/* La foto ocupa toda la franja; un degradado la funde con el fondo de la página
   para que el texto se lea sobre la pared lisa de la izquierda */
.hero-media { position: absolute; inset: 0; z-index: 0; display: block; }
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% 48%;
  display: block;
}
:root[data-theme="dark"] .hero-media img { filter: brightness(.55) saturate(.9); }

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg,
    var(--bg) 0%,
    color-mix(in srgb, var(--bg) 93%, transparent) 36%,
    color-mix(in srgb, var(--bg) 52%, transparent) 52%,
    transparent 70%);
}

.hero-grid { position: relative; z-index: 2; }
.hero-copy { max-width: 950px; }
.hero-copy h1 { margin-bottom: 18px; }

.lead {
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.6;
  max-width: 187,5ch;
  margin: 0;
}
.lead strong { color: var(--text); font-family: var(--serif); font-size: 1.1em; }

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.trust {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 8px;
  color: var(--text);
}
.trust li { display: flex; gap: 10px; align-items: baseline; }
.trust li::before {
  content: "✓";
  color: var(--primary);
  font-weight: 700;
}

/* Franja de cifras bajo el hero */
.hero-stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.hero-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 56px;
  list-style: none;
  padding: 26px 0;
  margin: 0;
}
.hero-figures li { display: flex; align-items: baseline; gap: 12px; }
.hero-figures strong {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--primary);
}
.hero-figures span { color: var(--muted); }

/* ---------- Secciones ---------- */
.home-section { padding-top: 80px; }

.section-head { max-width: 1500px; margin-bottom: 28px; }
.section-head p.muted { margin: 0; font-size: 1.05rem; }

/* ---------- Tu progreso ---------- */
#resume { padding-top: 40px; }

.resume {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px 32px;
  align-items: center;
  padding: 26px 28px;
}
.resume h2 { font-size: 1.5rem; }
.resume p.muted { margin: 0; }
.resume-stats { display: flex; gap: 12px; }
.resume-stats .stat { min-width: 100px; }
.resume-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Tarjetas de temario ---------- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.topic-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }

.topic-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topic-card .tag {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .04em;
}

.topic-card h3 { font-size: 1.2rem; margin: 18px 0 8px; }
.topic-card p { color: var(--muted); font-size: .97rem; margin: 0 0 18px; flex: 1; }

.topic-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: .95rem;
  color: var(--muted);
}
.topic-card-foot .go { color: var(--primary); font-weight: 700; }

.topic-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 14px;
}
.topic-progress div { height: 100%; background: var(--primary); border-radius: 999px; }

/* Cada grupo de tarjetas tiene su propio carácter, con los mismos colores de la web */
.topic-card { position: relative; overflow: hidden; }
.topic-card-foot .go { transition: transform .18s ease; }
.topic-card:hover .go { transform: translateX(4px); }

/* Temario común: tarjeta blanca con barra superior que crece y etiqueta rellena */
:is(#topicGrid, #examGrid) .topic-card { padding-top: 28px; }
:is(#topicGrid, #examGrid) .topic-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--primary);
  transform-origin: left;
  transform: scaleX(.18);
  transition: transform .28s ease;
}
:is(#topicGrid, #examGrid) .topic-card:hover { transform: translateY(-3px); }
:is(#topicGrid, #examGrid) .topic-card:hover::before { transform: scaleX(1); }
:is(#topicGrid, #examGrid) .topic-card .tag {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 10px;
  min-width: 52px;
  height: 40px;
}

/* Temario específico: tarjeta con fondo verde suave, esquinas más redondas y etiqueta circular */
#topicGridEspecifico .topic-card {
  border-radius: 18px;
  background: linear-gradient(155deg, var(--primary-soft) 0%, var(--surface) 62%);
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}
#topicGridEspecifico .topic-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  pointer-events: none;
}
#topicGridEspecifico .topic-card .tag {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 999px;
  min-width: 56px;
  height: 40px;
}
#topicGridEspecifico .topic-card:hover { transform: translateY(-3px); }
#topicGridEspecifico .topic-card-foot { border-top-style: dashed; }

/* Color propio de cada bloque: home.js pone style="--hue:N" en cada tarjeta y de ese
   único tono salen todos sus colores. OKLCH mantiene la misma luminosidad en todos los
   tonos, así ninguna tarjeta destaca más que otra y los textos conservan el contraste.
   Los navegadores sin OKLCH se quedan con el verde de la marca definido arriba. */
@supports (color: oklch(0.5 0.1 100)) {
  .topic-card {
    --hue: 165;
    --c-wash: oklch(0.972 0.022 var(--hue));    /* fondo de la tarjeta */
    --c-soft: oklch(0.928 0.048 var(--hue));    /* etiqueta, arranque del degradado */
    --c-line: oklch(0.875 0.058 var(--hue));    /* bordes y separadores */
    --c-strong: oklch(0.6 0.11 var(--hue));     /* barra superior y progreso */
    --c-ink: oklch(0.43 0.095 var(--hue));      /* texto de color (≥ 7:1 sobre el fondo) */
  }
  :root[data-theme="dark"] .topic-card {
    --c-wash: oklch(0.255 0.026 var(--hue));
    --c-soft: oklch(0.32 0.048 var(--hue));
    --c-line: oklch(0.37 0.05 var(--hue));
    --c-strong: oklch(0.74 0.1 var(--hue));
    --c-ink: oklch(0.85 0.075 var(--hue));
  }

  .topic-card { border-color: var(--c-line); }
  .topic-card:hover { border-color: var(--c-strong); }
  .topic-card .badge { background: var(--surface); color: var(--muted); }
  .topic-card-foot { border-top-color: var(--c-line); }
  .topic-card-foot .go { color: var(--c-ink); }
  .topic-progress { background: var(--c-soft); }
  .topic-progress div { background: var(--c-strong); }
  .topic-card:focus-visible { outline-color: var(--c-strong); }

  /* Común: fondo pastel liso, barra superior del color y etiqueta rellena */
  :is(#topicGrid, #examGrid) .topic-card { background: var(--c-wash); }
  :is(#topicGrid, #examGrid) .topic-card::before { background: var(--c-strong); }
  :is(#topicGrid, #examGrid) .topic-card .tag { background: var(--c-soft); color: var(--c-ink); }

  /* Específico: degradado del color hacia el fondo, anillo y etiqueta con borde */
  #topicGridEspecifico .topic-card {
    background: linear-gradient(155deg, var(--c-soft) 0%, var(--c-wash) 55%, var(--surface) 100%);
    border-color: var(--c-line);
  }
  #topicGridEspecifico .topic-card:hover { border-color: var(--c-strong); }
  #topicGridEspecifico .topic-card::after { border-color: var(--c-line); }
  #topicGridEspecifico .topic-card .tag {
    border-color: var(--c-strong);
    color: var(--c-ink);
  }
}

/* Tarjeta con dos enlaces: el título (a la guía) cubre toda la tarjeta con ::after;
   «Practicar» queda por encima para poder pulsarlo aparte */
.topic-card-link { color: inherit; text-decoration: none; }
.topic-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.topic-card-link:focus-visible { outline: none; }
.topic-card:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.topic-card-foot .go { position: relative; z-index: 2; text-decoration: none; padding: 6px 0; }
.topic-card-foot .go:hover { text-decoration: underline; }

/* Enlace al final de cada sección de la portada hacia la página del silo */
.section-more { margin: 26px 0 0; font-size: 1.05rem; font-weight: 700; }
.section-more a { color: var(--primary); }

/* Migas de pan (guías y páginas de silo) */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  font-size: .95rem;
  color: var(--muted);
}
.breadcrumbs li + li::before { content: "›"; margin: 0 8px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* Página principal de cada silo: cabecera de texto, rejilla de bloques y pie */
main.hub { padding-top: 56px; padding-bottom: 24px; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hub-actions .btn { text-decoration: none; }
.hub-title { font-size: 1.45rem; margin: 48px 0 18px; }
.hub-foot { margin-top: 24px; }

/* Guías por bloque: panel con etiquetas en forma de píldora */
.guides {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 32px 0 0;
  padding: 20px 24px;
  font-size: .97rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.guides-label {
  flex: 0 0 100%;
  margin-bottom: 2px;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
}
.guides a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 16px;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.guides a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  transition: background-color .15s;
}
.guides a:hover,
.guides a:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  transform: translateY(-2px);
}
.guides a:hover::before,
.guides a:focus-visible::before { background: var(--on-primary); }

/* ---------- Aviso de convocatoria oficial ---------- */
.notice {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px 40px;
  align-items: center;
  padding: 32px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--primary);
  border-radius: var(--radius);
}
.notice h2 { font-size: 1.5rem; max-width: 30ch; }
.notice p:last-child { margin-bottom: 0; }
.notice-text p { max-width: 62ch; color: var(--muted); margin: 0; }
.notice-links { display: grid; gap: 10px; min-width: 260px; }

/* ---------- Pasos ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.step {
  position: relative;
  padding: 28px 28px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* Línea que une los pasos en escritorio */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 52px;
  left: calc(100% + 2px);
  width: 36px;
  border-top: 2px dashed var(--border-strong);
}
.step h3 { font-size: 1.25rem; margin: 18px 0 8px; }
.step p { color: var(--muted); margin: 0; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

/* ---------- Qué incluye ---------- */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.checklist li {
  position: relative;
  padding: 20px 22px 20px 66px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 14px;
  transition: background-color .15s, box-shadow .15s;
}
.checklist li:hover { background: var(--surface); box-shadow: var(--shadow-lift); }
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 22px;
  top: 21px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .85rem;
  font-weight: 700;
}
.checklist strong { color: var(--text); }

/* ---------- Llamada final ---------- */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 44px 48px;
  border-radius: 16px;
  background: var(--primary);
  color: var(--on-primary);
}
.cta-band h2 { color: inherit; margin-bottom: 6px; }
.cta-band p { margin: 0; opacity: .9; max-width: 52ch; }
.cta-band .btn { background: var(--on-primary); color: var(--primary); }
.cta-band .btn:hover { opacity: .9; }
:root[data-theme="dark"] .cta-band .btn { background: var(--bg); color: var(--primary); }

.footer { margin-top: 96px; }

/* ---------- Pie de página (portada) ---------- */
.site-footer {
  position: relative;
  margin-top: 96px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .97rem;
}
/* Filo verde corto sobre la línea, como firma de marca */
.site-footer::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: min(220px, 40%);
  height: 3px;
  background: var(--primary);
}
.site-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, 1fr);
  gap: 40px 48px;
  padding-top: 56px;
  padding-bottom: 44px;
}
.sf-brand p { max-width: 34ch; margin: 16px 0 0; line-height: 1.55; }
.sf-title {
  margin: 0 0 14px;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
}
.sf-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sf-col a {
  display: inline-block;
  padding: 5px 0;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, transform .15s;
}
.sf-col a:hover,
.sf-col a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  transform: translateX(3px);
}
.site-footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 32px;
  padding-top: 22px;
  padding-bottom: 28px;
  border-top: 1px solid var(--border);
  font-size: .9rem;
}
.site-footer-legal p { margin: 0; max-width: 78ch; }
.site-footer-legal .sf-note { color: var(--text); font-weight: 600; }

/* ---------- Páginas de texto (legal y guías) ---------- */
.prose { max-width: 760px; }
/* Páginas de tema del temario: más anchas que las legales */
main.prose:not(.legal):not(.contact) { max-width: 1500px; }
main.prose { padding-top: 56px; }
.prose h1 { margin-bottom: 12px; }
.prose h2 { font-size: 1.45rem; margin: 40px 0 10px; }
.prose h2[id] { scroll-margin-top: 92px; } /* que la cabecera fija no tape el título al llegar por un ancla */
.prose p, .prose li { line-height: 1.7; }
.prose .lead { margin-bottom: 4px; }
.prose a:not(.btn) { text-decoration: underline; }
.topic-tests { padding-left: 1.2rem; }
/* ---------- Guías de cada bloque: autoría, índice, datos clave, preguntas frecuentes ---------- */
.guide-byline { margin: 14px 0 0; font-size: .97rem; color: var(--muted); line-height: 1.55; }
.guide-byline strong { color: var(--text); }
.guide-toc { margin: 28px 0 0; padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.guide-toc p { margin: 0 0 6px; font-weight: 700; }
.guide-toc ol { margin: 0; padding-left: 1.3rem; columns: 2 240px; column-gap: 28px; }
.guide-toc li { margin: 4px 0; break-inside: avoid; }
.guide-tip { margin: 18px 0; padding: 14px 18px; border-left: 4px solid var(--primary); border-radius: 0 var(--radius) var(--radius) 0; background: var(--primary-soft); line-height: 1.6; }
.guide-tip p { margin: 0; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 700; line-height: 1.45; min-height: 48px; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details > p { margin: 0; padding: 12px 18px 16px; }
.author-box { margin: 40px 0 0; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.author-box p { margin: 0; }
.author-box p + p { margin-top: 8px; }
.guide-sources { font-size: .97rem; }
.topic-tests li { margin: 8px 0; }

/* Páginas legales: aviso legal, privacidad y cookies */
.legal h3 { font-size: 1.15rem; margin: 28px 0 8px; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: 6px 0; }
.legal a { overflow-wrap: anywhere; }
.legal-data { margin: 16px 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.legal-data div { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 4px 16px; padding: 6px 0; }
.legal-data div + div { border-top: 1px solid var(--border); }
.legal-data dt { font-weight: 600; }
.legal-data dd { margin: 0; line-height: 1.6; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); }
.legal-table { width: 100%; min-width: 520px; border-collapse: collapse; background: var(--surface); }
.legal-table th, .legal-table td { padding: 10px 14px; text-align: left; vertical-align: top; line-height: 1.5; }
.legal-table th { background: var(--surface-2); font-weight: 700; }
.legal-table tr + tr td, .legal-table tbody tr td { border-top: 1px solid var(--border); }
.legal-more { margin-top: 40px; }

@media (max-width: 600px) {
  .legal-data div { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Página de contacto (formulario) ---------- */
.contact-form { margin-top: 28px; padding: 28px; }
.form-field + .form-field { margin-top: 22px; }
.form-field > label:not(.check) { display: block; font-weight: 700; margin-bottom: 8px; }
.form-field .opt { font-weight: 400; color: var(--muted); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
}
.contact-form textarea { resize: vertical; min-height: 160px; }
.contact-form select { font-size: 1.05rem; }
.contact-form ::placeholder { color: var(--muted); opacity: .8; }
.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible { border-color: var(--primary); }
.contact-form [aria-invalid="true"] { border-color: var(--ko); }
.form-help, .form-error { margin: 6px 0 0; font-size: .95rem; line-height: 1.45; }
.form-help { color: var(--muted); }
.form-error { color: var(--ko); font-weight: 600; }
.form-check { align-items: flex-start; line-height: 1.5; }
.form-check input { margin-top: 1px; }
.form-rgpd { margin-top: 22px; font-size: .95rem; }
.form-rgpd summary { cursor: pointer; font-weight: 600; color: var(--primary); min-height: 32px; }
.form-rgpd .legal-data { margin-top: 10px; }
.contact-form .btn { margin-top: 24px; }
/* Trampa para robots: fuera de la vista y del foco */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status {
  margin-top: 28px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid;
  font-weight: 600;
  line-height: 1.55;
}
.form-status:focus { outline: none; }
.form-status.is-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--text); }
.form-status.is-ko { background: var(--ko-soft); border-color: var(--ko); color: var(--text); }
.contact-alt { margin-top: 28px; }

@media (max-width: 600px) {
  .contact-form { padding: 20px 16px; }
  .contact-form .btn { width: 100%; }
}

/* ---------- Responsive ---------- */
@media (prefers-reduced-motion: reduce) {
  :is(#topicGrid, #examGrid) .topic-card:hover,
  #topicGridEspecifico .topic-card:hover { transform: none; }
  .topic-card:hover .go { transform: none; }
  .guides a:hover, .guides a:focus-visible { transform: none; }
  .sf-col a:hover, .sf-col a:focus-visible { transform: none; }
  :is(#topicGrid, #examGrid) .topic-card::before { transition: none; }
}

@media (max-width: 960px) {
  .hero-copy { max-width: 480px; }
  .steps { gap: 20px; }
  .site-footer-grid { grid-template-columns: 1fr 1fr; }
  .sf-brand { grid-column: 1 / -1; }
  .step:not(:last-child)::after { display: none; }
  .notice { grid-template-columns: 1fr; padding: 28px; }
  .notice-links { grid-template-columns: 1fr 1fr; min-width: 0; }
}

/* Móvil y tablet en vertical: la foto va arriba como una cabecera y el texto debajo */
@media (max-width: 900px) and (min-height: 521px) {
  .home-hero { --hero-img-h: clamp(240px, 48vw, 440px); display: block; min-height: 0; padding: 0 0 40px; }
  .hero-media { position: relative; inset: auto; height: var(--hero-img-h); }
  .hero-media img { object-position: 86% 50%; }
  .home-hero::before {
    inset: 0 0 auto 0;
    height: var(--hero-img-h);
    background: linear-gradient(180deg, transparent 55%, var(--bg) 100%);
  }
  .hero-grid { margin-top: 22px; }
  .hero-copy { max-width: 620px; }
}

@media (max-width: 720px) {
  .home-section { padding-top: 56px; }
  .steps, .checklist { grid-template-columns: 1fr; }
  .resume { grid-template-columns: 1fr; padding: 22px; }
  .notice-links { grid-template-columns: 1fr; }
  .cta-band { padding: 32px 24px; }
  .hero-figures { gap: 10px 32px; padding: 20px 0; }
  .footer, .site-footer { margin-top: 64px; }
  .site-footer-grid { padding-top: 40px; padding-bottom: 32px; gap: 28px 24px; }
}

@media (max-width: 600px) {
  .hero-ctas .btn { flex: 1 1 100%; }
  .topic-grid { grid-template-columns: 1fr; }
  .resume-stats { width: 100%; }
  .resume-stats .stat { flex: 1; min-width: 0; }
  .resume-actions .btn { flex: 1 1 100%; }
  .guides { padding: 16px; gap: 8px; }
  .guides a { padding: 6px 13px; white-space: normal; }
  main.prose { padding-top: 36px; }
  main.hub { padding-top: 36px; }
}

/* Móvil en horizontal (poca altura): texto a la izquierda y foto a la derecha, más compacto */
@media (max-height: 520px) and (orientation: landscape) {
  .home-hero { display: flex; min-height: 0; padding: 28px 0; }
  .hero-media { position: absolute; inset: 0; height: auto; }
  .hero-media img { object-position: 80% 48%; }
  .home-hero::before {
    inset: 0;
    height: auto;
    background: linear-gradient(90deg,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 93%, transparent) 42%,
      color-mix(in srgb, var(--bg) 52%, transparent) 58%,
      transparent 74%);
  }
  .hero-grid { margin-top: 0; }
  .hero-copy { max-width: min(500px, 60%); }
  .hero-copy h1 { font-size: clamp(1.45rem, 7vh, 1.9rem); margin-bottom: 10px; }
  .home-hero .eyebrow { margin-bottom: .3rem; font-size: .8rem; }
  .lead { font-size: 1rem; line-height: 1.5; }
  .hero-ctas { margin-top: 16px; }
  .hero-ctas .btn { flex: 0 0 auto; }
  .btn-lg { min-height: 46px; padding: 10px 14px; font-size: .97rem; }
  .trust { display: none; }
  .home-section { padding-top: 48px; }
  .hero-figures { padding: 16px 0; }
}
