/*
 * Bloques del editor nuevo de la información del evento (gestor fetrichamps2025).
 * El HTML llega con clases fx-* que F26HtmlClean conserva; aquí se pintan con el estilo de la web
 * (rojo FETRI, dorado, Montserrat). Los efectos (lightbox, carrusel, animaciones al hacer scroll y
 * modelos 3D) los pone js/rich-content.js, copia del del gestor.
 * Todo bajo html.f26c .f26-ev .fx-rich para ganar a las reglas generales de .html-description.
 */

html.f26c .f26-ev .fx-rich {
    --fx-gap: 12px;
    --fx-radius: 12px;
    display: flow-root; /* contiene las imágenes flotadas */
}

html.f26c .f26-ev .fx-rich img { box-sizing: border-box; }

/* ───────── Pie de foto ───────── */
html.f26c .f26-ev .fx-rich figure.fx-figure {
    max-width: 100%;
    margin: 12px auto;
}

    html.f26c .f26-ev .fx-rich figure.fx-figure > img {
        display: block;
        width: 100%;
        margin: 0;
    }

    html.f26c .f26-ev .fx-rich figure.fx-figure > figcaption {
        margin-top: 8px;
        color: var(--f26-text-2, #5B5F6B);
        font-size: 13px;
        font-weight: 600;
        line-height: 1.4;
        text-align: center;
    }

/* ───────── Estilos de imagen ───────── */
html.f26c .f26-ev .fx-rich img[data-fx-style="rounded"] { border-radius: 16px; }

html.f26c .f26-ev .fx-rich img[data-fx-style="shadow"] {
    border-radius: 12px;
    box-shadow: 0 18px 40px -12px rgba(28, 28, 34, .38);
}

html.f26c .f26-ev .fx-rich img[data-fx-style="frame"] {
    padding: 6px;
    border: 1px solid var(--f26-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--f26-shadow-1);
}

html.f26c .f26-ev .fx-rich img[data-fx-style="circle"] {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
}

/* Sin fondo: sombra que sigue la silueta del PNG transparente (renders 3D, IA) */
html.f26c .f26-ev .fx-rich img[data-fx-style="cutout"] {
    border-radius: 0;
    filter: drop-shadow(0 16px 18px rgba(28, 28, 34, .28));
}

/* ───────── Galería ───────── */
html.f26c .f26-ev .fx-rich .fx-gallery {
    --cols: 3;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: var(--fx-gap);
    align-items: center;
    margin: 16px 0;
    clear: both;
}

html.f26c .f26-ev .fx-rich .fx-gallery[data-cols="2"] { --cols: 2; }
html.f26c .f26-ev .fx-rich .fx-gallery[data-cols="4"] { --cols: 4; }

html.f26c .f26-ev .fx-rich .fx-gallery img {
    display: block;
    width: 100%;
    margin: 0;
}

html.f26c .f26-ev .fx-rich .fx-gallery[data-equal="1"] img {
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

    html.f26c .f26-ev .fx-rich .fx-gallery[data-equal="1"] img[data-fx-style="circle"] { object-fit: cover; }

/* Carrusel (lo monta rich-content.js) */
/* Nunca más ancho que la tarjeta: el carrusel se recorta en su caja y las fotos se pasan dentro.
   Los overflow llevan !important porque ChMain.razor fuerza «.html-description * { overflow: visible !important }»:
   sin él, la pista no recortaba y se veían todas las fotos saliéndose de la tarjeta. */
html.f26c .f26-ev .fx-rich .fx-gallery[data-view="carousel"] {
    --car-side: 52px; /* margen a cada lado para las flechas: van fuera de las fotos y el carrusel queda centrado */
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding-inline: var(--car-side);
    overflow: hidden !important;
}

html.f26c .f26-ev .fx-rich .fx-gallery[data-view="carousel"][data-fx-ready] { display: block; }

html.f26c .f26-ev .fx-rich .fx-car-track {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--fx-gap) * (var(--cols) - 1)) / var(--cols));
    gap: var(--fx-gap);
    align-items: center;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

    html.f26c .f26-ev .fx-rich .fx-car-track::-webkit-scrollbar { display: none; }
    html.f26c .f26-ev .fx-rich .fx-car-track > img { scroll-snap-align: start; }

