/*
Theme Name: YEAHX Theme
Theme URI: https://yeahx.net
Description: 성인 영상 큐레이션 매거진 테마 - Spankbang/Tokyomotion 직로드
Version: 3.1.3
Author: YEAHX Team
Author URI: https://yeahx.net
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yeahx
Tags: dark, magazine, video, adult

YEAHX Theme, Copyright 2026
YEAHX Theme is distributed under the terms of the GNU GPL
*/

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --primary-color: #ff0844;
    --primary-hover: #d90739;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --text-muted: #666666;
    --border-color: rgba(255, 255, 255, 0.08);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --max-width: 1400px;
    --spacing-unit: 20px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-dark) !important;
    color: var(--text-primary) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Container
   ========================================================================== */

.yeahx-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-unit);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: static !important;
    border-bottom: none;
    padding: 6px 0 2px;   /* S112 req①: 로고 URL바 바로 아래 (위 여백 제거) */
}

.site-header .yeahx-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2px;     /* S112 req①②: 헤더 컨테이너 상하 여백 타이트 */
    padding-bottom: 2px;
}

.site-logo {
    font-size: 56px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.site-logo:hover {
    opacity: 0.8;
}

/* PC: 로고 화면 중앙 정렬 (네비는 우측 유지). 모바일은 기존 좌측 정렬 유지 */
@media (min-width: 993px) {
    .site-header .yeahx-container {
        justify-content: flex-end;
        position: relative;
        min-height: 84px;   /* [S358-LOGO-SVG] 인라인 SVG 로고(76px) 절대배치 → 컨테이너 최소높이 확보(배너 침범 방지) */
    }
    .site-logo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-nav a {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--text-primary);
}

/* 텔레그램 광고문의 버튼 */
.header-tg-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: #229ED9;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s !important;
    white-space: nowrap;
}

.header-tg-btn:hover {
    background: #1a8bbf !important;
    color: #fff !important;
    transform: translateY(-1px);
}

@media(max-width:768px) {
    .header-tg-btn { font-size: 12px !important; padding: 6px 11px; }
}

/* ── S111: 모바일 헤더 세로 스택 (로고 PC 동일 중앙 / Contact Us 그 아래·배경 타이트, 텍스트 유지) ── */
@media (max-width: 992px) {
    .site-header .yeahx-container {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2px;   /* S112 req②: 로고↔Contact Us 간격 0에 가깝게 */
    }
    .site-logo {
        font-size: 56px;          /* PC 버전과 동일 크기 */
        text-align: center;
    }
    .header-nav {
        justify-content: center;
    }
    .header-tg-btn {
        padding: 4px 11px !important;   /* 불필요하게 큰 배경 축소 */
        gap: 5px;
    }
}

/* ==========================================================================
   Category Filter
   ========================================================================== */

.category-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 10px;
}

.cat-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-btn:hover {
    background: rgba(255, 8, 68, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.cat-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* ==========================================================================
   Main Layout
   ========================================================================== */

.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 30px 0;
}

.video-main {
    min-width: 0;
}

/* ==========================================================================
   Video Grid
   ========================================================================== */

.video-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
}

/* 관련 영상 그리드 */
.video-grid.related {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ==========================================================================
   Video Card
   ========================================================================== */

.video-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: visible;          /* 잘림 방지 */
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;     /* 썸네일 + 텍스트 세로 스택 */
    min-width: 0;               /* 그리드 트랙 오버플로 방지 */
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 8, 68, 0.3);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;           /* 이미지만 클립 */
    background: #000;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.1);
}

/* 호버 오버레이 */
.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay-bg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

/* preview 순환 중 재생 아이콘 숨김 */
.video-thumb[data-preview-thumbs]:hover .video-overlay {
    opacity: 0;
}

