/* ========================================
   Observatorio das Vacinas - Custom Styles
   Cores: Azul petroleo #1B3A5C, Laranja #E87722, Verde #6EB5A0
   ======================================== */

:root {
    --primary: #1B3A5C;
    --primary-light: #2A4F7A;
    --primary-dark: #0F2440;
    --accent: #4A7FB5;
    --accent-orange: #E87722;
    --accent-green: #6EB5A0;
    --accent-lavender: #8B9DC3;
    --accent-purple: #9B59B6;
    --bg-light: #F8F9FA;
    --bg-warm: #F0EDE8;
    --text-dark: #2D3748;
    --text-muted: #6C757D;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* ===== Base ===== */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
}

/* ===== Header / Navbar ===== */
.site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--white) !important;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent) 0%, #6BB8D9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.brand-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.6rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--white) !important;
    background: rgba(255,255,255,0.1);
}

.dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 220px;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

/* ===== Hero Carousel ===== */
.hero-carousel {
    position: relative;
}

.carousel-item {
    min-height: 480px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
}

.carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
}

.carousel-caption {
    position: relative;
    z-index: 2;
    text-align: left;
    padding: 3rem 2rem;
    max-width: 700px;
}

.carousel-caption h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.carousel-caption p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.btn-carousel {
    background: var(--accent-orange);
    color: white;
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232,119,34,0.4);
}

.btn-carousel:hover {
    background: #D4691A;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232,119,34,0.5);
    color: white;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    backdrop-filter: blur(4px);
}

.carousel-indicators button {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.4) !important;
    border: none !important;
    margin: 0 6px !important;
}

.carousel-indicators button.active {
    background: white !important;
    width: 30px !important;
    border-radius: 5px !important;
}

/* ===== Category Badges ===== */
.badge-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-destaques { background: rgba(232,119,34,0.85); color: #fff; }
.badge-eventos { background: rgba(110,181,160,0.85); color: #fff; }
.badge-observatorio-na-midia { background: rgba(138,157,195,0.85); color: #fff; }
.badge-videos { background: rgba(74,127,181,0.85); color: #fff; }
.badge-publicacoes { background: rgba(155,89,182,0.85); color: #fff; }
.badge-metodos { background: rgba(26,188,156,0.85); color: #fff; }
.badge-sem-categoria { background: rgba(149,165,166,0.85); color: #fff; }

/* ===== Cards ===== */
.card-post {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    height: 100%;
}

.card-post:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card-post .card-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.card-post .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-post:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-post .card-body {
    padding: 1.5rem;
}

.card-post .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.card-post .card-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.card-post .card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Section Headers ===== */
.section-header {
    margin-bottom: 2.5rem;
    position: relative;
}

.section-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--accent-orange);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* ===== Page Header ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-header h1 {
    color: white;
    font-weight: 700;
    font-size: 2.2rem;
    position: relative;
    z-index: 1;
}

.page-header p {
    color: rgba(255,255,255,0.8);
    position: relative;
    z-index: 1;
}

/* ===== Post Detail ===== */
.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: var(--primary);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===== Map Containers ===== */
.map-container {
    width: 100%;
    height: 600px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.map-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
}

/* ===== Team Members ===== */
.team-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    height: 100%;
}

.team-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.team-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 4px solid var(--white);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.team-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.team-role {
    font-size: 0.85rem;
    color: var(--accent-orange);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.team-institution {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== FAQ Accordion ===== */
.accordion-item {
    border: none;
    border-radius: var(--radius-md) !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--white);
}

.accordion-button {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--white);
    border: none;
}

.accordion-button:not(.collapsed) {
    background: var(--bg-light);
    color: var(--primary);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: none;
}

/* ===== Contact Form ===== */
.form-control {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.25s;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,127,181,0.15);
}

.btn-primary-custom {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    color: white;
}

/* ===== Video Cards ===== */
.video-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: var(--white);
}

.video-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== Partners / Supporters ===== */
.partners-bar {
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 2rem 0;
    margin: 2rem 0;
}

.partners-title {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1.25rem;
}

.partners-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.75rem;
}

.partners-logos img {
    max-height: 42px;
    width: auto;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
    filter: brightness(0) invert(1);
}

.partners-logos img:hover {
    opacity: 1;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .partners-logos {
        gap: 1.25rem;
    }
    .partners-logos img {
        max-height: 34px;
    }
}

/* ===== Footer ===== */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    padding: 3rem 0 1.5rem;
}

.site-footer h5 {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.site-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 2rem;
    padding-top: 1.5rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
}

/* ===== Pagination ===== */
.pagination .page-link {
    border: none;
    color: var(--primary);
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    margin: 0 2px;
}

.pagination .page-link:hover {
    background: var(--bg-light);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: white;
}

/* ===== Search Bar ===== */
.search-bar {
    position: relative;
}

.search-bar input {
    padding-left: 2.5rem;
    border-radius: 50px;
    border: 2px solid var(--border);
}

.search-bar .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ===== Quick Links Section ===== */
.quick-links {
    background: var(--bg-light);
    padding: 3rem 0;
}

.quick-link-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    height: 100%;
    text-decoration: none;
    color: var(--text-dark);
}

