/* ============================================================================
   UNIEBEC — Academic Offer (Oferta Académica)
   Estilos de la página de oferta académica (cursos.php). Diseño nuevo,
   fuera del template. El template (style.css y demás) no se modifica.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   Hero / banner del encabezado
   Banner de fondo a todo el ancho; el texto se superpone a la izquierda.
   La imagen de fondo se inyecta inline desde el JSON (campo hero.imagen).
   ---------------------------------------------------------------------------- */
.page-hero {
    position: relative;
    background-color: #eef3fa;
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
}

.page-hero__inner {
    display: flex;
    align-items: center;
    min-height: 460px;
}

.page-hero__text {
    max-width: 46%;
    padding: 40px 0;
}

.page-hero__text h1 {
    color: #163a8a;
    font-weight: 700;
    font-size: 3.25rem;
    line-height: 1.12;
    margin-bottom: 1.5rem;
}

.page-hero__text p {
    color: #5b6478;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 440px;
    margin-bottom: 0;
}

/* Figura frontal (estudiante + íconos): se superpone al fondo, alineada a la
   derecha y pegada al borde inferior del banner. */
.page-hero__figure {
    flex: 0 0 52%;
    max-width: 52%;
    margin-left: auto;
    align-self: flex-end;
}

.page-hero__figure img {
    display: block;
    width: 100%;
    height: auto;
}

/* Tablet */
@media (max-width: 1199px) {
    .page-hero__text h1 { font-size: 2.7rem; }
}

/* Móvil: el lado izquierdo (claro) queda visible para el texto */
@media (max-width: 991px) {
    .page-hero {
        background-position: left center;
    }

    .page-hero__inner {
        min-height: 340px;
    }

    .page-hero__text {
        max-width: 100%;
        padding: 30px 0;
    }

    .page-hero__text h1 {
        font-size: 2.2rem;
    }

    /* En móvil ocultamos la figura frontal para no tapar el texto; queda solo
       el fondo. */
    .page-hero__figure {
        display: none;
    }
}

/* ----------------------------------------------------------------------------
   Niveles académicos
   Tarjetas alternadas: imagen a un lado, contenido al otro. El lado y los
   colores (azul/rojo) se alternan con las clases .nivel--img-left / --img-right.
   ---------------------------------------------------------------------------- */
.niveles {
    padding: 80px 0;
}

.nivel {
    display: flex;
    align-items: stretch;
    background: #f4f5f7;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

/* Separación entre tarjetas. Se usa margin-bottom (no `.nivel + .nivel`) porque
   entre cada tarjeta hay un .nivel-modal oculto que rompe el selector adyacente. */
.nivel {
    margin-bottom: 48px;
}

.nivel:last-child {
    margin-bottom: 0;
}

/* Imagen */
.nivel__media {
    flex: 0 0 47%;
    max-width: 47%;
    min-height: 340px;
    background: #e9edf3;
}

.nivel__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Contenido */
.nivel__body {
    flex: 1;
    padding: 40px 56px;
    position: relative;
}

/* Barra de acento en el borde exterior */
.nivel__body::before {
    content: "";
    position: absolute;
    top: 32px;
    bottom: 32px;
    width: 9px;
    border-radius: 9px;
}

/* Variante: imagen a la derecha (contenido izquierda) → acento azul, botón rojo */
.nivel--img-right {
    flex-direction: row-reverse;
}

.nivel--img-right .nivel__body::before {
    left: 0;
    background: #163a8a;
}

.nivel--img-right .nivel__btn--solid {
    background: #e1232f;
}

/* Variante: imagen a la izquierda (contenido derecha) → acento rojo, botón azul */
.nivel--img-left .nivel__body::before {
    right: 0;
    background: #e1232f;
}

.nivel--img-left .nivel__btn--solid {
    background: #163a8a;
}

.nivel__title {
    color: #163a8a;
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.12;
    margin-bottom: 1.1rem;
}

.nivel__badge {
    display: inline-block;
    background: #f5b51a;
    color: #1f2937;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 7px 16px;
    border-radius: 7px;
}

.nivel__badge strong {
    font-weight: 800;
}

.nivel__desc {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.7;
    margin: 1.4rem 0 0;
    max-width: 470px;
}

.nivel__desc strong {
    color: #1f2937;
    font-weight: 700;
}

/* Horarios */
.nivel__schedule {
    display: flex;
    gap: 16px;
    margin: 30px 0;
}

.nivel__time {
    background: #e7ebf1;
    border-radius: 12px;
    padding: 12px 26px;
    text-align: center;
    min-width: 120px;
}

.nivel__time span {
    display: block;
    color: #8a93a3;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.nivel__time strong {
    color: #1f2937;
    font-size: 1.15rem;
    font-weight: 700;
}

/* Botones */
.nivel__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.nivel__btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 13px 28px;
    border-radius: 30px;
    text-decoration: none;
    transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.nivel__btn--solid {
    color: #fff;
}

.nivel__btn--solid:hover {
    opacity: 0.9;
    color: #fff;
}

.nivel__btn--outline {
    background: transparent;
    border: 1.5px solid #c9d2de;
    color: #163a8a;
}

.nivel__btn--outline:hover {
    border-color: #163a8a;
    color: #163a8a;
}

/* Responsive: una columna */
@media (max-width: 991px) {
    .niveles {
        padding: 50px 0;
    }

    .nivel,
    .nivel--img-right {
        flex-direction: column;
    }

    .nivel__media,
    .nivel--img-right .nivel__media {
        flex: 0 0 auto;
        max-width: 100%;
        min-height: 240px;
    }

    .nivel__body {
        padding: 36px 28px;
    }

    .nivel__body::before {
        top: 0;
        left: 0;
        right: auto;
        width: 100%;
        height: 7px;
        bottom: auto;
    }

    .nivel--img-left .nivel__body::before {
        right: auto;
        left: 0;
    }

    .nivel__title {
        font-size: 1.9rem;
    }

    .nivel__schedule {
        flex-wrap: wrap;
    }
}

/* ----------------------------------------------------------------------------
   Llamado final (Admisiones) — banner con velo azul, contacto y botón
   ---------------------------------------------------------------------------- */
.cta-final {
    position: relative;
    background-color: #14306f;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    padding: 90px 20px;
    text-align: center;
    overflow: hidden;
}

.cta-final .container {
    position: relative;
    z-index: 1;
}

/* El velo azul (.cta-final::before) se eliminó: la imagen de fondo se muestra
   tal cual, sin opacar. */

.cta-final__content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cta-final__title {
    color: #fff;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.6rem;
}

.cta-final__subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 1.8rem;
}

