/* 
 * Modern Institutional Layout (Overrides for Abrace Esperança style)
 */

:root {
    /* Modern Colors Override */
    --color-green: #2B7A5C;
    --color-green-dark: #1E5C44;
    --color-yellow: #FFC107;
    --bg-dark: #1A1D20;
    --bg-light: #f8fafc;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* 1. Header & Topbar */
.modern-topbar {
    background: var(--bg-dark);
    color: var(--color-white);
    padding: 8px 0;
    font-size: 0.85rem;
}
.topbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.topbar-left a, .topbar-right a {
    color: var(--color-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-associado {
    background: var(--color-yellow);
    color: var(--text-dark) !important;
    font-weight: 700;
    padding: 6px 15px;
    border-radius: 20px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.site-header {
    border-top: none;
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.header-main-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}
.header-main-area .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    width: 100%;
}
.site-branding {
    flex-direction: row;
    gap: 15px;
}
.main-navigation {
    flex: unset;
}
.classic-nav a {
    color: var(--text-dark);
    font-weight: 600;
    font-family: var(--font-heading);
}
.classic-nav a:hover {
    color: var(--color-green);
}

/* Custom Logo - Quadrado Sobreposto */
.site-branding {
    min-width: 140px; /* Espaçador para o logo absoluto */
    min-height: 80px; /* Altura minima para alinhar o menu */
    display: flex;
    align-items: center;
}

.header-logo-wrapper {
    position: absolute;
    top: 10px; /* Desce um pouco a partir do topo do menu */
    left: 15px; /* Alinha à esquerda na margem do container */
    z-index: 1050; /* Garante que fique sobre o slider (que é z-index menor) */
    background: var(--bg-white);
    padding: 10px;
    border-radius: 12px; /* Cantos arredondados no quadrado */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* Sombra elegante */
    border-bottom: 4px solid var(--color-green); /* Detalhe da marca */
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-wrapper .custom-logo-link {
    display: block;
    transition: transform 0.3s;
}

.header-logo-wrapper .custom-logo-link:hover {
    transform: scale(1.05);
}

.header-logo-wrapper img {
    height: 120px;
    width: 120px;
    object-fit: contain;
}

/* 2. Full-Width Sections */
.section-full {
    width: 100%;
    padding: var(--space-xl) 0;
}
.section-light {
    background: var(--bg-light);
}
.section-white {
    background: var(--bg-white);
}
.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
}

/* Hero Slider Section */
.modern-hero {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modern-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); /* Escurece imagem para leitura */
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 20px;
}
.hero-content h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.btn-hero {
    background: var(--color-green);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
    transition: background 0.3s;
}
.btn-hero:hover {
    background: var(--color-green-dark);
}

/* 3. Grid Moderno (3 Colunas) */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.modern-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}
.modern-card:hover {
    transform: translateY(-5px);
}
.modern-card > a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.modern-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.modern-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.modern-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}
.modern-card-date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}
.btn-outline {
    display: inline-block;
    border: 2px solid var(--color-green);
    color: var(--color-green);
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: auto; /* Alinha o botão na base do card */
    align-self: flex-start;
}
.btn-outline:hover {
    background: var(--color-green);
    color: white;
}

/* Publicacoes Adjustments */
.pub-card-img {
    width: 100%;
    aspect-ratio: 3/4;
    height: auto !important;
    object-fit: cover;
    background-color: #f8fafc;
    padding: 0;
    display: block;
}

/* 4. Quem Somos */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* 5. Footer Moderno */
.modern-footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 0 20px;
}
.footer-modern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}
.footer-col h4 {
    color: var(--color-white);
    font-family: var(--font-heading);
    margin-bottom: 20px;
    font-size: 1.2rem;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s;
}
.footer-col ul li a:hover {
    color: var(--color-green-light);
}

/* Custom Grids Desktop */
@media (min-width: 993px) {
    .eventos-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .eventos-grid > div:nth-child(4) {
        display: none !important; /* Esconde o 4º bloco no desktop para manter 3 colunas e 1 linha */
    }
    .obras-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Mobile Responsiveness — Comprehensive */

/* ---- Large Tablets (≤992px) ---- */
@media (max-width: 992px) {
    .modern-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .footer-modern-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .topbar-container {
        flex-direction: column;
        gap: 8px;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-slider-container {
        height: 50vh !important;
        min-height: 300px !important;
    }
}

/* ---- Tablets & Phones (≤768px) ---- */
@media (max-width: 768px) {
    .modern-topbar {
        display: none !important;
    }

    .modern-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .modern-grid.eventos-grid,
    .modern-grid.obras-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .footer-modern-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Centraliza o Menu e ajusta Logo no Mobile */
    .header-main-area .container {
        justify-content: center;
    }

    .site-branding {
        min-width: unset;
        min-height: unset;
        order: 2; /* Move the logo between the toggle and whatever else */
    }

    .header-logo-wrapper {
        position: relative;
        top: auto;
        left: auto;
        margin: 0 auto;
        margin-bottom: -40px; /* Sobrepõe o slider abaixo */
        padding: 8px;
        border-radius: 10px;
    }

    .header-logo-wrapper img {
        height: 80px;
        width: 80px;
    }

    /* Posição fixa do botão hambúrguer à esquerda */
    .menu-toggle {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
    }

    .header-main-area {
        gap: 0;
        padding-bottom: 0; /* Remove padding inferior extra para a sobreposição funcionar */
    }

    .header-main-area .container {
        gap: 10px;
        position: relative;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content {
        padding: 15px;
    }

    .btn-hero {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .hero-slider-container {
        height: 40vh !important;
        min-height: 250px !important;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-full {
        padding: var(--space-md, 2rem) 0;
    }

    .about-text p {
        font-size: 1rem;
    }

    .modern-card-img {
        height: 180px;
    }

    .pub-card-img {
        height: auto !important;
    }

    /* Slider Nav Buttons */
    .slider-prev,
    .slider-next {
        padding: 10px 14px !important;
        font-size: 1.2rem !important;
    }
}

/* ---- Small Phones (≤576px) ---- */
@media (max-width: 576px) {
    .section-title {
        font-size: 1.3rem;
    }

    .hero-slider-container {
        height: 35vh !important;
        min-height: 220px !important;
    }

    .hero-content h2 {
        font-size: 1.3rem;
    }

    .modern-card-body {
        padding: 15px;
    }

    .modern-card-title {
        font-size: 1rem;
    }

    .footer-col h4 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .btn-associado {
        font-size: 0.65rem;
        padding: 4px 10px;
    }
}

/* Download Button Fix */
.btn-download {
    background: var(--color-green);
    color: white !important;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    border: none;
}
.btn-download:hover {
    background: var(--color-green-dark);
    color: white !important;
}
.btn-download:visited {
    color: white !important;
}
