/* Explain: Styles for course cards, including hover effects and layout. */
.rich-text p { margin-bottom: 1.25em; }
.rich-text h2 { font-size: 1.75em; font-weight: 700; margin-top: 2em; margin-bottom: 1em; color: #111; }
.rich-text h3 { font-size: 1.35em; font-weight: 700; margin-top: 1.5em; margin-bottom: 0.75em; color: #111; }
.rich-text ul { list-style-type: disc; margin-left: 1.5em; margin-bottom: 1.25em; }
.rich-text ol { list-style-type: decimal; margin-left: 1.5em; margin-bottom: 1.25em; }
.rich-text a { color: var(--primary-color); text-decoration: underline; font-weight: 600; }
.rich-text blockquote { border-left: 4px solid var(--primary-color); padding-left: 1em; font-style: italic; color: #4b5563; }
.rich-text img { border-radius: 0.75rem; margin-top: 1.5em; margin-bottom: 1.5em; }

/* ===== Cartões de cursos (Agenda de Cursos e Treinamentos) ===== */
#cursosGrid .curso-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease;
}

#cursosGrid .curso-card:hover,
#cursosGrid .curso-card.is-open {
    border-color: var(--primary-color);
    box-shadow: 0 14px 32px rgba(0, 77, 48, 0.16);
    transform: translateY(-4px);
}

#cursosGrid .curso-card.is-hidden {
    display: none;
}

#cursosGrid .curso-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-color);
}

#cursosGrid .curso-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s ease;
}

#cursosGrid .curso-card:hover .curso-media img {
    transform: scale(1.06);
}

#cursosGrid .curso-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.25rem 1.25rem 1.5rem;
}

#cursosGrid .curso-name {
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: .35rem;
}

#cursosGrid .curso-when {
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: .85rem;
}

/* Sobreposição de detalhes — aparece no hover (computador) ou ao toque (celular) */
#cursosGrid .curso-details {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: linear-gradient(160deg, rgba(0, 77, 48, .97), rgba(0, 54, 34, .99));
    color: #ecfdf5;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
    overflow-y: auto;
}

#cursosGrid .curso-card:hover .curso-details,
#cursosGrid .curso-card.is-open .curso-details {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#cursosGrid .curso-details h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: .6rem;
    padding-right: 1.75rem;
}

#cursosGrid .curso-details-text {
    font-size: .85rem;
    line-height: 1.55;
    color: rgba(236, 253, 245, .92);
    margin-bottom: 1rem;
}

#cursosGrid .curso-details-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    font-size: .82rem;
    color: #ecfdf5;
    margin-bottom: 1rem;
}

#cursosGrid .curso-details-list i {
    color: #6ee7b7;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
    margin-top: .18rem;
}

#cursosGrid .curso-details-close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .16);
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease;
}

#cursosGrid .curso-details-close:hover {
    background: rgba(255, 255, 255, .32);
}

#cursosGrid .curso-card.is-open .curso-details-close {
    display: inline-flex;
}