/**
 * Saras Beauty Custom Slides
 * CSS Styling for Press Coverage (70/30) and Video Slides (Full-width)
 * Responsive design with viewport-based heights
 * 
 * @package Flatsome-Child
 * @version 3.2.0
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Site Colors */
    --saras-navy: #0f3d66;
    --saras-gold: #f7c256;
    --saras-gold-hover: #e7a339;

    /* Theme */
    --saras-bg: #f8f9fa;
    --saras-bg-card: #ffffff;
    --saras-text-dark: #1a1a2e;
    --saras-text-gray: #666666;
    --saras-light: #ffffff;

    /* Effects */
    --saras-radius: 12px;
    --saras-radius-sm: 8px;
    --saras-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --saras-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --saras-transition: 0.3s ease;

    /* Slide Heights - Responsive */
    --slide-height: 80vh;
    --slide-height-max: 800px;
    --slide-height-min: 500px;
}

/* ============================================
   PRESS SLIDE - 70/30 LAYOUT
   ============================================ */
.saras-press-slide--70-30 {
    height: var(--slide-height);
    max-height: var(--slide-height-max);
    min-height: var(--slide-height-min);
    padding: 0;
    background: var(--saras-bg);
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.saras-press-slide--70-30 .saras-press-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    height: 100%;
}

/* 70/30 Grid */
.saras-press-grid-70-30 {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 0;
    height: 100%;
}

/* ============================================
   FEATURED CARD - LEFT (70%)
   ============================================ */
.saras-press-featured {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.saras-press-featured__link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.saras-press-featured__image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.saras-press-featured__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.saras-press-featured:hover .saras-press-featured__image {
    transform: scale(1.03);
}

/* Gradient Overlay */
.saras-press-featured__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.4) 40%,
            rgba(0, 0, 0, 0.1) 70%,
            transparent 100%);
    pointer-events: none;
}

/* Featured Content Overlay */
.saras-press-featured__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    z-index: 2;
}

.saras-press-featured__badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--saras-navy);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--saras-radius-sm);
    margin-bottom: 12px;
}

/* Logo badge variant */
.saras-press-featured__badge--logo {
    padding: 0;
    background: transparent;
}

.saras-press-featured__badge-logo {
    height: 28px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    /* Makes logo white */
    transition: filter var(--saras-transition);
}

.saras-press-featured:hover .saras-press-featured__badge-logo {
    filter: brightness(0) invert(1) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.saras-press-featured__title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin: 0 0 16px;
    max-width: 90%;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.saras-press-featured__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--saras-gold);
    color: var(--saras-navy);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--saras-radius-sm);
    transition: all var(--saras-transition);
}

.saras-press-featured:hover .saras-press-featured__cta {
    background: #fff;
    transform: translateX(5px);
}

.saras-press-featured__cta svg {
    width: 14px;
    height: 14px;
    transition: transform var(--saras-transition);
}

.saras-press-featured:hover .saras-press-featured__cta svg {
    transform: translateX(4px);
}

/* ============================================
   SIDE CARDS STACK - RIGHT (30%) - OVERLAY STYLE
   ============================================ */
.saras-press-side-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
}

.saras-press-side-card {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 0;
}

.saras-press-side-card:last-child {
    border-bottom: none;
}

.saras-press-side-card__link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Full-bleed image wrapper */
.saras-press-side-card__image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.saras-press-side-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--saras-transition);
}

.saras-press-side-card:hover .saras-press-side-card__image {
    transform: scale(1.05);
}

/* Gradient overlay for readability */
.saras-press-side-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.5) 50%,
            rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

/* Content positioned at bottom as overlay */
.saras-press-side-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    z-index: 2;
}

.saras-press-side-card__badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Logo badge variant for side cards */
.saras-press-side-card__badge--logo {
    padding: 0;
    background: transparent;
}

.saras-press-side-card__badge-logo {
    height: 20px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Full title display - no truncation */
.saras-press-side-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin: 0 0 10px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.saras-press-side-card__cta {
    font-size: 11px;
    font-weight: 600;
    color: var(--saras-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--saras-transition);
}

.saras-press-side-card:hover .saras-press-side-card__cta {
    color: #fff;
}

/* ============================================
   VIDEO SLIDE - FULL WIDTH
   ============================================ */
.saras-video-slide--fullwidth {
    height: var(--slide-height);
    max-height: var(--slide-height-max);
    min-height: var(--slide-height-min);
    position: relative;
    overflow: hidden;
}

.saras-video-slide--fullwidth .saras-video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Logo Overlay - Top Right Corner (YouTube-style) */
.saras-video-logo-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    pointer-events: none;
}

