/* =====================================================================
   FETRI · Rediseño 2026 · Resultados incrustables en otras webs
   Con ?embed=1, /resultslive/{Key} y /event-results/{externalId} se ven
   dentro de un iframe en otra web: el script de cabecera de index.html
   pone html.f26e antes de pintar y aquí se quita la estructura de la web
   (barra superior, cabecera de página, patrocinadores, pie, barra inferior,
   Tritón y botones flotantes) y se da forma a la franja de marca
   (Components/Embed/EmbedBar). Los resultados se quedan como están.
   El botón "Incrustar" y su diálogo (Components/Embed/EmbedButton) van
   bajo html.f26c. FAA y FEDDI no llevan ninguna de las dos clases.
   ===================================================================== */

/* ---------- Página incrustada: sin estructura de la web ---------- */
html.f26.f26e {
    --f26-topbar-h: 0px;
    --f26-bottomnav-h: 0px;
    /* sin pie: lo que quede por debajo del contenido es del color de la página, no del pie */
    background: var(--f26-bg) !important;
    scroll-padding-top: 12px;
}
html.f26c.f26e body {
    padding-bottom: 0 !important;
    /* la altura del body es la del contenido (js/f26-embed.js la manda a la web que incrusta):
       sin márgenes que se salgan por arriba o por abajo */
    display: flow-root;
}

html.f26e .f26-splash,
html.f26e .f26-topbar,
html.f26e .f26-drawer,
html.f26e .f26-drawer-overlay,
html.f26e .f26-bottomnav,
html.f26e .f26-hero,
html.f26e .f26-sponsors,
html.f26e .f26-footer,
html.f26e .f26-bot,
html.f26e .scroll-to-top,
html.f26e .return-to-schedule-btn {
    display: none !important;
}

html.f26c.f26e body > #app main.container-fluid,
html.f26c.f26e main.container-fluid {
    margin-top: 0 !important;
}

/* Mientras carga la aplicación: en lugar de la presentación a pantalla completa, un anillo pequeño con el
   progreso (el cargador de #app que trae Blazor, en los colores de la web) */
html.f26.f26e #app > .loading-progress {
    display: block !important;
    width: 44px;
    height: 44px;
    margin: 72px auto 0;
}
html.f26.f26e #app > .loading-progress circle {
    stroke: var(--f26-tint-2) !important;
    stroke-width: 5px;
}
html.f26.f26e #app > .loading-progress circle:last-child {
    stroke: var(--f26-red) !important;
}
html.f26.f26e #app > .loading-progress-text {
    display: block !important;
    position: static;
    margin: 12px 0 0;
    color: var(--f26-mute);
    font-family: var(--f26-font);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}
html.f26.f26e #app > .loading-progress-text::after {
    content: "Cargando resultados " var(--blazor-load-percentage-text, "");
}

