.title-container {
    padding: 1rem 0;
    text-align: center;
    margin-bottom: 1.5rem;
}

.main-title {
    padding-top: 50px;
    color: #ffffff;
    font-size: 2rem;
    margin: 0;
}

.programas-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2rem;
    height: 450px;
}

.programa-card {
    position: relative;
    height: 100%;
    perspective: 1000px;
    cursor: pointer;
    margin: 0.3rem;
}

.programa-content {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.programa-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a23e0;
    color: white;
    margin: 0;
    transform: translateY(0);
    transition: transform 0.6s;
    z-index: 2;
    font-size: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.programa-card:hover .programa-title {
    transform: translateY(-100%);
}

.programa-description {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.6s;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1.4;
    text-align: justify;
    word-wrap: break-word;
    overflow-y: auto;
    box-sizing: border-box;
}

.programa-card:hover .programa-description {
    opacity: 1;
    transform: translateY(0);
}

.programa-description p {
    margin: 0;
    max-height: 100%;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 0.5rem;
    text-align: justify;
}

.instruccion-texto {
    text-align: center;
    margin: 2rem auto;
    padding: 1rem;
    max-width: 600px;
}

.instruccion-texto p {
    color: #666;
    font-size: 1.1rem;
    font-style: italic;
    margin: 0;
}

@media (max-width: 768px) {
    .programas-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1.2rem;
        padding: 1rem;
    }

    .title-container { padding: 0 !important; margin-bottom: 0.5rem !important; }
    .main-title { font-size: 2.2rem; padding-top: 10px !important; }

    /* Ocultar instrucción de cursor en móvil */
    .instruccion-texto { display: none; }

    /* Tarjeta sin altura fija — se adapta al contenido */
    .programa-card {
        height: auto;
        margin: 0;
        perspective: none;
    }

    /* Layout estático: título arriba, descripción abajo */
    .programa-content {
        position: static;
        transform-style: flat;
        transition: none;
        background-color: #f8f9fa;
        border-radius: 10px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* Título siempre visible arriba */
    .programa-title {
        position: static;
        transform: none !important;
        transition: none;
        font-size: 1.2rem;
        padding: 14px 16px;
        height: auto;
        text-align: center;
        border-radius: 10px 10px 0 0;
    }

    /* Descripción siempre visible abajo */
    .programa-description {
        position: static;
        transform: none !important;
        opacity: 1 !important;
        transition: none;
        font-size: 0.95rem;
        padding: 14px 16px;
        background-color: #ffffff;
        border-radius: 0 0 10px 10px;
        text-align: left;
    }

    .programa-description p {
        padding: 0;
        text-align: left;
    }

    /* Deshabilitar hover en móvil */
    .programa-card:hover .programa-title { transform: none !important; }
    .programa-card:hover .programa-description { transform: none !important; opacity: 1 !important; }
} 