/* Coinpress — post YouTube gallery + modal (post-video.css)
   Theme tokens: match style.css / __colors_default.css (5px radius, #0a1426 headings, #5e646d body). */

.cp-video-gallery,
.cp-video-modal {
    --cp-video-radius: 5px;
    --cp-video-text: #5e646d;
    --cp-video-heading: #0a1426;
    --cp-video-surface: #ffffff;
    --cp-video-border: #e2eef2;
    --cp-video-backdrop: rgba(10, 20, 38, 0.72);
    --cp-video-shadow: 0 8px 32px rgba(10, 20, 38, 0.16);
    --cp-video-close-bg: #eff6f8;
    --cp-video-close-hover: #dce8ec;
    --cp-video-focus: rgba(10, 20, 38, 0.12);
    --cp-video-active-ring: rgba(10, 20, 38, 0.35);
}

.scheme_dark .cp-video-gallery,
.scheme_dark .cp-video-modal {
    --cp-video-text: #aeb2ba;
    --cp-video-heading: #ffffff;
    --cp-video-surface: #0f1a2e;
    --cp-video-border: #2a3548;
    --cp-video-backdrop: rgba(0, 0, 0, 0.78);
    --cp-video-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --cp-video-close-bg: #1a2538;
    --cp-video-close-hover: #243044;
    --cp-video-focus: rgba(255, 255, 255, 0.12);
    --cp-video-active-ring: rgba(255, 255, 255, 0.45);
}

.cp-video-gallery {
    margin: 0;
    clear: both;
}

.cp-video-gallery > h2 {
    margin: 0 0 0.5rem;
    color: var(--cp-video-heading);
    font-weight: 600;
}

.cp-video-gallery__intro {
    margin: 0 0 1.25rem;
    line-height: 1.6;
    color: var(--cp-video-text);
}

.cp-video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    margin-bottom: 0.75rem;
    border-radius: var(--cp-video-radius);
    overflow: hidden;
}

.cp-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.cp-video-item--inline,
.cp-video-item--popup {
    margin-bottom: 0;
}

.cp-video-item__title {
    margin: 0 0 0.5rem;
    font-size: 1.3333rem;
    line-height: 1.35;
    color: var(--cp-video-heading);
    font-weight: 600;
}

.cp-video-item__description {
    line-height: 1.6;
    color: var(--cp-video-text);
}

.cp-video-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.cp-video-thumb__image-wrap {
    display: block;
    overflow: hidden;
    border-radius: var(--cp-video-radius);
    background: #111;
}

.cp-video-thumb--popup .cp-video-thumb__image-wrap,
.cp-video-grid__thumb .cp-video-thumb__image-wrap {
    background: transparent;
    border-radius: 0;
}

.cp-video-popup-preview {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.cp-video-popup-preview .cp-video-embed--popup-preview {
    margin-bottom: 0;
}

.cp-video-popup-preview .cp-video-embed--popup-preview iframe {
    pointer-events: none;
}

.cp-video-popup-preview__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: transparent;
}

.cp-video-popup-preview:hover .cp-video-embed--popup-preview,
.cp-video-popup-preview:focus-visible .cp-video-embed--popup-preview {
    outline: 2px solid var(--cp-video-focus);
    outline-offset: 2px;
}

.cp-video-thumb__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

/* Undo theme .post_content img rules (style.css). */
.post_item_single .post_content.entry-content .cp-video-gallery .cp-video-thumb__image {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin-left: 0;
    margin-right: 0;
    object-fit: cover;
}

html.cp-video-modal-open,
body.cp-video-modal-open {
    overflow: hidden !important;
}

.cp-video-thumb:hover .cp-video-thumb__image,
.cp-video-thumb:focus-visible .cp-video-thumb__image {
    transform: scale(1.02);
}

.cp-video-thumb__caption {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.941rem;
    line-height: 1.35;
    color: var(--cp-video-text);
}

.cp-video-carousel--scroll {
    width: 100%;
}

.cp-video-carousel__viewport {
    width: 100%;
    overflow: visible;
}

.cp-video-featured {
    width: 100%;
    margin-bottom: 1.25rem;
}

.cp-video-featured .cp-video-embed--featured {
    margin-bottom: 0.75rem;
}

