/* ==========================================================================
   BELARMINO MONTEIRO - CORE STYLESHEET (FOUNDATION)
   ==========================================================================
   Este arquivo contém a estrutura base, resets e utilitários compartilhados.
   As cores são controladas por variáveis CSS definidas nos arquivos de tema.
*/

/* --- 1. CONFIGURAÇÕES GLOBAIS --- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    --header-height: 85px; /* UX FIX: Altura ajustada para o novo cabeçalho compacto */
}

/* Ajuste de altura do cabeçalho para dispositivos móveis */
@media (max-width: 991px) {
    html {
        scroll-padding-top: 70px;
        --header-height: 65px; /* Altura reduzida para mobile */
    }
}

body {
    background-color: var(--color-background, #fff);
    color: var(--color-text, #333);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    width: 100%;
}

/* ==========================================================================
   SEM BARRAS DE ROLAGEM VISÍVEIS (mantém scroll funcional)
   ========================================================================== */
html, body {
    -ms-overflow-style: none; /* IE/Edge antigo */
    scrollbar-width: none;    /* Firefox */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

::selection {
    background: var(--color-primary, #b92027);
    color: #fff;
}

/* --- 2. BOOTSTRAP OVERRIDES --- */

.form-control:focus, 
.btn:focus, 
.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 185, 32, 39), 0.25);
    border-color: var(--color-primary, #b92027);
    outline: none;
}

@media (min-width: 1400px) {
    .container {
        max-width: 1280px;
    }
}

a {
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
}

/* --- 3. UTILITÁRIOS VISUAIS --- */

.img-cover { width: 100%; height: 100%; object-fit: cover; }
.img-contain { width: 100%; height: 100%; object-fit: contain; }
.section-padding { padding-top: 100px; padding-bottom: 100px; }
.fw-extra-bold { font-weight: 800; }
.text-justify { text-align: justify; }
.text-balance { text-wrap: balance; }

.glass-effect {
    background: var(--color-glass-bg, rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-glass-border, rgba(255, 255, 255, 0.5));
}

/* --- 4. ANIMAÇÕES GLOBAIS --- */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse-soft {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb, 185, 32, 39), 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(var(--color-primary-rgb, 185, 32, 39), 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb, 185, 32, 39), 0); }
}

/* --- ANIMAÇÕES DE SCROLL (REVEAL) --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

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

/* Delays opcionais para elementos em sequência */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* --- 5. COMPONENTES GENÉRICOS --- */

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--color-whatsapp, #25d366);
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: var(--color-whatsapp-hover, #20b358);
    color: #fff;
    transform: scale(1.1);
}

@media (max-width: 576px) {
    .whatsapp-float { bottom: 20px; right: 20px; width: 50px; height: 50px; font-size: 24px; }
}

#scrollToTop {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 9998;
    border: none;
    outline: none;
    background-color: rgba(0,0,0,0.5);
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: 0.3s;
}

#scrollToTop.show { visibility: visible; opacity: 1; }
#scrollToTop:hover { background-color: var(--color-primary, #333); }

/* --- 6. DARK MODE UTILS --- */

