/* Kawaii Life Hero Slider Block Styles */
.hero.hero-slider {
    max-width: var(--wp--custom--width--header, 1450px);
    margin: 0 auto;
    display: block;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 34px;
    border-bottom-right-radius: 34px;
    background: linear-gradient(120deg,#F4E8FF 0%,#FFDCE9 55%,#FFF1CB 100%);
    /* The reference inherits the browser's 16px / normal, not the theme's body text. */
    font-size: 16px;
    line-height: normal;
    letter-spacing: normal;
}

/*
 * Full bleed up to the header width: inside a padded post content the page
 * padding would otherwise inset it, where the reference runs edge to edge.
 */
.has-global-padding > .hero.hero-slider {
    --kawaii-hero-width: min(var(--wp--custom--width--header, 1450px), calc(100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px)));
    width: var(--kawaii-hero-width);
    max-width: none;
    margin-left: calc((100% - var(--kawaii-hero-width)) / 2);
    margin-right: calc((100% - var(--kawaii-hero-width)) / 2);
}

.hero.hero-slider .heroSwiper {
    width: 100%;
}

.hero.hero-slider .heroSwiper .swiper-slide {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    padding: 48px 6%;
    min-height: 520px;
    height: auto;
    box-sizing: border-box;
}

.heroText {
    position: relative;
    z-index: 2;
    flex: 0 1 60%;
    max-width: 660px;
}

.heroText .eyebrow {
    display: inline-block;
    padding: 9px 15px;
    background: #fff;
    color: #8b6280;
    font-size: 11px;
    font-weight: 900;
    line-height: normal;
    letter-spacing: normal;
    border-radius: 999px;
    text-transform: uppercase;
}

.heroText :is(h1, h2) {
    font-size: clamp(48px, 6vw, 78px);
    line-height: 0.92;
    letter-spacing: normal;
    text-wrap: auto; /* the theme's text-wrap: pretty rebalances this onto three lines */
    color: #302A3A;
    margin: 18px 0;
}

.heroText :is(h1, h2) span,
.heroText :is(h1, h2) mark {
    color: #FF79A7;
    background: transparent;
}

.heroText p {
    max-width: 500px;
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: normal;
    color: #625866;
    margin: 16px 0;
}

