/* _detail.css 분할본 4/4 — 영상 전체화면 모달(모드 분기·커스텀 컨트롤)·키오스크 분기·동작 줄이기 (리팩토링 W-D6, 2026-10-23). 내용은 원본 1544~1892행 그대로, 로드 순서는 templates/includes/stories_css.html 참조. 사진 여러 장(옛 photo-swiper)은 10-28 키트 갤러리(screen-kit.css .sk-media--gallery)로 옮겨 여기서 뺐다. */
/* ========================================
   Video Fullscreen Modal (pseudo-fullscreen)
   ========================================
   네이티브 Fullscreen API 미사용 — 세로 영상 자동 회전 방지 + 이중 재생 방지.
   object-fit: contain 으로 원본 비율 유지 (세로는 세로로 꽉, 가로는 좌우 꽉 + 위·아래 검정). */
.video-fullscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
    /* iOS safe-area 보정: 상단 상태바·하단 홈 인디케이터 영역까지 검정 유지 */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

.video-fullscreen-modal.is-open {
    display: flex;
}

.video-fullscreen-modal__video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;     /* 원본 비율 유지, 회전 없음 */
    background: #000;
    outline: none;
}

/* 좌상단 뒤로가기(닫기) 버튼 — WCAG 2.5.8 AAA 44×44, safe-area 반영
   V-N9.1: 다른 컨트롤과 함께 토글 (진입 시 숨김 → 첫 탭에 표시) */
.video-fullscreen-modal__back {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;                /* gesture 레이어(1)보다 위 */
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease, background 0.15s ease;
    outline: none;             /* 전역 빨간 :focus-visible outline을 덮어씀 */
}
.video-fullscreen-modal__back.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.video-fullscreen-modal__back:hover {
    background: rgba(0, 0, 0, 0.75);
}

.video-fullscreen-modal__back:focus-visible {
    background: rgba(0, 0, 0, 0.75);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

/* 투명 제스처 캡처 레이어 — video 위를 덮어 스와이프/탭 인식
   하단 커스텀 컨트롤 영역(.vf__controls-bar)은 비워두어 시크/음소거 조작 보장 */
.video-fullscreen-modal__gesture {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 96px;
    z-index: 1;                /* video 위, back 버튼 아래 */
    background: transparent;
    touch-action: none;        /* 브라우저 기본 pan/zoom 간섭 차단 */
}

/* ========================================
   V-N9 두 모드 분기 — data-mode 로 vf__media-* 토글
   - "video"  : 커스텀 컨트롤 (모드 B)
   - "iframe" : Bunny embed (모드 A, 키오스크 + bunny_video_id)
   ======================================== */
.video-fullscreen-modal .vf__media-video,
.video-fullscreen-modal .vf__media-iframe {
    width: 100%;
    height: 100%;
    position: relative;
}
.video-fullscreen-modal[data-mode="iframe"] .vf__media-video { display: none; }
.video-fullscreen-modal[data-mode="video"]  .vf__media-iframe { display: none; }

.vf__media-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
}

/* ========================================
   커스텀 컨트롤 (모드 B) — 브랜드 SVG 활용
   ======================================== */

/* 중앙 재생/일시정지 토글 — play-circle / pause-circle 33×33 viewBox SVG
   배경 원형/blur 제거. 반투명 효과는 아이콘 자체에 적용. */
.vf__play-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    line-height: 0;
}
.vf__play-toggle.is-visible {
    opacity: 0.6;             /* 더 투명하게 — 영상 시야 방해 최소화 */
    pointer-events: auto;
}
/* 마우스 기기에서만 hover 강조 — 터치 기기의 sticky :hover 로
   .is-visible 제거 후에도 중앙 버튼이 계속 떠 있던 버그 방지 */
@media (hover: hover) and (pointer: fine) {
    .vf__play-toggle:hover {
        opacity: 0.9;
    }
}
.vf__play-toggle .menu-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.55));   /* 어두운 배경 위 가독성 */
}
.vf__play-toggle .vf__icon-pause { display: none; }
.vf__play-toggle.is-playing .vf__icon-play  { display: none; }
.vf__play-toggle.is-playing .vf__icon-pause { display: block; }
.vf__play-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

