/*
Theme Name: DragonHouse Theme
Author: Gemini
Description: ธีมดูซีรีย์ เขียว-ทอง Web App Style
Version: 2.0
*/

:root {
    --primary-bg: #05190d;
    --secondary-bg: #0f2e1b;
    --accent: #d4af37;
    --accent-hover: #f3cf55;
    --text-main: #ffffff;
    --text-muted: #a0b3a6;
}

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

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
a:hover { color: var(--accent); }

/* Layout */
.site-content { flex: 1; width: 100%; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* Header & Logo */
.main-header {
    background: var(--secondary-bg); border-bottom: 2px solid var(--accent); padding: 10px 0; position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo-wrapper { flex-shrink: 0; max-width: 200px; }
.custom-logo-link img { width: auto; height: auto; max-height: 50px; max-width: 100%; display: block; }
.logo { font-size: 1.8rem; font-weight: bold; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; }

/* Search Bar */
.header-search { flex-grow: 1; max-width: 400px; }
.search-form { display: flex; border: 1px solid #2a5a3f; border-radius: 4px; overflow: hidden; }
.search-field { width: 100%; background: #05190d; border: none; color: #fff; padding: 8px 15px; font-family: 'Kanit', sans-serif; outline: none; }
.search-submit { background: var(--accent); border: none; color: #000; padding: 0 15px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.search-submit:hover { background: var(--accent-hover); }

/* Menu */
.main-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.main-nav ul li a { color: var(--text-main); font-weight: 500; font-size: 1rem; padding: 5px 10px; display: block; }
.main-nav ul li a:hover { color: var(--accent); }
.menu-toggle { display: none; }

/* Breadcrumbs */
.dragon-breadcrumbs { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; padding: 10px 0; border-bottom: 1px solid #1f422e; }
.dragon-breadcrumbs a { color: var(--text-muted); } .dragon-breadcrumbs a:hover { color: var(--accent); } .dragon-breadcrumbs span { color: var(--accent); }

/* SEO Section */
.seo-section { background: var(--secondary-bg); padding: 25px; border-radius: 8px; margin-bottom: 30px; border-left: 5px solid var(--accent); margin-top: 20px; }
.seo-section h1 { color: var(--accent); margin-bottom: 15px; font-size: 22px; }
.seo-section h2 { color: var(--accent); margin-bottom: 15px; font-size: 20px; }
.seo-section h3 { color: var(--accent); margin-bottom: 15px; font-size: 18px; }
.seo-section h4 { color: var(--accent); margin-bottom: 15px; font-size: 18px; }
.seo-section p { color: var(--text-muted); line-height: 1.8; font-size: 18px; }

/* Grid Layout */
.series-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; margin-top: 30px; }
.series-card { background: var(--secondary-bg); border-radius: 8px; overflow: hidden; position: relative; transition: transform 0.2s; border: 1px solid #1f422e; }
.series-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.card-thumb { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.card-info { padding: 10px; }
.card-title { font-size: 0.95rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main); }

/* --- BADGES (ดีไซน์ใหม่) --- */

/* EP Badge (มุมขวาบน) */
.ep-badge { 
    position: absolute; top: 10px; right: 10px; 
    background: rgba(0,0,0,0.8); color: var(--accent); border: 1px solid var(--accent);
    font-size: 0.75rem; padding: 3px 8px; 
    border-radius: 4px; font-weight: bold; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 5;
}

/* Voice Badge (มุมซ้ายบน - สไตล์ริบบิ้นทอง) */
.voice-badge {
    position: absolute;
    top: 10px; left: 0;
    background: linear-gradient(45deg, #d4af37, #f3cf55); /* สีทองไล่เฉด */
    color: #05190d; /* ตัวหนังสือสีเขียวเข้ม */
    font-size: 0.75rem;
    padding: 4px 10px;
    font-weight: 800; /* ตัวหนามาก */
    text-transform: uppercase;
    border-radius: 0 4px 4px 0; /* มนเฉพาะด้านขวา */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5); /* เงาให้ดูลอย */
    z-index: 10;
    letter-spacing: 0.5px;
    border-left: 3px solid #8e7321; /* เส้นขอบซ้ายให้ดูมีมิติ */
}

/* Meta Voice Tag (สำหรับหน้าดูซีรีย์ - หัวข้อ) */
.meta-voice-tag {
    display: inline-block;
    background: linear-gradient(to bottom, #d4af37, #b89628);
    color: #000;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    vertical-align: middle;
}

/* Single Page */
.single-container { margin-top: 20px; display: grid; grid-template-columns: 3fr 1fr; gap: 30px; }
.player-wrapper { position: relative; padding-bottom: 56.25%; height: 0; background: #000; border: 2px solid var(--accent); border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.player-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.episode-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; max-height: 400px; overflow-y: auto; background: var(--secondary-bg); padding: 15px; border-radius: 8px; }
.ep-btn { background: #05190d; color: var(--text-main); border: 1px solid #2a5a3f; padding: 10px; text-align: center; cursor: pointer; border-radius: 4px; transition: 0.2s; }
.ep-btn:hover, .ep-btn.active { background: var(--accent); color: #000; font-weight: bold; }
.series-meta { margin-bottom: 20px; color: var(--text-muted); font-size: 0.9rem; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; } 
.series-meta a { color: var(--text-muted); } .series-meta a:hover { color: var(--accent); }
.synopsis { background: var(--secondary-bg); padding: 20px; border-radius: 8px; margin-bottom: 20px; }

/* Sidebar */
.sidebar-title { color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 10px; margin-bottom: 15px; margin-top: 30px; }
.sidebar-title:first-child { margin-top: 0; }
.recent-item { display: flex; gap: 10px; margin-bottom: 15px; align-items: center; }
.recent-thumb { width: 60px; height: 90px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.view-count { font-size: 0.8rem; color: #a0b3a6; display: block; margin-top: 5px; }

/* Footer */
footer { text-align: center; padding: 30px 20px; background: var(--secondary-bg); color: var(--text-muted); border-top: 1px solid var(--accent); margin-top: auto; }
.pagination { margin: 40px 0; text-align: center; }
.pagination .page-numbers { background: var(--secondary-bg); color: var(--text-main); padding: 10px 15px; margin: 0 5px; border-radius: 4px; border: 1px solid var(--accent); }
.pagination .current { background: var(--accent); color: #000; font-weight: bold; }

/* 404 Page */
.error-404 { text-align: center; padding: 50px 0; }
.error-code { font-size: 8rem; font-weight: bold; color: var(--accent); line-height: 1; }
.error-msg { font-size: 1.5rem; margin-bottom: 30px; color: var(--text-muted); }
.btn-home { display: inline-block; background: var(--accent); color: #000; padding: 10px 20px; border-radius: 4px; font-weight: bold; margin-top: 20px; }

/* Related Posts Grid */
.related-section { margin-bottom: 40px; }
.related-grid { margin-top: 15px; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .series-grid { grid-template-columns: repeat(4, 1fr); }
    .single-container { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .series-grid { grid-template-columns: repeat(3, 1fr); }
    .custom-logo-link img { max-height: 40px; }
    .menu-toggle { display: block; background: none; border: none; color: var(--accent); font-size: 1.8rem; cursor: pointer; }
    .main-nav { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--secondary-bg); border-bottom: 2px solid var(--accent); padding: 20px; }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; gap: 15px; text-align: center; }
    .header-search { display: none; }
}
@media (max-width: 480px) {
    .series-grid { grid-template-columns: repeat(2, 1fr); }
}