/* Estilos para o Container de Treinamentos */
.abdc-trainings-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
    align-items: stretch; /* Garante que todos os itens da linha tenham a mesma altura */
}

/* Estilos para o Card de Treinamento */
.abdc-training-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Organiza o conteúdo verticalmente */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    height: 100%; /* Ocupa toda a altura disponível no grid */
}

.abdc-training-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.abdc-training-card .abdc-thumbnail-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Mantém a imagem sempre quadrada */
    overflow: hidden;
    background-color: #f9f9f9;
}

.abdc-training-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Garante que a imagem preencha o espaço sem distorcer */
    display: block;
}

.abdc-training-card .caption {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Faz com que a área de texto cresça para preencher o card */
    text-align: center;
}

.abdc-training-card .entry-title {
    font-size: 1.25em;
    color: #003366;
    margin: 0 0 15px 0;
    font-weight: 700;
    line-height: 1.3;
    /* Limitar título a 2 linhas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.2em; /* Mantém espaço para 2 linhas mesmo se for 1 */
}

.abdc-training-card .entry-content {
    font-size: 0.95em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1; /* Empurra o botão para o fundo */
    
    /* Truncamento de texto (Exibindo 3 linhas) */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 4.8em; /* Mantém espaço para 3 linhas */
}

.abdc-training-card .abdc-saiba-mais-btn {
    background-color: #003366;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 50px; /* Botão mais arredondado */
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.3s ease;
    align-self: center; /* Centraliza o botão */
    width: fit-content;
    margin-top: auto; /* Garante que o botão fique sempre na mesma linha no fundo */
}

.abdc-training-card .abdc-saiba-mais-btn:hover {
    background-color: #002244;
}

/* Estilos para o Modal */
.abdc-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.abdc-modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 40px;
    width: 90%;
    max-width: 850px;
    border-radius: 20px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.abdc-modal-close {
    color: #333;
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 30px;
    font-weight: 300;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f5f5f5;
    transition: 0.3s;
}

.abdc-modal-close:hover {
    background: #e0e0e0;
    color: #000;
}

.abdc-modal-body h2 {
    color: #003366;
    margin-top: 0;
    font-size: 2.2em;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.abdc-modal-body div {
    line-height: 1.8;
    font-size: 1.1em;
    color: #444;
}

/* Impedir scroll do corpo quando modal aberto */
body.abdc-modal-open {
    overflow: hidden;
}

/* Responsividade */
@media (max-width: 768px) {
    .abdc-modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 25px;
    }
    .abdc-modal-body h2 {
        font-size: 1.6em;
    }
    .abdc-trainings-container {
        grid-template-columns: 1fr;
    }
}
