/* ==========================================================================
   Program Cards
   ========================================================================== */
.iubello-program-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-negro);
    border-top: 4px solid var(--card-color, var(--color-azul));
}

.iubello-program-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: var(--color-negro);
}

.iubello-program-card__image {
    overflow: hidden;
    aspect-ratio: 16/10;
}

.iubello-program-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.iubello-program-card:hover .iubello-program-card__image img {
    transform: scale(1.05);
}

.iubello-program-card__body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.iubello-program-card__badge {
    display: inline-block;
    align-self: flex-start;
    padding: 0.2rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(25,83,135,0.08);
    color: var(--color-azul);
    border-radius: 999px;
    margin-bottom: 0.625rem;
}

.iubello-program-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.iubello-program-card__excerpt {
    font-size: 0.875rem;
    color: var(--color-gris);
    flex: 1;
    margin-bottom: 0.75rem;
}

.iubello-program-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-gris);
    margin-bottom: 0.75rem;
}

.iubello-program-card__meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.iubello-program-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-azul);
    margin-top: auto;
}

/* ==========================================================================
   Single Program
   ========================================================================== */
.iubello-programa-hero {
    position: relative;
    padding: 6rem 0 3rem;
    background: linear-gradient(135deg, var(--color-azul), var(--programa-color, var(--color-azul)));
    color: #fff;
}

.iubello-programa-hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
}

.iubello-programa-hero__inner {
    position: relative;
    z-index: 1;
}

.iubello-programa-hero__badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 999px;
    margin-bottom: 1rem;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.iubello-programa-hero__title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fff;
    margin-bottom: 0.75rem;
}

.iubello-programa-hero__excerpt {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 700px;
    margin-bottom: 1.5rem;
}

.iubello-programa-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.iubello-programa-hero__meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    opacity: 0.9;
}

/* Tabs */
.iubello-programa-tabs {
    padding: 3rem 0;
}

.iubello-programa-tabs__nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.iubello-programa-tabs__btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-gris);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.iubello-programa-tabs__btn:hover {
    color: var(--color-azul);
}

.iubello-programa-tabs__btn.is-active {
    color: var(--color-azul);
    border-bottom-color: var(--color-azul);
}

.iubello-programa-tabs__panel {
    display: none;
}

.iubello-programa-tabs__panel.is-active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Campos de acción (layout legado si se usa .iubello-programa-campos sin grid). */
.iubello-programa-campos {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.iubello-programa-campos .iubello-programa-campos__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.35rem 0;
    margin: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
    transition: color 0.2s ease;
}

.iubello-programa-campos .iubello-programa-campos__item:hover {
    border: none;
    box-shadow: none;
}

.iubello-programa-campos .iubello-programa-campos__item svg {
    flex-shrink: 0;
    width: 1.625rem;
    height: 1.625rem;
    padding: 0.375rem;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(25, 83, 135, 0.1);
    color: var(--color-azul);
    margin-top: 2px;
}

/* Related Programs */
.iubello-programa-related {
    padding: 3rem 0;
    background: var(--color-blanco);
}