.play-icon {
    font-size: 56px;
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* 카테고리 썸네일 배지 - 비활성화 (썸네일 가림 제거) */
.video-category {
    display: none;
}

/* 썸네일 위 조회수 배지 - 비활성화 (제목 옆으로 이동) */
.video-views {
    display: none;
}

/* ── video-link: a 태그 블록 처리 ── */
.video-link {
    display: block !important;
    color: inherit;
    text-decoration: none;
    width: 100%;
}

/* ── 카드 하단 텍스트 영역 래퍼 ── */
.video-card-body {
    display: block;
    padding: 0;
    background: var(--bg-card);
}

/* ── 제목 + 뷰 카운트 행 ── */
.video-title-row {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    padding: 10px 12px 4px;
    min-height: 0;
}

/* 제목 (card 내부 - 2줄 clamp) */
.video-title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 뷰 카운트 */
.video-views-inline {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted, #888);
    white-space: nowrap;
    padding-top: 2px;
    line-height: 1.5;
}

/* ── 메타 태그 행 ── */
.video-meta-row {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 12px 10px;
}

.vm-date {
    font-size: 11px;
    color: var(--text-muted, #777);
    line-height: 1.6;
}

.vm-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
    line-height: 1.5;
}

/* 카테고리 */
.vm-cat {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary, #aaa);
    border: 1px solid rgba(255,255,255,0.1);
}

/* 영상 길이 */
.vm-dur {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted, #888);
    border: 1px solid rgba(255,255,255,0.08);
}

/* 해상도 */
.vm-qual {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted, #888);
    border: 1px solid rgba(255,255,255,0.08);
}

/* 좋아요 */
.vm-like {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #888);
}

/* 싫어요 */
.vm-dislike {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #888);
}

/* ── 재생시간 오버레이 (썸네일 우하단) ── */
.video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.4;
    z-index: 2;
    pointer-events: none;
}

.video-card.mini .video-title {
    font-size: 13px;
    padding: 10px;
    min-height: 50px;
}

/* 메타 정보 */
.video-meta {
    padding: 0 15px 15px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 15px;
    align-items: center;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    margin: 60px 0 40px;
    text-align: center;
}

