/* style4.css */
@font-face {
    font-family: 'Quantico';
    src: url('Quantico-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Quantico';
    src: url('Quantico-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

:root {
    --bg-color: #ffffff;
    --border-cyan: rgb(0, 0, 0);
    /* 얇고 연한 청록색 격자선 */
    --border-violet: rgba(220, 160, 220, 0.8);
    /* 외곽 핑크/보라선 */
    --text-main: #1a1a1a;
    --text-muted: #7f7f7f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Quantico', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 전체화면 기준 4열 그리드 */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    width: 100%;
    border: 1px solid var(--border-violet);
    /* 외곽 보라색 테두리 */
}

/* 모든 그리드 자식 요소에 격자 보더라인 일괄 적용 */
.grid>* {
    position: relative;
    box-sizing: border-box;
}

.grid>*::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-right: 1px solid var(--border-cyan);
    border-bottom: 1px solid var(--border-cyan);
    z-index: 3;
    /* 비디오 엘리먼트 위에 오도록 z-index를 높임 */
}

/* 4열 기준 맨 우측 열의 오른쪽 보더선 제거 */
.grid> :nth-child(4n)::after {
    border-right: none;
}

/* 맨 하단 행의 아래쪽 보더선 제거 */
.grid> :nth-last-child(-n+4)::after {
    border-bottom: none;
}

/* 격자선 교차점의 원 배치 (10px 크기 - 흰배경, 1px 검은 보더) */
/* DOM 렌더링 순서 상 뒤의 요소(오른쪽, 아래쪽 카드)가 앞 요소를 덮지 않도록 left/top 기준으로 배치 */
/* .grid>*::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 7px;
    height: 7px;
    background-color: #ffffff;
    border: 1px solid #000000;
    border-radius: 50%;
    box-sizing: border-box;
    /* 전체 원의 크기를 정확히 10px로 유지 */
/*  transform: translate(-50%, -50%);
    z-index: 4;
    /* 보더라인 및 비디오 위에 오도록 z-index를 높임 */
/*   pointer-events: none;
}

/* 4열 기준 맨 좌측 열(1열)의 왼쪽 교차점 원 제거 */
.grid> :nth-child(4n+1)::before {
    display: none;
}

/* 맨 상단 행(1행)의 위쪽 교차점 원 제거 */
.grid> :nth-child(-n+4)::before {
    display: none;
}

/* 1. 타이틀 전용 카드 (1행 1열) */
.title-card {
    padding: 24px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16/10;
}

/* 시안 이미지의 얇은 파란색 텍스트 테두리 상자 구현 */
.title-box {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start; /* 텍스트 정렬은 왼쪽 정렬(flex-start)로 설정 */
    gap: 4px;
    background-color: #ffffff;
}

.title-box h4 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.2;
}

.title-box h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
}

/* 2. 비디오 카드 셀 */
.card {
    position: relative;
    /* overflow: hidden 제거하여 교차점 원이 잘리지 않도록 함 */
    aspect-ratio: 16/10;
    width: 100%;
}

.card video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* 3. 호버 시 적용되는 오버레이 */
.card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* 노란색에서 투명으로 떨어지는 그라디언트 배경 */
    background: linear-gradient(to bottom, rgba(255, 255, 85, 0.95) 0%, rgba(255, 255, 85, 0.7) 45%, rgba(255, 255, 85, 0) 100%);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    color: #1a1a1a;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 카드 호버 시 오버레이 노출 */
.card:hover .overlay {
    opacity: 1;
}

.card .overlay h2 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.2px;
}

.card .overlay .desc {
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    /* 다중행 말줄임표 처리 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* 공간 확보를 위해 3줄 노출 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 4. 빈 카드 셀 */
.empty-card {
    aspect-ratio: 16/10;
    background-color: transparent;
}

/* 반응형 모바일 구조 */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid>*::after {
        border-right: 1px solid var(--border-cyan) !important;
        border-bottom: 1px solid var(--border-cyan) !important;
    }

    .grid> :nth-child(2n)::after {
        border-right: none !important;
    }

    .grid> :nth-last-child(-n+2)::after {
        border-bottom: none !important;
    }

    /* 2열 기준 교차점 처리 */
    .grid>*::before {
        display: block !important;
    }

    /* 2열 기준 맨 좌측 열(1열)의 왼쪽 교차점 원 제거 */
    .grid> :nth-child(2n+1)::before {
        display: none !important;
    }

    /* 맨 상단 행(1행)의 위쪽 교차점 원 제거 */
    .grid> :nth-child(-n+2)::before {
        display: none !important;
    }

    .title-box h1 {
        font-size: 22px;
    }

    .title-box h4 {
        font-size: 14px;
    }
}

@media (max-width: 500px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .grid>*::after {
        border-right: none !important;
        border-bottom: 1px solid var(--border-cyan) !important;
    }

    .grid> :last-child::after {
        border-bottom: none !important;
    }

    /* 1열 기준 교차점 모두 숨김 */
    .grid>*::before {
        display: none !important;
    }
}