.iubello-programa-related__heading {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.iubello-programa-related__cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.iubello-programa-related__card {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 220px;
    text-decoration: none;
    color: var(--color-negro);
    transition: box-shadow var(--transition);
}

.iubello-programa-related__card:hover {
    box-shadow: var(--shadow-md);
    color: var(--color-negro);
}

.iubello-programa-related__card--current {
    border: 2px solid var(--color-azul);
}

.iubello-programa-related__card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.iubello-programa-related__card p {
    font-size: 0.875rem;
    color: var(--color-gris);
}

.iubello-programa-related__badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(25,83,135,0.1);
    color: var(--color-azul);
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

.iubello-programa-related__arrow {
    display: flex;
    align-items: center;
}

/* Program CTA */
.iubello-programa-cta,
.iubello-archive-cta {
    padding: 4rem 0;
    background: var(--color-azul);
    color: #fff;
    text-align: center;
}

.iubello-programa-cta__inner,
.iubello-archive-cta__inner {
    max-width: 600px;
    margin: 0 auto;
}

.iubello-programa-cta h2,
.iubello-archive-cta h2 {
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.75rem;
}

.iubello-programa-cta p,
.iubello-archive-cta p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.iubello-programa-cta__buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.iubello-programa-cta .iubello-btn--outline {
    color: #fff;
    border-color: #fff;
}

.iubello-programa-cta .iubello-btn--outline:hover {
    background: #fff;
    color: var(--color-azul);
}

.iubello-archive-cta .iubello-btn--primary {
    background: #fff;
    color: var(--color-azul);
    border-color: #fff;
}

.iubello-archive-cta .iubello-btn--primary:hover {
    background: var(--color-blanco);
}

/* Two-Column Layout */
.iubello-programa-body { padding: 3rem 0; }
.iubello-programa-body__layout {
    display: grid;
    /* minmax(0,1fr) evita que tablas muy anchas estiren el grid y empujen el sidebar fuera del viewport */
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 2.5rem;
    align-items: start;
    max-width: 100%;
}
.iubello-programa-body__main {
    min-width: 0;
    max-width: 100%;
}
.iubello-programa-body__sidebar {
    min-width: 0;
    max-width: 100%;
}

/* Plan de estudios: banda a ancho viewport debajo del grid (tabla sin caja estrecha) */
.iubello-programa-body__plan-breakout {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    padding-top: 0.5rem;
    padding-bottom: 3rem;
    background: rgba(25, 83, 135, 0.04);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.iubello-programa-body__plan-breakout-inner {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-inline: clamp(1rem, 3vw, 1.5rem);
    box-sizing: border-box;
}
.iubello-programa-body__plan-breakout .iubello-programa-section__title {
    justify-content: center;
    text-align: center;
}
.iubello-programa-body__plan-breakout .iubello-programa-plan__subtitle {
    text-align: center;
}
.iubello-programa-body__plan-breakout .iubello-programa-section--plan {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.iubello-programa-body__plan-breakout .iubello-programa-plan {
    min-width: 0;
    max-width: 100%;
}
.iubello-programa-body__plan-breakout .iubello-programa-plan__table {
    min-width: 0;
}
.iubello-programa-body__plan-breakout .iubello-programa-plan__table--plan-v2 {
    min-width: 100%;
    width: 100%;
}
@media (min-width: 901px) {
    .iubello-programa-body__plan-breakout .iubello-programa-plan__table-wrap {
        overflow-x: visible;
        max-width: none;
    }
}
@media (max-width: 900px) {
    .iubello-programa-body__plan-breakout .iubello-programa-plan__table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.iubello-programa-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.iubello-programa-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.iubello-programa-section__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-negro);
    margin-bottom: 1.5rem;
}
.iubello-programa-section__title svg { color: var(--color-azul); flex-shrink: 0; }
/* Campos de acción — ficha single: lista editorial sin marcos; icono en círculo. */
.iubello-programa-campos-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 42rem;
}

.iubello-programa-campos-grid .iubello-programa-campos__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.35rem 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    transition: color 0.2s ease;
}

.iubello-programa-campos-grid .iubello-programa-campos__item:hover {
    border: none;
    box-shadow: none;
}

.iubello-programa-campos-grid .iubello-programa-campos__item span {
    line-height: 1.55;
    color: var(--color-negro);
}

.iubello-programa-campos-grid .iubello-programa-campos__item svg {
    flex-shrink: 0;
    width: 1.625rem;
    height: 1.625rem;
    padding: 0.375rem;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(25, 83, 135, 0.1);
    color: var(--color-azul);
    margin-top: 0.15rem;
}

/* Sidebar */
.iubello-programa-sidebar {
    position: sticky;
    top: calc(var(--navbar-height) + 1.5rem);
    width: 100%;
    max-width: 360px;
    justify-self: end;
    box-sizing: border-box;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.iubello-programa-sidebar__title {
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    background: var(--programa-color, var(--color-azul));
}
.iubello-programa-sidebar__list {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.iubello-programa-sidebar__list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.iubello-programa-sidebar__list li svg {
    color: var(--programa-color, var(--color-azul));
    flex-shrink: 0;
    margin-top: 2px;
}
.iubello-programa-sidebar__list li div { display: flex; flex-direction: column; }
.iubello-programa-sidebar__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(15, 15, 15, 0.5);
    font-weight: 600;
}
.iubello-programa-sidebar__value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-negro);
}
.iubello-programa-sidebar__actions {
    padding: 0 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.iubello-programa-sidebar__btn { width: 100%; justify-content: center; }
.iubello-programa-sidebar__related {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.iubello-programa-sidebar__related h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(15, 15, 15, 0.5);
    margin-bottom: 0.75rem;
}
.iubello-programa-sidebar__related-card {
    display: block;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(25, 83, 135, 0.15);
    background: rgba(25, 83, 135, 0.03);
    text-decoration: none;
    transition: all 0.3s;
    margin-bottom: 0.5rem;
}
.iubello-programa-sidebar__related-card:hover {
    border-color: var(--color-azul);
    box-shadow: var(--shadow-sm);
}
.iubello-programa-sidebar__related-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-azul);
    background: rgba(25, 83, 135, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}
.iubello-programa-sidebar__related-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-negro);
}
.iubello-programa-sidebar__related-dur {
    display: block;
    font-size: 0.8125rem;
    color: rgba(15, 15, 15, 0.6);
}
.iubello-programa-sidebar__related-card svg {
    display: none;
}

