/* H&C · capa final de accesibilidad visual
   Se carga después de todas las hojas de presentación para impedir que estilos
   de página reintroduzcan combinaciones de bajo contraste.
   Criterio: WCAG 2.2 AA para texto normal (>= 4.5:1) y controles/foco (>= 3:1). */

:root {
  --hc-a11y-ink: #172033;
  --hc-a11y-body: #46505c;
  --hc-a11y-small: #3f4a57;
  --hc-a11y-accent: #245a4f;
  --hc-a11y-accent-hover: #174f45;
  --hc-a11y-mint: #8fd5c5;
  --hc-a11y-mint-hover: #a8dfd3;
  --hc-a11y-dark: #09101f;
  --hc-a11y-light: #f8f4eb;
  --hc-a11y-light-muted: #cbd2d5;
  --hc-a11y-light-small: #b8c2c8;
}

body { font-weight: 400; }

/* Texto continuo y microcopy: Inter 300 resultaba demasiado fino en tamaños pequeños. */
:where(.u-body, .momento-body, .momento-intro, .instr-body, .instr-intro, .escena-body,
  .page-body, .post-body__content, .legal-page__content, .hc-prose,
  .hc-page-intro p, .hc-page-section__intro) {
  font-weight: 400 !important;
}

/* Superficies claras: acento oscuro y texto secundario con margen AA. */
:is(.section--light, .section--light-2, .hc-page-section--paper, .hc-page-section--light,
  .hc-page-section--light-2, .form-ctx, .legal-page, .e3-module) {
  --accent: var(--hc-a11y-accent) !important;
  --accent-hover: var(--hc-a11y-accent-hover) !important;
  --text-muted: var(--hc-a11y-body) !important;
}

:is(.section--light, .section--light-2, .hc-page-section--paper, .hc-page-section--light,
  .hc-page-section--light-2) :where(p, li, dd) {
  color: var(--hc-a11y-body);
}

:is(.section--light, .section--light-2, .hc-page-section--paper, .hc-page-section--light,
  .hc-page-section--light-2) :where(.u-eyebrow, [class$='__eyebrow'], [class$='__kicker'],
  [class$='__num'], [class$='__label']) {
  color: var(--hc-a11y-accent) !important;
}

/* Superficies oscuras: el menta conserva su función de acento luminoso. */
:is(.section--dark, .section--dark-2, .hc-page-section--dark, .hc-page-section--dark-2,
  .c-hero, .hc-page-hero, .hc-cta-band, .momento-hero, .instr-hero, .escena-hero) {
  --accent: var(--hc-a11y-mint) !important;
  --accent-hover: var(--hc-a11y-mint-hover) !important;
  --text-muted: var(--hc-a11y-light-muted) !important;
}

:is(.section--dark, .section--dark-2, .hc-page-section--dark, .hc-page-section--dark-2,
  .c-hero, .hc-page-hero, .hc-cta-band, .momento-hero, .instr-hero, .escena-hero)
  :where(.u-eyebrow, [class$='__eyebrow'], [class$='__kicker'], [class$='__num'], [class$='__label']) {
  color: var(--hc-a11y-mint) !important;
}

/* Una ambient-surface oscura necesita veladura oscura; la regla heredada era clara. */
:is(.section--dark, .section--dark-2).ambient-surface::after {
  background:
    linear-gradient(120deg, rgba(9,16,31,.90), rgba(16,24,45,.78)),
    var(--ambient-image, none) center/cover no-repeat !important;
  opacity: .94 !important;
}

/* Botón lleno: por defecto, menta + tinta oscura para superficies oscuras. */
.btn--solid,
a.btn--solid,
button.btn--solid,
.c-nav__mobile-cta {
  background: var(--hc-a11y-mint) !important;
  border-color: var(--hc-a11y-mint) !important;
  color: var(--hc-a11y-dark) !important;
  font-weight: 600 !important;
}

