/* Estilos Gerais */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f7fa;
    color: #333;
    line-height: 1.6;
    margin: 0;
    /* padding: 20px 0; */
    /* Adiciona espaço no topo/base, remove dos lados */
    text-align: center;
    box-sizing: border-box;
}

.main-container {
    max-width: 1200px;
    margin: -3rem auto;
    padding: 1.5rem;
    background-color: #e9ecef;
}

h1 {
    color: #527d76;
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

h2 {
    color: #527d76;
    font-size: 1.8rem;
    /* margin-top: 40px; */
    /* margin-bottom: 30px; */
    border-bottom: 2px solid #bdc3c7;
    /* padding-bottom: 10px; */
    display: inline-block;
}

.team-section {
    margin-bottom: 50px;
}

.sub-heading {
    font-size: 1.4rem;
    color: #34495e;
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Estilo do Card de Membro (Desktop) */
.card {
    background-color: #ffffff;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    padding: 6px;
    width: auto;
    display: inline-block;
    vertical-align: top;
    margin: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card .icon {
    width: 8rem;
    height: 8rem;
    background-color: #eaf0f6;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #7f8c8d;
    font-size: 1.2rem;
}

.card .icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.card .name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    word-wrap: break-word;
}

.card .title {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 4px;
}

/* Estrutura da Árvore Hierárquica - DESKTOP */
.org-tree ul {
    padding-top: 20px;
    position: relative;
    list-style-type: none;
    display: flex;
    justify-content: center;
}

.org-tree li {
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
}

.org-tree li::before,
.org-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid #bdc3c7;
    width: 50%;
    height: 20px;
}

.org-tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid #bdc3c7;
}

.org-tree li:only-child::after,
.org-tree li:only-child::before {
    display: none;
}

.org-tree li:only-child {
    padding-top: 0;
}

.org-tree li:first-child::before,
.org-tree li:last-child::after {
    border: 0 none;
}

.org-tree li:last-child::before {
    border-right: 2px solid #bdc3c7;
    border-radius: 0 5px 0 0;
}

.org-tree li:first-child::after {
    border-radius: 5px 0 0 0;
}

.org-tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid #bdc3c7;
    width: 0;
    height: 20px;
}

/* Container para grupos de cards */
.card-grid-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.profile-picture {
    height: 6rem;
    /* 128px */
    width: 6rem;
    /* 128px */
    border-radius: 9999px;
    margin-left: auto;
    margin-right: auto;
    /* margin-bottom: 1rem; */
    object-fit: cover;
    object-position: top;
    border: 4px solid white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   >>> ESTILOS RESPONSIVOS <<<
   ========================================================================== */

/* Para Tablets e telas menores */
@media (max-width: 992px) {

    /* Permite rolagem horizontal na árvore se ela for muito grande nesta resolução */
    .org-tree {
        overflow-x: auto;
        padding-bottom: 20px;
    }
}


/* Para Tablets e Celulares (onde a mudança principal ocorre) */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .sub-heading {
        font-size: 1.2rem;
    }

    /* ===== CORREÇÃO DA ÁRVORE HIERÁRQUICA ===== */

    .org-tree {
        overflow-x: hidden;
        /* Garante que não haja rolagem lateral */
    }

    .org-tree ul {
        display: block;
        /* Empilha os itens da lista */
        padding: 0;
    }

    .org-tree li {
        display: block;
        /* Faz cada item ocupar sua própria linha */
        padding: 0 0 25px 0;
        /* Adiciona espaço abaixo de cada card */
    }

    /* Remove as linhas conectoras do desktop */
    .org-tree li::before,
    .org-tree li::after,
    .org-tree ul ul::before {
        display: none;
    }

    /* Cria a indentação para mostrar a hierarquia */
    .org-tree ul ul {
        padding-left: 25px;
        /* Recuo para os níveis inferiores */
        margin-top: 25px;
    }

    /* Faz o card da árvore ocupar o espaço corretamente */
    .org-tree .card {
        width: 100%;
        /* O card ocupa 100% do seu container (li) */
        max-width: 350px;
        /* Limita a largura máxima em telas maiores */
        margin: 0 auto;
        /* Centraliza o card */
        display: block;
    }

    /* Ajuste geral dos cards para telas menores */
    .card-grid-container .card {
        max-width: 350px;
        width: 100%;
        margin: 10px 0;
    }
}

/* Para Celulares (ajustes finos) */
@media (max-width: 480px) {

    .main-container {
        padding: 0 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .sub-heading {
        font-size: 1.1rem;
    }
}