/* Plan de estudios estructurado + adjunto */
.iubello-programa-plan__section {
    margin-bottom: 1.75rem;
}
.iubello-programa-plan__section[data-plan-part="malla"] {
    text-align: center;
}
.iubello-programa-plan__section[data-plan-part="malla"] .iubello-programa-plan__subtitle {
    text-align: center;
}
.iubello-programa-plan__malla-actions {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.iubello-programa-plan__subtitle {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-negro);
    margin: 0 0 1rem;
}
.iubello-programa-plan__sem-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--color-azul);
}
.iubello-programa-plan {
    min-width: 0;
}
.iubello-programa-plan__table-wrap {
    overflow-x: auto;
    max-width: 100%;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    /* Borde en la <table> para que coincida con el ancho intrínseco (evita borde más corto que la tabla). */
}
.iubello-programa-plan__table {
    width: 100%;
    min-width: 640px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    /* El desbordamiento largo en celdas (p. ej. justificación) se recorta en td/th con overflow-wrap. */
    overflow: hidden;
}
.iubello-programa-plan__table--plan-v2 {
    table-layout: auto;
    min-width: 1320px;
}
.iubello-programa-plan__table thead th {
    text-align: center;
    padding: 0.75rem 0.625rem;
    background: rgba(25, 83, 135, 0.1);
    color: var(--color-negro);
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.35;
    border-bottom: 2px solid rgba(25, 83, 135, 0.2);
    vertical-align: bottom;
}
.iubello-programa-plan__table thead th:first-child {
    border-top-left-radius: var(--radius-sm);
}
.iubello-programa-plan__table thead th:last-child {
    border-top-right-radius: var(--radius-sm);
}
.iubello-programa-plan__table tbody td {
    padding: 0.6rem 0.625rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: top;
}
/* Plan v2 — anchuras: justificación más ancha para textos largos */
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--semestre,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--semestre {
    width: 5%;
    white-space: nowrap;
    text-align: center;
}
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--creditos,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--creditos {
    text-align: center;
    white-space: nowrap;
    width: 4%;
    max-width: 3.75rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}
/* Horas: celdas numéricas compactas (sin salto) */
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--horas_acomp_docente,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--horas_presenciales,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--horas_autonomas,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--total_horas {
    text-align: center;
    white-space: nowrap;
    width: 4.25%;
    min-width: 3rem;
    max-width: 4rem;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}
/* Horas: cabeceras — texto largo en 2 renglones si no cabe en una línea */
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--horas_acomp_docente,
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--horas_presenciales,
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--horas_autonomas,
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--total_horas {
    text-align: center;
    white-space: normal;
    vertical-align: bottom;
    line-height: 1.3;
    min-width: 4.75rem;
    max-width: 6.25rem;
    width: 5.5%;
    padding: 0.5rem 0.35rem 0.65rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--codigo,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--codigo {
    width: 11%;
    min-width: 7.5rem;
}
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--asignatura,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--asignatura {
    min-width: 11.5rem;
    width: 17%;
    text-align: left;
}
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--componente_curricular,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--componente_curricular {
    min-width: 10rem;
    width: 13%;
    text-align: left;
}
.iubello-programa-plan__table--plan-v2 thead th.iubello-plan-col--justificacion,
.iubello-programa-plan__table--plan-v2 tbody td.iubello-plan-col--justificacion {
    min-width: 18rem;
    width: 32%;
    max-width: 32%;
    text-align: left;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
}
.iubello-programa-plan__table tbody tr:nth-child(even) td {
    background: rgba(25, 83, 135, 0.02);
}
.iubello-programa-plan__figure {
    margin: 1rem 0;
    text-align: center;
}
.iubello-programa-plan__img[data-full-src] {
    cursor: zoom-in;
}
.iubello-programa-plan__img[data-full-src]:focus-visible {
    outline: 3px solid var(--color-azul);
    outline-offset: 3px;
}
.iubello-programa-plan__img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.iubello-programa-plan__download {
    margin: 1rem 0;
}
.iubello-programa-plan__notes .iubello-programa-plan__subtitle {
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .iubello-programa-body__layout {
        grid-template-columns: 1fr;
    }
    .iubello-programa-sidebar {
        position: static;
        max-width: none;
        justify-self: stretch;
    }
}

@media (max-width: 768px) {
    .iubello-programa-hero {
        padding: 4rem 0 2rem;
    }

    .iubello-programa-hero__meta {
        gap: 0.75rem;
    }

    .iubello-programa-related__cards {
        flex-direction: column;
    }

    .iubello-programa-related__arrow {
        transform: rotate(90deg);
    }
}

/* Oferta Académica provisional (interruptor IUBELLO_OFERTA_PROVISIONAL) */
.iubello-archive-hero--provisional {
    padding: 5rem 0 3.5rem;
}

.iubello-archive-hero--provisional .iubello-archive-hero__subtitle {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.55;
}

.iubello-oferta-provisional-section {
    padding: 3rem 0 4rem;
    background: var(--color-fondo-soft, #f5f8fb);
}

.iubello-oferta-provisional {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2rem clamp(1.25rem, 4vw, 2.25rem);
    background: #fff;
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
    border-left: 4px solid var(--color-azul);
}

.iubello-oferta-provisional__title {
    font-size: clamp(1.25rem, 2.8vw, 1.45rem);
    font-weight: 700;
    color: var(--color-azul);
    margin: 0 0 1.25rem;
    line-height: 1.3;
}

.iubello-oferta-provisional p {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.0625rem);
    line-height: 1.7;
    color: var(--color-negro);
}

.iubello-oferta-provisional p + p {
    margin-top: 1.25rem;
}