.saras-video-logo-img {
    height: auto;
    width: auto;
    max-height: 120px;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

@media (max-width: 849px) {
    .saras-video-logo-overlay {
        top: 8px;
        right: 8px;
    }

    .saras-video-logo-img {
        max-height: 80px;
        max-width: 150px;
    }
}

.saras-video-slide--fullwidth .saras-video-poster {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Direct YouTube embed wrapper (when no custom poster) */
.saras-video-embed-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saras-video-embed-wrapper iframe {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border: none;
}

/* No custom poster mode - white/light background */
.saras-video-slide--fullwidth.no-custom-poster {
    background-color: #fff;
}

/* Touch overlay for mobile swipe - allows dragging slider while showing video */
.saras-video-touch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.saras-video-touch-hint {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.saras-video-touch-hint::before {
    content: '▶';
    font-size: 12px;
}

/* Hide overlay on desktop - not needed */
@media (min-width: 850px) {
    .saras-video-touch-overlay {
        display: none;
    }
}

.saras-video-slide--fullwidth .saras-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

/* Minimal Video Content - Play Button Only */
.saras-video-content--minimal {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 20px;
}

/* Play Button */
.saras-video-play-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    transition: transform var(--saras-transition);
}

.saras-video-play-btn:hover {
    transform: scale(1.1);
}

.saras-video-play-icon {
    width: 90px;
    height: 90px;
    color: #fff;
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.4));
    transition: filter var(--saras-transition), color var(--saras-transition);
}

.saras-video-play-btn:hover .saras-video-play-icon {
    color: var(--saras-gold);
    filter: drop-shadow(0 0 40px rgba(247, 194, 86, 0.6));
}

.saras-video-play-icon svg {
    width: 100%;
    height: 100%;
}

.saras-video-play-text {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Video Player - Uses poster image as background instead of black */
.saras-video-player {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    /* Let poster image show through */
    z-index: 10;
}

/* Keep the poster visible behind the video for letterbox effect */
.saras-video-slide--fullwidth.is-playing .saras-video-poster {
    display: block !important;
}

.saras-video-slide--fullwidth.is-playing .saras-video-poster::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: blur(20px);
    transform: scale(1.1);
    z-index: -1;
}

.saras-video-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 11;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--saras-transition), border-color var(--saras-transition);
}

.saras-video-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.saras-video-iframe-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saras-video-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border: none;
}

/* ============================================
   HOMEPAGE SLIDER WRAPPER - OVERRIDE HEIGHTS
   ============================================ */
.saras-homepage-slider-wrapper {
    width: 100%;
}

.saras-homepage-slider-wrapper .slider-wrapper {
    margin-bottom: 0 !important;
}

/* Override with custom property heights if set */
.saras-homepage-slider-wrapper .saras-press-slide--70-30,
.saras-homepage-slider-wrapper .saras-video-slide--fullwidth {
    height: var(--slide-height, 80vh);
    max-height: var(--slide-height-max, 800px);
    min-height: var(--slide-height-min, 500px);
}

/* ============================================
   RESPONSIVE - LARGE DESKTOP (1200px+)
   ============================================ */
@media (min-width: 1200px) {
    :root {
        --slide-height: 80vh;
        --slide-height-max: 800px;
        --slide-height-min: 550px;
    }

    .saras-press-featured__content {
        padding: 50px;
    }

    .saras-press-featured__title {
        font-size: 28px;
        max-width: 80%;
    }

    .saras-press-featured__cta {
        padding: 14px 28px;
        font-size: 14px;
    }

    .saras-press-side-card__content {
        padding: 20px;
    }

    .saras-press-side-card__title {
        font-size: 14px;
    }

    .saras-video-play-icon {
        width: 110px;
        height: 110px;
    }
}

/* ============================================
   RESPONSIVE - DESKTOP (850px - 1199px)
   ============================================ */
