/* ==========================================================================
   MW VIDEO LOOP ITEM WIDGET
   Styling matches the MW Video Carousel card layout exactly.
   For use inside Elementor Loop Grid with modal video popup.
   ========================================================================== */

/* ── Custom Properties (mirrors video carousel) ── */
.mw-video-loop-item {
	--mw-vli-card-bg: #ffffff;

	--mw-vli-cat-color: #2F31FC;
	--mw-vli-cat-font-size: 18px;

	--mw-vli-heading-color: #1a1a1a;
	--mw-vli-heading-hover-color: #2F31FC;
	--mw-vli-heading-font-size: 24px;
	--mw-vli-heading-line-height: 1.2;

	--mw-vli-excerpt-color: #555555;
	--mw-vli-excerpt-font-size: 0.875rem;
	--mw-vli-excerpt-line-height: 1.55;

	--mw-vli-cta-color: #2F31FC;
	--mw-vli-cta-font-size: 18px;
	--mw-vli-cta-hover-color: #2F31FC;

	--mw-vli-body-padding: 1.25rem;
	--mw-vli-transition-speed: 0.25s;

	/* Video-specific */
	--mw-vli-play-icon-size: 60px;
	--mw-vli-play-icon-color: #ffffff;
	--mw-vli-play-icon-bg: rgba(47, 49, 252, 0.9);
}

/* ── Card ── */
.mw-video-loop-item {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--mw-vli-card-bg);
	overflow: hidden;
	border: none;
	outline: none;
	box-shadow: none;
}

/* ── Equal-height support inside Elementor Loop Grid ── */
.elementor-loop-container .elementor-element,
.elementor-loop-container .elementor-widget,
.elementor-loop-container .elementor-widget-container {
	height: 100%;
}

/* ============================================================
 * THUMBNAIL (mirrors Video Carousel)
 * ============================================================ */

.mw-video-loop-item__thumbnail,
.mw-video-loop-item__thumbnail:visited,
.mw-video-loop-item__thumbnail:focus {
	position: relative;
	flex-shrink: 0;
	overflow: hidden;
	background-color: transparent;
	text-decoration: none;
	font-size: 0;
	line-height: 0;
	border: none;
	outline: none;
}

.mw-video-loop-item__thumbnail--clickable {
	cursor: pointer;
}

/* 16:9 aspect ratio */
.mw-video-loop-item__image-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	overflow: hidden;
	background: #1a1a1a;
}

.mw-video-loop-item__image {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
	transition: transform var(--mw-vli-transition-speed) ease,
	            opacity var(--mw-vli-transition-speed) ease;
}

.mw-video-loop-item__thumbnail--clickable:hover .mw-video-loop-item__image {
	transform: scale(1.05);
	opacity: 0.8;
}

.mw-video-loop-item__image-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-color: #1a1a1a;
	background-image: linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
	                  linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
	                  linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
	                  linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
	background-size: 20px 20px;
	background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

/* Play Icon */
.mw-video-loop-item__play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: var(--mw-vli-play-icon-size);
	height: var(--mw-vli-play-icon-size);
	background-color: var(--mw-vli-play-icon-bg);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mw-vli-play-icon-color);
	transition: transform var(--mw-vli-transition-speed) ease,
	            background-color var(--mw-vli-transition-speed) ease;
	z-index: 2;
}

.mw-video-loop-item__play-icon svg {
	width: 24px;
	height: 24px;
	margin-left: 3px;
}

.mw-video-loop-item__thumbnail--clickable:hover .mw-video-loop-item__play-icon {
	transform: translate(-50%, -50%) scale(1.1);
	background-color: rgba(47, 49, 252, 1);
}

/* Duration Badge on Thumbnail */
.mw-video-loop-item__duration-badge {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background-color: rgba(0, 0, 0, 0.8);
	color: #ffffff;
	font-size: 12px;
	font-weight: 500;
	padding: 4px 8px;
	border-radius: 3px;
	z-index: 2;
	line-height: 1.3;
}

/* ============================================================
 * CARD BODY (mirrors Video Carousel / Post Carousel)
 * ============================================================ */

.mw-video-loop-item__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--mw-vli-body-padding);
}

