.tvmedia-trigger {
    cursor: pointer;
    display: inline-block;
    text-decoration: underline;
}


.tvmedia-trigger--button {
    border: 1px solid currentColor;
    border-radius: 4px;
    display: inline-block;
    padding: 0.6rem 1rem;
    text-decoration: none;
}

.tvmedia-trigger--button:hover,
.tvmedia-trigger--button:focus {
    text-decoration: none;
}

.tvmedia-trigger__image {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border: 0;
}

.tvmedia-modal,
.tvmedia-modal[hidden] {
    display: none !important;
}

.tvmedia-modal {
    align-items: center;
    background: rgba(0, 0, 0, 0.68);
    box-sizing: border-box;
    height: 100vh;
    justify-content: center;
    left: 0;
    padding: 2.5vh 2.5vw;
    position: fixed;
    top: 0;
    width: 100vw;
    z-index: 100000;
}

.tvmedia-modal.is-open:not([hidden]) {
    display: flex !important;
}

body.tvmedia-modal-open {
    overflow: hidden;
}

.tvmedia-modal__overlay {
    appearance: none;
    background: transparent;
    border: 0;
    bottom: 0;
    cursor: default;
    display: block;
    margin: 0;
    padding: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}

.tvmedia-modal__content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 15px 55px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 95vh;
    max-height: 95vh;
    max-width: 95vw;
    overflow: hidden;
    position: relative;
    width: 95vw;
    z-index: 2;
}

.tvmedia-modal__close,
.tvmedia-modal__floating-close {
    align-items: center;
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
    color: #222 !important;
    cursor: pointer;
    display: flex;
    font-size: 34px;
    height: 48px;
    justify-content: center;
    line-height: 1;
    position: fixed;
    right: 18px;
    text-decoration: none !important;
    top: 18px;
    width: 48px;
    z-index: 2147483647;
}

.tvmedia-modal__close:hover,
.tvmedia-modal__close:focus,
.tvmedia-modal__floating-close:hover,
.tvmedia-modal__floating-close:focus {
    color: #000 !important;
    text-decoration: none !important;
}

.tvmedia-modal__toolbar {
    align-items: center;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    box-sizing: border-box;
    display: flex;
    flex: 0 0 48px;
    gap: 1rem;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 0.75rem 0 1rem;
    position: relative;
    z-index: 3;
}

.tvmedia-modal__title {
    color: #222;
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvmedia-modal__toolbar-close {
    appearance: none;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 4px;
    color: #111 !important;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
    padding: 0.55rem 0.75rem;
    position: relative;
    z-index: 4;
}

.tvmedia-modal__toolbar-close:hover,
.tvmedia-modal__toolbar-close:focus {
    background: #eee;
    color: #000 !important;
}

.tvmedia-modal__body,
.tvmedia-viewer {
    border: 0;
    box-sizing: border-box;
    min-height: 0;
    width: 100%;
}

.tvmedia-modal__body {
    flex: 1 1 auto;
    height: auto;
}

.tvmedia-viewer {
    height: 100%;
}

.tvmedia-viewer {
    display: block;
}


.tvmedia-mobile-fallback {
    display: none;
    height: 100%;
}

.tvmedia-modal.is-mobile-fallback .tvmedia-mobile-fallback {
    display: block;
}

.tvmedia-modal.is-mobile-fallback .tvmedia-viewer[data-tvmedia-mobile-skip="1"] {
    display: none;
}

.tvmedia-message {
    align-items: center;
    box-sizing: border-box;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.tvmedia-message__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tvmedia-message--error h3 {
    color: #b00020;
}

.tvmedia-button {
    border: 1px solid currentColor;
    border-radius: 4px;
    display: inline-block;
    padding: 0.6rem 1rem;
    text-decoration: none;
}

@media (max-width: 768px) {
    .tvmedia-modal {
        padding: 0;
    }

    .tvmedia-modal__content {
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
        max-width: 100vw;
        width: 100vw;
    }
}

.tvmedia-external-close {
    display: none;
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 2147483647 !important;
    background: #fff !important;
    color: #111 !important;
    border: 2px solid #111 !important;
    border-radius: 999px !important;
    padding: 10px 14px !important;
    font: 700 18px/1 Arial, sans-serif !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .45) !important;
    cursor: pointer !important;
}

.tvmedia-modal.is-open + .tvmedia-external-close,
.tvmedia-external-close.is-open {
    display: block !important;
}

/* 0.1.12 hardening: viewer/fallback states must be mutually exclusive. */
.tvmedia-modal:not(.is-open) .tvmedia-viewer[data-tvmedia-src] {
    display: none !important;
}

.tvmedia-modal:not(.is-mobile-fallback) .tvmedia-mobile-fallback[data-tvmedia-mobile-fallback] {
    display: none !important;
}

.tvmedia-modal.is-mobile-fallback .tvmedia-mobile-fallback[data-tvmedia-mobile-fallback] {
    display: block !important;
}

.tvmedia-modal.is-mobile-fallback .tvmedia-viewer[data-tvmedia-mobile-skip="1"] {
    display: none !important;
}

.tvmedia-modal.is-open:not(.is-mobile-fallback) .tvmedia-viewer[data-tvmedia-src] {
    display: block !important;
}

/* 0.1.13 hardening: create a stable viewport for browser PDF renderers. */
.tvmedia-modal.is-open:not([hidden]) {
    display: flex !important;
}

.tvmedia-modal__content {
    display: block !important;
    position: relative !important;
    overflow: hidden !important;
}

.tvmedia-modal__toolbar {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: 52px !important;
    min-height: 52px !important;
    z-index: 2147483600 !important;
}

.tvmedia-modal__body {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 52px !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.tvmedia-viewer-host {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
    background: #fff !important;
}

.tvmedia-viewer-host[style*="display: block"],
.tvmedia-modal.is-open:not(.is-mobile-fallback) .tvmedia-viewer-host[data-tvmedia-viewer-host] {
    display: block !important;
}

.tvmedia-viewer,
.tvmedia-viewer-host iframe.tvmedia-viewer {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    border: 0 !important;
    display: block !important;
    background: #fff !important;
}

.tvmedia-modal:not(.is-open) .tvmedia-viewer-host[data-tvmedia-viewer-host],
.tvmedia-modal.is-mobile-fallback .tvmedia-viewer-host[data-tvmedia-mobile-skip="1"] {
    display: none !important;
}

.tvmedia-mobile-fallback[data-tvmedia-mobile-fallback] {
    position: absolute !important;
    inset: 0 !important;
    overflow: auto !important;
}

@media (max-width: 768px) {
    .tvmedia-modal__toolbar {
        height: 56px !important;
        min-height: 56px !important;
    }

    .tvmedia-modal__body {
        top: 56px !important;
    }
}