.btn--solid:hover,
.btn--solid:focus-visible,
a.btn--solid:hover,
a.btn--solid:focus-visible,
button.btn--solid:hover,
button.btn--solid:focus-visible,
.c-nav__mobile-cta:hover,
.c-nav__mobile-cta:focus-visible {
  background: var(--hc-a11y-mint-hover) !important;
  border-color: var(--hc-a11y-mint-hover) !important;
  color: var(--hc-a11y-dark) !important;
}

/* Sobre papel, el botón relleno usa verde oscuro: contraste de texto y del control. */
:is(.section--light, .section--light-2, .hc-page-section--paper, .hc-page-section--light,
  .hc-page-section--light-2, .form-ctx, .legal-page, .e3-module) .btn--solid {
  background: var(--hc-a11y-accent) !important;
  border-color: var(--hc-a11y-accent) !important;
  color: #ffffff !important;
}
:is(.section--light, .section--light-2, .hc-page-section--paper, .hc-page-section--light,
  .hc-page-section--light-2, .form-ctx, .legal-page, .e3-module) .btn--solid:hover {
  background: var(--hc-a11y-accent-hover) !important;
  border-color: var(--hc-a11y-accent-hover) !important;
  color: #ffffff !important;
}

/* Botones transparentes sobre papel deben usar tinta oscura. */
:is(.section--light, .section--light-2, .hc-page-section--paper, .hc-page-section--light,
  .hc-page-section--light-2) :is(.btn--ghost, .btn--outline, .btn:not(.btn--solid)) {
  color: var(--hc-a11y-ink) !important;
  border-color: rgba(23, 32, 51, .42) !important;
}

:is(.section--light, .section--light-2, .hc-page-section--paper, .hc-page-section--light,
  .hc-page-section--light-2) :is(.btn--ghost, .btn--outline, .btn:not(.btn--solid)):hover {
  color: var(--hc-a11y-accent-hover) !important;
  border-color: var(--hc-a11y-accent) !important;
  background: rgba(36, 90, 79, .06) !important;
}

/* En oscuro, los botones transparentes recuperan texto claro. */
:is(.section--dark, .section--dark-2, .hc-page-section--dark, .hc-page-section--dark-2,
  .c-hero, .hc-page-hero, .hc-cta-band, .momento-hero) :is(.btn--ghost, .btn--outline, .btn:not(.btn--solid)) {
  color: var(--hc-a11y-light) !important;
  border-color: rgba(248, 244, 235, .42) !important;
}

