/**
 * Carousel Spacing — Single source of truth for hero carousel spacing.
 * All other CSS files and inline styles have had their carousel margin/padding rules removed.
 * Edit ONLY this file to adjust carousel top spacing.
 *
 * @package YeapNews_Store
 */

/* ── Site content: no negative pull ─────────────────────────────────────── */
.site-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.site-header + .site-content,
#masthead + .site-content,
header + .site-content,
.navbar + .site-content {
    margin-top: 0 !important;
}

/* ── Hero carousel top spacing ───────────────────────────────────────────── */
/* Navbar is position:fixed at 70px height. This pushes carousel below it. */
/* To adjust: change this one value only. */
.hero-carousel {
    margin-top: 70px !important;
}

/* ── Carousel inner elements: no extra spacing on desktop ────────────────── */
.carousel,
.slider,
.banner,
.hero-section,
[class*="carousel"] {
    padding-top: 0 !important;
}

.carousel-inner,
.carousel-item {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Override wp-post-image height:auto which collapses photo slides */
.hero-carousel .carousel-item img,
.hero-carousel .carousel-item .wp-post-image {
    width: 100% !important;
    height: 70vh !important;
    min-height: 350px !important;
    max-height: 700px !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Video controls ──────────────────────────────────────────────────────── */
.carousel-video {
    width: 100% !important;
    height: auto !important;
    min-height: 500px !important;
    object-fit: contain !important;
    background-color: #000 !important;
    position: relative !important;
    z-index: 1 !important;
}

.carousel-item iframe {
    width: 100% !important;
    height: 500px !important;
    object-fit: contain !important;
    position: relative !important;
    z-index: 1 !important;
}

/* ── Slide controls ──────────────────────────────────────────────────────── */
.slide-prev, .slide-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    font-size: 30px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.slide-prev { left: 20px !important; }
.slide-next { right: 20px !important; }

.slide-prev:hover, .slide-next:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

/* ── Mute button ─────────────────────────────────────────────────────────── */
.video-mute-btn {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
    cursor: pointer !important;
    z-index: 10000 !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
    opacity: 1 !important;
    /* display and visibility are controlled by JS — flex on video slides, none on photo slides */
}

.video-mute-btn:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.1) !important;
}

/* ── Tablet (769px – 1024px) ─────────────────────────────────────────────── */
@media (max-width: 1024px) and (min-width: 769px) {
    .hero-carousel {
        margin-top: 70px !important;
    }
    .video-mute-btn {
        top: 80px !important;
        right: 20px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 18px !important;
    }
}

/* ── Mobile (≤ 768px) ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-carousel {
        margin-top: 70px !important;
        padding-top: 0 !important;
    }


    .carousel-video {
        min-height: unset !important;
        height: auto !important;
        max-height: 280px !important;
        object-fit: cover !important;
        width: 100% !important;
    }

    .carousel-item iframe {
        min-height: unset !important;
        height: 250px !important;
        max-height: 280px !important;
    }

    .slide-prev {
        left: 8px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
    }

    .slide-next {
        right: 8px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
    }

    .video-mute-btn {
        top: 120px !important;
        right: 20px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }

    /* Photo slide images on mobile */
    .hero-carousel .carousel-item img,
    .hero-carousel .carousel-item .wp-post-image {
        height: 55vw !important;
        min-height: 200px !important;
        max-height: 320px !important;
    }

    /* Video captions visible on mobile */
    .carousel-item.has-video .homepage-carousel-caption {
        display: block !important;
        position: relative !important;
        bottom: auto !important;
    }

    /* Admin bar on mobile (≤768px) — must come last to win */
    body.admin-bar .hero-carousel {
        margin-top: 116px !important; /* 70px navbar + 46px admin bar */
    }
    body.admin-bar-scrolled .hero-carousel {
        margin-top: 70px !important;
    }
}

/* ── Admin bar offset — desktop/tablet (logged-in users only) ────────────── */
/* Placed after all breakpoints so these rules always win */
body.admin-bar .hero-carousel {
    margin-top: 102px !important; /* 70px navbar + 32px admin bar */
}
body.admin-bar-scrolled .hero-carousel {
    margin-top: 70px !important;
}
@media screen and (max-width: 782px) {
    body.admin-bar .hero-carousel {
        margin-top: 116px !important; /* 70px navbar + 46px admin bar */
    }
    body.admin-bar-scrolled .hero-carousel {
        margin-top: 70px !important;
    }
}
