/*
 * Banner Block Skin: hyetaek-hero — 메인 슬라이드 (혜택의 차이)
 *
 * 20px 둥근 무대 안에서 MubloItemLayout(Swiper)이 1장씩 넘긴다.
 * 기본은 이미지가 무대를 꽉 채우는 이미지 전용 슬라이드이고,
 * extras 문구가 있는 배너만 왼쪽 문구 패널 + 오른쪽 이미지로 갈린다.
 * 컨트롤(이전 · 1 / 3 · 다음)은 무대 왼쪽 아래에 떠 있다.
 */

.hy-hero {
    --hy-hero-min: 420px;
    --hy-hero-inset: clamp(26px, 4vw, 52px);
}

.hy-hero__stage {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--muted, #F4F4F4);
    /* 둥근 모서리가 Swiper 전환 중에도 잘리도록 (Safari) */
    isolation: isolate;
}

.hy-hero__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Swiper 가 붙기 전(또는 Swiper 가 없을 때)에는 첫 장만 보인다.
   목록으로 쏟아져 히어로 높이가 몇 배로 늘어나는 걸 막는다. */
.hy-hero__layout:not(.is-slide) > ul {
    display: block !important;
}

.hy-hero__layout:not(.is-slide) > ul > li + li {
    display: none;
}

/* 슬라이드 높이를 가장 큰 장에 맞춘다 — 넘길 때 무대가 출렁이지 않게. */
.hy-hero .swiper-slide {
    height: auto;
}

.hy-hero__item {
    min-width: 0;
}

.hy-hero__slide {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    height: 100%;
    min-height: var(--hy-hero-min);
    background: var(--hy-hero-bg, var(--muted, #F4F4F4));
}

/* 이미지 전용: 이미지가 무대 전체를 덮는다. */
.hy-hero__media {
    position: absolute;
    inset: 0;
    display: block;
    color: inherit;
}

.hy-hero__media picture,
.hy-hero__media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
}

/* 문구 패널이 있는 장: 왼쪽 문구 + 오른쪽 이미지 (시안 그대로). */
.hy-hero__slide--text .hy-hero__media {
    position: relative;
    inset: auto;
    flex: 1 1 380px;
    min-width: 0;
    min-height: 280px;
}

.hy-hero__copy {
    box-sizing: border-box;
    flex: 1 1 420px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    /* 아래쪽은 컨트롤(40px + 26px 여백) 자리를 비워 둔다. */
    padding: clamp(28px, 4.3vw, 56px) var(--hy-hero-inset) 96px;
    color: var(--foreground, #111);
}

.hy-hero__eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted-foreground, #555);
}

.hy-hero__headline {
    display: block;
    margin: 0;
    font-size: clamp(28px, 3.5vw, 46px);
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -0.04em;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.hy-hero__sub {
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--muted-foreground, #444);
    word-break: keep-all;
}

.hy-hero__btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    height: 48px;
    margin-top: 10px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--foreground, #111);
    color: var(--background, #FFF) !important;
    font-weight: 700;
    text-decoration: none;
}

.hy-hero__btn:hover {
    background: var(--hy-accent, #C4001A);
}

/* 컨트롤 — 이전 · 1 / 3 · 다음 */
.hy-hero__controls {
    position: absolute;
    left: var(--hy-hero-inset);
    bottom: 26px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hy-hero__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--foreground, #111);
    border-radius: 999px;
    background: var(--background, #FFF);
    color: var(--foreground, #111);
    cursor: pointer;
}

.hy-hero__nav:hover {
    border-color: var(--hy-accent, #C4001A);
    color: var(--hy-accent, #C4001A);
}

.hy-hero__nav:focus-visible {
    outline: 2px solid var(--hy-accent, #C4001A);
    outline-offset: 2px;
}

/* Swiper 의 fraction 기본 배치(absolute · 폭 100%)를 걷어 내고 버튼 사이에 앉힌다.
   이미지 위에서도 읽히도록 흰 알약 바탕을 깐다. */
.hy-hero .hy-hero__count,
.hy-hero .hy-hero__count.swiper-pagination-fraction {
    position: static;
    width: auto;
    min-width: 44px;
    padding: 4px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--background, #FFF) 85%, transparent);
    color: var(--foreground, #111);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* 운영자가 그 기기에서 숨긴 배너는 컨트롤도 함께 숨긴다. */
@media (min-width: 769px) {
    .hy-hero__layout[data-pc-style="none"] ~ .hy-hero__controls { display: none; }
}

@media (max-width: 768px) {
    .hy-hero {
        --hy-hero-min: 300px;
        --hy-hero-inset: 16px;
    }

    .hy-hero__layout[data-mo-style="none"] ~ .hy-hero__controls { display: none; }

    /* 문구가 있으면 문구 위, 이미지 아래로 쌓는다. */
    .hy-hero__slide--text {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .hy-hero__copy {
        flex: none;
        gap: 10px;
        padding: 28px 22px 20px;
    }

    .hy-hero__sub {
        font-size: 14px;
    }

    .hy-hero__btn {
        height: 44px;
        margin-top: 4px;
        padding: 0 18px;
    }

    .hy-hero__slide--text .hy-hero__media {
        flex: 1 1 auto;
        min-height: 160px;
    }

    .hy-hero__controls {
        bottom: 16px;
        gap: 8px;
    }
}

/* 빈 상태 — 렌더러가 편집 미리보기에서 이 스킨의 style.css 로 그린다.
   (BannerRenderer::renderEmpty 가 선택된 스킨의 CSS 를 불러온다) */
.block-banner-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 100px;
    padding: 16px;
    border: 1px dashed var(--border, #E5E5E5);
    border-radius: 10px;
    color: color-mix(in srgb, var(--muted-foreground, #555) 55%, transparent);
    font-size: 0.875rem;
    text-align: center;
}

.block-banner-empty__icon {
    font-size: 1.75rem;
    line-height: 1;
}
