/* sw_3 - 배경컬러 + 텍스트 모션 스킨 */
/* 배경: 이미지 없이 설정 컬러값 / 텍스트: 우→좌 슬라이드인 / SVG: 컬러 마스크 채우기 */

/* ===== 래퍼 ===== */
.sw_3_wrap {
    position: relative;
    width: 100%;
    height: 100%;
    --sw3-bg: #ffffff;
}

/* ===== 배경: 고정 모드 (항목 1개) ===== */
.sw_3_bg_static {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

/* ===== 배경: 스와이퍼 모드 (항목 2개+) ===== */
.sw_3_swiper {
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    -webkit-user-drag: none;
}
.sw_3_swiper .swiper-wrapper { height: 100%; }
.sw_3_swiper .swiper-slide {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
}
.sw_3_swiper .swiper-slide:not(.swiper-slide-active) {
    pointer-events: none !important;
    z-index: 0 !important;
}
.sw_3_swiper .swiper-slide-active {
    z-index: 2 !important;
}
.sw_3_swiper .slide_bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

/* ===== 텍스트 오버레이 ===== */
.sw_3_wrap .slide_text_wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    z-index: 15;
    width: 100%;
    pointer-events: none;
}

.sw_3_wrap .slide_text_wrap .contents-container {
    width: 100%;
    box-sizing: border-box;
    pointer-events: none;
}