/* Navegación: tamaño funcional mínimo y contraste estable. */
.c-nav__brand-name { font-size: .68rem !important; font-weight: 600 !important; }
.c-nav__links a,
.c-nav__toggle { color: #d3dadd !important; font-size: .72rem !important; font-weight: 500 !important; }
.c-nav__links a:hover,
.c-nav__toggle:hover,
.c-nav__item--has-submenu.is-open .c-nav__toggle { color: #ffffff !important; }

.c-hero__eyebrow,
.u-eyebrow { font-size: .72rem !important; font-weight: 600 !important; }
.c-hero__practice-rail span { color: var(--hc-a11y-light-small) !important; font-size: .70rem !important; font-weight: 500 !important; }

/* Momentos: corrección explícita de los casos observados sobre papel claro. */
.section--light .momento-scene-card__body span,
.section--light-2 .momento-scene-card__body span,
.section--light .momento-card__link,
.section--light-2 .momento-card__link,
.section--light .momento-instr-group h3,
.section--light-2 .momento-instr-group h3,
.section--light .momento-cta__eyebrow,
.section--light-2 .momento-cta__eyebrow,
.section--light .momento-cta__link,
.section--light-2 .momento-cta__link {
  color: var(--hc-a11y-accent) !important;
  font-weight: 600 !important;
}

.momento-scene-card__body span,
.momento-card__link,
.momento-instr-group h3 { font-size: .74rem !important; }
.momento-scene-card__body p,
.momento-card__sub,
.momento-layers li { color: var(--hc-a11y-body) !important; font-size: .92rem !important; font-weight: 400 !important; }
.momento-instr-list a { color: var(--hc-a11y-ink) !important; font-size: .98rem !important; font-weight: 500 !important; }

/* Rail de Momentos: los rótulos beige originales quedaban bajo AA sobre marfil. */
.moment-journey-rail__mobile summary > span,
.moment-journey-rail__type,
.moment-journey-rail__group-label {
  color: #5d574b !important;
  font-size: .70rem !important;
  font-weight: 600 !important;
}
.moment-journey-rail__group a {
  color: var(--hc-a11y-body) !important;
  font-size: .76rem !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}
.moment-journey-rail__group a:hover,
.moment-journey-rail__node a:hover { color: var(--hc-a11y-accent-hover) !important; }
.moment-journey-rail__group li::before,
.moment-journey-rail__mobile summary::after { color: var(--hc-a11y-accent) !important; }
.moment-journey-rail__node.is-current::before { background: var(--hc-a11y-accent) !important; }

/* Diagnósticos y formularios compartidos: texto continuo siempre en peso regular. */
.diag-description,
.diag-question-text,
.diag-option,
.diag-result-message p { font-weight: 400 !important; }
.diag-block-title,
.diag-result-kicker,
.diag-result-section__head > span,
.diag-result-section__head p,
.diag-signal__top span,
.diag-path__eyebrow { font-size: .70rem !important; font-weight: 600 !important; }

/* Nueva familia de páginas: los cuerpos ya tienen buen contraste; reforzamos el microtexto. */
.hc-service-card__num,
.hc-feature-card__num,
.hc-link-card__eyebrow,
.hc-process__step span,
.hc-service-card__link,
.hc-link-card__link { font-size: .72rem !important; font-weight: 700 !important; }
.hc-service-card p,
.hc-feature-card p,
.hc-link-card p,
.hc-process__step p,
.hc-split__aside p,
.hc-split__aside li { color: var(--hc-a11y-body) !important; font-weight: 400 !important; }
.hc-list li::before { color: var(--hc-a11y-accent) !important; }
.hc-page-section--dark .hc-list li::before { color: var(--hc-a11y-mint) !important; }

/* Footer actual + footers heredados. */
.hc-footer__social a,
.hc-footer__bottom p,
.hc-footer__bottom a { color: #b8c2c8 !important; font-size: .74rem !important; }
.hc-footer__heading,
.hc-footer__contact dt,
.hc-footer__e3-copy > span { color: var(--hc-a11y-mint) !important; font-size: .70rem !important; }
.hc-footer__col li a { color: #d2d9dc !important; font-size: .88rem !important; }
.hc-footer__contact-cta { color: var(--hc-a11y-mint) !important; font-size: .78rem !important; }

.site-footer__brand small,
.federated-footer__brand small,
.c-footer__copy,
.c-footer__newsletter-legal {
  color: rgba(255,255,255,.72) !important;
  font-size: .70rem !important;
  font-weight: 400 !important;
}
.site-footer__links > span,
.federated-footer__links > span { color: var(--hc-a11y-mint) !important; font-size: .68rem !important; font-weight: 600 !important; }
.site-footer__links a,
.federated-footer__link,
.federated-footer__links a { color: rgba(255,255,255,.78) !important; font-size: .72rem !important; font-weight: 500 !important; }

/* Foco y preferencias del sistema. */
:where(a, button, summary, input, textarea, select):focus-visible {
  outline: 3px solid var(--hc-a11y-mint) !important;
  outline-offset: 4px !important;
}
:is(.section--light, .section--light-2, .hc-page-section--paper, .hc-page-section--light,
  .hc-page-section--light-2, .form-ctx, .legal-page, .e3-module)
  :where(a, button, summary, input, textarea, select):focus-visible {
  outline-color: var(--hc-a11y-accent-hover) !important;
}

@media (prefers-contrast: more) {
  :root { --hc-a11y-accent: #174f45; --hc-a11y-body: #303a46; --hc-a11y-small: #303a46; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
