/* ─── OS Intro Strip ─────────────────────────────────────────────────────────── */
[data-intro-skip] #os-intro { display: none !important; }

.os-intro {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.32s ease;
}

.os-intro--fading {
    opacity: 0;
    pointer-events: none;
}

/* ── 로고 영상 인트로 ── */
.os-intro__video-intro {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 2;
    opacity: 1;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.os-intro__video-intro.is-out { opacity: 0; }

.os-intro__video {
    /* 게이트의 CC 로고와 동일한 크기 */
    width: clamp(81px, 10.8vw, 135px);
    height: clamp(81px, 10.8vw, 135px);
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* 게이트 CC 로고 모바일 확대(+약 10%)와 동일하게 맞춤 */
@media (max-width: 720px) {
    .os-intro__video {
        width: clamp(89px, 11.91vw, 149px);
        height: clamp(89px, 11.91vw, 149px);
    }
}

/* ── 컨텐츠 래퍼: 데스크탑 세로 중앙 ── */
.os-intro__content {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
}

/* ── 스트립 wrap ── */
.os-intro__strip-wrap {
    overflow: visible;
}

/* ── 스트립 ── */
.os-intro__strip {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 0;
    list-style: none;
    margin: 0;
    will-change: transform;
}

/* ── 타일 ── */
.os-intro__tile {
    flex-shrink: 0;
}

.os-intro__tile-link {
    display: block;
    outline-offset: 4px;
}

.os-intro__tile img {
    height: 220px;
    width: auto;
    display: block;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

/* ── 프로그램 타일: 1:1 검정 박스 ── */
.os-intro__tile--program .os-intro__tile-link {
    width: 200px;
    height: 200px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.os-intro__tile--program img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ── 캡션 (스트립 바로 아래 8px) ── */
.os-intro__caption {
    padding: 12px 0 0;
    text-align: center;
    font-family: var(--font-en);
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--black);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}
.os-intro__caption.is-visible { opacity: 1; }
.os-intro__caption-title,
.os-intro__caption-sub {
    font-family: var(--font-en);
    word-break: keep-all;
    overflow-wrap: break-word;
}
.os-intro__caption-title { font-weight: 500; }
.os-intro__caption-sub   { font-weight: 500; }
.os-intro__caption-sep   { display: block; }
.os-intro__caption-sep.is-hidden { display: none; }
.os-intro__caption-title.is-kr,
.os-intro__caption-sub.is-kr {
    font-family: var(--font-kr) !important;
    font-weight: 500;
    letter-spacing: 0;
}

/* ── 모바일: 세로 스택 ── */
@media (max-width: 1023px) {
    .os-intro__content {
        position: absolute;
        inset: 0;
        top: 0;
        transform: none;
        flex-direction: row;
    }

    .os-intro__strip-wrap {
        position: absolute;
        inset: 0;
        overflow: hidden;
    }

    .os-intro__strip {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 0 0 calc(50vh - 80px); /* padding-bottom: 마지막 타일이 중앙까지 스크롤 가능하도록 */
        width: 100%;
    }

    .os-intro__tile {
        width: 100%;
        text-align: center;
        flex-shrink: 0;
    }

    .os-intro__tile .os-intro__tile-link {
        display: inline-block;
    }

    .os-intro__tile img {
        height: 160px;
        width: auto;
        object-fit: cover;
    }

    .os-intro__tile--program .os-intro__tile-link {
        width: 160px;
        height: 160px;
    }

    /* 캡션: 좌측 고정, 뷰포트 세로 중앙 */
    .os-intro__caption {
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        padding: 0;
        text-align: left;
        white-space: normal;
        width: 160px;
        font-size: 10px;
        display: flex;
        flex-direction: column;
        gap: 2px;
        z-index: 2;
    }

    .os-intro__caption-sep { display: none; }
}

@media (max-width: 569px) {
    .os-intro__caption { display: none; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .os-intro,
    .os-intro__tile,
    .os-intro__caption,
    .os-intro__phrase { transition: none; }
}

body.has-intro .bookmarks { visibility: hidden; }

/* ─── prefers-reduced-motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .bm,
    .bm-strip,
    .bm:not(.active)::before {
        transition: none;
    }
    .site-main {
        animation: none;
    }
}

/* ─── Word break: programs / books pages ─────────────────────────────────── */
body.post-type-archive-program,
body.single-program,
body.post-type-archive-book,
body.single-book {
    word-break: keep-all;
    overflow-wrap: break-word;
}