.cta-final__contact {
    display: inline-flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(10, 24, 60, 0.55);
    border-radius: 16px;
    padding: 20px 38px;
    margin-bottom: 2rem;
}

.cta-final__contact a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity 0.2s;
}

.cta-final__contact a:hover {
    opacity: 0.85;
    color: #fff;
}

.cta-final__contact i {
    color: #f5b51a;
}

.cta-final__btn {
    display: inline-block;
    background: #e1232f;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 36px;
    border-radius: 30px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.cta-final__btn:hover {
    opacity: 0.9;
    color: #fff;
}

@media (max-width: 991px) {
    .cta-final {
        padding: 60px 16px;
    }

    .cta-final__title {
        font-size: 1.9rem;
    }
}

/* ----------------------------------------------------------------------------
   Modal de asignaturas (se abre desde "Ver asignaturas" de cada nivel)
   ---------------------------------------------------------------------------- */
.nivel-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 16px;
    overflow-y: auto;
}

.nivel-modal[hidden] {
    display: none;
}

.nivel-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 56, 0.55);
}

.nivel-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    margin-top: 18px;
    background-color: #fff;
    background-size: cover;
    background-position: center;
    border-radius: 18px;
    border-top: 5px solid #e1232f;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

/* Velo blanco sobre la imagen de fondo del modal */
.nivel-modal__dialog::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
}

/* Pestaña roja con la X */
.nivel-modal__close {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translate(-50%, -100%);
    width: 70px;
    height: 38px;
    background: #e1232f;
    border: 0;
    border-radius: 14px 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
}

.nivel-modal__close i {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    color: #e1232f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.nivel-modal__scroll {
    position: relative;
    z-index: 2;
    padding: 22px 26px 24px;
}

.nivel-modal__logo {
    display: block;
    height: 58px;
    width: auto;
    margin: 0 auto 14px;
}

/* Tabla de subniveles */
.nmt {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 34px rgba(20, 45, 120, 0.12);
}

.nmt__header {
    background: #e1232f;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
    padding: 10px 12px;
}

.nmt__header strong {
    font-weight: 800;
}

.nmt__subhead {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: #1c3d8f;
    color: #fff;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.nmt__subhead span {
    padding: 7px 6px;
}

.nmt__sub2 {
    background: #eef2fb;
    text-align: center;
    color: #5b6478;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 10px;
}

.nmt__colhead {
    display: flex;
    background: #f3f5f9;
    color: #9aa3b2;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.nmt__colhead-spacer {
    flex: 0 0 120px;
}

.nmt__colhead > span:not(.nmt__colhead-spacer) {
    flex: 1;
    padding: 6px 14px;
}

.nmt__group {
    display: flex;
}

/* Formato nuevo (áreas -> asignaturas, sin año/números): sin columna de año. */
.nmt--noyear .nmt__colhead-spacer,
.nmt--noyear .nmt__year {
    display: none;
}

.nmt__year {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;      /* todos los grados apilados (8vo / 9no & / 10mo) */
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f8fafc;
    border-right: 1px solid #eef1f6;
    padding: 18px 6px;
}

.nmt__year-item {
    color: #163a8a;          /* texto (er, do, vo, no, &, de BGU) en navy */
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}
.nmt__year-item b {
    color: #e1232f;          /* TODOS los números en rojo y grandes */
    font-size: 1.9rem;
    font-weight: 800;
}

.nmt__year b {
    color: #e1232f;
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
}

.nmt__year span {
    color: #163a8a;
    font-size: 1rem;
    font-weight: 700;
}

.nmt__areas {
    flex: 1;
    min-width: 0;
}

.nmt__arearow {
    display: flex;
}

.nmt__arearow + .nmt__arearow {
    border-top: 1px solid #eef1f6;
}

.nmt__area {
    flex: 1;
    min-width: 0;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    color: #5b6478;
    font-size: 0.8rem;
}

.nmt__asigs {
    flex: 1;
    min-width: 0;
    border-left: 1px solid #eef1f6;
}

.nmt__asig {
    padding: 7px 14px;
    color: #5b6478;
    font-size: 0.8rem;
}

.nmt__asig + .nmt__asig {
    border-top: 1px solid #eef1f6;
}

.nmt__empty {
    text-align: center;
    color: #7b8494;
    font-size: 0.95rem;
    padding: 30px 16px;
    margin: 0;
}

@media (max-width: 575px) {
    .nivel-modal__scroll {
        padding: 34px 16px 24px;
    }

    .nmt__colhead-spacer,
    .nmt__year {
        flex-basis: 64px;
    }

    .nmt__year b {
        font-size: 1.7rem;
    }

    .nmt__area,
    .nmt__asig,
    .nmt__colhead > span:not(.nmt__colhead-spacer) {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 0.78rem;
    }
}