.bg-dark-mode-force {
    background-color: var(--color-dark-bg, #121212) !important;
    color: var(--color-dark-text, #e0e0e0) !important;
}

body.dark-mode .invert-on-dark {
    filter: invert(1) brightness(2);
}

@media only screen and (min-width: 2560px) {
    body { font-size: 22px !important; max-width: 2400px; margin: 0 auto; }
    .container { max-width: 2200px !important; }
    p { line-height: 1.8 !important; }
}

/* Novo utilitário para centralização de conteúdo */
.content-centered-wrapper {
    width: 100%;
    max-width: 1200px; /* Consistente com .contact-wrapper */
    margin: 0 auto; /* Centraliza horizontalmente */
    padding: 0 20px; /* Preenchimento lateral */
}

/* ==========================================================================
   7. SAFETY OVERRIDES (BLINDAGEM DE LAYOUT)
   ========================================================================== */

/* --- HEADER & LOGO --- */
.navbar-brand img {
    height: 55px !important; /* Altura fixa elegante */
    width: auto !important;
    max-width: 250px;
    object-fit: contain;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .navbar-brand img {
        height: 45px !important; /* Menor no mobile */
    }
}

.inner-header-universal {
    max-height: 450px; /* Impede header gigante em páginas internas */
}

/* --- SEÇÃO SOBRE (Imagens) --- */
.about-img-col {
    max-height: 800px; /* Limite para não esticar infinitamente */
}

/* --- SEÇÃO EQUIPE (Cards) --- */
.team-img-wrapper {
    max-height: 450px !important; /* Garante uniformidade nas fotos */
}
.team-img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* --- SEÇÃO MAPA --- */
.map-frame {
    max-height: 600px; /* Limite vertical para o mapa */
}

/* --- SEÇÃO CTA (Chamada para Ação) --- */
.cta-universal-wrapper {
    overflow: hidden; /* Impede scroll horizontal causado por decorações */
}

/* Correção para evitar quebra de layout no iPhone SE/Small */
@media (max-width: 375px) {
    .hero-title { font-size: 2.5rem !important; }
    .btn-luxury { padding: 15px 30px !important; }
}

/* ==========================================================================
   8. UI ENHANCEMENTS (NAVBAR & HOME)
   ========================================================================== */

/* Ajuste para a Home Page começar abaixo da Navbar Fixa */
.home-page-container {
    /* REMOVIDO: padding-top removido para vídeo iniciar imediatamente após o header */
    padding-top: 0 !important;
    margin-top: 0 !important;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   9. AREAS CAROUSEL (3D CARDS) - IMAGENS E EFEITOS
   ========================================================================== */

.area-card-3d {
    position: relative;
    display: block;
    width: 100%;
    height: 100%; /* Garante que o card ocupe o slide */
    min-height: 400px; /* Altura mínima para garantir visualização */
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background-color: #000; /* Fundo base */
    transform: translateZ(0); /* Aceleração de hardware */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Efeito de Glare (Brilho/Profundidade) */
.area-card-3d::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Gradiente radial simulando luz vindo de cima */
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1; /* Acima do BG, abaixo do conteúdo */
    pointer-events: none;
}
.area-card-3d:hover::before { opacity: 1; }

.area-card-3d .card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%); /* Preto e branco por padrão */
    transition: filter 0.5s ease, transform 0.5s ease;
    z-index: 0;
    opacity: 0.7; /* Leve escurecimento para contraste do texto */
}

.area-card-3d:hover .card-bg {
    filter: grayscale(0%); /* Colorido no hover */
    transform: scale(1.1); /* Leve zoom (escalável) */
    opacity: 1;
}

.area-card-3d .card-content {
    position: relative;
    z-index: 2; /* Garante que texto fique acima do Glare */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
}

.area-card-3d .area-icon {
    font-size: 2.5rem;
    color: var(--color-primary, #b92027);
    margin-bottom: 1rem;
}

.area-card-3d .area-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.area-card-3d .area-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.5;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Mapeamento de Imagens por Área (Baseado no HREF) */
a.area-card-3d[href*="consumidor"] .card-bg { background-image: url('../images/direito-do-consumidor.jpg'); }
a.area-card-3d[href*="familia"] .card-bg { background-image: url('../images/Direito Familia.jpeg'); }
a.area-card-3d[href*="civil"] .card-bg { background-image: url('../images/Direito Civil.png'); }
a.area-card-3d[href*="previdenciario"] .card-bg { background-image: url('../images/Direito Previdenciario.jpeg'); }

/* ==========================================================================
   10. SEÇÃO NOSSA HISTÓRIA (STORYTELLING VISUAL)
   ========================================================================== */

.about-universal-wrapper {
    padding: 120px 0;
    background-color: var(--color-background, #fff);
    position: relative;
}

.about-content-col {
    padding-right: 3rem;
}

.about-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-primary, #b92027);
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
}

.about-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: var(--color-text, #333);
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-secondary, #666);
    margin-bottom: 2rem;
    text-align: justify;
}

.about-img-frame {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    transform: rotate(2deg); /* Toque artístico sutil */
    transition: transform 0.5s ease;
}

.about-img-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.about-img-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   11. HISTORY SECTION REDESIGN (PREMIUM ANCHORED LOOK)
   ========================================================================== */

.history-composition {
    position: relative;
    padding: 30px;
    z-index: 1;
}

/* Elemento Decorativo de Fundo (Shape Geométrico) */
.history-composition::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 75%;
    height: 95%;
    background: linear-gradient(135deg, rgba(185, 32, 39, 0.08) 0%, rgba(185, 32, 39, 0.02) 100%);
    border-radius: 30px 0 30px 0;
    z-index: -1;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(185, 32, 39, 0.05);
}

/* Padrão de Pontos (Dots Texture) para textura */
.history-composition::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(var(--color-primary, #b92027) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: 0.15;
    z-index: -1;
}

.history-composition:hover::before {
    transform: scale(1.03) translate(-5px, -5px);
    background: linear-gradient(135deg, rgba(185, 32, 39, 0.12) 0%, rgba(185, 32, 39, 0.05) 100%);
}

/* Moldura da Imagem (Frame) - Versão Harmônica e Interativa */
.history-img-frame {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: translateX(15px) translateY(15px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: #fff;
    border: 4px solid #fff;
    max-width: 100%;
    max-height: 550px; /* Aumentado de 450px para 550px */
    width: auto;
    display: inline-block;
}

/* Efeito de mudança de cor de fundo ao passar o mouse - Cor escura similar à seção de áreas */
.history-img-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #1a1a1a; /* Cor escura similar à seção de áreas de atuação */
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    border-radius: 16px;
    pointer-events: none;
}

.history-composition:hover .history-img-frame::before {
    opacity: 0.3; /* Fundo escuro mais sutil para manter a foto visível */
}

.history-composition:hover .history-img-frame {
    transform: translateX(10px) translateY(10px) scale(1.02);
    box-shadow: 0 35px 70px -15px rgba(185, 32, 39, 0.2);
    border-color: rgba(185, 32, 39, 0.2);
}

.history-img-frame img {
    width: 100%;
    height: auto;
    max-height: 550px; /* Aumentado de 500px para 550px */
    object-fit: contain;
    display: block;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), filter 0.6s ease;
    position: relative;
    z-index: 0;
    filter: brightness(1) contrast(1);
}

.history-composition:hover .history-img-frame img {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.1); /* Mais brilhante para compensar o overlay escuro */
}

/* Badge Flutuante de Autoridade */
.history-badge {
    position: absolute;
    bottom: 45px;
    left: -10px;
    background: var(--color-background, #fff);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    z-index: 2;
    border-left: 4px solid var(--color-primary, #b92027);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: floatBadge 4s ease-in-out infinite alternate;
}

@keyframes floatBadge {
    from { transform: translateY(0); }
    to { transform: translateY(-6px); }
}