/* ---------- Franja de marca (arriba del todo, a todo el ancho) ---------- */
html.f26e .f26-embed-strip {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin: 0 calc(-1 * var(--f26-gutter)) 16px;
    padding: 8px var(--f26-gutter) 11px;
    background: var(--f26-ink);
    color: #fff;
    font-family: var(--f26-font);
}
html.f26e .f26-embed-strip::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--f26-tex);
    opacity: .9;
    pointer-events: none;
}
html.f26e .f26-embed-strip::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--f26-grad-accent);
    pointer-events: none;
}
html.f26e .f26-embed-strip__iso {
    flex: none;
    width: 36px;
    height: auto;
}
html.f26e .f26-embed-strip__txt {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
html.f26e .f26-embed-strip__kicker,
html.f26e .f26-embed-strip__title {
    overflow: hidden;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html.f26e .f26-embed-strip__kicker {
    color: var(--f26-gold);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
html.f26e .f26-embed-strip__title {
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
}
html.f26e .f26-embed-strip__link {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--f26-pill);
    background: rgba(255, 255, 255, .1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
    color: #fff !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}
html.f26e .f26-embed-strip__link:hover {
    background: #fff;
    color: var(--f26-ink) !important;
}
html.f26e .f26-embed-strip__link i { font-size: 11px; }

@media (max-width: 575.98px) {
    html.f26e .f26-embed-strip {
        gap: 10px;
        min-height: 50px;
        margin-bottom: 10px;
        padding: 7px 12px 10px;
    }
    html.f26e .f26-embed-strip__iso { width: 30px; }
    html.f26e .f26-embed-strip__kicker { font-size: 9.5px; letter-spacing: .08em; }
    /* el nombre de la prueba o del evento puede ocupar dos líneas antes de cortarse */
    html.f26e .f26-embed-strip__title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: 12.5px;
        white-space: normal;
    }
    html.f26e .f26-embed-strip__link { min-height: 32px; padding: 0 11px; font-size: 11px; gap: 6px; }
}
/* marcos muy estrechos: "Ver" y el icono */
@media (max-width: 359.98px) {
    html.f26e .f26-embed-strip__more { display: none; }
}

/* Resultados del evento incrustados: sin "Volver al horario", el Excel queda a la derecha */
html.f26e .f26-er.is-embedded .event-results-header { justify-content: flex-end; }

/* Clasificación incrustada en el móvil: sin anterior y siguiente, los botones van juntos y "Actualizar" al final */
@media (max-width: 768px) {
    html.f26e .is-embedded .rl-toolbar-row:last-child { justify-content: flex-start; gap: 8px; }
    html.f26e .is-embedded .rl-toolbar-row:last-child .rl-divider { margin-left: auto; }
}

/* ---------- Diálogos dentro del iframe ----------
   El iframe mide lo mismo que su contenido, así que un diálogo fijo centrado quedaría en mitad de la
   clasificación, quizá fuera de la vista. La web que incrusta (embed.js) dice qué parte del iframe se ve y
   js/f26-embed.js lo deja en --f26e-top y --f26e-vh; sin ese aviso (iframe de alto fijo) valen 0 y 100 %. */
html.f26e .rl-modal-overlay,
html.f26e .rl-bio-modal-overlay,
html.f26e .modal.show {
    top: var(--f26e-top, 0px) !important;
    bottom: auto !important;
    height: var(--f26e-vh, 100%) !important;
}
html.f26e .rl-modal,
html.f26e .rl-bio-modal {
    max-height: calc(var(--f26e-vh, 100vh) * .9) !important;
}
/* Los de Bootstrap se centran en el alto de la pantalla (100vh), que en el iframe es todo su alto: con la parte
   que se ve, el diálogo no desborda su capa y la rueda del ratón mueve la web y no el diálogo */
html.f26e .modal.show .modal-dialog-centered {
    min-height: calc(var(--f26e-vh, 100vh) - 3.5rem) !important;
}
@media (max-width: 767.98px) {
    html.f26e .rl-modal { max-height: calc(var(--f26e-vh, 100vh) * .94) !important; }
}

/* ---------- Botón "Incrustar" en la barra de los resultados ---------- */
html.f26c .f26-embed-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
html.f26c .f26-embed-btn i { margin: 0 !important; font-size: 12px; }

/* Resultados del evento: la píldora va junto al Excel (dorado), pero en blanco como "Volver" */
html.f26c .f26-er .event-results-header > .event-results-actions:last-child .rk-pill-btn.f26-embed-btn {
    border: 1px solid var(--f26-line) !important;
    background: #fff !important;
    color: var(--f26-ink) !important;
}
html.f26c .f26-er .event-results-header > .event-results-actions:last-child .rk-pill-btn.f26-embed-btn:hover {
    border-color: var(--f26-ink) !important;
}

/* En el móvil, solo el icono (el texto sigue ahí para los lectores de pantalla): cabe en la fila sin partirla */
@media (max-width: 575.98px) {
    html.f26c .f26-embed-btn {
        flex: 0 0 auto !important;
        padding: 0 !important;
    }
    html.f26c .rl-pill-btn.f26-embed-btn { width: 34px; }
    html.f26c .rk-pill-btn.f26-embed-btn { width: 40px; }
    html.f26c .f26-embed-btn__txt {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* ---------- Diálogo "Incrustar en tu web" (ModalDialog) ---------- */
html.f26c .f26-embed-dlg {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--f26-text);
    font-size: 14px;
}
html.f26c .f26-embed-dlg__lead {
    margin: 0;
    color: var(--f26-text-2);
    line-height: 1.55;
}
html.f26c .f26-embed-dlg__lead b { color: var(--f26-ink); font-weight: 800; }
html.f26c .f26-embed-dlg__label {
    margin: 4px 0 -4px;
    color: var(--f26-mute);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
html.f26c .f26-embed-dlg__code {
    display: block;
    width: 100%;
    min-height: 132px;
    padding: 12px 14px;
    border: 1px solid var(--f26-line);
    border-radius: var(--f26-r-sm);
    background: var(--f26-tint);
    color: var(--f26-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    resize: vertical;
}
html.f26c .f26-embed-dlg__code:focus { border-color: var(--f26-ink); outline: none; }
html.f26c .f26-embed-dlg__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
}
html.f26c .f26-embed-dlg__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: var(--f26-pill);
    background: var(--f26-red);
    color: #fff;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color .15s ease;
}
html.f26c .f26-embed-dlg__copy:hover { background: var(--f26-red-dk); }
html.f26c .f26-embed-dlg__copy.is-done { background: var(--f26-green-text); }
html.f26c .f26-embed-dlg__preview {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--f26-ink) !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
html.f26c .f26-embed-dlg__preview i { font-size: 11px; }
html.f26c .f26-embed-dlg__status {
    min-height: 1.3em;
    margin: -4px 0 0;
    color: var(--f26-green-text);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
}
html.f26c .f26-embed-dlg__status.is-error { color: var(--f26-red-dk); }
html.f26c .f26-embed-dlg__notes {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--f26-line);
    color: var(--f26-text-2);
    font-size: 12.5px;
    line-height: 1.45;
    list-style: none;
}
html.f26c .f26-embed-dlg__notes li {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 8px;
}
html.f26c .f26-embed-dlg__notes i {
    margin-top: 3px;
    color: var(--f26-red);
    font-size: 12px;
    text-align: center;
}
@media (max-width: 575.98px) {
    html.f26c .f26-embed-dlg__copy { flex: 1 1 100%; }
    html.f26c .f26-embed-dlg__code { min-height: 184px; font-size: 12px; }
}
