.ftcl-media-frame {
    position: relative;
    display: inline-block;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    vertical-align: top;
}

.ftcl-media-frame > img,
.ftcl-media-frame > a,
.ftcl-media-frame > a > img,
.ftcl-media-frame > a > picture,
.ftcl-media-frame > a > picture > img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.ftcl-media-frame > picture,
.ftcl-media-frame > picture > img {
    display: block;
    width: 100%;
}

.ftcl-media-watermark {
    position: absolute;
    left: 9px;
    bottom: 9px;
    z-index: 2;
    width: auto !important;
    height: 42% !important;
    min-height: 88px;
    max-height: 190px;
    padding: 0;
    border: 0;
    background: none;
    object-fit: contain !important;
    object-position: left bottom;
    opacity: .72;
    pointer-events: none;
}

.ftcl-media-watermark[hidden] {
    display: none !important;
}

.ftcl-media-zoom {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 3;
    display: grid;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 0;
    color: #fff;
    background: rgba(20, 18, 19, .74);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    cursor: zoom-in;
    opacity: .9;
    transition: background .18s ease, opacity .18s ease, transform .18s ease;
}

.ftcl-media-zoom:hover,
.ftcl-media-zoom:focus-visible {
    color: #211f20;
    background: #fff;
    opacity: 1;
    transform: scale(1.05);
}

.ftcl-media-zoom:focus-visible {
    outline: 3px solid #998484;
    outline-offset: 2px;
}

.ftcl-media-zoom svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.ftcl-media-modal[hidden] {
    display: none !important;
}

.ftcl-media-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    overflow: hidden;
    padding: 28px;
    place-items: center;
    background: rgba(13, 12, 12, .92);
}

.ftcl-media-modal-dialog {
    position: relative;
    display: grid;
    max-width: min(1180px, 94vw);
    max-height: 92vh;
    place-items: center;
    touch-action: none;
}

.ftcl-media-modal-image {
    display: block;
    width: auto;
    max-width: 94vw;
    height: auto;
    max-height: 88vh;
    object-fit: contain;
    box-shadow: 0 12px 42px rgba(0, 0, 0, .52);
    cursor: zoom-in;
    user-select: none;
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: center center;
    transition: transform .16s ease;
    will-change: transform;
}

.ftcl-media-modal-image.is-zoomed {
    cursor: grab;
}

.ftcl-media-modal-image.is-dragging {
    cursor: grabbing;
    transition: none;
}

.ftcl-media-hint {
    position: absolute;
    left: 50%;
    bottom: 10px;
    z-index: 3;
    margin: 0;
    padding: 6px 10px;
    color: #fff;
    background: rgba(20, 18, 19, .76);
    font: 600 10px/1.2 Arial, sans-serif;
    letter-spacing: .08em;
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
    white-space: nowrap;
    opacity: 1;
    transition: opacity .14s ease;
}

.ftcl-media-modal.is-zoomed .ftcl-media-hint {
    opacity: 0;
    visibility: hidden;
}

.ftcl-media-modal .ftcl-media-watermark {
    left: 13px;
    bottom: 13px;
    height: 32% !important;
    min-height: 120px;
    max-height: 260px;
    opacity: .78;
}

.ftcl-media-close {
    position: absolute;
    top: -18px;
    right: -18px;
    z-index: 4;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    color: #211f20;
    background: #fff;
    font: 400 29px/38px Arial, sans-serif;
    cursor: pointer;
}

.ftcl-media-close:hover,
.ftcl-media-close:focus-visible {
    color: #fff;
    background: #998484;
}

.ftcl-media-close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

body.ftcl-media-open {
    overflow: hidden;
}

/* Sustituye los visores incrustados en fichas antiguas sin editar su contenido. */
html.ftcl-media-global-active .ftai-open,
html.ftcl-media-global-active #ftai-lightbox {
    display: none !important;
}

@media (max-width: 480px) {
    .ftcl-media-modal {
        padding: 16px;
    }

    .ftcl-media-zoom {
        top: 7px;
        right: 7px;
        width: 34px;
        height: 34px;
    }

    .ftcl-media-watermark {
        left: 7px;
        bottom: 7px;
        min-height: 78px;
        max-height: 125px;
    }

    .ftcl-media-close {
        top: -13px;
        right: -9px;
    }

    .ftcl-media-hint {
        bottom: 7px;
        max-width: calc(100% - 20px);
        font-size: 9px;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ftcl-media-zoom,
    .ftcl-media-modal-image {
        transition: none;
    }
}
