/* ------------------------------------------------------------------
   Polimentos visuais — transições, hover, focus, font smoothing.
   Não altera cores nem layout, apenas dá uma sensação mais fluida.
------------------------------------------------------------------ */

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

a,
button,
input[type="submit"],
input[type="text"],
input[type="search"] {
    transition: color 0.2s ease,
                background-color 0.2s ease,
                border-color 0.2s ease,
                opacity 0.2s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease;
}

a:hover img {
    opacity: 0.88;
}

/* Acessibilidade: foco visível para teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* Click feedback */
button:active,
input[type="submit"]:active,
.navbar-toggle:active {
    transform: scale(0.97);
}

/* Cursor padrão para botões */
button,
input[type="submit"],
.navbar-toggle {
    cursor: pointer;
}

/* ----- Header ----- */
header .logo a {
    display: inline-block;
}

header .logo a:hover img {
    opacity: 0.9;
    transform: translateY(-1px);
}

#nav-desktop a,
#nav-mobile a {
    transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

/* Submenu — pequeno fade-in (mantém comportamento de display existente) */
#nav-desktop .submenu {
    animation: sethosuFadeIn 0.18s ease-out;
}

@keyframes sethosuFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search input — foco com glow sutil */
#searchform input[type="text"]:focus,
#s:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* ----- Footer ----- */
footer .midias-sociais a,
footer .parceiros a,
footer .logo a {
    display: inline-block;
}

footer .midias-sociais a:hover,
footer .parceiros a:hover {
    transform: translateY(-3px);
    opacity: 0.88;
}

footer .logo a:hover img {
    opacity: 0.92;
}

/* Selo "Developed by" no rodapé */
.div-finer .thumb-wrapper a img {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.div-finer .thumb-wrapper a:hover img {
    transform: scale(1.06);
    opacity: 0.95;
}

/* Mapa do rodapé */
#mapa iframe {
    transition: filter 0.4s ease;
}

#mapa:hover iframe {
    filter: saturate(1.1);
}

/* ----- Imagens em conteúdo ----- */
article img,
.entry-content img,
.thumb img {
    transition: transform 0.35s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}

a:hover article img,
.thumb a:hover img {
    transform: scale(1.02);
}

/* Seleção de texto */
::selection {
    background-color: rgba(0, 0, 0, 0.12);
}

/* Scrollbar mais limpa (apenas WebKit) */
@media (pointer: fine) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    ::-webkit-scrollbar-track {
        background: transparent;
    }
    ::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.35);
    }
}

/* Reduz movimento para quem prefere */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =================================================================
   POLIMENTOS NOTÁVEIS — efeitos mais perceptíveis
================================================================== */

/* ----- Header sticky com sombra ao rolar ----- */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    will-change: box-shadow;
}

header.is-scrolled {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

/* ----- Underline animado no menu desktop ----- */
#nav-desktop > ul > li {
    position: relative;
}

#nav-desktop > ul > li > a {
    position: relative;
    display: inline-block;
}

#nav-desktop > ul > li > a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.28s ease, left 0.28s ease;
}

#nav-desktop > ul > li:hover > a::after,
#nav-desktop > ul > li > a:focus-visible::after {
    width: 100%;
    left: 0;
}

/* ----- Submenu slide-in vindo de cima ----- */
#nav-desktop .submenu {
    transform-origin: top center;
    animation: sethosuSlideDown 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
}

@keyframes sethosuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#nav-desktop .submenu li a {
    position: relative;
    overflow: hidden;
}

#nav-desktop .submenu li a::before {
    content: "";
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.05);
    transition: left 0.3s ease;
    z-index: -1;
}

#nav-desktop .submenu li a:hover::before {
    left: 0;
}

/* ----- Hambúrguer mobile vira X quando aberto ----- */
.navbar-toggle {
    transition: transform 0.3s ease;
}

.navbar-toggle .icon-bar {
    transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55),
                opacity 0.25s ease,
                background-color 0.2s ease;
    transform-origin: center;
}

.navbar-toggle:not(.collapsed) .icon-bar:nth-child(2) {
    transform: translateY(7px) rotate(45deg);
}

.navbar-toggle:not(.collapsed) .icon-bar:nth-child(3) {
    opacity: 0;
    transform: scale(0);
}

.navbar-toggle:not(.collapsed) .icon-bar:nth-child(4) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ----- Logo do header com efeito flutuante ----- */
header .logo a {
    position: relative;
}

header .logo a::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 60%;
    height: 8px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.12) 0%, transparent 70%);
    transition: transform 0.3s ease;
    pointer-events: none;
}

header .logo a:hover::after {
    transform: translateX(-50%) scale(1);
}

header .logo a:hover img {
    transform: translateY(-2px) scale(1.02);
}

/* ----- Search input expande no foco ----- */
#searchform {
    position: relative;
}

#searchform input[type="text"],
#s {
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

#searchform input[type="text"]:focus,
#s:focus {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* ----- Botão voltar ao topo ----- */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: opacity 0.3s ease,
                transform 0.3s ease,
                background-color 0.25s ease,
                box-shadow 0.25s ease;
    z-index: 999;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.back-to-top:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    color: #fff;
}

.back-to-top svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* ----- Cards / thumbs com lift + sombra modern ----- */
.thumb,
.noticia,
.convenio,
.parceiros a,
#footer .div-finer {
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.thumb:hover,
.noticia:hover,
.convenio:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1),
                0 6px 12px rgba(0, 0, 0, 0.06);
}