.pagination ul {
    display: inline-flex;
    list-style: none;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.pagination .current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* ==========================================================================
   Ads
   ========================================================================== */

/* 상단 배너 그리드 */
/* 롤링 배너 컨테이너 */
.top-banner-rolling {
    position: relative;
    margin: 20px 0;
    min-height: 90px;
}

/* 각 그룹(4개씩) - 기본 숨김 */
.banner-group {
    display: none;  /* JS가 active 클래스 추가 전까지 숨김 */
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* JS 로드 전 첫 그룹 기본 표시 (JS가 로드되면 active로 제어) */
.banner-group:first-child {
    display: grid;
}

/* 활성 그룹만 표시 */
.banner-group.active {
    display: grid;
}

/* JS 로드 후 첫 그룹 비활성 시 숨김 */
.top-banner-rolling.js-ready .banner-group:first-child:not(.active) {
    display: none;
}

/* 개별 배너 슬롯 */
.banner-slot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.2s;
}

.banner-slot:hover {
    border-color: var(--primary-color);
}

/* 광고 코드 없을 때 플레이스홀더 */
.banner-placeholder {
    color: var(--text-muted);
    font-size: 11px;
    opacity: 0.4;
}

/* 광고 코드 있을 때 내부 요소 꽉 채우기 */
.banner-slot > *:not(.banner-placeholder) {
    width: 100%;
    height: 100%;
}


/* ==========================================================================
   Single Video Page
   ========================================================================== */

.video-single {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   Single Video Page - 광고 레이아웃
   ========================================================================== */

/* 전체 페이지 래퍼 */
.sv-page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ── 상단/하단 배너 영역 (2행) ── */
.sv-top-ads,
.sv-bottom-ads {
    width: 100%;
    margin-bottom: 10px;
}
.sv-bottom-ads {
    margin-top: 10px;
    margin-bottom: 0;
}

/* S125(세션3): 영상상세 통합 배너 그리드 (5열×2행, 정적·사이드 폐지) */
.sv-ad-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: 0;
}
.sv-ad-slot {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0;
}
.sv-ad-slot > *:not(.sv-ad-placeholder):not(.yx-ad-inquiry):not(.yx-ad-empty) { max-width:100%; height:auto; display:block; }
.sv-ad-placeholder {
    width: 100%;
    height: 100px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: rgba(255,255,255,0.2);
}

/* S125(세션3): 본문 단일 컬럼 (좌/우 사이드 폐지) */
.sv-main-layout {
    display: block;
}

/* 메인 콘텐츠 영역 */
.sv-content {
    min-width: 0;
}

/* ── 반응형: 모바일 ── */
@media (max-width: 768px) {
    .sv-ad-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sv-ad-slot { min-height: 80px; }
    .sv-ad-placeholder { height: 80px; }
}

/* ── 상단/하단 배너(AD#1~10·11~20): 콘텐츠폭 돌파 full-width 밴드 + 고정 300×100 ──
   body{overflow-x:hidden}로 100vw 브레이크아웃 안전(가로스크롤 없음). 한 줄 최대 5개(=1500px), 좁으면 자동 줄바꿈, 모바일 1열. */
.sv-top-ads, .sv-bottom-ads {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
.sv-top-ads { margin-top: 0; margin-bottom: 10px; }
.sv-bottom-ads { margin-top: 10px; margin-bottom: 0; }
.sv-top-ads .sv-ad-grid, .sv-bottom-ads .sv-ad-grid {
    grid-template-columns: repeat(auto-fit, 300px);  /* 한 줄 최대 5개(=1500px), 좁으면 자동 줄바꿈 */
    justify-content: center;
    max-width: 1500px;   /* 5 × 300px */
    margin: 0 auto;
    gap: 0;
}
.sv-top-ads .sv-ad-slot, .sv-bottom-ads .sv-ad-slot {
    width: 300px;
    height: 100px;
    min-height: 100px;
}
.sv-top-ads .sv-ad-placeholder, .sv-bottom-ads .sv-ad-placeholder { height: 100px; }
@media (max-width: 768px) {
    /* S320d: 모바일 2열 유동 (홈/화면별 S320c와 동일) */
    .sv-top-ads .sv-ad-grid, .sv-bottom-ads .sv-ad-grid { grid-template-columns: 1fr 1fr; gap:6px; }
    .sv-top-ads .sv-ad-slot, .sv-bottom-ads .sv-ad-slot { width: 100%; max-width:100%; height: auto; min-height:0; }
    .sv-top-ads .sv-ad-slot img, .sv-bottom-ads .sv-ad-slot img { width:100%; max-width:100%; height:auto; aspect-ratio:3/1; object-fit:cover; }
}


.video-player-section {
    margin-bottom: 30px;
}

.video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    padding-bottom: 56.25%; /* 16:9 비율 */
    height: 0;
}

.video-player iframe,
.video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* extra/PART 플레이어 컨테이너 — .video-player와 동일한 16:9 구조 */
.sv-extra-player,
.sv-part-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.sv-extra-player iframe,
.sv-extra-player video,
.sv-part-player iframe,
.sv-part-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.video-info {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.video-info .video-title {
    font-size: 28px;
    line-height: 1.4;
    margin-bottom: 20px;
    padding: 0;
    min-height: auto;
    display: block;
    -webkit-line-clamp: unset;
}

.video-meta-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.meta-item {
    font-size: 14px;
    color: var(--text-secondary);
}

.meta-item a {
    color: var(--primary-color);
}

.video-taxonomy {
    margin-bottom: 20px;
}

.video-categories,
.video-tags {
    margin-bottom: 10px;
    font-size: 14px;
}

.video-categories a,
.video-tags a {
    color: var(--primary-color);
    margin: 0 5px;
}

.video-description {
    line-height: 1.8;
    color: var(--text-secondary);
}

/* 관련 영상 섹션 */
.related-videos-section {
    margin-top: 60px;
}

.section-title {
    font-size: 24px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-content p {
    margin: 10px 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* 비디오 그리드 스텝핑: 1279px 이하 5열 (세션B) */
@media (max-width: 1279px) {
    .video-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* 1200px 이하 (배너) */
@media (max-width: 1200px) {
    .banner-group { grid-template-columns: repeat(3, 1fr); }
    .banner-group.active { grid-template-columns: repeat(3, 1fr); }
}

/* 비디오 그리드 스텝핑: 1079px 이하 4열 (세션B) */
@media (max-width: 1079px) {
    .video-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* 992px 이하 */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .video-main {
        order: 1;
    }
}

/* 768px 이하 */
@media (max-width: 768px) {
    :root {
        --spacing-unit: 15px;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    
    .video-grid.related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    /* 모바일: 카테고리 뱃지 + 좋아요/싫어요 숨김 (상세페이지에서만 노출) */
    .video-card .video-meta-row {
        display: none !important;
    }
    
    /* 모바일: 카드 텍스트 영역 축소 */
    .video-card .video-title-row {
        padding: 6px 8px 6px;
    }
    
    .video-card .video-title {
        font-size: 12px;
        line-height: 1.35;
    }
    
    .video-card .video-views-inline {
        font-size: 10px;
    }
    
    /* 모바일: 카드 border-radius 축소 */
    .video-card {
        border-radius: 8px;
    }
    
    .video-thumb {
        border-radius: 8px 8px 0 0;
    }
    
    /* 모바일: 호버 효과 제거 (터치 기기) */
    .video-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .banner-group { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    
    .category-filter {
        padding: 15px;
        gap: 8px;
    }
    
    .cat-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .video-info .video-title {
        font-size: 22px;
    }
    
    .play-icon {
        font-size: 40px;
    }
    
    .section-title {
        font-size: 20px;
    }
}

/* 480px 이하 */
@media (max-width: 480px) {
    .video-meta-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* ==========================================================================
   No Videos Message
   ========================================================================== */

.no-videos {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-videos p {
    font-size: 18px;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}