html.f26c .f26-ev .fx-rich .fx-car-btn {
    position: absolute;
    top: calc(50% - 34px);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--f26-ink);
    color: #fff;
    box-shadow: 0 6px 18px rgba(28, 28, 34, .3);
    cursor: pointer;
    transition: opacity .2s, background .2s;
}

    html.f26c .f26-ev .fx-rich .fx-car-btn:hover { background: var(--f26-red); }
    html.f26c .f26-ev .fx-rich .fx-car-btn:focus-visible { outline: 3px solid var(--f26-gold); outline-offset: 2px; }
    /* En el tope se queda tenue (no desaparece) para que los dos lados se vean iguales */
    html.f26c .f26-ev .fx-rich .fx-car-btn[disabled] { opacity: .25; box-shadow: none; cursor: default; pointer-events: none; }
    html.f26c .f26-ev .fx-rich .fx-car-btn.is-prev { left: 4px; }
    html.f26c .f26-ev .fx-rich .fx-car-btn.is-next { right: 4px; }
    html.f26c .f26-ev .fx-rich .fx-car-btn svg { width: 20px; height: 20px; }

html.f26c .f26-ev .fx-rich .fx-car-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

    html.f26c .f26-ev .fx-rich .fx-car-dots button {
        width: 8px;
        height: 8px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: var(--f26-line);
        cursor: pointer;
        transition: width .25s, background .25s;
    }

        html.f26c .f26-ev .fx-rich .fx-car-dots button.is-active {
            width: 24px;
            background: var(--f26-red);
        }

html.f26c .f26-ev .fx-rich img.fx-lb { cursor: zoom-in; }

/* ───────── Imagen + texto ───────── */
html.f26c .f26-ev .fx-rich .fx-media-text {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin: 22px 0;
    clear: both;
}