/* ----- Imagens em conteúdo com hover zoom + sombra ----- */
.entry-content figure,
article figure,
.thumb {
    overflow: hidden;
    border-radius: 4px;
}

.entry-content figure img,
article figure img,
.thumb img {
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.entry-content figure:hover img,
article figure:hover img,
.thumb:hover img {
    transform: scale(1.06);
}

/* ----- Mídias sociais — efeito círculo de luz ----- */
footer .midias-sociais a {
    position: relative;
    overflow: visible;
}

footer .midias-sociais a::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

footer .midias-sociais a:hover::before {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 1;
}

footer .midias-sociais a:hover {
    transform: translateY(-4px) scale(1.08);
}

/* ----- Mapa do rodapé com transformação suave ao entrar na visão ----- */
#mapa {
    overflow: hidden;
    position: relative;
}

#mapa::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.04) 100%);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#mapa:hover::after {
    opacity: 0.5;
}

/* ----- Animação de entrada do header content (uma vez ao carregar) ----- */
@keyframes sethosuFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header .bg-header > div {
    animation: sethosuFadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

header .bg-header > div:nth-child(1) {
    animation-delay: 0.05s;
}
header .bg-header > div:nth-child(2) {
    animation-delay: 0.15s;
}
header .bg-header > div:nth-child(3) {
    animation-delay: 0.25s;
}

#nav-desktop {
    animation: sethosuFadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s both;
}

/* ----- Footer slide-up subtle ----- */
#footer .container > div {
    animation: sethosuFadeUp 0.7s ease 0.1s both;
}

#footer .container > div:nth-child(2) {
    animation-delay: 0.2s;
}
#footer .container > div:nth-child(3) {
    animation-delay: 0.3s;
}

/* ----- Scrollbar reforçada ----- */
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.35));
    border-radius: 8px;
}

/* =================================================================
   MUDANÇAS OUSADAS — alto impacto visual
================================================================== */

/* ----- Barra de progresso de scroll no topo ----- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #6BA833, #92c84e, #6BA833);
    background-size: 200% 100%;
    animation: sethosuShimmer 3s linear infinite;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(107, 168, 51, 0.5);
    transition: width 0.05s linear;
    pointer-events: none;
}

@keyframes sethosuShimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* ----- Reveal-on-scroll ----- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.45s; }
.reveal-stagger > *:nth-child(n+6) { transition-delay: 0.5s; }

/* ----- Overlay em imagens de figure/thumb ----- */
.entry-content figure,
article figure,
.thumb {
    position: relative;
    isolation: isolate;
}

.entry-content figure::after,
article figure::after,
.thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
                rgba(0, 0, 0, 0) 50%,
                rgba(0, 0, 0, 0.55) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
}

.entry-content figure:hover::after,
article figure:hover::after,
.thumb:hover::after {
    opacity: 1;
}

/* ----- Mobile menu como overlay fullscreen ----- */
@media (max-width: 991px) {
    #nav-mobile #navbarCollapse.collapse.in,
    #nav-mobile #navbarCollapse.collapsing {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh !important;
        max-height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        z-index: 9998;
        padding: 80px 24px 24px;
        overflow-y: auto;
        animation: sethosuFadeIn 0.25s ease;
    }

    #nav-mobile #navbarCollapse ul {
        list-style: none;
        padding: 0;
        margin: 0;
        text-align: center;
    }

    #nav-mobile #navbarCollapse ul li {
        opacity: 0;
        transform: translateY(20px);
        animation: sethosuFadeUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }

    #nav-mobile #navbarCollapse.in ul li:nth-child(1) { animation-delay: 0.05s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(2) { animation-delay: 0.10s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(3) { animation-delay: 0.15s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(4) { animation-delay: 0.20s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(5) { animation-delay: 0.25s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(6) { animation-delay: 0.30s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(7) { animation-delay: 0.35s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(8) { animation-delay: 0.40s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(9) { animation-delay: 0.45s; }
    #nav-mobile #navbarCollapse.in ul li:nth-child(n+10) { animation-delay: 0.5s; }

    #nav-mobile #navbarCollapse ul li a {
        display: block;
        padding: 16px 12px;
        font-size: 18px;
        font-weight: 500;
        letter-spacing: 0.5px;
        text-decoration: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        transition: color 0.2s ease, transform 0.2s ease, padding 0.25s ease;
    }

    #nav-mobile #navbarCollapse ul li a:hover,
    #nav-mobile #navbarCollapse ul li a:focus {
        transform: translateX(8px);
        color: #6BA833;
    }

    .navbar-toggle {
        position: relative;
        z-index: 9999;
    }
}

/* ----- Cards/imagens ganham borda inferior animada estilo "tape" ----- */
.thumb,
.noticia {
    position: relative;
}

.thumb::before,
.noticia::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #6BA833, #92c84e);
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 2;
}

.thumb:hover::before,
.noticia:hover::before {
    width: 100%;
}

/* ----- Header decoration: linha verde animada na borda inferior ----- */
header.is-scrolled::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
                transparent,
                rgba(107, 168, 51, 0.6),
                transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    animation: sethosuShine 3s ease-in-out infinite;
}

@keyframes sethosuShine {
    0%, 100% { background-position: -100% 0; }
    50% { background-position: 200% 0; }
}

/* ----- Tipografia mais marcante em headings ----- */
h1, h2, h3 {
    letter-spacing: -0.01em;
}

h2.section-title,
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

h2.section-title::after,
.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #6BA833, #92c84e);
    border-radius: 2px;
    transition: width 0.4s ease;
}

h2.section-title:hover::after,
.section-title:hover::after {
    width: 100%;
}
