/* ==========================================================================
   Hub Institucional Premium CSS
   ========================================================================== */

.page-institucional {
    background-color: #f8fafc;
    color: var(--hp-text, #334155);
    font-family: 'Inter', 'Roboto', sans-serif;
    padding-bottom: 60px;
}

/* --- Hero Section --- */
.inst-hero {
    background: linear-gradient(135deg, var(--portal-primary-hex, #1351B4) 0%, #1e3a8a 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.inst-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: #fff;
}

.inst-hero p {
    font-size: 1.1rem;
    color: #ffffff !important;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.inst-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #f8fafc;
    border-radius: 100% 100% 0 0 / 100% 100% 0 0;
}

/* --- Content Wrapper --- */
.inst-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Gestão (Prefeito/Vice) Cards --- */
.inst-gestao {
    margin-top: -30px;
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.gestao-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-top: 4px solid var(--portal-primary-hex, #1351B4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gestao-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.gestao-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #94a3b8;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.gestao-avatar img,
.gestao-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.gestao-nome {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hp-primary-dark, #0f172a);
    margin-bottom: 5px;
}

.gestao-cargo {
    font-size: 1rem;
    color: var(--portal-primary-hex, #1351B4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.gestao-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
    text-align: justify;
}

/* --- Section Headers --- */
.inst-section-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.inst-section-title i {
    color: var(--portal-primary-hex, #1351B4);
}

/* --- Secretarias Accordions --- */
.inst-secretarias {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sec-accordion {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.sec-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    text-align: left;
    transition: background 0.2s ease;
}

.sec-header:hover {
    background: #f8fafc;
}

.sec-header[aria-expanded="true"] {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.sec-icon {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sec-icon i {
    color: var(--portal-primary-hex, #1351B4);
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sec-toggle-icon {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.sec-header[aria-expanded="true"] .sec-toggle-icon {
    transform: rotate(180deg);
}

.sec-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
}

.sec-content.is-open {
    opacity: 1;
    /* max-height is set dynamically by JS to allow smooth transition to dynamic content height */
}

.sec-body-inner {
    padding: 25px;
}

/* --- Metadados da Secretaria --- */
.sec-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--portal-primary-hex, #1351B4);
}

.sec-meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sec-meta-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sec-meta-label i {
    color: var(--portal-primary-hex, #1351B4);
}

.sec-meta-value {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 500;
}

.sec-meta-value a {
    color: var(--portal-primary-hex, #1351B4);
    text-decoration: none;
}
.sec-meta-value a:hover {
    text-decoration: underline;
}

/* --- Competências --- */
.sec-competencias h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.sec-competencias-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #475569;
}

.sec-competencias-text p {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .inst-hero {
        padding: 40px 20px;
    }
    .inst-hero h1 {
        font-size: 2rem;
    }
    .gestao-card {
        padding: 20px;
    }
    .sec-header {
        font-size: 1.05rem;
        padding: 15px;
    }
    .sec-body-inner {
        padding: 15px;
    }
}