.cp-video-featured__title {
    margin-bottom: 0;
}

.cp-video-carousel__track {
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.cp-video-carousel--rows-2 .cp-video-carousel__track {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: min(52vw, 280px);
    align-items: start;
}

.cp-video-carousel--rows-2.cp-video-carousel--small .cp-video-carousel__track {
    grid-auto-columns: min(42vw, 200px);
}

.cp-video-carousel--rows-2.cp-video-carousel--medium .cp-video-carousel__track {
    grid-auto-columns: min(52vw, 280px);
}

.cp-video-carousel--rows-2.cp-video-carousel--big .cp-video-carousel__track {
    grid-auto-columns: min(72vw, 360px);
}

.cp-video-carousel--rows-1 .cp-video-carousel__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
}

.cp-video-carousel--rows-1.cp-video-carousel--small .cp-video-carousel__slide {
    flex: 0 0 auto;
    width: min(42vw, 200px);
}

.cp-video-carousel--rows-1.cp-video-carousel--medium .cp-video-carousel__slide {
    flex: 0 0 auto;
    width: min(52vw, 280px);
}

.cp-video-carousel--rows-1.cp-video-carousel--big .cp-video-carousel__slide {
    flex: 0 0 auto;
    width: min(72vw, 360px);
}

.cp-video-carousel__slide {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    scroll-snap-align: start;
}

.cp-video-carousel__slide-title {
    margin-top: 0.65rem;
    font-size: 1rem;
}

.cp-video-carousel__slide-desc {
    margin-top: 0.35rem;
    font-size: 0.92rem;
}

.cp-video-gallery__grid--small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 1rem 1.25rem;
    width: 100%;
}

.cp-video-gallery__grid-cell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cp-video-gallery__grid-title {
    margin-top: 0.55rem;
    font-size: 0.95rem;
}

.cp-video-gallery__grid-desc {
    margin-top: 0.35rem;
    font-size: 0.92rem;
}

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

.cp-video-modal {
    position: fixed;
    inset: 0;
    z-index: 200010;
}

.cp-video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--cp-video-backdrop);
}

.cp-video-modal__dialog {
    position: relative;
    max-width: 920px;
    width: calc(100% - 2rem);
    margin: 2rem auto;
    background: var(--cp-video-surface);
    color: var(--cp-video-text);
    border-radius: var(--cp-video-radius);
    padding: 1.25rem;
    max-height: calc(100vh - 4rem);
    overflow: auto;
    box-shadow: var(--cp-video-shadow);
}

.cp-video-modal__layout {
    display: block;
}

.cp-video-modal__main {
    min-width: 0;
}

.cp-video-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    width: 2.125rem;
    height: 2.125rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--cp-video-radius);
    background: var(--cp-video-close-bg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.3s ease;
}

.cp-video-modal__close:hover,
.cp-video-modal__close:focus-visible {
    background: var(--cp-video-close-hover);
}

.cp-video-modal__close-icon {
    position: relative;
    display: block;
    width: 12px;
    height: 12px;
}

.cp-video-modal__close-icon::before,
.cp-video-modal__close-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: var(--cp-video-heading);
    border-radius: 1px;
}

.cp-video-modal__close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.cp-video-modal__close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.cp-video-modal__video {
    margin-top: 0;
    width: 100%;
    max-width: 100%;
}

.cp-video-modal__video .cp-video-embed {
    margin-bottom: 0;
    width: 100%;
}

.cp-video-modal__rail {
    margin: 1.25rem 0 0;
    width: 100%;
}

.cp-video-modal__rail-label {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cp-video-heading);
}

.cp-video-modal__carousel {
    width: 100%;
}

.cp-video-modal__carousel .cp-video-carousel__track {
    padding: 4px 4px 0.35rem;
    overflow-y: visible;
}

.cp-video-modal__rail-slide.is-active .cp-video-modal__switch {
    outline: none;
    box-shadow: 0 0 0 2px var(--cp-video-active-ring);
}

.cp-video-featured .cp-video-popup-preview {
    width: 100%;
    max-width: 100%;
}

.cp-video-modal__title {
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.5rem;
    padding-right: 2.75rem;
    font-size: 1.3333rem;
    line-height: 1.35;
    font-weight: 600;
    color: var(--cp-video-heading);
}