.quick-link-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    color: var(--primary);
    text-decoration: none;
}

.quick-link-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.quick-link-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.quick-link-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Stats / Info Bar ===== */
.info-bar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 2.5rem 0;
    color: white;
}

.info-bar .stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    display: block;
}

.info-bar .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .carousel-item {
        min-height: 350px;
    }

    .carousel-caption h2 {
        font-size: 1.4rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }

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

    .page-header h1 {
        font-size: 1.6rem;
    }

    .map-container {
        height: 400px;
    }
}

/* ===== Utilities ===== */
.bg-warm { background-color: var(--bg-warm) !important; }
.text-primary { color: var(--primary) !important; }
.gap-4 { gap: 1.5rem !important; }
.py-section { padding-top: 4rem; padding-bottom: 4rem; }

/* ===== Fixes applied to WP Theme ===== */

/* ===== Navbar Brand Logo ===== */
.brand-logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(1px 1px 0 #fff) drop-shadow(-1px -1px 0 #fff) drop-shadow(1px -1px 0 #fff) drop-shadow(-1px 1px 0 #fff);
}

/* ===== Dropdown text fix (dark text on white background) ===== */
.dropdown-menu .dropdown-item,
.dropdown-menu .nav-link {
    color: var(--text-dark) !important;
}
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .nav-link:hover,
.navbar-nav .dropdown-menu .nav-link:hover,
.navbar-nav .dropdown-menu .nav-link.active {
    color: var(--primary) !important;
    background-color: var(--bg-light) !important;
}

/* ===== Footer Parceiros / Logos ===== */
.footer-parceiros {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 2.5rem;
    padding-top: 2rem;
    padding-bottom: 1rem;
}

.footer-parceiros-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
}

.footer-logos-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem 3rem;
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.footer-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-item img {
    height: 80px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    transition: transform 0.2s;
}

.footer-logo-item:hover img {
    opacity: 1;
}

/* Logos com fundo muito escuro precisam de altura diferente */
.footer-logo-ms img {
    height: 95px;
}

.footer-logo-ucds img {
    height: 95px;
}

@media (max-width: 576px) {
    .footer-logos-row {
        gap: 1rem 1.5rem;
    }
    .footer-logo-item img {
    height: 80px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    transition: transform 0.2s;
}
    .footer-logo-ms img,
    .footer-logo-ucds img {
    height: 95px;
}
    .brand-logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(1px 1px 0 #fff) drop-shadow(-1px -1px 0 #fff) drop-shadow(1px -1px 0 #fff) drop-shadow(-1px 1px 0 #fff);
}
}

/* ===== Fallback for Visual Composer Content ===== */
.vce-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}
.vce-col {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
}
.vce-single-image-inner {
    max-width: 100%;
}
.vce-single-image-inner img {
    max-width: 100%;
    height: auto;
}

/* ===== Fix for broken Visual Composer inline styles on /vacinas/ ===== */
.vce-single-image-inner {
    width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 0 !important;
    position: relative !important;
}
.vce-single-image-inner img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    position: static !important;
}
.vce-row-container {
    max-width: 100% !important;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .vce-col--md-18-37p {
        flex: 0 0 18.37% !important;
        max-width: 18.37% !important;
    }
    .vce-col--md-81-62p {
        flex: 0 0 81.62% !important;
        max-width: 81.62% !important;
    }
    .vce-col--md-auto {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 100% !important;
    }
}

/* Fix: vce-col elements are inside vce-row-content */
.vce-row-content {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}
.vce-row {
    width: 100%;
}
.vce-row-content--middle {
    align-items: center;
}
.vce-row-content--top {
    align-items: flex-start;
}
.vce-row-content--bottom {
    align-items: flex-end;
}

/* ===== Multi-level Dropdown Support for Bootstrap 5 ===== */
.dropdown-menu .dropdown {
    position: relative;
}
.dropdown-menu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
    position: absolute;
}
.dropdown-menu .dropdown:hover > .dropdown-menu {
    display: block;
}
@media (max-width: 991px) {
    .dropdown-menu .dropdown-menu {
        left: 0;
        position: relative;
        padding-left: 1rem;
        background: rgba(0,0,0,0.02);
        border: none;
        box-shadow: none;
    }
}

/* ===== Make all dropdowns open on hover on desktop ===== */
@media (min-width: 992px) {
    .navbar .dropdown:hover > .dropdown-menu {
        display: block;
    }
}

/* Fix: allow footer logos to reach their natural widths instead of being constrained by max-width: 180px/250px from earlier */
.footer-parceiros .footer-logo-item img {
    height: auto !important;
    max-width: 100% !important;
    width: auto !important;
}

/* Visual Composer Fallback Grid */
.vce-row-content { display: flex; flex-wrap: wrap; width: 100%; align-items: center; }
.vce-col { flex: 1 1 auto; }
.vce-col--md-18-37p { width: 18.37%; flex-basis: 18.37%; }
.vce-col--md-81-62p { width: 81.62%; flex-basis: 81.62%; }
@media (max-width: 768px) {
  .vce-row-content { flex-direction: column; }
  .vce-col { width: 100% !important; flex-basis: 100% !important; }
}

img.vce-single-image { max-width: 100% !important; height: auto !important; }
