/* Las reglas tipográficas también prevalecen sobre tamaños antiguos marcados como !important. */
@layer lop-typography {
    :root {
        --lop-type-narrowing: clamp(0px, calc(1120px - 100vw), 760px);
        --lop-type-h1: calc(var(--lop-type-h1-base, 2.125rem) - var(--lop-type-narrowing) * .009210526);
        --lop-type-h2: calc(var(--lop-type-h2-base, 1.375rem) - var(--lop-type-narrowing) * .005263158);
        --lop-type-body-1: calc(var(--lop-type-body-1-base, 1.0625rem) - var(--lop-type-narrowing) * .001315789);
        --lop-type-body-2: calc(var(--lop-type-body-2-base, .875rem) - var(--lop-type-narrowing) * .001315789);
    }

    :is(body.fusion-body, body.tuli-intranet) {
        font-size: var(--lop-type-body-1) !important;
    }

    :is(#wrapper, body.tuli-intranet, .tuli-alert-dialog) h1,
    body.lop-portada .lop-ed-hero .lop-home-hero-copy h1 {
        font-size: var(--lop-type-h1) !important;
    }

    :is(#wrapper, body.tuli-intranet, .lop-ed-dialog, .tuli-alert-dialog) h2,
    body.lop-portada .lop-ed-stats dt,
    #wrapper .content-box-counter :is(.display-counter, .unit) {
        font-size: var(--lop-type-h2) !important;
    }

    :is(#wrapper, body.tuli-intranet, .lop-ed-dialog) :where(h3, h4, h5, h6, .fusion-text, .fusion-reading-box-container, .fusion-accordian .panel-title, .fusion-content-boxes .heading, .fusion-person .person-name, .fusion-person .person-title, .counter-box-content),
    :is(#wrapper, body.tuli-intranet, .lop-ed-dialog) :where(input:not([type="submit"], [type="button"], [type="reset"], [type="checkbox"], [type="radio"]), select, textarea, label, legend),
    :is(#wrapper, .lop-ed-dialog) :is(p, li, dt, dd, th, td, blockquote),
    body.lop-portada .lop-ed-hero .lop-home-hero-copy .fusion-text p {
        font-size: var(--lop-type-body-1) !important;
    }

    :is(#wrapper, .lop-ed-dialog) :is(.fusion-button, .fusion-button-text, .fusion-progressbar .progress-title, .fusion-progressbar .progress-value, button, input[type="submit"], input[type="button"], input[type="reset"]),
    :is(#wrapper, body.tuli-intranet, .lop-ed-dialog) :is(small, figcaption, caption, .wp-caption-text, .fusion-copyright-notice, .lop-cuerpo-2),
    body.lop-portada :is(.lop-home-organisms-label, .lop-ed-pills > *, .lop-ed-stats dd, .lop-ed-related a, .lop-ed-card-link, .lop-ed-footer-grid li, .lop-ed-footer-grid a),
    #wrapper :is(.fusion-slider-loading, .fusion-main-menu a, .fusion-mobile-nav-holder a, .lop-editorial-note p, .tradingview-widget-copyright .blue-text),
    .lop-site-footer :is(a, li, p, h2, h3) {
        font-size: var(--lop-type-body-2) !important;
    }

    :is(#wrapper, .lop-ed-dialog) :is(h1, h2, h3, h4, h5, h6, .fusion-text, .fusion-button, .lop-cuerpo-2) :where(span, a, strong, b, em, mark, u, s, sub, sup, font):not(.fusion-button-text),
    :is(#wrapper, .lop-ed-dialog) :is(span, a, strong, b, em, font)[style*="font-size" i] {
        font-size: inherit !important;
    }

    /* TuLiApp mantiene su tipografía de producto y usa la escala de Avada. */
    :is(body.tuli-intranet, #main .tuli-app, body .tuli-alert-dialog) {
        --td-title-size: var(--lop-type-h1) !important;
        --td-mobile-title: var(--lop-type-h1) !important;
        --td-account-title-size: var(--lop-type-h1) !important;
        --td-heading-size: var(--lop-type-h2) !important;
        --td-body-size: var(--lop-type-body-1) !important;
        --td-mobile-size: var(--lop-type-body-1) !important;
        --td-small-size: var(--lop-type-body-2) !important;
        --td-metric-size: var(--lop-type-h2) !important;
        --td-fluid-title: var(--lop-type-h1) !important;
        --td-fluid-heading: var(--lop-type-h2) !important;
        --td-fluid-body: var(--lop-type-body-1) !important;
        --td-fluid-small: var(--lop-type-body-2) !important;
        --ui-title: var(--lop-type-h1) !important;
        --ui-section: var(--lop-type-h2) !important;
        --ui-heading: var(--lop-type-h2) !important;
        --ui-metric: var(--lop-type-h2) !important;
        --ui-card-title: var(--lop-type-body-1) !important;
        --ui-input: var(--lop-type-body-1) !important;
        --ui-body: var(--lop-type-body-1) !important;
        --ui-small: var(--lop-type-body-2) !important;
        --ui-nav: var(--lop-type-body-2) !important;
    }

    html body :is(#main .tuli-app, .tuli-alert-dialog) :is(.tuli-metric strong, .tuli-donut strong, .tuli-result-amount strong, .tuli-countdown) {
        font-size: var(--lop-type-h2) !important;
    }

    html body :is(#main .tuli-app, .tuli-alert-dialog) :is(.tuli-buyer, .tuli-help, .tuli-result-meta, .tuli-result-meta span, .tuli-tag, .tuli-feature-tag, .tuli-entity-link, .tuli-nav-label, .tuli-quick button) {
        font-size: var(--lop-type-body-2) !important;
    }

    html body #main .tuli-app .tuli-result h3 a,
    html body .tuli-intranet :is(.tuli-auth-tabs a, .tuli-account-footer a) {
        font-size: var(--lop-type-body-1) !important;
    }

    /* La cabecera utiliza Roboto también sobre la plantilla de acceso de TuLiApp. */
    body .lop-single-header #lop-public-navigation :is(.lop-nav-label, .lop-nav-heading, .lop-nav-section :where(a), .lop-nav-action) {
        font-family: var(--lop-type-menu-family, Roboto, Arial, sans-serif) !important;
        font-size: var(--lop-type-body-2) !important;
    }

    @media (max-width: 1040px) {
        body .lop-single-header #lop-public-navigation .lop-nav-label {
            font-size: var(--lop-type-body-1) !important;
        }
    }
}

@media (max-height: 350px) and (max-width: 650px) and (orientation: landscape) {
    .lop-portada .lop-ed-hero:has(.lop-hf-svg) > .fusion-builder-row.fusion-row {
        grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
        padding-inline: max(1rem, env(safe-area-inset-left, 0px))
                        max(1rem, env(safe-area-inset-right, 0px)) !important;
    }
}

@media (max-height: 300px) and (max-width: 650px) and (orientation: landscape) {
    .lop-portada .lop-single-header .lop-nav-row.fusion-row {
        min-height: 3.15rem;
        padding-block: .15rem;
    }

    .lop-portada .lop-ed-hero:has(.lop-hf-svg) {
        gap: .2rem;
        padding-block-start: .25rem !important;
    }

    .lop-portada .lop-ed-hero:has(.lop-hf-svg) > .fusion-builder-row.fusion-row {
        grid-template-columns: minmax(0, 2.65fr) minmax(0, 1fr);
    }

    .lop-portada .lop-ed-hero:has(.lop-hf-svg) .lop-home-hero-copy .fusion-text p,
    .lop-portada .lop-ed-hero:has(.lop-hf-svg) .lop-home-organisms-label {
        line-height: 1.2;
    }
}
