.ctqv-section {
    --ctqv-visible: 6;
    --ctqv-gap: 12px;
    padding: 32px 0 38px;
    color: #fff;
    background: #071b2d;
    direction: rtl;
    overflow: hidden;
}

.ctqv-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ctqv-heading h2 {
    margin: 0;
    padding-right: 12px;
    color: #fff;
    border-right: 6px solid #d20d16;
    font-size: clamp(22px, 2vw, 29px);
    font-weight: 900;
}

.ctqv-heading__line {
    height: 1px;
    flex: 1;
    background: rgba(255, 255, 255, 0.18);
}

.ctqv-controls {
    display: flex;
    gap: 6px;
}

.ctqv-controls button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #fff;
    background: #123654;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
}

.ctqv-controls button:last-child .canada-icon {
    transform: rotate(180deg);
}

.ctqv-controls button:disabled {
    opacity: 0.35;
    cursor: default;
}

.ctqv-controls .canada-icon {
    width: 20px;
    height: 20px;
}

.ctqv-viewport {
    width: 100%;
    overflow: hidden;
}

.ctqv-track {
    display: flex;
    width: 100%;
    gap: var(--ctqv-gap);
    direction: rtl;
    transition: transform 420ms cubic-bezier(.22, .75, .23, 1);
    will-change: transform;
}

.ctqv-card {
    position: relative;
    flex: 0 0 calc((100% - 60px) / 6);
    aspect-ratio: 9 / 16;
    max-height: 430px;
    overflow: hidden;
    background: #10283d;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    isolation: isolate;
}

.ctqv-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0d2336;
}

.ctqv-card__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92), transparent 55%);
    pointer-events: none;
}

.ctqv-card__play {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #fff;
    background: rgba(18, 137, 204, 0.92);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ctqv-card__play .canada-icon {
    width: 27px;
    height: 27px;
}

.ctqv-card.is-playing .ctqv-card__play {
    display: none;
}

.ctqv-card__content {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 13px;
    left: 12px;
    pointer-events: none;
}

.ctqv-card__content span {
    display: inline-block;
    margin-bottom: 5px;
    padding: 2px 7px;
    color: #fff;
    background: #1477bd;
    font-size: 10px;
    font-weight: 900;
}

.ctqv-card__content h3 {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.55;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.ctqv-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 16px;
}

.ctqv-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    background: rgba(255, 255, 255, 0.42);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.ctqv-dots button.is-active {
    background: #fff;
    transform: scale(1.15);
}

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

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

.ctqv-modal {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.ctqv-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.ctqv-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(3, 17, 29, 0.94);
    border: 0;
    cursor: default;
}

.ctqv-modal__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(470px, 1.1fr) minmax(330px, 0.9fr);
    width: min(1120px, calc(100vw - 64px));
    height: min(800px, calc(100vh - 64px));
    min-height: 540px;
    overflow: hidden;
    color: #fff;
    background: #0a2135;
    border: 0;
    box-shadow: none;
    direction: rtl;
}

.ctqv-modal__close {
    position: absolute;
    z-index: 5;
    top: 10px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0 0 4px;
    color: #fff;
    background: rgba(2, 14, 24, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    cursor: pointer;
    font: 300 34px/1 Arial, sans-serif;
}

.ctqv-modal__close:hover,
.ctqv-modal__close:focus-visible {
    color: #fff;
    background: #c90e17;
}

.ctqv-modal__player {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    justify-items: center;
    min-width: 0;
    min-height: 0;
    padding: 0 58px 0 18px;
    background: #102d49;
}

.ctqv-modal__player video {
    display: block;
    width: auto;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: 9 / 16;
    object-fit: contain;
    background: transparent;
    border: 0;
    outline: 0;
}

.ctqv-modal__caption {
    width: min(520px, 100%);
    min-height: 74px;
    padding: 10px 8px 13px;
    text-align: center;
}

.ctqv-modal__caption span {
    display: block;
    margin-bottom: 3px;
    color: #2f98e8;
    font-size: 12px;
    font-weight: 800;
}

.ctqv-modal__caption h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.55;
}

.ctqv-modal__actions {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    transform: translateY(-50%);
}