html.f26c .f26-ev .fx-rich .fx-media-text[data-ratio="40"] { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
html.f26c .f26-ev .fx-rich .fx-media-text[data-side="right"][data-ratio="40"] { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
html.f26c .f26-ev .fx-rich .fx-media-text[data-side="right"] > .fx-mt-media { order: 2; }

html.f26c .f26-ev .fx-rich .fx-mt-media img {
    display: block;
    width: 100%;
    margin: 0;
}

html.f26c .f26-ev .fx-rich .fx-mt-body > :first-child { margin-top: 0; }
html.f26c .f26-ev .fx-rich .fx-mt-body > :last-child { margin-bottom: 0; }
html.f26c .f26-ev .fx-rich .fx-mt-placeholder { display: none; } /* hueco sin imagen: no se publica */

/* ───────── Avisos ─────────
   Mismos colores que en el editor del gestor (fetrichamps2025 wwwroot/css/rich-content.css), para que el tipo
   elegido se reconozca igual en los dos sitios: info azul, importante ámbar, consejo morado y éxito verde. */
html.f26c .f26-ev .fx-rich .fx-callout {
    --c: #2563eb;
    --ic: #2563eb;
    --bg: #eff6ff;
    position: relative;
    margin: 16px 0;
    padding: 14px 16px 14px 50px;
    border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
    border-left: 4px solid var(--c);
    border-radius: 12px;
    background: var(--bg);
    clear: both;
}

    html.f26c .f26-ev .fx-rich .fx-callout::before {
        content: "";
        position: absolute;
        left: 16px;
        top: 15px;
        width: 22px;
        height: 22px;
        background: var(--ic);
        -webkit-mask: var(--icon) center / contain no-repeat;
        mask: var(--icon) center / contain no-repeat;
    }

    html.f26c .f26-ev .fx-rich .fx-callout > :first-child { margin-top: 0; }
    html.f26c .f26-ev .fx-rich .fx-callout > :last-child { margin-bottom: 0; }

    /* «IMPORTANTE: …» dentro de un aviso ya es un aviso: no se vuelve a pintar como nota dorada */
    html.f26c .f26-ev .fx-rich .fx-callout .f26-doc-note {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: none !important;
    }

html.f26c .f26-ev .fx-rich .fx-callout[data-type="info"] {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-11v6h2v-6h-2zm0-4v2h2V7h-2z'/%3E%3C/svg%3E");
}

html.f26c .f26-ev .fx-rich .fx-callout[data-type="warning"] {
    --c: #d97706;
    --ic: #d97706;
    --bg: #fffbeb;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zM11 16v2h2v-2h-2zm0-7v5h2V9h-2z'/%3E%3C/svg%3E");
}

html.f26c .f26-ev .fx-rich .fx-callout[data-type="tip"] {
    --c: #7c3aed;
    --ic: #7c3aed;
    --bg: #f5f3ff;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.973 18H11v-5h2v5h1.027c.132-1.202.745-2.194 1.74-3.277.113-.122.832-.867.917-.973a6 6 0 1 0-9.37-.002c.086.107.807.853.918.974.996 1.084 1.609 2.076 1.741 3.278zM10 20v1h4v-1h-4zm-4.246-5a8 8 0 1 1 12.49.002C17.624 15.774 16 17 16 18.5V21a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-2.5C8 17 6.375 15.774 5.754 15z'/%3E%3C/svg%3E");
}

html.f26c .f26-ev .fx-rich .fx-callout[data-type="success"] {
    --c: #059669;
    --ic: #059669;
    --bg: #ecfdf5;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.997-6l7.07-7.071-1.414-1.414-5.656 5.657-2.829-2.829-1.414 1.414L11.003 16z'/%3E%3C/svg%3E");
}

/* ───────── Botón ───────── */
/* .html-description p fuerza text-align:left !important: el botón necesita su propia alineación.
   Con .fx-block (todo botón lo lleva) gana también a «.normative-body .html-description p» de la normativa. */
html.f26c .f26-ev .fx-rich .fx-btn-row.fx-block {
    margin: 20px 0;
    text-align: center !important;
    clear: both;
}

html.f26c .f26-ev .fx-rich .fx-btn-row[data-align="left"] { text-align: left !important; }
html.f26c .f26-ev .fx-rich .fx-btn-row[data-align="right"] { text-align: right !important; }

html.f26c .f26-ev .fx-rich a.fx-btn {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: 12px 24px;
    border: 2px solid var(--f26-red);
    border-radius: 999px;
    background: var(--f26-red);
    color: #fff !important;
    font-family: var(--f26-font);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none !important;
    box-shadow: 0 10px 22px -10px rgba(207, 18, 47, .7);
    transition: transform .2s, background .2s, border-color .2s;
}

    html.f26c .f26-ev .fx-rich a.fx-btn::after {
        content: "→";
        transition: transform .2s;
    }

    html.f26c .f26-ev .fx-rich a.fx-btn:hover {
        border-color: var(--f26-red-dk);
        background: var(--f26-red-dk);
        transform: translateY(-2px);
    }

        html.f26c .f26-ev .fx-rich a.fx-btn:hover::after { transform: translateX(3px); }

    html.f26c .f26-ev .fx-rich a.fx-btn:focus-visible { outline: 3px solid var(--f26-gold); outline-offset: 3px; }

    html.f26c .f26-ev .fx-rich a.fx-btn[data-variant="outline"] {
        background: transparent;
        color: var(--f26-red) !important;
        box-shadow: none;
    }

        html.f26c .f26-ev .fx-rich a.fx-btn[data-variant="outline"]:hover {
            background: var(--f26-red);
            color: #fff !important;
        }

/* ───────── Modelo 3D ───────── */
html.f26c .f26-ev .fx-rich .fx-3d {
    --ratio: 1 / 1;
    position: relative;
    width: 60%;
    max-width: 100%;
    margin: 20px auto;
    aspect-ratio: var(--ratio);
    overflow: hidden !important; /* ChMain.razor fuerza overflow: visible en todo .html-description */
    border-radius: var(--fx-radius);
    background: radial-gradient(120% 120% at 50% 0%, #FFFFFF 0%, #ECEEF2 100%);
    clear: both;
}

html.f26c .f26-ev .fx-rich .fx-3d[data-ratio="4/3"] { --ratio: 4 / 3; }
html.f26c .f26-ev .fx-rich .fx-3d[data-ratio="16/9"] { --ratio: 16 / 9; }

html.f26c .f26-ev .fx-rich .fx-3d-ph {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--f26-text);
    font-size: 13px;
    text-align: center;
}

    html.f26c .f26-ev .fx-rich .fx-3d-ph svg { width: 44px; height: 44px; color: var(--f26-red); }

html.f26c .f26-ev .fx-rich .fx-3d-preview { display: none; }

html.f26c .f26-ev .fx-rich .fx-3d model-viewer {
    width: 100%;
    height: 100%;
    background: transparent;
    --poster-color: transparent;
}

html.f26c .f26-ev .fx-rich .fx-3d-hint {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(28, 28, 34, .72);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    transition: opacity .4s;
}

html.f26c .f26-ev .fx-rich .fx-3d.is-touched .fx-3d-hint { opacity: 0; }

/* ───────── Animaciones ───────── */
@keyframes fx-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

html.f26c .f26-ev .fx-rich [data-fx-anim="float"] { animation: fx-float 5s ease-in-out infinite; }

html.f26c .f26-ev .fx-rich [data-fx-anim]:not([data-fx-anim="float"]) {
    transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}

html.f26c.fx-js .f26-ev .fx-rich [data-fx-anim]:not([data-fx-anim="float"]):not(.is-in) { opacity: 0; }
html.f26c.fx-js .f26-ev .fx-rich [data-fx-anim="fade-up"]:not(.is-in) { transform: translateY(28px); }
html.f26c.fx-js .f26-ev .fx-rich [data-fx-anim="slide-left"]:not(.is-in) { transform: translateX(-48px); }
html.f26c.fx-js .f26-ev .fx-rich [data-fx-anim="slide-right"]:not(.is-in) { transform: translateX(48px); }
html.f26c.fx-js .f26-ev .fx-rich [data-fx-anim="zoom"]:not(.is-in) { transform: scale(.9); }

@media (prefers-reduced-motion: reduce) {
    html.f26c .f26-ev .fx-rich [data-fx-anim] {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ───────── Móvil ───────── */
@media (max-width: 576px) {
    html.f26c .f26-ev .fx-rich .fx-gallery[data-cols="3"],
    html.f26c .f26-ev .fx-rich .fx-gallery[data-cols="4"] { --cols: 2; }

    /* Sin flechas (se pasa con el dedo): sin margen lateral */
    html.f26c .f26-ev .fx-rich .fx-gallery[data-view="carousel"] { --car-side: 0px; }
    html.f26c .f26-ev .fx-rich .fx-gallery[data-view="carousel"] .fx-car-track { grid-auto-columns: 82%; }
    html.f26c .f26-ev .fx-rich .fx-car-btn { display: none; }

    /* Las imágenes con texto alrededor pasan a ir centradas */
    html.f26c .f26-ev .fx-rich img[style*="float"],
    html.f26c .f26-ev .fx-rich figure.fx-figure[style*="float"] {
        float: none !important;
        display: block;
        margin: 12px auto !important;
        min-width: 60%;
    }

    html.f26c .f26-ev .fx-rich .fx-media-text,
    html.f26c .f26-ev .fx-rich .fx-media-text[data-ratio="40"],
    html.f26c .f26-ev .fx-rich .fx-media-text[data-side="right"][data-ratio="40"] {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    html.f26c .f26-ev .fx-rich .fx-media-text[data-side="right"] > .fx-mt-media { order: 0; }
    html.f26c .f26-ev .fx-rich .fx-3d { width: 100% !important; }
}
