/*
 * 히어로 슬라이더 — views/home/sections/hero.php 의 마크업 스타일.
 * 공개 화면과 관리자 미리보기가 같은 파일을 쓴다. 동작은 /js/hero-slider.js.
 * Tailwind 는 공개(v3 CDN)와 관리자(v4 browser)가 달라서, 동작에 필요한 규칙은 여기에 직접 적는다.
 */
.home-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    /* 모바일 주소창이 보이는 상태의 높이. 100vh 는 주소창 뒤로 잘린다. */
    height: 100svh;
    overflow: hidden;
}

/* 숨은 슬라이드는 visibility 로 감춘다 — 보이지 않는 장의 버튼에 Tab·스크린리더가 닿지 않는다.
   사라질 때는 투명도 전환이 끝난 뒤에 감춘다. */
.home-hero [data-hero-slide] {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.home-hero [data-hero-slide].is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease, visibility 0s;
}

.home-hero [data-hero-zoom] {
    transform-origin: center center;
}

.home-hero-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* YouTube 배경을 화면에 꽉 채운다(16:9 를 잘라 cover 처럼). 컨테이너 단위를 모르는 브라우저는 뷰포트 기준. */
.home-hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 177.78vh;
    height: 56.25vw;
    min-width: 100%;
    min-height: 100%;
    border: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
@supports (width: 1cqw) {
    .home-hero-media {
        container-type: size;
    }
    .home-hero-video {
        width: 177.78cqh;
        height: 56.25cqw;
    }
}

/* 슬라이드가 보일 때 차례로 떠오르는 글자. 스크립트가 is-revealed 를 붙인다. */
.home-hero [data-hero-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.home-hero [data-hero-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

/* 관리자 미리보기를 다시 그릴 때는 전환 없이 곧바로 보여 준다. */
.home-hero.is-instant [data-hero-slide],
.home-hero.is-instant [data-hero-reveal] {
    transition: none !important;
}

.home-hero-control {
    position: absolute;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 9999px;
    background-color: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.home-hero-control:hover {
    background-color: rgba(0, 0, 0, 0.6);
}
.home-hero-prev,
.home-hero-next {
    top: 50%;
    transform: translateY(-50%);
}
.home-hero-prev {
    left: 0.75rem;
}
.home-hero-next {
    right: 0.75rem;
}
.home-hero-toggle {
    right: 1rem;
    bottom: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.75rem;
}
.home-hero-control:focus-visible,
.home-hero-dot:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.home-hero-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
/* 누르는 영역은 24px, 보이는 점은 10px. */
.home-hero-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    cursor: pointer;
}
.home-hero-dot::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.home-hero-dot:hover::before {
    background-color: rgba(255, 255, 255, 0.8);
}
.home-hero-dot[aria-current="true"]::before {
    background-color: rgba(255, 255, 255, 0.95);
    transform: scale(1.2);
}

/* 아래쪽 조작(도트·멈춤 버튼)이 아래 정렬 글자·버튼을 덮지 않게 한다. lg 부터는 본래 여백(70px)이 충분하다. */
@media (max-width: 1023px) {
    .home-hero.has-bottom-controls .home-hero-content {
        padding-bottom: 4.5rem;
    }
}

/* 휴대폰에서는 화살표가 글자를 가린다. 밀어서 넘길 수 있으면 화살표를 숨긴다(도트는 남는다). */
@media (max-width: 767px) {
    .home-hero[data-swipe="1"] .home-hero-prev,
    .home-hero[data-swipe="1"] .home-hero-next {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero [data-hero-slide],
    .home-hero [data-hero-reveal] {
        transition: none;
    }
    .home-hero [data-hero-reveal] {
        opacity: 1;
        transform: none;
    }
}
