/*
 * ================================================================
 * PORTAL LCC-UFMG — LAYOUT GERAL E CABEÇALHO
 * ================================================================
 * Este arquivo controla o layout geral, acessibilidade, cabeçalho,
 * barra Gov.br, identificação visual do LCC e comportamento responsivo.
 *
 * A marca do CABEÇALHO usa exclusivamente a classe .lcc-header-logo.
 * As marcas do RODAPÉ são controladas pelo footer.css.
 * Isso impede que regras de uma área alterem a outra.
 * ================================================================
 */

:root {
    --lcc-blue: #1351b4;
    --lcc-blue-dark: #071d49;
    --lcc-text: #1f2937;
    --lcc-border: #d7dce5;
    --lcc-surface: #ffffff;
    --lcc-surface-soft: #f6f8fc;
    --lcc-focus: #ffcd07;
}


html {
    max-width: 100%;
    scroll-behavior: smooth;
}


body.template-base {
    background: var(--lcc-surface);
    color: var(--lcc-text);
    display: flex;
    flex-direction: column;
    margin: 0;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}


body.template-base > main,
.lcc-main-content {
    flex: 1 0 auto;
    min-width: 0;
}


/* ========================================
   ACESSIBILIDADE
   ======================================== */

.lcc-skip-link {
    background: #000000;
    border: 2px solid #ffffff;
    border-radius: 4px;
    color: #ffffff;
    font-weight: 600;
    left: 0.75rem;
    padding: 0.75rem 1rem;
    position: fixed;
    text-decoration: none;
    top: 0.75rem;
    transform: translateY(-180%);
    transition: transform 0.2s ease;
    z-index: 10000;
}


.lcc-skip-link:focus {
    transform: translateY(0);
}


.lcc-visually-hidden {
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}


.lcc-main-content:focus {
    outline: none;
}


body.template-base :where(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 3px solid var(--lcc-focus);
    outline-offset: 3px;
}


/* ========================================
   CABEÇALHO GOV.BR — BARRA COMPACTA
   ======================================== */

.lcc-site-header {
    margin-bottom: 0 !important;
    overflow: visible !important;
    padding-bottom: 0.65rem !important;
    padding-top: 0.2rem !important;
}


.lcc-site-header > .container-lg {
    max-width: 1200px;
    overflow: visible;
    width: 100%;
}


.lcc-site-header .lcc-govbar {
    align-items: center !important;
    display: flex !important;
    gap: clamp(1rem, 2vw, 2rem) !important;
    min-height: 38px !important;
    overflow: visible !important;
    padding: 0.1rem 0 !important;
    position: relative;
    width: 100% !important;
}


.lcc-site-header .lcc-govbar-logo {
    flex: 0 0 auto;
    line-height: 0;
    min-width: 0;
}


.lcc-site-header .lcc-govbar-logo a {
    align-items: center;
    display: inline-flex;
    line-height: 0;
    min-height: 32px;
    text-decoration: none;
}


.lcc-site-header .lcc-govbar-logo img {
    display: block !important;
    height: auto !important;
    max-height: 30px !important;
    max-width: 82px !important;
    object-fit: contain !important;
    width: 82px !important;
}


.lcc-site-header .lcc-govbar-links {
    align-items: center;
    display: flex !important;
    flex: 1 1 auto;
    gap: clamp(1.1rem, 1.8vw, 1.8rem) !important;
    justify-content: flex-end;
    margin-left: auto;
    min-width: 0;
}


.lcc-site-header .lcc-govbar-links a {
    color: var(--lcc-blue-dark) !important;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    padding: 0.45rem 0;
    text-decoration: none;
    white-space: nowrap;
}


.lcc-site-header .lcc-govbar-links a:hover,
.lcc-site-header .lcc-govbar-links a:focus-visible {
    color: var(--lcc-blue) !important;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}


.lcc-site-header .lcc-govbar-controls {
    align-items: center;
    display: flex !important;
    flex: 0 0 auto;
    gap: 0.4rem;
    justify-content: flex-end;
}


