/*
 * MF EDUCAR — Biblioteca Digital V001.0.3.15.1
 * Skip Link Acessível sob Foco + Continuidade Vertical da Home
 * + Eliminação de Espaçamento Residual entre Seções.
 *
 * Camada incremental e estritamente visual/acessível.
 * Não altera Biblioteca interna, Jornada, AACP, autenticação ou MFChat.
 */

/*
 * 1) Skip link: permanece disponível para teclado/leitor de tela,
 * mas não participa visualmente do layout enquanto não recebe foco.
 * O padrão clip/clip-path evita o vazamento observado em impressão/PDF.
 */
.mf-landing-page .mf-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10000;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    border-radius: 0;
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    transform: none;
    transition: opacity .16s ease, box-shadow .16s ease;
}

.mf-landing-page .mf-skip-link:focus,
.mf-landing-page .mf-skip-link:focus-visible {
    width: auto;
    height: auto;
    margin: 0;
    padding: 12px 16px;
    overflow: visible;
    clip: auto;
    clip-path: none;
    border: 2px solid #1767f2;
    border-radius: 10px;
    background: #ffffff;
    color: #0b2e68;
    opacity: 1;
    white-space: normal;
    pointer-events: auto;
    outline: 3px solid rgba(23, 103, 242, .22);
    outline-offset: 3px;
    box-shadow: 0 14px 34px rgba(18, 61, 140, .20);
}

/*
 * 2) Continuidade vertical: reduz somente a soma de respiros entre
 * Trajetória e MFChat. Não comprime o conteúdo interno nem altera
 * a hierarquia visual dos cards homologados.
 */
.mf-landing-page .mf-value-section {
    min-height: 0;
    padding-bottom: 64px;
}

.mf-landing-page .mf-value-section .mf-section-heading {
    margin-bottom: 38px;
}

.mf-landing-page .mf-value-grid {
    margin-bottom: 0;
}

.mf-landing-page .mf-value-section + .mf-mfchat-section {
    margin-top: 0;
}

.mf-landing-page .mf-mfchat-section {
    min-height: 0;
    padding-top: 76px;
}

/* A seção seguinte mantém o mesmo ritmo sem acumular margens residuais. */
.mf-landing-page .mf-mfchat-section + .mf-audience-section {
    margin-top: 0;
}

/*
 * 3) Impressão/PDF: o skip link não deve ser materializado no documento
 * e grids grandes podem fragmentar normalmente entre páginas, evitando
 * reservar uma página inteira antes da próxima seção.
 */
@media print {
    .mf-landing-page .mf-skip-link {
        display: none !important;
    }

    .mf-landing-page .mf-value-section,
    .mf-landing-page .mf-mfchat-section,
    .mf-landing-page .mf-audience-section,
    .mf-landing-page .mf-final-cta {
        min-height: 0 !important;
        break-before: auto !important;
        break-after: auto !important;
        page-break-before: auto !important;
        page-break-after: auto !important;
    }

    .mf-landing-page .mf-value-section {
        margin-top: 0 !important;
        padding-top: 34px !important;
        padding-bottom: 30px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .mf-landing-page .mf-section-heading {
        margin-bottom: 24px !important;
    }

    .mf-landing-page .mf-value-grid {
        gap: 14px !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    .mf-landing-page .mf-value-card {
        min-height: 0 !important;
        padding: 20px !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        box-shadow: none !important;
    }

    .mf-landing-page .mf-value-card-featured {
        transform: none !important;
    }

    .mf-landing-page .mf-mfchat-section {
        padding-top: 34px !important;
        padding-bottom: 34px !important;
    }

    /* Grid de uma única linha tende a ser empurrado inteiro para a página seguinte.
       Em impressão ele vira fluxo normal para permitir fragmentação vertical. */
    .mf-landing-page .mf-mfchat-grid {
        display: block !important;
    }

    .mf-landing-page .mf-mfchat-preview {
        margin-top: 26px !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .mf-landing-page .mf-audience-section {
        padding-top: 38px !important;
        padding-bottom: 38px !important;
    }
}

@media (max-width: 760px) {
    .mf-landing-page .mf-value-section {
        padding-bottom: 52px;
    }

    .mf-landing-page .mf-mfchat-section {
        padding-top: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mf-landing-page .mf-skip-link {
        transition: none;
    }
}
