/* ========================================
   Video Promo Section
   Homepage video promo for Palomarr Insights
   ======================================== */

.video-promo-section {
    position: relative;
    width: 100%;
    border-radius: 2.2rem 2.2rem 2.2rem 0;
    margin: 1rem 0 6rem !important;
}

/* ----------------------------------------
   Promo State (Default)
   ---------------------------------------- */

.video-promo-section[data-state="promo"] {
    height: 40vh;
    min-height: 22rem;
    max-height: 32rem;
}

/* Video Wrapper */
.video-promo-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: var(--border-radius-p-2);
    box-shadow: 0 -4rem 10rem color-mix(in srgb, var(--color-accent) 25%, transparent), 0 -2rem 4rem color-mix(in srgb, var(--color-accent) 25%, transparent);
    overflow: hidden;
}

.video-promo-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: object-fit 0.3s ease;
}

/* Hide video controls overflow menu (three-dot menu) */
.video-promo-video::-webkit-media-controls-overflow-button {
    display: none !important;
}

.video-promo-video::-webkit-media-controls-download-button {
    display: none !important;
}

.video-promo-video::-webkit-media-controls-playback-rate-button {
    display: none !important;
}

/* Clickable section in promo state */
.video-promo-section[data-state="promo"] {
    cursor: pointer;
}

/* ----------------------------------------
   Controls - Top positioned button row
   ---------------------------------------- */

.video-promo-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

/* Enable pointer events on buttons */
.video-promo-controls .nectar-button {
    pointer-events: all;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.3s ease !important;
}

/* Explore button specific styling */
a.video-promo-explore-btn,
button.video-promo-scroll-btn {
    padding-left: 0.8rem !important;
    gap: 0.7rem;
}

.video-promo-explore-icon {
    width: 1.1rem;
    height: 1.1rem;
    background: url("/wp-content/uploads/2026/01/icon-insights-g.svg") no-repeat center;
    background-size: contain;
    flex-shrink: 0;
}

/* Scroll button icon (down arrow) */
.video-promo-scroll-icon {
    width: 1.2rem;
    height: 1.2rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232F9376'%3E%3Cpath d='M12 16.5l-6-6 1.4-1.4 4.6 4.6 4.6-4.6 1.4 1.4z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    flex-shrink: 0;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* Play button specific styling */
button.video-promo-play-btn {
    padding-left: 0.8rem !important;
    padding-right: 1.3rem !important;
    gap: 0.7rem;
}

.video-promo-play-icon {
    width: 1.2rem;
    height: 1.2rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") no-repeat center;
    background-size: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-black) 50%, transparent);
}

/* Close button - icon only */
.video-promo-close-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
    pointer-events: all;
}

.video-promo-close-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.video-promo-close-icon {
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

/* Promo state: show Watch, hide Close */
.video-promo-section[data-state="promo"] .video-promo-play-btn {
    display: inline-flex;
}

.video-promo-section[data-state="promo"] .video-promo-close-btn {
    display: none;
}

/* Expanded state: hide Watch, show Close (on hover) */
.video-promo-section[data-state="expanded"] .video-promo-play-btn {
    display: none;
}

.video-promo-section[data-state="expanded"] .video-promo-close-btn {
    display: inline-flex;
    opacity: 0;
}

.video-promo-section[data-state="expanded"]:hover .video-promo-close-btn {
    opacity: 1;
}

/* ----------------------------------------
   Expanded State
   ---------------------------------------- */

.video-promo-section[data-state="expanded"] {
    height: auto;
    aspect-ratio: 16/9;
    max-height: 90vh;
    max-width: calc(90vh * 16 / 9);
    margin-left: auto !important;
    margin-right: auto !important;
}

.video-promo-section[data-state="expanded"] .video-promo-video {
    object-fit: contain;
    background: #000;
}

/* ----------------------------------------
   Responsive
   ---------------------------------------- */

@media only screen and (max-width: 1024px) {
    .video-promo-section[data-state="promo"] {
        height: 30vh;
        min-height: 15rem;
        max-height: 17.5rem;
    }
}

@media only screen and (max-width: 640px) {
    .video-promo-section {
        border-radius: 1.5rem 1.5rem 1.5rem 0;
        margin: 1rem 0;
        display: flex;
        flex-direction: column;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .video-promo-section[data-state="promo"] .video-promo-video-wrapper {
        position: relative;
        height: 40vh;
        min-height: 20rem;
        max-height: 25rem;
    }

    .video-promo-controls {
        padding: 1rem;
        justify-content: flex-end; /* Watch button to the right */
    }

    /* Hide explore button in controls on mobile */
    .video-promo-controls .video-promo-explore-btn {
        display: none;
    }

    .video-promo-section[data-state="expanded"] {
        max-height: 40vh;
        max-width: calc(40vh * 16 / 9);
    }
}

/* Mobile explore button - below video */
.video-promo-section .video-promo-explore-btn--mobile {
    display: none;
}

@media only screen and (max-width: 640px) {
    .video-promo-section .video-promo-explore-btn--mobile {
        display: flex;
        width: calc(100% - 2rem);
        justify-content: center;
        margin: 1rem 0 !important;
    }
}

/* ----------------------------------------
   Insights Page Override
   Hide "Explore Palomarr Insights" button on /insights/
   ---------------------------------------- */

.insights-page .video-promo-explore-btn {
    display: none !important;
}

.insights-page .video-promo-controls {
    justify-content: flex-end;
}