.ctqv-modal__actions a,
.ctqv-modal__actions button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #fff !important;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    cursor: pointer;
    font: 700 18px/1 Arial, sans-serif;
    text-decoration: none !important;
}

.ctqv-modal__actions a:hover,
.ctqv-modal__actions button:hover,
.ctqv-modal__actions a:focus-visible,
.ctqv-modal__actions button:focus-visible {
    background: #1679c4;
    border-color: #1679c4;
}

.ctqv-modal__actions button:disabled {
    opacity: 0.3;
    cursor: default;
}

.ctqv-modal__actions svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.ctqv-modal__action-separator {
    width: 28px;
    height: 1px;
    margin: 2px auto;
    background: rgba(255, 255, 255, 0.28);
}

.ctqv-modal__actions [data-ctqv-modal-prev],
.ctqv-modal__actions [data-ctqv-modal-next] {
    color: #fff;
    background: #1769aa;
    border: 0;
    border-radius: 0;
    font-size: 15px;
}

.ctqv-modal__playlist {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    padding: 18px 14px 14px;
    background: #071b2d;
    border-right: 1px solid rgba(142, 182, 214, 0.2);
}

.ctqv-modal__playlist > h2 {
    margin: 0 0 12px;
    padding: 0 12px 10px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 23px;
    font-weight: 900;
}

.ctqv-modal__list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    padding-left: 5px;
    overflow-y: auto;
    scrollbar-color: #6a8295 #0a2135;
    scrollbar-width: thin;
}

.ctqv-modal__item {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 11px;
    min-height: 112px;
    padding: 8px;
    color: #fff;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: right;
    direction: rtl;
}

.ctqv-modal__item:hover,
.ctqv-modal__item:focus-visible,
.ctqv-modal__item.is-active {
    background: #113552;
    border-color: rgba(63, 150, 219, 0.48);
}

.ctqv-modal__item.is-active {
    box-shadow: inset -4px 0 #2384d3;
}

.ctqv-modal__thumb {
    display: grid;
    place-items: center;
    width: 84px;
    height: 112px;
    overflow: hidden;
    color: #fff;
    background: #173c5b;
}

.ctqv-modal__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ctqv-modal__item-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

.ctqv-modal__item-copy small {
    margin-bottom: 5px;
    color: #3e9ce5;
    font-size: 10px;
    font-weight: 800;
}

.ctqv-modal__item-copy strong {
    display: -webkit-box;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

@media (max-width: 1050px) and (min-width: 768px) {
    .ctqv-modal__dialog {
        grid-template-columns: minmax(420px, 1fr) 300px;
        width: calc(100vw - 34px);
        height: calc(100vh - 34px);
    }
    .ctqv-modal { padding: 17px; }
    .ctqv-modal__item { grid-template-columns: 70px minmax(0, 1fr); min-height: 98px; }
    .ctqv-modal__thumb { width: 70px; height: 94px; }
    .ctqv-modal__player { padding-right: 50px; }
    .ctqv-modal__actions { right: 8px; }
}

@media (max-width: 991.98px) {
    .ctqv-section { --ctqv-visible: 4; }
    .ctqv-card { flex-basis: calc((100% - 36px) / 4); }
}

@media (max-width: 767.98px) {
    .ctqv-section {
        --ctqv-visible: 2;
        --ctqv-gap: 8px;
        padding-block: 24px 28px;
    }

    .ctqv-heading { margin-bottom: 12px; }
    .ctqv-heading h2 { padding-right: 9px; border-right-width: 5px; font-size: 21px; }
    .ctqv-heading__line { display: none; }
    .ctqv-controls { margin-right: auto; }
    .ctqv-controls button { width: 32px; height: 32px; }
    .ctqv-card { max-height: none; }
    .ctqv-card { flex-basis: calc((100% - 8px) / 2); }
    .ctqv-card__content { right: 9px; bottom: 10px; left: 9px; }
    .ctqv-card__content h3 { font-size: 12px; }
    .ctqv-card__play { width: 42px; height: 42px; }
    .ctqv-modal { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .ctqv-track { transition: none; }
}
