/*
 * VideoModal 스타일 — js/video-modal.js와 세트. 다른 프로젝트로 옮길 때는
 * --video-modal-font 한 줄만 그 프로젝트 폰트로 바꾸면 된다(font-family를
 * 이 파일에 직접 박지 않음 — 그라파이트는 Gilroy, 다른 프로젝트는 폰트가 다름).
 * 수치는 Figma 1920 기준 캔버스에서 px/10 = rem으로 환산(이 프로젝트 1rem=10px 기준, 데스크톱/모바일 공통).
 */
:root {
    --video-modal-font: 'Gilroy', 'Pretendard', sans-serif;
}

.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    /* 모달 배경이 불투명 검정이 아니라 반투명 + 블러라, 뒤 페이지가 흐릿하게
       비쳐 보인다. 영상이 object-fit:contain이라 생기는 레터박스 영역도
       이 배경(블러된 페이지)이 그대로 드러난다. */
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2.4rem);
    -webkit-backdrop-filter: blur(2.4rem);
    clip-path: inset(50% 0% 50% 0%);
}
html.video-modal-lock {
    overflow: hidden;
}

.video-modal-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.video-modal-stage {
    position: absolute;
    inset: 0;
    cursor: pointer;
}
.video-modal-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* PC/모바일 공통 — 가로 100% 꽉 채우고 세로는 원본 비율 그대로(잘리지 않음).
       비율이 안 맞아 남는 여백은 위 .video-modal의 반투명+블러 배경이 비쳐 보인다. */
    object-fit: contain;
}
.video-modal-dim {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.video-modal-stage.is-dimmed .video-modal-dim {
    opacity: 1;
    pointer-events: auto;
}

.video-modal-playCenter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: 0;
    padding: 0.4rem;
    cursor: pointer;
    font-family: var(--video-modal-font);
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 2rem;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}

.video-modal-topbar,
.video-modal-bottombar {
    position: absolute;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}
.video-modal:not(.is-dimmed) .video-modal-topbar,
.video-modal:not(.is-dimmed) .video-modal-bottombar {
    mix-blend-mode: difference;
}
.video-modal.is-idle .video-modal-topbar,
.video-modal.is-idle .video-modal-bottombar {
    opacity: 0;
    pointer-events: none;
}

.video-modal-topbar {
    top: 0;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.2rem 2rem;
}
.video-modal-title {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-family: var(--video-modal-font);
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 2rem;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}
.video-modal-title-name { flex: none; overflow: hidden; text-overflow: ellipsis; }
.video-modal-title-sep { flex: none; opacity: 0.7; }
.video-modal-title-sub { flex: none; }

.video-modal-close,
.video-modal-playpause,
.video-modal-mute {
    flex: none;
    background: none;
    border: 0;
    padding: 0.4rem 0;
    cursor: pointer;
    font-family: var(--video-modal-font);
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 2rem;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}

.video-modal-bottombar {
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1.2rem;
    padding: 2rem;
}
.video-modal-btns {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
}
.video-modal-col {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    align-items: center;
}
.video-modal-col-time { gap: 6rem; }
.video-modal-col-mute { justify-content: flex-end; }
.video-modal-time {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--video-modal-font);
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 2rem;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.video-modal-duration { opacity: 0.4; }

.video-modal-progress {
    position: relative;
    width: 100%;
}
.video-modal-progress-track {
    position: relative;
    width: 100%;
    height: 0.4rem;
    cursor: pointer;
}
.video-modal-progress-track::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #d9d9d9;
    opacity: 0.4;
    border-radius: 0.2rem;
}
.video-modal-progress-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    background-color: #d9d9d9;
    border-radius: 0.2rem;
}
.video-modal-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 0.5rem;
    height: 1.4rem;
    background-color: #fff;
    border-radius: 0.25rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.video-modal-progress-tooltip {
    position: absolute;
    bottom: 100%;
    margin-bottom: 0.8rem;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-family: var(--video-modal-font);
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1.6rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    font-variant-numeric: tabular-nums;
}
.video-modal-progress-tooltip.is-visible {
    opacity: 1;
}

@media (max-width: 768px) {
    /* viewport-fit=cover라 iOS에서 화면이 상태바·홈 표시줄 뒤까지 그려진다 — 그만큼 안쪽으로 */
    /* 여백은 Figma 모바일 영상 모달(node 14838:7550): 상단 바 사방 8px, 하단 바 위아래 20px·좌우 8px,
       버튼 줄과 진행 바 사이 12px. 상태바·홈 표시줄 높이(safe-area)는 그 바깥에 더한다. */
    .video-modal-topbar { padding: calc(0.8rem + env(safe-area-inset-top, 0px)) 0.8rem 0.8rem; gap: 1.2rem; }
    .video-modal-bottombar { padding: 2rem 0.8rem calc(2rem + env(safe-area-inset-bottom, 0px)); gap: 1.2rem; }
    /* Figma 모바일 영상 모달(node 14838:7550): 제목·CLOSE·시간·PLAY/PAUSE·MUTE 14px/normal,
       가운데 PLAY VIDEO 16/20px, 시간 "00:00 / 00:00" 사이 4px. 모두 Gilroy ExtraBold 대문자. */
    .video-modal-title,
    .video-modal-close,
    .video-modal-playpause,
    .video-modal-mute,
    .video-modal-time {
        font-size: 1.4rem;
        line-height: normal;
    }
    .video-modal-time { gap: 0.4rem; }
    .video-modal-playCenter {
        font-size: 1.6rem;
        line-height: 2rem;
    }
    /* 하단 버튼 줄: 시간 | PLAY | MUTE 를 같은 너비 3칸(사이 8px)으로. 마크업은 시간·PLAY가 한 칸
       (.video-modal-col-time)에 같이 있어서, 그 칸을 2칸 너비로 두고 안을 2열 그리드로 나눈다. */
    .video-modal-btns { gap: 0.8rem; }
    .video-modal-col-spacer { display: none; }
    .video-modal-col-time { flex: 0 0 calc((100% - 1.6rem) * 2 / 3 + 0.8rem); display: grid; grid-template-columns: 1fr 1fr; column-gap: 0.8rem; gap: 0 0.8rem; align-items: center; }
    .video-modal-col-time .video-modal-playpause { justify-self: start; }
    /* PLAY/PAUSE·MUTE의 위아래 padding(누르는 영역)은 남기고 줄 높이에는 넣지 않는다(글자 높이 기준 배치) */
    .video-modal-playpause,
    .video-modal-mute { margin: -0.4rem 0; }
    /* 모바일은 프로젝트명 / 부제를 두 줄로(구분선 ⏤ 숨김). 줄마다 길면 말줄임. */
    .video-modal-title { flex-direction: column; align-items: flex-start; gap: 0; }
    /* 제목이 두 줄이 되면서 CLOSE가 가운데로 내려가지 않게 위쪽에 맞춘다.
       CLOSE의 위아래 padding(0.4rem, 누르는 영역)만큼 끌어올려 글자 윗선을 제목 첫 줄과 맞춘다. */
    .video-modal-topbar { align-items: flex-start; }
    .video-modal-topbar .video-modal-close { margin-top: -0.4rem; }
    .video-modal-title-sep { display: none; }
    .video-modal-title-name,
    .video-modal-title-sub { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