.cp-video-modal__description {
    line-height: 1.6;
    width: 100%;
    max-width: none;
    margin: 0.75rem 0 0;
    color: var(--cp-video-text);
}

@media (min-width: 1024px) {
    .cp-video-modal__dialog {
        max-width: calc(100% - 2rem);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .cp-video-modal__layout {
        display: grid;
        grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
        gap: 0 1.25rem;
        align-items: start;
        min-height: 0;
        flex: 1 1 auto;
        overflow: hidden;
    }

    .cp-video-modal__main {
        overflow: auto;
        max-height: calc(100vh - 5.5rem);
        padding-right: 0.25rem;
    }

    .cp-video-modal__rail {
        margin: 0;
        max-height: calc(100vh - 5.5rem);
        display: flex;
        flex-direction: column;
        min-height: 0;
        border-left: 1px solid var(--cp-video-border);
        padding-left: 1rem;
    }

    .cp-video-modal__rail-label {
        flex-shrink: 0;
    }

    .cp-video-modal__carousel {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .cp-video-modal__carousel .cp-video-carousel__viewport {
        overflow-x: hidden;
        overflow-y: auto;
        flex: 1 1 auto;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }

    .cp-video-modal__carousel.cp-video-carousel--rows-1 .cp-video-carousel__track {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        overflow-x: hidden;
        scroll-snap-type: none;
    }

    .cp-video-modal__carousel.cp-video-carousel--rows-1.cp-video-carousel--small .cp-video-modal__rail-slide,
    .cp-video-modal__carousel.cp-video-carousel--rows-1.cp-video-carousel--small .cp-video-carousel__slide {
        width: 100%;
        flex: 0 0 auto;
    }

    .cp-video-modal__carousel .cp-video-modal__switch {
        width: 100%;
    }

    .cp-video-modal__carousel .cp-video-thumb__image-wrap {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
}

@media (min-width: 1200px) {
    .cp-video-modal__dialog {
        max-width: 1140px;
    }
}

/* —— Coinpress post layout —— */

.post_item_single .post_content.entry-content .cp-video-item--inline,
.post_item_single .post_content.entry-content .cp-video-item--popup {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.post_item_single .post_content.entry-content .cp-video-item--popup .cp-video-popup-preview,
.post_item_single .post_content.entry-content .cp-video-item--inline .cp-video-embed {
    width: 100%;
    max-width: 100%;
}

.post_item_single .post_content.entry-content .cp-video-item--inline .cp-video-item__title,
.post_item_single .post_content.entry-content .cp-video-item--inline .cp-video-item__description,
.post_item_single .post_content.entry-content .cp-video-item--popup .cp-video-item__title,
.post_item_single .post_content.entry-content .cp-video-item--popup .cp-video-item__description {
    width: 100%;
    max-width: 100%;
}

.post_item_single .cp-video-gallery--carousel,
.post_item_single .cp-video-gallery--featured_carousel,
.page_content_wrap .cp-video-gallery--carousel,
.page_content_wrap .cp-video-gallery--featured_carousel {
    margin-top: 2rem;
    margin-bottom: 2rem;
    clear: both;
}

.post_item_single .cp-video-gallery--carousel > h2,
.post_item_single .cp-video-gallery--featured_carousel > h2 {
    margin: 0 0 1rem;
}

.post_item_single .cp-video-gallery--carousel .cp-video-gallery__intro,
.post_item_single .cp-video-gallery--featured_carousel .cp-video-gallery__intro {
    margin: 0 0 1.25rem;
}

.post_item_single .cp-video-gallery--featured_carousel .cp-video-featured,
.post_item_single .cp-video-gallery--featured_carousel .cp-video-featured .cp-video-popup-preview {
    width: 100%;
    max-width: 100%;
}

.post_item_single .cp-video-gallery--carousel .cp-video-carousel,
.post_item_single .cp-video-gallery--featured_carousel .cp-video-carousel {
    width: 100%;
}

.post_item_single .cp-video-gallery--carousel .cp-video-carousel__track,
.post_item_single .cp-video-gallery--featured_carousel .cp-video-carousel__track {
    gap: 1rem;
    padding-bottom: 0.5rem;
}