/* Category */
.mw-video-loop-item__category {
	display: inline-block;
	align-self: flex-start;
	margin-bottom: 0.75rem;
	font-size: var(--mw-vli-cat-font-size);
	font-weight: 400;
	line-height: 1.5;
	color: var(--mw-vli-cat-color);
	text-transform: none;
}

/* Title */
.mw-video-loop-item__title {
	margin: 0 0 1.25rem;
	font-size: var(--mw-vli-heading-font-size);
	font-weight: 400;
	font-family: inherit;
	line-height: var(--mw-vli-heading-line-height);
	color: var(--mw-vli-heading-color);
}

.mw-video-loop-item__title a,
.mw-video-loop-item__title a:visited,
.mw-video-loop-item__title a:focus {
	color: inherit;
	text-decoration: none;
	background: transparent;
	transition: color var(--mw-vli-transition-speed) ease;
}

.mw-video-loop-item__title a:hover,
.mw-video-loop-item__title a:focus-visible {
	color: var(--mw-vli-heading-hover-color);
	text-decoration: none;
	background: transparent;
}

/* Title trigger (modal click) */
.mw-video-loop-item__title-trigger {
	color: inherit;
	cursor: pointer;
	transition: color var(--mw-vli-transition-speed) ease;
}

.mw-video-loop-item__title-trigger:hover,
.mw-video-loop-item__title-trigger:focus-visible {
	color: var(--mw-vli-heading-hover-color);
}

/* Duration (standalone, shown when thumbnail hidden) */
.mw-video-loop-item__duration {
	color: #666666;
	font-size: 14px;
	line-height: 1.5;
	margin-bottom: 10px;
}

/* Date */
.mw-video-loop-item__date {
	color: #666666;
	font-size: 14px;
	line-height: 1.5;
	margin-bottom: 10px;
}

/* Excerpt */
.mw-video-loop-item__excerpt {
	margin: 0 0 1rem;
	font-size: var(--mw-vli-excerpt-font-size);
	line-height: var(--mw-vli-excerpt-line-height);
	color: var(--mw-vli-excerpt-color);
	flex: 1;
}

/* CTA / Watch Button */
.mw-video-loop-item__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	margin-top: auto;
	font-size: var(--mw-vli-cta-font-size);
	font-weight: 400;
	font-family: inherit;
	color: var(--mw-vli-cta-color);
	text-decoration: none;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: color var(--mw-vli-transition-speed) ease;
}

.mw-video-loop-item__cta:visited,
.mw-video-loop-item__cta:focus {
	color: var(--mw-vli-cta-color);
	background: none;
}

.mw-video-loop-item__cta:hover,
.mw-video-loop-item__cta:focus-visible {
	color: var(--mw-vli-cta-hover-color);
	background: none;
}

.mw-video-loop-item__cta-arrow {
	flex-shrink: 0;
	transition: transform var(--mw-vli-transition-speed) ease;
}

.mw-video-loop-item__cta:hover .mw-video-loop-item__cta-arrow {
	transform: translateX(3px);
}

/* Placeholder styling for editor */
.mw-video-loop-item--placeholder {
	padding: 15px;
	background-color: #fafafa;
	border: 1px dashed #ddd;
	border-radius: 4px;
}


/* ==========================================================================
   VIDEO MODAL
   ========================================================================== */

.mw-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 12, 51, 1);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mw-video-modal--active {
    opacity: 1;
    visibility: visible;
}

.mw-video-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/wp-content/uploads/2025/11/SectionHeaderPattern_1.svg') center / cover no-repeat;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

/* Header */
.mw-video-modal__header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    flex-shrink: 0;
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 30px;
}

.mw-video-modal__logo-link {
    flex-shrink: 0;
    line-height: 0;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.mw-video-modal__logo-link:hover {
    opacity: 1;
}

.mw-video-modal__logo {
    width: 40px;
    height: auto;
}

.mw-video-modal__title-wrapper {
    flex: 1;
    padding-right: 20px;
}

.mw-video-modal__watching {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2px;
    margin-top: 3px;
}

.mw-video-modal__title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
}

.mw-video-modal__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mw-video-modal__title a:hover {
    color: inherit;
}