/* 하단 컨트롤 바 (시크바 + 시간 + 음소거) */
.vf__controls-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px calc(env(safe-area-inset-right, 0px) + 12px) calc(env(safe-area-inset-bottom, 0px) + 12px) calc(env(safe-area-inset-left, 0px) + 12px);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    z-index: 2;
    color: var(--color-white);
    font-variant-numeric: tabular-nums;
}
.vf__controls-bar.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.vf__time {
    font-size: 12px;
    line-height: 1;
    min-width: 36px;
    text-align: center;
}
.vf__time-current { text-align: right; }
.vf__time-total   { text-align: left; }

/* 시크바: appearance 제거 + 흰색 thumb + 반투명 track. 터치 hit-area 는 padding 으로 확보 */
.vf__progress {
    flex: 1 1 auto;
    -webkit-appearance: none;
    appearance: none;
    height: 24px;                /* hit area */
    background: transparent;
    cursor: pointer;
    margin: 0;
}
.vf__progress:focus { outline: none; }
.vf__progress::-webkit-slider-runnable-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
}
.vf__progress::-moz-range-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
}
.vf__progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-white);
    margin-top: -6px;            /* track 가운데 정렬 */
    border: 2px solid rgba(0, 0, 0, 0.4);
    cursor: pointer;
}
.vf__progress::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-white);
    border: 2px solid rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

/* 음소거 토글 */
.vf__mute-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.vf__mute-toggle .vf__icon-volume-off { display: none; }
.vf__mute-toggle.is-muted .vf__icon-volume-on  { display: none; }
.vf__mute-toggle.is-muted .vf__icon-volume-off { display: block; }
.vf__mute-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

/* [가로로 보기](11-20 명세 3-2): 컨트롤 줄 맨 오른쪽: 앱 뷰어와 같은 자리 · 같은 아이콘(arrows-out / 가로 중엔 arrows-in). 비율 1.1 이상만(JS 가 hidden 을 푼다) */
.vf__rotate {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}
.vf__rotate[hidden] { display: none; }
.vf__rotate .vf__icon-portrait { display: none; }
.vf__rotate.is-landscape .vf__icon-landscape { display: none; }
.vf__rotate.is-landscape .vf__icon-portrait { display: block; }
.vf__rotate:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

/* 두 손가락 벌림 = 채우기(cover), 오므림 = 맞춤(contain 기본): 11-20 명세 3-3 */
.video-fullscreen-modal.is-fill .video-fullscreen-modal__video { object-fit: cover; }

/* ========================================
   키오스크 모드 분기 — body.is-kiosk
   - 좌상단 ✕ 미렌더(이미 story-view.css:2249 처리)
   - iframe 모드에서는 커스텀 컨트롤 영역 자체 미존재 (data-mode="iframe" 가 display:none 처리)
   - video 모드(키오스크 + MP4 폴백)는 커스텀 컨트롤 항상 노출 + 중앙 토글 숨김
     (Bunny 환경 대신 native MP4 폴백 시 컨트롤은 보이되 중앙 큰 버튼은 시각 혼란 방지차원으로 숨김)
   ======================================== */
body.is-kiosk .video-fullscreen-modal[data-mode="video"] .vf__controls-bar {
    opacity: 1 !important;
    pointer-events: auto !important;
}
body.is-kiosk .video-fullscreen-modal .vf__play-toggle {
    display: none;
}

/* ========================================
   Reduced Motion (접근성)
   ======================================== */

/* AI 음성 대화 — 인터뷰 기사 박스 (feed_detail.html, 2026-09-16) */
.feed-detail__article {
    margin: 0 0 var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    border-left: 3px solid var(--color-primary);
    background: var(--color-bg-secondary);
    border-radius: 0 12px 12px 0;
}
.feed-detail__article-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-primary);
}
.feed-detail__article-body {
    font-size: var(--font-size-md);
    line-height: 1.85;
    color: var(--color-text-primary);
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