.lcc-site-header .lcc-govbar-menu-toggle,
.lcc-site-header .lcc-contrast-toggle {
    align-items: center !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    color: var(--lcc-blue) !important;
    flex: 0 0 auto;
    height: 34px !important;
    justify-content: center !important;
    min-height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    width: 34px !important;
}


.lcc-site-header .lcc-govbar-menu-toggle {
    display: none !important;
}


.lcc-site-header .lcc-contrast-toggle {
    display: inline-flex !important;
}


.lcc-site-header .lcc-govbar-menu-toggle:hover,
.lcc-site-header .lcc-govbar-menu-toggle:focus-visible,
.lcc-site-header .lcc-contrast-toggle:hover,
.lcc-site-header .lcc-contrast-toggle:focus-visible {
    background: var(--lcc-surface-soft) !important;
    border-color: var(--lcc-border) !important;
}


.lcc-site-header .lcc-govbar-menu-toggle i,
.lcc-site-header .lcc-contrast-toggle i {
    font-size: 0.95rem;
    line-height: 1;
    pointer-events: none;
}


.lcc-site-header .lcc-header-divider {
    display: block;
    margin: 0.3rem 0 0.6rem !important;
}


.lcc-site-header .header-bottom {
    margin-top: 0 !important;
}


/* ========================================
   IDENTIFICAÇÃO LCC-UFMG
   ======================================== */

.lcc-header-brand {
    align-items: center;
    color: #111111;
    display: inline-flex;
    gap: 1.25rem;
    max-width: 100%;
    min-width: 0;
    text-decoration: none;
}


.lcc-header-brand:hover,
.lcc-header-brand:focus {
    color: #111111;
    text-decoration: none;
}


.lcc-site-header .lcc-header-logo {
    flex: 0 0 auto;
    height: auto;
    max-width: 42vw;
    width: 180px;
    max-height: none;
    object-fit: contain;
}