.mw-video-modal__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 22px;
    margin-left: 8px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
    vertical-align: middle;
}

.mw-video-modal__more svg {
    width: 14px;
    height: 14px;
}

.mw-video-modal__more circle {
    fill: rgba(255, 255, 255, 0.5);
    transition: fill 0.3s ease;
}

.mw-video-modal__more:hover {
    background-color: rgba(255, 255, 255, 0.18);
}

.mw-video-modal__more:hover circle {
    fill: #ffffff;
}

@media (min-width: 768px) {
    .mw-video-modal__title {
        font-size: 24px;
    }
}

.mw-video-modal__close {
    width: 32px;
    height: 32px;
    padding: 0;
    background: none !important;
    background-color: transparent !important;
    border: none;
    color: #ffffff !important;
    opacity: 0.5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.mw-video-modal__close:focus,
.mw-video-modal__close:active {
    background: none !important;
    background-color: transparent !important;
    color: #ffffff !important;
    opacity: 0.5;
    outline: none;
}

.mw-video-modal__close:hover,
.mw-video-modal__close:focus:hover {
    opacity: 1;
}

.mw-video-modal__close svg {
    width: 34px;
    height: 34px;
}

/* Body with navigation */
.mw-video-modal__body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 80px 30px;
    position: relative;
}

/* Navigation arrows - positioned at viewport edges */
.mw-video-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 80px;
    background: none !important;
    background-color: transparent !important;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    z-index: 100002;
}

.mw-video-modal__nav--prev {
    left: 0;
    padding-left: 15px;
}

.mw-video-modal__nav--next {
    right: 0;
    padding-right: 15px;
}

.mw-video-modal__nav:hover,
.mw-video-modal__nav:focus,
.mw-video-modal__nav:active {
    background: none !important;
    background-color: transparent !important;
    color: #ffffff;
}

.mw-video-modal__nav svg {
    width: 40px;
    height: 40px;
}

/* Video content */
.mw-video-modal__content {
    width: 100%;
    max-width: 1000px;
    position: relative;
}

.mw-video-modal__video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
}

.mw-video-modal__video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .mw-video-modal__header {
        padding: 15px 20px;
    }

    .mw-video-modal__watching {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .mw-video-modal__title {
        font-size: 16px;
    }

    .mw-video-modal__body {
        padding: 0 50px 20px;
    }

    .mw-video-modal__nav {
        width: 44px;
        height: 60px;
    }

    .mw-video-modal__nav--prev {
        padding-left: 10px;
    }

    .mw-video-modal__nav--next {
        padding-right: 10px;
    }

    .mw-video-modal__nav svg {
        width: 28px;
        height: 28px;
    }

    .mw-video-modal__close {
        width: 32px;
        height: 32px;
    }

    .mw-video-modal__close svg {
        width: 40px;
        height: 40px;
    }
}


/* ==========================================================================
   MW VIDEO THUMBNAIL WIDGET
   Standalone clickable thumbnail for single video pages
   ========================================================================== */

.mw-video-thumbnail {
    position: relative;
    overflow: hidden;
    background-color: #000;
    cursor: pointer;
    aspect-ratio: 16/9;
}

.mw-video-thumbnail__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mw-video-thumbnail:hover .mw-video-thumbnail__image {
    transform: scale(1.05);
    opacity: 0.8;
}

.mw-video-thumbnail__placeholder {
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    background-image: linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
                      linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
                      linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Play Icon */
.mw-video-thumbnail__play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-color: rgba(47, 49, 252, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 2;
}

.mw-video-thumbnail__play-icon svg {
    width: 32px;
    height: 32px;
    margin-left: 4px;
}

.mw-video-thumbnail:hover .mw-video-thumbnail__play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(47, 49, 252, 1);
}

/* Duration Badge */
.mw-video-thumbnail__duration {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 3px;
    z-index: 2;
}

/* Responsive */
@media (max-width: 767px) {
    .mw-video-thumbnail__play-icon {
        width: 60px;
        height: 60px;
    }

    .mw-video-thumbnail__play-icon svg {
        width: 24px;
        height: 24px;
        margin-left: 3px;
    }

    .mw-video-thumbnail__duration {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
        padding: 4px 8px;
    }
}