.heroBtns {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.heroBtns .btn {
    display: inline-block;
    margin: 8px 7px 0 0;
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 900;
    line-height: normal;
    letter-spacing: normal;
    border-radius: 999px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.heroBtns .btn.primary {
    position: relative;
    z-index: 0;
    overflow: hidden;
    background: #FF79A7;
    color: #fff;
}

/* A light sweeps across the pink button on hover, as in the reference. */
.heroBtns .btn.primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    z-index: -1;
    width: 100%;
    height: 100%;
    transform: skew(-15deg);
    background-image: linear-gradient(90deg, transparent, rgb(243 243 243 / 25%), transparent);
}

.heroBtns .btn.primary:hover::after {
    animation: kawaii-shine 1000ms ease;
}

@keyframes kawaii-shine {
    to {
        left: 100%;
    }
}

.heroBtns .btn.light {
    background: #fff;
    color: #302A3A;
}

.heroImg {
    flex: 0 1 auto;
    width: 40%;
    max-width: 100%;
    height: 440px;
    object-fit: contain;
    filter: drop-shadow(0 18px 18px #8c6d8c22);
}

/* Pagination dots */
.hero.hero-slider .swiper-pagination {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    z-index: 10;
}

.hero.hero-slider .swiper-pagination-bullet {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin: 0 4px;
    border-radius: 50%;
    background: #fff;
    opacity: .6;
    cursor: pointer;
    transition: all 0.25s ease;
}

.hero.hero-slider .swiper-pagination-bullet-active {
    opacity: 1;
    background: #FF79A7;
    width: 22px;
    border-radius: 999px;
}

/* Banner arrows */
.hero.hero-slider .swiper-button-prev,
.hero.hero-slider .swiper-button-next {
    width: 44px;
    height: 44px;
    margin-top: -22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 12px 35px rgba(80, 50, 80, 0.09);
    color: #302A3A;
    z-index: 10;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero.hero-slider .swiper-button-prev::after,
.hero.hero-slider .swiper-button-next::after {
    font-size: 14px;
    font-weight: 900;
}

.hero.hero-slider .swiper-button-prev {
    left: 16px;
}

.hero.hero-slider .swiper-button-next {
    right: 16px;
}

@media (max-width: 1050px) {
    .hero.hero-slider .heroSwiper .swiper-slide {
        flex-direction: column;
        text-align: center;
    }
    .heroText {
        flex: none;
        width: 100%;
        max-width: 100%;
    }
    .heroText p {
        margin: 0 auto;
    }
    .heroBtns {
        justify-content: center;
    }
    .heroImg {
        width: 100%;
        height: 330px;
        margin: 30px 0;
    }
}

@media (max-width: 650px) {
    .hero.hero-slider {
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
    }
    .heroText .eyebrow {
        padding: 7px 15px;
    }
    .heroText :is(h1, h2) {
        font-size: 44px;
    }
    .heroBtns .btn {
        width: 200px;
    }
    .hero.hero-slider .swiper-button-prev,
    .hero.hero-slider .swiper-button-next {
        display: none;
    }
}

/* Horizontal Slider Layout for Gutenberg Block Editor */
.block-editor-block-list__block[data-type="kawaii/hero-slider"],
.wp-block[data-type="kawaii/hero-slider"],
.wp-block-kawaii-hero-slider,
.block-editor-kawaii-hero-slider {
    max-width: 1450px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.hero.hero-slider .block-editor-block-list__layout {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    gap: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hero.hero-slider .block-editor-block-list__layout::-webkit-scrollbar {
    display: none;
}

.hero.hero-slider .block-editor-block-list__layout > .wp-block-kawaii-hero-slide,
.hero.hero-slider .block-editor-block-list__layout > .block-editor-block-list__block,
.hero.hero-slider .block-editor-block-list__layout > [data-type="kawaii/hero-slide"] {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.kawaii-hero-slide-editor {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 48px 6% !important;
    min-height: 520px !important;
    box-sizing: border-box !important;
    position: relative;
    /* An inset outline marks the slide without taking space, so the
       preview keeps the front end's size. */
    outline: 2px dashed rgba(255, 121, 167, 0.2);
    outline-offset: -2px;
    border-radius: 20px;
    margin: 0 !important;
    background: transparent;
}

.kawaii-hero-slide-editor .heroText :is(h1, h2) span.title-accent {
    color: #FF79A7;
    background: transparent;
}

/* The editable title is a span too; only the accent is pink. */
.kawaii-hero-slide-editor .heroText :is(h1, h2) .title-main {
    color: #302A3A;
}

/* Sized like the front's bare .heroImg: 40% of the slide, 440px tall. */
.kawaii-hero-slide-editor .heroImgWrapper {
    flex: 0 1 auto;
    width: 40%;
    height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kawaii-hero-slide-editor .heroImgWrapper .heroImg {
    width: 100%;
    height: 100%;
}

.kawaii-hero-slide-editor .heroImgPlaceholder {
    width: 100%;
    height: 320px;
    border: 2px dashed #FF79A7;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #8b6280;
    cursor: pointer;
    transition: background 0.2s ease;
}

.kawaii-hero-slide-editor .heroImgPlaceholder:hover {
    background: #fff;
    color: #FF79A7;
}

.kawaii-hero-slide-editor [contenteditable]:focus {
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 1050px) {
    .kawaii-hero-slide-editor {
        flex-direction: column !important;
        text-align: center !important;
    }
    .kawaii-hero-slide-editor .heroImgWrapper {
        flex: none;
        width: 100%;
        max-width: 100%;
        height: 330px;
        margin: 30px 0;
    }
}
