/* ====================================
   CORE COMPONENT STYLES
   (Botões, Navegação, Cards Genéricos, Footer, etc.)
   ==================================== */

/* Header Components */
.navbar {
    background-color: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-dark);
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--accent-color);
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    background-color: var(--accent-color);
    border-color: var(--accent-hover);
}

/* Button Components */
.btn-primary-custom {
    background-color: var(--accent-color);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
    background-color: #e5484d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 90, 95, 0.3);
}

.btn-hero {
    background-color: var(--accent-color);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    margin: 0.5rem;
    transition: all 0.3s ease;
}

.btn-hero:hover,
.btn-hero:focus {
    background-color: #e5484d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 90, 95, 0.4);
    color: white;
}

.btn-hero-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-hero-secondary:hover,
.btn-hero-secondary:focus {
    background-color: white;
    color: var(--primary-color);
}

/* Hero Components (conteúdo) */
.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Service Card Components */
.service-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color), #ff7a7f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.service-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Featured Card Components (genérico) */
.featured-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}

.featured-image {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.featured-content {
    padding: 2rem;
}

.featured-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.featured-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.rating {
    color: #ffa500;
    margin-bottom: 1rem;
}

/* CTA Components */
.cta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer Components */
.footer h5 {
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer ul li a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer ul li a:hover,
.footer ul li a:focus {
    color: white;
}

.social-links a {
    color: #a0aec0;
    font-size: 1.5rem;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.social-links a:hover,
.social-links a:focus {
    color: var(--accent-color);
}

/* Loading States (Global) */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn-loading {
    cursor: not-allowed;
    opacity: 0.8;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ====================================
   FIX PARA GALERIAS V2 (FOCO NA NITIDEZ)
   ==================================== */

/* Container principal da galeria */
.post-content .wp-block-gallery,
.post-content .gallery {
    display: grid;
    gap: 0.75rem; /* Espaçamento entre as imagens */
    margin-bottom: 2rem;
}

/* Define o número de colunas para a galeria */
.post-content .gallery-columns-2, .post-content .wp-block-gallery.columns-2 { grid-template-columns: repeat(2, 1fr); }
.post-content .gallery-columns-3, .post-content .wp-block-gallery.columns-3 { grid-template-columns: repeat(3, 1fr); }
.post-content .gallery-columns-4, .post-content .wp-block-gallery.columns-4 { grid-template-columns: repeat(4, 1fr); }
/* Adicione mais colunas se precisar (ex: repeat(5, 1fr)) */

/* Item individual da galeria */
.post-content .blocks-gallery-item,
.post-content .gallery-item {
    margin: 0 !important;
    padding: 0 !important;
}

.post-content .blocks-gallery-item figure,
.post-content .gallery-item figure {
    margin: 0 !important;
    height: 100%;
}

/* A MÁGICA ACONTECE AQUI */
.post-content .blocks-gallery-item img,
.post-content .gallery-item img {
    display: block;
    height: 100%;       /* Força a imagem a ocupar toda a altura do container */
    width: 100%;        /* Força a imagem a ocupar toda a largura do container */
    object-fit: cover;  /* Garante que a imagem cubra o espaço sem distorcer, cortando o excesso */
    aspect-ratio: 1/1;  /* FORÇA A IMAGEM A SER UM QUADRADO PERFEITO (MUDE SE QUISER OUTRO FORMATO, ex: 16/9) */
    border-radius: 8px;
    max-width: 100% !important; /* Sobrescreve outras regras de max-width */
}

/* Legendas */
.post-content .gallery-caption,
.post-content .blocks-gallery-item figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
    padding-top: 0.5rem;
}

/* Ajustes para mobile (colunas) */
@media (max-width: 576px) {
    /* Força 2 colunas no mobile para não ficar muito pequeno */
    .post-content .gallery-columns-3, .post-content .wp-block-gallery.columns-3,
    .post-content .gallery-columns-4, .post-content .wp-block-gallery.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ====================================
   AJUSTE FORÇADO P/ LARGURA DO SUBMENU (v2)
   ==================================== */

.navbar-expand-lg .navbar-nav .dropdown-menu {
    /* Força o submenu a se ajustar à largura do maior item */
    width: max-content;
    
    /* Garante que o submenu não seja menor que o seu "botão" pai */
    min-width: 100%; 
    
    /* Remove qualquer limite máximo de largura que possa estar vindo de outra regra */
    max-width: none; 
}

.navbar-nav .dropdown-item {
    /* Garante que o texto não quebre a linha */
    white-space: nowrap;
}

/* ====================================
   HOME FEATURED POSTS SECTION - ALINHAMENTO COM GRID
   ==================================== */

.home-featured-posts {
    background-color: #f8f9fa;
    background-image: radial-gradient(circle, #dddddd 1px, rgba(0, 0, 0, 0) 1px);
    background-size: 5px 5px;
}

.home-featured-posts a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.home-featured-posts article {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.home-featured-posts article:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

/* --- Estilos Genéricos para o Efeito de Sobreposição --- */

.post-card-overlay .image-overlay-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    height: 100%;
}

.post-card-overlay .image-overlay-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.post-card-overlay:hover .image-overlay-container img {
    transform: scale(1.05);
}

.post-card-overlay .overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.post-card-overlay .overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.25rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

/* --- NOVO: Lógica de Alinhamento com Grid --- */

/* A coluna da esquerda agora estica para preencher a altura disponível */
.noticia-macro {
    display: flex;
    flex-direction: column;
}

/* A coluna da direita se torna um container grid */
.featured-grid-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colunas de largura igual */
    grid-template-rows: repeat(2, 1fr);    /* 2 linhas de altura igual */
    gap: 1.5rem; /* Espaçamento entre os cards, substitui o mb-4 */
}

/* As alturas fixas foram removidas, pois o grid agora controla isso */
.noticia-macro .overlay-content h2 {
    font-size: 1.8rem;
    line-height: 1.3;
}

.noticia-micro .overlay-content h3 {
    font-size: 1.1rem;
    line-height: 1.4;
}

/* --- FIM DA NOVA LÓGICA --- */


/* Ajustes Responsivos */
@media (max-width: 991.98px) {
    /* Em telas de tablet e mobile, o grid da direita é desativado para que os posts fiquem um abaixo do outro */
    .featured-grid-right {
        display: block;
    }
    .featured-grid-right > div {
        margin-bottom: 1.5rem; /* Adiciona a margem de volta para mobile */
    }
}

/* --- Tamanhos Específicos para Alinhamento e Destaque --- */

/* Destaque Principal */
.noticia-macro .image-overlay-container {
    /* Define uma altura mínima de 75% da altura da tela */
    min-height: 55vh; 
}

/* O título pode ser um pouco maior para preencher o espaço */
.noticia-macro .overlay-content h2 {
    font-size: 2.2rem; /* Aumentamos um pouco o título */
    line-height: 1.3;
}

/* A coluna da direita se torna um container grid */
.featured-grid-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Destaques Secundários */
.noticia-micro .overlay-content h3 {
    font-size: 1.1rem;
    line-height: 1.4;
}


/* --- Ajustes Responsivos --- */
@media (max-width: 991.98px) {
    /* Em telas menores, diminuímos a altura do banner principal para não ocupar a tela inteira */
    .noticia-macro .image-overlay-container {
        min-height: 50vh; 
    }

    .noticia-macro .overlay-content h2 {
        font-size: 1.8rem;
    }
    
    .featured-grid-right {
        display: block;
    }
    .featured-grid-right > div {
        margin-bottom: 1.5rem;
    }
}

/* ====================================
   FORMULÁRIO DE BUSCA PROFISSIONAL (HOME)
   ==================================== */

.form-section-professional {
    background-color: var(--secondary-color);
    color: white;
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section-professional h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-section-professional p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

/* Esconde as labels visualmente, mas as mantém para leitores de tela */
.form-section-professional .visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.form-section-professional .wpcf7-form .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1rem;
    height: 100%; /* Garante que todos os inputs tenham a mesma altura */
}

.form-section-professional .wpcf7-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-section-professional .wpcf7-form input[type="submit"] {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 100%;
    height: 100%; /* Garante que o botão tenha a mesma altura dos inputs */
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-section-professional .wpcf7-form input[type="submit"]:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

