/* Rodapé do site público (<x-site.footer>). Tudo escopado em #footer. Contrato: .kiro/steering/site-footer.md
   Cor de destaque por instituição: --footer-accent (definida em inst_<instituicao>_style.css). */

#footer.site-footer {
    --footer-accent: #ffb600;
    --footer-bg: #0f1115;
    --footer-bg-2: #0a0c0f;
    --footer-texto: rgba(255, 255, 255, .66);
    --footer-titulo: #fff;
    --footer-linha: rgba(255, 255, 255, .09);
    background: linear-gradient(180deg, var(--footer-bg) 0%, var(--footer-bg-2) 100%);
    border-top: 3px solid var(--footer-accent);
    color: var(--footer-texto);
    position: relative;
}

#footer .site-footer__main { padding: 64px 0 28px; }

#footer .site-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(4, 1fr);
    gap: 40px 32px;
}

/* ---- Marca ---- */
#footer .site-footer__logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--footer-titulo);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}
#footer .site-footer__logo img { display: block; }
#footer .site-footer__desc { margin: 16px 0 20px; max-width: 320px; line-height: 1.6; }

#footer ul { list-style: none; margin: 0; padding: 0; }

#footer .site-footer__redes { display: flex; flex-wrap: wrap; gap: 10px; }
#footer .site-footer__redes a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 17px;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
#footer .site-footer__redes a:hover,
#footer .site-footer__redes a:focus-visible {
    background: var(--footer-accent);
    color: #111;
    transform: translateY(-2px);
    text-decoration: none;
}

#footer .site-footer__contato { margin-top: 22px; display: grid; gap: 10px; font-size: 14px; }
#footer .site-footer__contato li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
#footer .site-footer__contato i { color: var(--footer-accent); margin-top: 4px; width: 16px; text-align: center; }
#footer .site-footer__contato a { color: inherit; overflow-wrap: anywhere; }
#footer .site-footer__contato a:hover { color: #fff; }

/* ---- Seções de links ---- */
#footer .site-footer__secao summary {
    list-style: none;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    color: var(--footer-titulo);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
#footer .site-footer__secao summary::-webkit-details-marker { display: none; }
#footer .site-footer__secao summary i { display: none; font-size: 12px; transition: transform .2s ease; }

#footer .site-footer__secao li a {
    display: inline-block;
    padding: 6px 0;
    color: var(--footer-texto);
    font-size: 15px;
    transition: color .2s ease, transform .2s ease;
}
#footer .site-footer__secao li a:hover,
#footer .site-footer__secao li a:focus-visible {
    color: var(--footer-accent);
    transform: translateX(4px);
    text-decoration: none;
}

/* ---- Instituições ---- */
#footer .site-footer__instituicoes {
    margin-top: 48px;
    padding: 22px 24px;
    border: 1px solid var(--footer-linha);
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
}
#footer .site-footer__instituicoes img { display: block; width: 100%; max-width: 980px; margin: 0 auto; height: auto; opacity: .9; }

/* ---- Barra inferior ---- */
#footer .site-footer__base { border-top: 1px solid var(--footer-linha); padding: 20px 0; font-size: 13.5px; }
#footer .site-footer__base .container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    align-items: center;
    justify-content: space-between;
}
#footer .site-footer__legal { display: flex; flex-wrap: wrap; gap: 6px 20px; }
#footer .site-footer__legal a { color: var(--footer-texto); }
#footer .site-footer__legal a:hover { color: var(--footer-accent); text-decoration: none; }

/* ---- Voltar ao topo ---- */
#footer #back-to-top .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    transition: transform .2s ease;
}
#footer #back-to-top .btn:hover,
#footer #back-to-top .btn:focus-visible { transform: translateY(-2px); }

#footer a:focus-visible { outline: 2px solid var(--footer-accent); outline-offset: 2px; border-radius: 3px; }

/* ---- Tablet ---- */
@media (max-width: 991.98px) {
    #footer .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
    #footer .site-footer__marca { grid-column: 1 / -1; }
}

/* ---- Mobile: acordeão ---- */
@media (max-width: 767.98px) {
    #footer .site-footer__main { padding: 44px 0 20px; }
    #footer .site-footer__grid { grid-template-columns: 1fr; gap: 0; }
    #footer .site-footer__marca { padding-bottom: 28px; text-align: center; }
    #footer .site-footer__desc { margin-left: auto; margin-right: auto; }
    #footer .site-footer__redes { justify-content: center; }
    #footer .site-footer__contato li { justify-content: center; text-align: left; }

    #footer .site-footer__secao { border-top: 1px solid var(--footer-linha); }
    #footer .site-footer__secao:last-of-type { border-bottom: 1px solid var(--footer-linha); }
    #footer .site-footer__secao summary {
        cursor: pointer;
        min-height: 56px;
        margin: 0;
    }
    #footer .site-footer__secao summary i { display: inline-block; }
    #footer .site-footer__secao[open] summary i { transform: rotate(180deg); }
    #footer .site-footer__secao ul { padding-bottom: 14px; }
    #footer .site-footer__secao li a { padding: 11px 0; font-size: 15.5px; } /* alvo de toque ~44px */

    #footer .site-footer__instituicoes { margin-top: 28px; padding: 16px 14px; }
    #footer .site-footer__base .container { flex-direction: column; align-items: flex-start; }
    #footer .site-footer__legal a { display: inline-block; padding: 6px 0; }
}

@media (prefers-reduced-motion: reduce) {
    #footer * { transition: none !important; }
}
