/**
 * Video Post Format Styles
 */

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
}

.video-container iframe,
.video-container object,
.video-container embed,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
}

/* Video post card in archives - targeting the exact HTML structure */
.format-video .relative a {
    position: relative;
    cursor: pointer;
    display: block;
}

/* Play button overlay */
.format-video .relative a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.format-video .relative a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-image: url('../images/playbutton.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    transition: transform 0.3s ease;
}

.format-video .relative a:hover::before {
    opacity: 1;
}

.format-video .relative a:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Hide the existing play button */
.format-video .relative .w-12.h-12,
.format-video .relative .border-l-white {
    display: none;
}

/* Our custom structure (for backward compatibility) */
.post-format-video .post-thumbnail {
    position: relative;
    cursor: pointer;
}

.post-format-video .post-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.post-format-video .post-thumbnail::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-image: url('../images/playbutton.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    transition: transform 0.3s ease;
}

.post-format-video .post-thumbnail:hover::before {
    opacity: 1;
}

.post-format-video .post-thumbnail:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video Popup Modal */
.video-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.video-popup-modal.hidden {
    display: none;
}

.video-popup-content {
    position: relative;
    width: 100%;
    max-width: 1000px;
    background-color: #000;
    border-radius: 0.5rem;
    overflow: hidden;
}

.video-popup-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-popup-container iframe,
.video-popup-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-popup-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 30px;
    height: 30px;
    background-color: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.video-popup-close:hover {
    color: #cc0b2a;
}

.video-popup-close:focus {
    outline: none;
}

.overflow-hidden {
    overflow: hidden;
}

.video-thumbnail-trigger {
	position: relative;
	display: block;
	cursor: pointer;
	overflow: hidden;
}

.video-thumbnail-trigger img {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
