/* =========================================================
   Wistia Facade Styles - FINAL PRODUCTION VERSION
   ========================================================= */

/* 1. Structural Layout Unlock 
   Targets the specific ID to force the container to expand with the video math.
   This kills the '35px cage' seen in the mobile inspector. */
#fbs-wistia-video-container,
#fbs-wistia-video-container .elementor-widget-container {
    height: auto !important;
    min-height: min-content !important;
    display: block !important;
}

/* 2. Main Facade Container (The Space Reserver) */
.fbs-wistia-facade {
    position: relative !important;
    display: block !important; 
    width: 100% !important;
    height: auto !important;
    /* Inherits the 720/1472 math injected by PHP */
    aspect-ratio: inherit; 
    margin: 0 auto !important;
    line-height: 0 !important;
    overflow: hidden !important; 
    background-color: #000;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.5);
}

/* 3. Desktop Strategy (Maintain the Row) 
   Capping height ensures the bio fits side-by-side with the video. */
@media (min-width: 768px) {
    [style*="aspect-ratio"] {
        max-height: 62vh !important; 
        width: auto !important; 
    }
}

/* 4. Mobile Strategy (Stacking & Pushing) 
   Ensures the video is full-width and pushes the description down. */
@media (max-width: 767px) {
    [style*="aspect-ratio"] {
        max-height: none !important; 
        width: 100% !important;     
    }
    /* Physical safety gap to prevent overlaps on small screens */
    .fbs-wistia-facade {
        margin-bottom: 35px !important; 
    }
}

/* 5. Thumbnail Image
   Fills the mathematically reserved space exactly. */
.fbs-wistia-facade__image {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100% !important; 
    height: 100% !important;
    object-fit: cover !important; 
    object-position: top center !important; 
    z-index: 1;
}

/* 6. Play Button (Centering Recovery) 
   Uses hard-pixel margins to ensure true center on portrait videos. */
.fbs-wistia-facade__play-button {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 96px !important;
    height: 60px !important;
    margin-left: -48px !important; /* Half of width */
    margin-top: -30px !important;  /* Half of height */
    background-color: #0077d9 !important;
    border-radius: 6px !important;
    z-index: 10 !important;        /* Sits above the thumbnail layer */
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.25) !important;
    transition: background-color .18s ease !important;
}

/* Play Triangle Icon */
.fbs-wistia-facade__play-button::before {
    content: "" !important;
    width: 0 !important;
    height: 0 !important;
    border-top: 13px solid transparent !important;
    border-bottom: 13px solid transparent !important;
    border-left: 22px solid #ffffff !important;
    margin-left: 5px !important; /* Visual optical adjustment */
}

/* Hover Effect */
.fbs-wistia-facade:hover .fbs-wistia-facade__play-button {
    background-color: #005BB5 !important;
}

/* 7. Persistent Player Styling
   Shadow and radius persist after the Facade is clicked. */
.wistia_embed {
    position: absolute !important;
    top: 0; 
    left: 0;
    width: 100% !important; 
    height: 100% !important;
    z-index: 2;
    border-radius: 4px;
    box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.5) !important;
}