@media (min-width: 850px) and (max-width: 1199px) {
    :root {
        --slide-height: 70vh;
        --slide-height-max: 650px;
        --slide-height-min: 450px;
    }

    .saras-press-featured__content {
        padding: 35px;
    }

    .saras-press-featured__title {
        font-size: 22px;
    }

    .saras-press-side-card__content {
        padding: 14px;
    }

    .saras-press-side-card__title {
        font-size: 13px;
    }

    .saras-video-play-icon {
        width: 90px;
        height: 90px;
    }
}

/* ============================================
   RESPONSIVE - TABLET (550px - 849px)
   ============================================ */
@media (min-width: 550px) and (max-width: 849px) {
    :root {
        --slide-height: 65vh;
        --slide-height-max: 550px;
        --slide-height-min: 400px;
    }

    /* Switch to stacked layout on tablet */
    .saras-press-grid-70-30 {
        grid-template-columns: 1fr;
        grid-template-rows: 60% 40%;
    }

    .saras-press-side-stack {
        flex-direction: row;
    }

    .saras-press-side-card {
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .saras-press-side-card:last-child {
        border-right: none;
    }

    /* Side cards maintain overlay style */

    .saras-press-featured__content {
        padding: 25px;
    }

    .saras-press-featured__title {
        font-size: 18px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .saras-press-featured__badge {
        font-size: 10px;
        padding: 5px 10px;
    }

    .saras-press-featured__cta {
        padding: 8px 16px;
        font-size: 12px;
    }

    .saras-press-side-card__content {
        padding: 12px;
    }

    .saras-press-side-card__title {
        font-size: 11px;
    }

    .saras-video-play-icon {
        width: 80px;
        height: 80px;
    }

    .saras-video-play-text {
        font-size: 12px;
        letter-spacing: 2px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (< 550px)
   ============================================ */
@media (max-width: 549px) {
    :root {
        /* Mobile slide height matches Flatsome image slides (~48.6vw on 375px = ~182px) */
        --slide-height: 48.6vw;
        --slide-height-max: 185px;
        --slide-height-min: 0;
    }

    /* Force all slides to same height on mobile */
    .saras-press-slide--70-30,
    .saras-video-slide--fullwidth {
        height: var(--slide-height);
        max-height: var(--slide-height-max);
        min-height: var(--slide-height-min);
    }

    /* Single column layout on mobile - show only featured article */
    .saras-press-grid-70-30 {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        gap: 0;
        height: 100%;
    }

    /* Featured takes full height on mobile */
    .saras-press-featured {
        height: 100%;
        min-height: unset;
        max-height: unset;
    }

    /* Hide side stack on mobile for cleaner look that matches slider height */
    .saras-press-side-stack {
        display: none;
    }

    .saras-press-featured__content {
        padding: 15px 20px;
    }

    .saras-press-featured__badge {
        font-size: 9px;
        padding: 3px 8px;
        margin-bottom: 6px;
    }

    .saras-press-featured__title {
        font-size: 14px;
        margin-bottom: 10px;
        max-width: 100%;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .saras-press-featured__cta {
        padding: 6px 12px;
        font-size: 10px;
    }

    .saras-press-featured__cta svg {
        width: 12px;
        height: 12px;
    }

    /* Video slide on mobile - same height as other slides */
    .saras-video-slide--fullwidth {
        height: var(--slide-height);
        max-height: var(--slide-height-max);
        min-height: var(--slide-height-min);
    }

    .saras-video-play-icon {
        width: 50px;
        height: 50px;
    }

    .saras-video-play-text {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .saras-video-content--minimal {
        padding: 20px 15px;
    }

    .saras-video-close-btn {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes saras-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.saras-video-play-icon {
    animation: saras-pulse 2.5s ease-in-out infinite;
}

.saras-video-play-btn:hover .saras-video-play-icon {
    animation: none;
}

/* Flickity Integration */
.flickity-slider .saras-press-slide--70-30,
.flickity-slider .saras-video-slide--fullwidth {
    width: 100%;
}

.flickity-slider>*:not(.is-selected) .saras-video-player {
    display: none !important;
}

/* Fix Flatsome slider height */
.saras-homepage-slider-wrapper .slider,
.saras-homepage-slider-wrapper .flickity-viewport {
    height: auto !important;
}