.sw_3_wrap .slide_text_wrap .slide_text_inner {
    pointer-events: none;
    position: relative;
    z-index: 5;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.sw_3_wrap .slide_txt {
    position: relative;
    pointer-events: none;
    margin-bottom: 0;
}
.sw_3_wrap .slide_txt:last-child { margin-bottom: 0; }

/* 버튼/링크만 클릭 가능 */
.sw_3_wrap .slide_link_btn,
.sw_3_wrap .slide_img_btn {
    pointer-events: auto;
}

/* block.php 동적 애니메이션 override (sw_3은 자체 모션 사용) */
.MAIN_TOP_TOTAL .sw_3_wrap .slide_txt {
    transform: none;
    transition: none;
}
.MAIN_TOP_TOTAL .sw_3_wrap .slide_btn_group {
    transform: none;
    transition: none;
}

/* ======================================================
   ★ 텍스트 등장 모션 A: 우 → 좌 슬라이드인 (기본)
   ====================================================== */
@keyframes sw3_slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sw_3_wrap .sw3_entrance .slide_txt {
    opacity: 0;
    animation: sw3_slideInFromRight 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.sw_3_wrap .sw3_entrance .slide_txt:nth-child(1) { animation-delay: 0.15s; }
.sw_3_wrap .sw3_entrance .slide_txt:nth-child(2) { animation-delay: 0.35s; }
.sw_3_wrap .sw3_entrance .slide_txt:nth-child(3) { animation-delay: 0.55s; }
.sw_3_wrap .sw3_entrance .slide_txt:nth-child(4) { animation-delay: 0.75s; }
.sw_3_wrap .sw3_entrance .slide_txt:nth-child(5) { animation-delay: 0.95s; }

.sw_3_wrap .sw3_entrance .slide_btn_group {
    opacity: 0;
    animation: sw3_slideInFromRight 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 1.0s;
}


/* ======================================================
   ★ 이미지 컬러 마스크 효과 (sw3_img_reveal)
   구조: 회색 이미지(아래) + 컬러 이미지(위, clip-path로 좌→우 노출)
   ====================================================== */

/* 래퍼 */
.sw_3_wrap .sw3_img_reveal {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

/* 공통: 래퍼 내 이미지 크기 */
.sw_3_wrap .sw3_img_reveal img,
.sw_3_wrap .sw3_img_reveal .sw3_layer img {
    width: 100% !important;
    height: auto !important;
    display: block;
}

/* ── 아래층: 회색 이미지 (연하게 + 좌→우 페이드인) ── */
@keyframes sw3_grayReveal {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 0.1;
        clip-path: inset(0 0 0 0);
    }
}

.sw_3_wrap .sw3_img_reveal .sw3_gray,
.sw_3_wrap .sw3_img_reveal img.sw3_gray {
    position: relative;
    z-index: 1;
    filter: grayscale(100%) brightness(1.35) contrast(0.6);
    opacity: 0;
    animation: sw3_grayReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.2s;
}

/* ── 위층: 컬러 원본 이미지 (absolute 겹침 + clip-path 마스크) ── */
/* 블러 마스크: 왼쪽 0% → 100% 크기로 커지며 채우기 */
@keyframes sw3_maskReveal {
    0%   { -webkit-mask-size: 0% 100%; mask-size: 0% 100%; }
    100% { -webkit-mask-size: 200% 100%; mask-size: 200% 100%; }
}

.sw_3_wrap .sw3_img_reveal .sw3_color,
.sw_3_wrap .sw3_img_reveal img.sw3_color {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    -webkit-mask-image: linear-gradient(to right, #000 50%, transparent 100%);
    mask-image: linear-gradient(to right, #000 50%, transparent 100%);
    -webkit-mask-size: 0% 100%;
    mask-size: 0% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: left center;
    mask-position: left center;
    animation: sw3_maskReveal 5s cubic-bezier(0.4, 0, 0.1, 1) forwards;
    animation-delay: 1.5s;
}

/* div 래퍼(.sw3_layer)일 때 내부 img도 absolute 채우기 */
.sw_3_wrap .sw3_img_reveal .sw3_layer.sw3_color {
    display: block;
}
.sw_3_wrap .sw3_img_reveal .sw3_layer.sw3_color img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* ===== 텍스트 정렬 ===== */
.sw_3_wrap .slide_text_wrap.text_align_left {
    justify-content: flex-start;
}
.sw_3_wrap .slide_text_wrap.text_align_left .slide_text_inner,
.sw_3_wrap .slide_text_wrap.text_align_left .slide_txt {
    text-align: left;
}

.sw_3_wrap .slide_text_wrap.text_align_center {
    justify-content: center;
}
.sw_3_wrap .slide_text_wrap.text_align_center .slide_text_inner,
.sw_3_wrap .slide_text_wrap.text_align_center .slide_txt {
    text-align: center;
}

.sw_3_wrap .slide_text_wrap.text_align_right {
    justify-content: flex-end;
}
.sw_3_wrap .slide_text_wrap.text_align_right .slide_text_inner,
.sw_3_wrap .slide_text_wrap.text_align_right .slide_txt {
    text-align: right;
}

/* ===== 텍스트 스타일 (어두운 배경이 아니므로 어두운 텍스트 기본) ===== */
/* 텍스트 1 - 서브 타이틀 */
.sw_3_wrap .slide_txt1 .txt_content,
.sw_3_wrap .slide_txt1 .sub_tit {
    display: inline-block;
    font-size: clamp(14px, calc(0.8vw + 10px), 20px);
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.4;
}

/* 텍스트 2 - 메인 타이틀 */
.sw_3_wrap .slide_txt2 .txt_content,
.sw_3_wrap .slide_txt2 .main_tit {
    display: block;
    font-size: clamp(28px, calc(3vw + 16px), 60px);
    font-weight: 700;
    color: #222;
    line-height: 1.2;
}

/* 텍스트 3 - 설명 */
.sw_3_wrap .slide_txt3 .txt_content,
.sw_3_wrap .slide_txt3 .desc {
    display: block;
    font-size: clamp(14px, calc(0.8vw + 10px), 20px);
    font-weight: 400;
    color: #555;
    line-height: 1.6;
}

/* 텍스트 4 */
.sw_3_wrap .slide_txt4 .txt_content {
    display: inline-block;
    font-size: clamp(13px, calc(0.6vw + 10px), 18px);
    font-weight: 400;
    color: #666;
    line-height: 1.5;
}

/* 텍스트 5 */
.sw_3_wrap .slide_txt5 .txt_content {
    display: inline-block;
    font-size: clamp(12px, calc(0.5vw + 10px), 16px);
    font-weight: 400;
    color: #777;
}

/* ===== 이미지 ===== */
.sw_3_wrap .slide_img_wrap {
    margin-bottom: clamp(10px, calc(1vw + 5px), 20px);
    position: relative;
    display: inline-block;
}

.sw_3_wrap .slide_img_wrap img {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    display: inline-block;
}
.sw_3_wrap .slide_text_wrap.text_align_center .slide_img_wrap {
    text-align: center;
}
.sw_3_wrap .slide_text_wrap.text_align_right .slide_img_wrap {
    text-align: right;
}

/* ===== 버튼 그룹 ===== */
.sw_3_wrap .slide_btn_group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    pointer-events: none;
    position: relative;
    z-index: 20;
}

.sw_3_wrap .slide_link_wrap {
    margin-top: clamp(15px, calc(1.5vw + 8px), 30px);
}

.sw_3_wrap .slide_link_btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary, #333);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}
.sw_3_wrap .slide_link_btn:hover {
    background: var(--primary-dark, #111);
    transform: translateY(-2px);
}

/* 이미지 버튼 */
.sw_3_wrap .slide_img_btn {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 5;
}
.sw_3_wrap .slide_img_btn:hover .slide_img_wrap { opacity: 0.9; }
.sw_3_wrap .slide_img_btn:hover img { transform: scale(1.02); }
.sw_3_wrap .slide_img_btn img { transition: transform 0.3s ease; }

/* 이미지+텍스트 버튼 (pill) */
.sw_3_wrap .slide_img_btn.has_txt {
    display: inline-flex;
    align-items: center;
    position: relative;
    background: transparent;
    border-radius: var(--btn-radius, 50px);
    padding: var(--btn-padding, 8px 40px 8px 8px);
    gap: var(--btn-gap, 15px);
    overflow: visible;
    transition: all 0.3s;
    border-width: var(--btn-border-width, 0);
    border-style: var(--btn-border-style, none);
    border-color: var(--btn-border-color, transparent);
    margin-top: var(--btn-margin-top, 0);
    margin-bottom: var(--btn-margin-bottom, 0);
    -webkit-backdrop-filter: blur(var(--btn-backdrop-blur, 0px));
    backdrop-filter: blur(var(--btn-backdrop-blur, 0px));
}
.sw_3_wrap .slide_img_btn.has_txt::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--btn-bg, var(--primary, #333));
    opacity: var(--btn-bg-opacity, 1);
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
    transition: background 0.3s, opacity 0.3s;
}
.sw_3_wrap .slide_img_btn.has_txt > .slide_img_wrap,
.sw_3_wrap .slide_img_btn.has_txt > .txt_content {
    position: relative;
    z-index: 1;
}
.sw_3_wrap .slide_img_btn.has_txt:hover {
    border-color: var(--btn-border-color-hover, var(--btn-border-color, transparent));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}
.sw_3_wrap .slide_img_btn.has_txt:hover::before {
    background: var(--btn-bg-hover, var(--btn-bg, var(--primary-dark, #111)));
}
.sw_3_wrap .slide_img_btn.has_txt:hover .txt_content {
    color: var(--btn-color-hover, var(--btn-color, #fff));
}
.sw_3_wrap .slide_img_btn.has_txt .slide_img_wrap {
    position: absolute;
    top: var(--btn-img-top, auto);
    left: var(--btn-img-left, auto);
    bottom: var(--btn-img-bottom, auto);
    right: var(--btn-img-right, auto);
    margin-bottom: 0;
    z-index: 1;
}
.sw_3_wrap .slide_img_btn.has_txt .slide_img_wrap img { display: block; }
.sw_3_wrap .slide_img_btn.has_txt .txt_content {
    color: var(--btn-color, #fff);
    font-size: var(--btn-font-size, clamp(14px, calc(0.6vw + 11px), 18px));
    font-weight: var(--btn-font-weight, 600);
    white-space: nowrap;
    transition: color 0.3s;
    position: relative;
    z-index: 1;
}
@media screen and (max-width: 768px) {
    .sw_3_wrap .slide_img_btn.has_txt {
        padding: var(--btn-padding-mo, 6px 25px 6px 6px);
    }
}

/* ===== 인라인 편집 (관리자) ===== */
.admin_div .sw_3_wrap .wg_edit_txt,
.admin_div .sw_3_wrap .wg_edit_img,
.admin_div .sw_3_wrap .wg_edit_link {
    cursor: pointer;
    pointer-events: auto;
}
.admin_div .sw_3_wrap .wg_edit_txt:hover,
.admin_div .sw_3_wrap .wg_edit_img:hover {
    outline: 2px dashed rgba(34, 197, 94, 0.8);
    outline-offset: 4px;
}
.admin_div .sw_3_wrap .wg_edit_link:hover {
    outline: 2px dashed rgba(59, 130, 246, 0.8);
    outline-offset: 4px;
}
.admin_div .sw_3_wrap .wg_edit_txt::after,
.admin_div .sw_3_wrap .wg_edit_img::after {
    content: 'Shift+클릭';
    position: absolute;
    top: -22px; left: 0;
    font-size: 10px;
    color: #22c55e;
    background: rgba(255,255,255,0.95);
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 100;
}
.admin_div .sw_3_wrap .wg_edit_link::after {
    content: 'Ctrl+클릭';
    position: absolute;
    top: -22px; left: 0;
    font-size: 10px;
    color: #3b82f6;
    background: rgba(255,255,255,0.95);
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 100;
}
.admin_div .sw_3_wrap .wg_edit_txt:hover::after,
.admin_div .sw_3_wrap .wg_edit_img:hover::after,
.admin_div .sw_3_wrap .wg_edit_link:hover::after {
    opacity: 1;
}

/* ===== 반응형 ===== */
@media screen and (max-width: 768px) {
    .sw_3_wrap .slide_txt {
        margin-bottom: 8px;
    }
    .sw_3_wrap .slide_img_wrap {
        margin-bottom: 10px;
    }
    .sw_3_wrap .slide_text_inner {
        padding: 0;
    }
    .sw_3_wrap .slide_txt2 .txt_content,
    .sw_3_wrap .slide_txt2 .main_tit {
        font-size: clamp(24px, calc(5vw + 8px), 36px);
    }
}
