/* /css/video.css — 회복의 자리 동영상 페이지 전용 */
/* 사이트 기본 색상 변수: #142242(navy), #d75e03(orange), #f7f7f8(light) */

/* ===== 썸네일 그리드 공통 ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.aspect-video { aspect-ratio: 16 / 9; }

/* ===== 시청 페이지 블라인드 래퍼 ===== */
.video-blind-wrap {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(20, 34, 66, 0.15);
    /* 우클릭 영역 시각적 표시 제거 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 16:9 비율 유지 (padding-bottom 트릭) */
.video-ratio {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 9/16 = 0.5625 */
    height: 0;
}

/* iframe 호스트 */
.video-frame-host {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}
.video-frame-host iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ===== 상단/하단 블라인드 오버레이 ===== */
/* YouTube 제목줄/로고를 덮는 영역. 클릭 통과는 불가(pointer-events:none)로 해야
   재생/일시정지 버튼 클릭이 iframe으로 전달됨. 그러나 너무 완전히 클릭 통과시키면
   YouTube 제목 클릭도 되므로 상/하단은 pointer-events: auto 로 두고, 중앙은 뚫어둔다. */

.video-top-hide,
.video-bottom-hide {
    position: absolute;
    left: 0;
    width: 100%;
    background: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0,0,0,0) 100%);
    z-index: 10;
    pointer-events: auto; /* YouTube 제목/로고 클릭 차단 */
}
.video-top-hide {
    top: 0;
    height: 48px;
}
.video-bottom-hide {
    bottom: 0;
    height: 52px;
    background: linear-gradient(to top, #000 0%, #000 55%, rgba(0,0,0,0) 100%);
}

/* 호버 시 투명도 증가 (컨트롤 보이게) */
.video-blind-wrap:hover .video-top-hide,
.video-blind-wrap:hover .video-bottom-hide {
    background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.3) 70%, rgba(0,0,0,0) 100%);
}
.video-blind-wrap:hover .video-bottom-hide {
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.3) 55%, rgba(0,0,0,0) 100%);
}

/* ===== 로딩 스피너 ===== */
.video-loading {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    font-size: 14px;
}
.video-loading .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #d75e03; /* pcc-orange */
    border-radius: 50%;
    animation: video-spin 0.9s linear infinite;
}
@keyframes video-spin {
    to { transform: rotate(360deg); }
}

/* 에러 메시지 */
.video-error {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #ffb4b4;
    font-size: 14px;
    padding: 16px 24px;
    background: rgba(20, 34, 66, 0.6);
    border: 1px solid rgba(255,180,180,0.4);
    border-radius: 8px;
    text-align: center;
    max-width: 80%;
}

/* ===== 모바일 대응 ===== */
@media (max-width: 640px) {
    .video-blind-wrap { border-radius: 12px; }
    .video-top-hide    { height: 34px; }
    .video-bottom-hide { height: 38px; }
    .video-loading      { font-size: 12px; }
    .video-loading .spinner { width: 32px; height: 32px; }
}

/* 가로 모드(landscape) 스마트폰 */
@media (max-width: 900px) and (orientation: landscape) {
    .video-top-hide    { height: 30px; }
    .video-bottom-hide { height: 34px; }
}

/* ===== 관리자 테이블 → 모바일 카드 모드 ===== */
@media (max-width: 640px) {
    .admin-video-table { display: block; }
    .admin-video-table thead { display: none; }
    .admin-video-table tbody, .admin-video-table tr { display: block; }
    .admin-video-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 10px;
        margin-bottom: 10px;
        background: #fff;
    }
    .admin-video-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: 0 !important;
        padding: 6px 4px !important;
        text-align: right !important;
    }
    .admin-video-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #434549;
        font-size: 12px;
        margin-right: 10px;
    }
    .admin-video-table td:first-child { display: none; } /* ID 숨김 */
}
