/**
 * CR Acessibilidade · Estilos Globais
 *
 * Implementa foco visível global para navegação por teclado (WCAG 2.4.7).
 * Aplica-se a TODOS os elementos interativos · sobrescrevível por CSS específico.
 *
 * @package CursosRateio
 * @since 1.0.0
 * @date 2026-05-07
 */

/* Foco visível global - WCAG 2.4.7 (AA) */
:focus-visible {
    outline: 2px solid var(--cr-brand-primary, #6366F1) !important;
    outline-offset: 2px !important;
    border-radius: 4px !important;
}

/* Remove outline padrão quando :focus-visible cuida */
:focus:not(:focus-visible) {
    outline: none !important;
}

/* Inputs: outline + box-shadow suave */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--cr-brand-primary, #6366F1) !important;
    outline-offset: 0 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* Skip-link visível ao focar */
a.skip-link:focus,
a.skip-link:focus-visible {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important;
    z-index: 10000 !important;
    padding: 0.5rem 1rem !important;
    background: #fff !important;
    color: #000 !important;
    text-decoration: underline !important;
}

/* ============================================================
 * R13 · Fraunces Variable Font · explorar eixos
 *
 * Fraunces tem axes: wght (peso), opsz (optical-size 9..144),
 * soft (suavidade), WONK (estilização).
 *
 * Aplicamos opsz baseado no tamanho do heading para que cada
 * tamanho use o desenho ótico ideal da fonte.
 * ============================================================ */

/* h1 (display grande) · opsz=144 = desenho mais elegante */
h1 {
    font-variation-settings: "opsz" 144, "SOFT" 50;
    font-optical-sizing: auto;
}

/* h2 (subhead) · opsz=72 = balanço entre legibilidade e elegância */
h2 {
    font-variation-settings: "opsz" 72, "SOFT" 50;
    font-optical-sizing: auto;
}

/* h3 (heading menor) · opsz=32 = mais legível em tamanho menor */
h3 {
    font-variation-settings: "opsz" 32, "SOFT" 50;
    font-optical-sizing: auto;
}

/* h4-h6 · opsz=14 = otimizado pra texto */
h4, h5, h6 {
    font-variation-settings: "opsz" 14, "SOFT" 50;
    font-optical-sizing: auto;
}

/* Permite que classes específicas sobrescrevam */
.cr-no-variation,
.cr-no-variation * {
    font-variation-settings: normal;
}
