/* =====================================================================
   SEU Chapelhill: telefonos (hasta 767.98px, el mismo corte que usa style.css)
   ---------------------------------------------------------------------
   Se carga despues de style.css y todo vive en un solo media query.

   1. Escala tipografica: cada nivel es mas chico que el anterior, sin excepciones
        H1  titulo del hero ................. 38px / 1.05
        H2  titulo de seccion ............... 30px / 1.15
        H3  titulo de tarjeta o caja ........ 22px / 1.25
        T   titulo de acordeon o pregunta ... 18px / 1.35  (siempre mayor que su texto)
        H4  subtitulo, nombre, grupo ........ 17px / 1.35
        L   texto destacado (lead) .......... 18px / 1.55
        P   texto ........................... 16px / 1.6
        E   etiquetas (mayusculas) .......... 13px / 1.4
   2. Texto alineado a la izquierda
   3. Ritmo vertical en multiplos de 8: secciones 48px, titulo → texto 16px,
      texto → titulo siguiente 32px, entre bloques apilados 24-32px
   4. Fotos a pantalla completa: maximo 70vh
   5. Ajustes de cada bloque
   ===================================================================== */

@media (max-width: 767.98px) {

    /* =================================================================
       1. ESCALA TIPOGRAFICA
       ================================================================= */

    /* H1 */
    body .hero__title {
        font-size: 38px;
        line-height: 1.05;
        letter-spacing: -0.01em;
    }

    /* H2 */
    body main h2,
    body .section-title,
    body .red-band__title,
    body .req-band__title {
        font-size: 30px;
        line-height: 1.15;
        letter-spacing: -0.01em;
    }

    /* H3 */
    body main h3,
    body main h4,
    body .value-card__title,
    body .practicum-box__title,
    body .degree-content__title,
    body .card-purpose__title,
    body .card-purpose__panel h4,
    body .list-card-w h3,
    body .step-card__step {
        font-size: 22px;
        line-height: 1.25;
    }

    /* H4 */
    body main h5,
    body main h6,
    body .degree-tabs__group,
    body .team-card__name {
        font-size: 17px;
        line-height: 1.35;
    }

    /* P: todo el texto corrido, incluidos los cuerpos de acordeones y listas */
    body p,
    body main li,
    body .rich-text,
    body .value-card__text,
    body .practicum-box__text,
    body .degree-content__text,
    body .dark-band__text,
    body .step-card__text,
    body .faq-accordion .accordion-body,
    body .dark-band .faq-accordion .accordion-body,
    body .req-item__body,
    body .req-item__body p,
    body .req-item__body li,
    body .req-item__link,
    body .list-card-w p {
        font-size: 16px !important;
        line-height: 1.6;
    }

    /* Lo que va dentro de un texto (negritas, enlaces) usa el tamano de su parrafo */
    body .faq-accordion .accordion-body :is(p, li, b, strong, a, span, em),
    body .req-item__body :is(b, strong, a, span, em),
    body .rich-text :is(b, strong, a, span, em) {
        font-size: inherit !important;
    }

    /* "Step 1" de la banda roja es un parrafo con tamano de H3 */
    body p.step-card__step {
        font-size: 22px !important;
        line-height: 1.25;
    }

    /* L: el primer parrafo de una seccion, un poco mas grande que el texto */
    body p.intro__lead,
    body p.fz-20,
    body .fz-20 {
        font-size: 18px !important;
        line-height: 1.55;
    }

    /* T: titulos de acordeon, siempre por encima del texto que abren */
    body .faq-accordion .accordion-button,
    body .dark-band .faq-accordion .accordion-button,
    body .dark-band .faq-accordion .accordion-button span,
    body .req-item__header {
        font-size: 18px;
        line-height: 1.35;
        font-weight: 600;
    }

    /* E: etiquetas */
    body .req-item__label,
    body p.req-item__label,
    body .step-card__title,
    body h3.step-card__title,
    body .degree-content__label,
    body h5.degree-content__label {
        font-size: 13px !important;
        line-height: 1.4;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    body .practicum-box__subtitle {
        font-size: 15px !important;
        line-height: 1.45;
    }
    body .practicum-box__focus {
        font-size: 14px !important;
        line-height: 1.55;
    }
    body .team-card__role {
        font-size: 13px !important;
        line-height: 1.4;
    }

    /* Palabras en movimiento: decorativas, sin competir con el H2 */
    body .marquee__unit {
        font-size: 30px;
    }

    /* =================================================================
       2. TEXTO A LA IZQUIERDA
       ================================================================= */
    main :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, blockquote, figcaption, label),
    main .text-center,
    main .text-sm-center,
    main .text-md-center,
    main .text-end,
    main .text-md-end,
    main .text-lg-end,
    footer :is(h1, h2, h3, h4, h5, h6, p, li) {
        text-align: left !important;
    }
    .hero .justify-content-lg-end,
    .hero .text-lg-end {
        justify-content: flex-start !important;
    }

    /* =================================================================
       3. RITMO VERTICAL
       ================================================================= */

    /* Secciones: las clases de espaciado del sitio, a escala de telefono */
    .pt-30 { padding-top: 24px !important; }
    .pt-40 { padding-top: 32px !important; }
    .pt-60 { padding-top: 40px !important; }
    .pt-80 { padding-top: 48px !important; }
    .pt-100 { padding-top: 56px !important; }
    .pb-60 { padding-bottom: 40px !important; }
    .pb-80 { padding-bottom: 48px !important; }
    .pb-100 { padding-bottom: 56px !important; }
    .py-80 { padding-top: 48px !important; padding-bottom: 48px !important; }
    .mb-40 { margin-bottom: 32px !important; }
    .mb-50 { margin-bottom: 24px !important; }
    .mb-80 { margin-bottom: 48px !important; }
    .mb-100 { margin-bottom: 56px !important; }
    .mt-60 { margin-top: 40px !important; }

    /* Margen lateral: una sola linea a 20px de cada borde para todo
       (logo, boton del menu, enlaces del menu, titulo del hero, contenido y footer) */
    main .container,
    footer .container,
    .site-header .navbar > .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .site-header,
    .site-header.is-scrolled,
    .site-header .navbar,
    .site-header.is-scrolled .navbar {
        padding-left: 0;
        padding-right: 0;
    }
    /* El boton mide 46px pero su icono 26px: se corre para que las rayas toquen la linea de 20px */
    .site-header .navbar-toggler {
        margin-right: -10px;
    }
    .site-header .navbar-collapse {
        padding-left: 20px;
        padding-right: 20px;
    }
    /* El hero tiene un marco de 10px: su contenido suma 10px mas para caer en la misma linea */
    main .hero .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Titulo → su texto */
    main h2 { margin-bottom: 16px; }
    main :is(h3, h4) { margin-bottom: 12px; }
    main p { margin-bottom: 16px; }

    /* Texto → el titulo siguiente: el titulo abre un bloque nuevo */
    main :is(p, ul, ol, .rich-text, .accordion, .faq-accordion) + :is(h2, h3, h4) {
        margin-top: 32px;
    }

    /* Columnas que en telefono quedan una debajo de la otra (filas sin separacion propia) */
    main .row:not([class*="g-"]):not([class*="gy-"]) {
        row-gap: 32px;
    }

    /* El ultimo texto de una tarjeta o columna no suma espacio debajo */
    main :is(.value-card, .practicum-box, .step-card, .list-card-w li, .degree-content, [class*="col-"]) > p:last-child {
        margin-bottom: 0;
    }

    /* =================================================================
       4. FOTOS A PANTALLA COMPLETA: MAXIMO 70vh
       ================================================================= */
    body .hero,
    body .parallax-band--full {
        min-height: 0;
        height: 70vh;
        max-height: 70vh;
    }
    body .hero {
        padding: 40px 0 32px;
    }
    body .parallax-band {
        max-height: 70vh;
    }
    body .values-slide {
        height: 52vh;
        max-height: 70vh;
    }
    .hero .container > .row {
        row-gap: 16px;
    }

    /* =================================================================
       5. BLOQUES
       ================================================================= */

    /* Tarjetas y cajas */
    body .value-card,
    body .practicum-box {
        padding: 24px 22px;
    }
    body .list-card-w li {
        padding: 24px 22px;
    }
    body .list-card-w p {
        max-width: none;
    }

    /* Bandas roja y de preguntas */
    body .red-band,
    body .req-band {
        padding: 40px 18px;
    }
    body .step-card {
        padding: 24px 22px;
    }
    body .step-card__step {
        margin-bottom: 4px !important;
    }
    body .step-card__title {
        margin-bottom: 12px;
    }

    /* Acordeones */
    body .faq-accordion .accordion-button {
        padding: 18px 20px;
        gap: 12px;
    }
    body .faq-accordion .accordion-body {
        padding: 0 20px 20px;
    }
    body .faq-accordion .accordion-item {
        margin-bottom: 12px;
    }
    body .req-item__header {
        padding: 12px 0;
    }
    body .req-item__body {
        padding: 4px 0 24px;
    }

    /* Programas: la lista se desplaza en su caja y el detalle se lee por bloques */
    body .degree-tabs {
        padding: 20px 18px;
    }
    body .degree-tabs .nav {
        max-height: 320px;
        overflow-y: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent);
        mask-image: linear-gradient(to bottom, #000 88%, transparent);
    }
    body .degree-tabs__link {
        padding-top: 10px;
        padding-bottom: 10px;
        line-height: 1.35;
    }
    body .degree-content {
        padding: 24px 20px;
    }
    body .degree-content__title {
        padding-bottom: 12px;
        margin-bottom: 4px;
    }
    /* Cada dato (etiqueta + valor) separado del anterior por una linea */
    body .degree-content__label {
        width: auto;
        margin: 0;
        padding-top: 16px;
        border-top: 1px solid #e6e6e9;
        text-decoration: none;
        color: #8a8a8f;
    }
    body .degree-content__title + .degree-content__label {
        border-top: 0;
    }
    body .degree-content__text {
        width: auto;
        margin: 4px 0 16px;
        color: var(--color-heading);
    }
    body .degree-content__text.mb-0 {
        margin-bottom: 0 !important;
    }

    /* Equipo */
    body .team-card__name {
        margin-bottom: 2px;
    }

    /* Imagenes y videos nunca mas anchos que la pantalla */
    main img,
    main video,
    main iframe {
        max-width: 100%;
    }

    /* Enlaces largos (correos, direcciones) no rompen el ancho */
    main a,
    footer a {
        overflow-wrap: anywhere;
    }
}
