/*
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;
}

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 {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .yeahx-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.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; }
}

/* ==========================================================================
   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: 250px 1fr;
    gap: 30px;
    margin: 30px 0;
}

.sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

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

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

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

/* 관련 영상 그리드 */
.video-grid.related {
    grid-template-columns: repeat(4, 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;     /* 썸네일 + 텍스트 세로 스택 */
}

.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;
}

.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-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
   ========================================================================== */

/* 상단 배너 그리드 */
/* 롤링 배너 컨테이너 - 구버전 .ad-banner-grid 대체 */
.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%;
}

/* 하위 호환: 구버전 ad-banner-grid 혹시 남아있을 경우 */
.ad-banner-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.ad-banner-item {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 사이드바 광고 */
.ad-sidebar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ad-sidebar-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 컨텐츠 광고 */
.video-grid-ad {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   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;
}

/* 배너 한 행 (4칸) */
.sv-banner-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

/* 배너 슬롯 */
.sv-banner-slot {
    min-height: 90px;
    overflow: hidden;
    border-radius: 6px;
}

/* 광고 미입력 시 placeholder */
.sv-banner-placeholder {
    width: 100%;
    height: 90px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: rgba(255,255,255,0.2);
}

/* ── 본문 3열 레이아웃: 좌사이드 | 메인 | 우사이드 ── */
.sv-main-layout {
    display: grid;
    grid-template-columns: 160px 1fr 160px;
    gap: 10px;
    align-items: start;
}

/* 사이드 컬럼 */
.sv-side-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 20px;
}

/* 사이드 슬롯 */
.sv-side-slot {
    min-height: 250px;
    overflow: hidden;
    border-radius: 6px;
}

/* 사이드 placeholder */
.sv-side-placeholder {
    width: 100%;
    height: 250px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: rgba(255,255,255,0.2);
}

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

/* ── 반응형: 태블릿 ── */
@media (max-width: 1100px) {
    .sv-main-layout {
        grid-template-columns: 120px 1fr 120px;
    }
    .sv-side-slot {
        min-height: 180px;
    }
    .sv-side-placeholder {
        height: 180px;
    }
}

/* ── 반응형: 모바일 ── */
@media (max-width: 768px) {
    .sv-main-layout {
        grid-template-columns: 1fr;
    }
    .sv-side-col {
        display: none; /* 모바일에서 사이드 광고 숨김 */
    }
    .sv-banner-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .sv-banner-slot {
        min-height: 70px;
    }
    .sv-banner-placeholder {
        height: 70px;
    }
}


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

.video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-player iframe,
.video-player video {
    width: 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
   ========================================================================== */

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

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

/* 768px 이하 */
@media (max-width: 768px) {
    :root {
        --spacing-unit: 15px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .video-grid.related {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ad-banner-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .banner-group { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .banner-group.active { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    
    .category-filter {
        padding: 15px;
        gap: 8px;
    }
    
    .cat-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .video-title {
        font-size: 14px;
        padding: 12px;
    }
    
    .video-info .video-title {
        font-size: 22px;
    }
    
    .play-icon {
        font-size: 40px;
    }
    
    .section-title {
        font-size: 20px;
    }
}

/* 480px 이하 */
@media (max-width: 480px) {
    .site-logo {
        font-size: 22px;
    }
    
    .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;
}

/* ==========================================================================
   그리드 광고 카드 - 영상 카드와 동일 크기로 자동 삽입
   ========================================================================== */

.video-card.ad-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    cursor: default;
}

.video-card.ad-card::before {
    content: 'AD';
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 10;
    background: rgba(0,0,0,0.55);
    color: #aaa;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.ad-card-inner {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-card-inner > * {
    width: 100% !important;
    height: 100% !important;
}

.ad-card-placeholder {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0.4;
}