.lcc-site-header .header-bottom .lcc-header-brand .lcc-header-brand-text {
    color: #111111 !important;
    display: block;
    font-family: "Raleway", "Rawline", sans-serif;
    font-size: clamp(1.65rem, 2.35vw, 2.5rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.025em;
    line-height: 1.05 !important;
    max-width: 780px;
    min-width: 0;
    overflow-wrap: normal;
    text-wrap: balance;
}


/* ========================================
   RODAPÉ INSTITUCIONAL
   ======================================== */

.lcc-footer {
    background: #ffffff;
    border-top: 1px solid var(--lcc-border);
    color: var(--lcc-text);
    flex: 0 0 auto;
    margin-top: 4rem;
}


.lcc-footer-logos {
    align-items: center;
    border-bottom: 1px solid var(--lcc-border);
    display: grid;
    gap: clamp(1.5rem, 5vw, 5rem);
    grid-template-columns: 1.25fr 1fr 1fr 1.25fr;
    justify-items: center;
    min-height: 160px;
    padding: 2rem 0;
}


.lcc-footer-logo-group {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
}


.lcc-footer-logo-link {
    border-radius: 4px;
}


.lcc-footer-logos img {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    width: auto;
}


.lcc-footer-government img {
    max-height: 42px;
}


.lcc-footer-lncc {
    max-height: 58px;
}


.lcc-footer-sinapad {
    max-height: 74px;
}


.lcc-footer-meta {
    align-items: center;
    color: #4b5563;
    display: flex;
    font-size: 0.875rem;
    gap: 1rem;
    justify-content: space-between;
    min-height: 58px;
    padding: 1rem 0;
}


/* ========================================
   ALTO CONTRASTE
   Compatível com classe no html, no body
   e com data-lcc-contrast="true".
   ======================================== */

html.lcc-high-contrast,
html[data-lcc-contrast="true"],
body.lcc-high-contrast {
    color-scheme: dark;
    --lcc-blue: #ffff00;
    --lcc-blue-dark: #ffff00;
    --lcc-text: #ffffff;
    --lcc-border: #ffffff;
    --lcc-surface: #000000;
    --lcc-surface-soft: #111111;
    --lcc-focus: #00ffff;
}


html.lcc-high-contrast,
html[data-lcc-contrast="true"],
html.lcc-high-contrast body,
html[data-lcc-contrast="true"] body,
body.lcc-high-contrast {
    background: #000000 !important;
    color: #ffffff !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) :where(
    body,
    header,
    main,
    footer,
    section,
    article,
    aside,
    nav,
    .lcc-site-header,
    .br-menu,
    .br-list,
    .br-item,
    .br-card,
    .br-modal,
    .br-message,
    .br-table,
    .br-breadcrumb,
    .br-tab,
    .br-accordion,
    .br-collapse,
    .lcc-govbar-links,
    .lcc-footer,
    .lcc-pre-footer,
    .lcc-main-footer,
    .lcc-main-footer-bottom
),
body.lcc-high-contrast :where(
    header,
    main,
    footer,
    section,
    article,
    aside,
    nav,
    .lcc-site-header,
    .br-menu,
    .br-list,
    .br-item,
    .br-card,
    .br-modal,
    .br-message,
    .br-table,
    .br-breadcrumb,
    .br-tab,
    .br-accordion,
    .br-collapse,
    .lcc-govbar-links,
    .lcc-footer,
    .lcc-pre-footer,
    .lcc-main-footer,
    .lcc-main-footer-bottom
) {
    background-color: #000000 !important;
    color: #ffffff !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) a:not(.br-button),
body.lcc-high-contrast a:not(.br-button) {
    color: #ffff00 !important;
    text-decoration: underline !important;
    text-underline-offset: 0.2em;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) a:not(.br-button):visited,
body.lcc-high-contrast a:not(.br-button):visited {
    color: #ffb3ff !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) a:not(.br-button):hover,
:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) a:not(.br-button):focus-visible,
body.lcc-high-contrast a:not(.br-button):hover,
body.lcc-high-contrast a:not(.br-button):focus-visible {
    color: #00ffff !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) .lcc-header-brand,
:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) .lcc-header-brand span,
body.lcc-high-contrast .lcc-header-brand,
body.lcc-high-contrast .lcc-header-brand span {
    color: #ffffff !important;
    text-decoration: none !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) :where(
    .br-divider,
    .lcc-header-divider,
    .lcc-footer,
    .lcc-footer-logos,
    .lcc-main-footer,
    .lcc-main-footer-bottom,
    .br-card,
    .br-list,
    .br-item,
    .br-message,
    .br-table,
    .br-input,
    .br-select,
    .br-textarea,
    input,
    select,
    textarea,
    button
),
body.lcc-high-contrast :where(
    .br-divider,
    .lcc-header-divider,
    .lcc-footer,
    .lcc-footer-logos,
    .lcc-main-footer,
    .lcc-main-footer-bottom,
    .br-card,
    .br-list,
    .br-item,
    .br-message,
    .br-table,
    .br-input,
    .br-select,
    .br-textarea,
    input,
    select,
    textarea,
    button
) {
    border-color: #ffffff !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) :where(
    input,
    select,
    textarea,
    .br-input input,
    .br-select select,
    .br-textarea textarea
),
body.lcc-high-contrast :where(
    input,
    select,
    textarea,
    .br-input input,
    .br-select select,
    .br-textarea textarea
) {
    background-color: #000000 !important;
    color: #ffffff !important;
    caret-color: #ffffff;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) :where(input, textarea)::placeholder,
body.lcc-high-contrast :where(input, textarea)::placeholder {
    color: #d9d9d9 !important;
    opacity: 1;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) :where(.br-button, button),
body.lcc-high-contrast :where(.br-button, button) {
    background-color: #000000 !important;
    border-color: #ffff00 !important;
    color: #ffff00 !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) :where(.br-button, button):hover,
body.lcc-high-contrast :where(.br-button, button):hover {
    background-color: #ffff00 !important;
    color: #000000 !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) .lcc-contrast-toggle[aria-pressed="true"],
body.lcc-high-contrast .lcc-contrast-toggle[aria-pressed="true"] {
    background-color: #ffff00 !important;
    border-color: #ffff00 !important;
    color: #000000 !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) :where(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]:not([tabindex="-1"])
):focus-visible,
body.lcc-high-contrast :where(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 3px solid #00ffff !important;
    outline-offset: 3px !important;
}


:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) :where(img, svg),
body.lcc-high-contrast :where(img, svg) {
    filter: none !important;
}


/* ========================================
   TABLET E MENU HAMBÚRGUER
   ======================================== */

@media (max-width: 1023.98px) {
    .lcc-site-header .lcc-govbar {
        display: grid !important;
        gap: 0.45rem 0.75rem !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
    }


    .lcc-site-header .lcc-govbar-logo {
        grid-column: 1;
        grid-row: 1;
    }


    .lcc-site-header .lcc-govbar-controls {
        grid-column: 2;
        grid-row: 1;
    }


    html.lcc-js .lcc-site-header .lcc-govbar-menu-toggle {
        display: inline-flex !important;
    }


    .lcc-site-header .lcc-govbar-links {
        background: var(--lcc-surface);
        border: 1px solid var(--lcc-border);
        border-radius: 6px;
        box-shadow: 0 8px 24px rgba(7, 29, 73, 0.16);
        display: grid !important;
        gap: 0.25rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        left: 0;
        margin: 0;
        max-width: 100%;
        min-width: 0;
        padding: 0.5rem;
        position: absolute;
        right: 0;
        top: calc(100% + 0.35rem);
        width: auto;
        z-index: 950;
    }


    html.lcc-js .lcc-site-header .lcc-govbar-links:not(.is-open) {
        display: none !important;
    }


    html.lcc-js .lcc-site-header .lcc-govbar-links.is-open {
        display: grid !important;
    }


    .lcc-site-header .lcc-govbar-links a {
        align-items: center;
        border-radius: 4px;
        display: flex;
        font-size: 0.875rem;
        min-height: 42px;
        min-width: 0;
        overflow-wrap: anywhere;
        padding: 0.6rem 0.75rem;
        white-space: normal;
        width: 100%;
    }


    .lcc-site-header .lcc-govbar-links a:hover,
    .lcc-site-header .lcc-govbar-links a:focus-visible {
        background: var(--lcc-surface-soft) !important;
    }


    .lcc-footer-logos {
        gap: 2rem 3rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ========================================
   CELULAR
   ======================================== */

@media (max-width: 575.98px) {
    .lcc-site-header {
        padding-bottom: 0.55rem !important;
    }


    .lcc-site-header .lcc-govbar {
        column-gap: 0.5rem !important;
    }


    .lcc-site-header .lcc-govbar-logo img {
        max-height: 27px !important;
        max-width: 70px !important;
        width: 70px !important;
    }


    .lcc-site-header .lcc-govbar-links {
        grid-template-columns: minmax(0, 1fr);
        left: -0.15rem;
        right: -0.15rem;
    }


    .lcc-site-header .lcc-govbar-links a {
        font-size: 0.84rem;
    }


    .lcc-site-header .lcc-header-divider {
        margin-bottom: 0.5rem !important;
    }


    .lcc-header-brand {
        gap: 0.75rem;
        width: 100%;
    }


    .lcc-site-header .lcc-header-logo {
        max-width: 38vw;
        width: 118px;
    }


    .lcc-site-header .header-bottom .lcc-header-brand .lcc-header-brand-text {
        font-size: clamp(1.1rem, 4.6vw, 1.45rem) !important;
        line-height: 1.08 !important;
        letter-spacing: -0.02em;
    }

    .lcc-header-brand-line-break {
        display: none;
    }


    .lcc-footer {
        margin-top: 2.5rem;
    }


    .lcc-footer-logos {
        gap: 2rem;
        grid-template-columns: 1fr;
        min-height: 0;
    }


    .lcc-footer-government,
    .lcc-footer-ufmg {
        flex-wrap: wrap;
    }


    .lcc-footer-meta {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ========================================
   CELULARES MUITO ESTREITOS
   ======================================== */

@media (max-width: 359.98px) {
    .lcc-site-header .lcc-govbar-logo img {
        max-width: 62px !important;
        width: 62px !important;
    }


    .lcc-site-header .lcc-govbar-menu-toggle,
    .lcc-site-header .lcc-contrast-toggle {
        height: 30px !important;
        min-height: 30px !important;
        min-width: 30px !important;
        width: 30px !important;
    }


    .lcc-header-brand {
        gap: 0.55rem;
    }


    .lcc-site-header .lcc-header-logo {
        width: 100px;
    }


    .lcc-site-header .header-bottom .lcc-header-brand .lcc-header-brand-text {
        font-size: 1rem !important;
        line-height: 1.1 !important;
    }
}


/* ========================================
   REDUÇÃO DE MOVIMENTO
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }


    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}


/* ========================================
   CORES FORÇADAS DO SISTEMA OPERACIONAL
   ======================================== */

@media (forced-colors: active) {
    .lcc-site-header,
    .lcc-footer,
    .lcc-govbar-links a,
    .lcc-contrast-toggle {
        border-color: CanvasText;
        forced-color-adjust: auto;
    }


    .lcc-govbar-links a {
        color: LinkText;
    }
}


/* ========================================
   IMPRESSÃO
   ======================================== */

@media print {
    .lcc-menu,
    .lcc-govbar-controls,
    .lcc-skip-link,
    .lcc-footer,
    [vw] {
        display: none !important;
    }


    .lcc-site-header {
        box-shadow: none !important;
    }
}

/* ========================================
   CORREÇÃO FINAL — HOVER DA IDENTIFICAÇÃO LCC
   ======================================== */

body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand,
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand:link,
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand:visited,
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand:hover,
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand:focus,
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand:focus-visible,
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand:active,
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand span {
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    text-decoration: none !important;
}


html.lcc-high-contrast
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand,
html.lcc-high-contrast
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand span,
html[data-lcc-contrast="true"]
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand,
html[data-lcc-contrast="true"]
body.template-base
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand span,
body.template-base.lcc-high-contrast
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand,
body.template-base.lcc-high-contrast
.lcc-site-header
.header-bottom
.header-menu
> a.lcc-header-brand span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}


/* ========================================
   VOLTAR AO TOPO
   ======================================== */

.lcc-back-to-top {
    align-items: center;
    background: #174a99;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(7, 29, 73, 0.24);
    color: #ffffff !important;
    display: inline-flex;
    height: 3rem;
    justify-content: center;
    position: fixed;
    right: 1.5rem;
    text-decoration: none !important;
    transition:
        background-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
    width: 3rem;
    z-index: 900;
}

.lcc-back-to-top:hover,
.lcc-back-to-top:focus-visible {
    background: var(--lcc-blue);
    box-shadow: 0 10px 28px rgba(7, 29, 73, 0.3);
    color: #ffffff !important;
    transform: translateY(-2px);
}

.lcc-back-to-top i {
    font-size: 1.3rem;
    line-height: 1;
}

@media (max-width: 575.98px) {
    .lcc-back-to-top {
        bottom: 1rem;
        height: 2.75rem;
        right: 1rem;
        width: 2.75rem;
    }
}

@media print {
    .lcc-back-to-top {
        display: none !important;
    }
}

:is(
    html.lcc-high-contrast,
    html[data-lcc-contrast="true"]
) .lcc-back-to-top,
body.lcc-high-contrast .lcc-back-to-top {
    background: #000000 !important;
    border-color: #ffff00 !important;
    color: #ffff00 !important;
}