/*
Theme Name: YokePya
Theme URI: https://yokepyacomic.com
Author: NexPass
Description: ရုပ်ပြ comic ဖတ်ရန် custom theme — mobile-first, dark mode default, ပုံကာကွယ်ရေး, နေ့တိုင်းလဲတဲ့ ပင်မစာမျက်နှာ
Version: 0.9.14
Requires PHP: 7.4
Text Domain: yokepya-theme
*/

/* ==================== Design tokens ==================== */
:root {
	--bg: #0b0f17;
	--surface: #131a26;
	--surface-2: #1b2434;
	--border: #243044;
	--text: #e8edf5;
	--muted: #93a1b8;
	--accent: #25d366;
	--accent-soft: rgba(37, 211, 102, 0.14);
	--accent-2: #2be273;
	--r18: #ff3d5e;
	--radius: 10px;
	--shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
	--header-h: 56px;
}
html[data-theme="light"] {
	--bg: #f4f6fa;
	--surface: #ffffff;
	--surface-2: #eef2f8;
	--border: #dde4ee;
	--text: #17202e;
	--muted: #5b6879;
	--accent: #149e4a;
	--accent-soft: rgba(20, 158, 74, 0.1);
	--accent-2: #17b355;
	--shadow: 0 4px 14px rgba(23, 32, 46, 0.08);
}

/* ==================== Base ==================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "Noto Sans Myanmar", "Pyidaungsu", -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.7;
}
img { max-width: 100%; height: auto; }

/* ==================== ပုံကာကွယ်ရေး (v0.9.7) ====================
 * ဖုန်းမှာ ကြာကြာဖိရင် "Save image" menu မပေါ်အောင် + drag ဆွဲထုတ်မရအောင် ။
 * scroll/link/ခလုတ်တွေကို လုံးဝမထိဘူး — ပုံနဲ့ reader နေရာပဲ ကာတာ ။ */
img {
	-webkit-touch-callout: none;          /* iOS Safari — long-press menu ပိတ် */
	-webkit-user-drag: none;
	user-drag: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: auto;
}
.ypt-reader, .yp-card-thumb, .yp-series-cover {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
/* reader ထဲမှာ စာသားရွေးလို့မရအောင် (ပုံနဲ့တွဲပြီး drag-select မလုပ်နိုင်စေရန်) */
.yp-reader-wrap { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; }
.yp-container { max-width: 1200px; margin: 0 auto; padding: 0 12px; }
@media (min-width: 768px) { .yp-container { padding: 0 20px; } }

/* ==================== Header ==================== */
.yp-header {
	position: sticky; top: 0; z-index: 500;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow);
}
.yp-header-row {
	display: flex; align-items: center; gap: 10px;
	min-height: var(--header-h); padding: 7px 0;
}
.yp-logo { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.yp-logo-img {
	height: 30px; width: auto; display: block;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
html[data-theme="light"] .yp-logo-img { filter: drop-shadow(0 2px 4px rgba(23, 32, 46, 0.15)); }
.yp-tagline {
	font-size: 10px; color: var(--muted); line-height: 1.45; letter-spacing: 0.2px;
	border-left: 1px solid var(--border); padding-left: 10px; white-space: nowrap;
}
@media (min-width: 768px) {
	.yp-logo { gap: 12px; }
	.yp-logo-img { height: 38px; }
	.yp-tagline { font-size: 12px; padding-left: 12px; }
}
.yp-header-search { flex: 1; display: none; }
@media (min-width: 768px) { .yp-header-search { display: block; max-width: 480px; margin: 0 auto; } }
.yp-header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.yp-iconbtn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--surface-2); border: 1px solid var(--border);
	color: var(--text); cursor: pointer; font-size: 16px; line-height: 1;
}
.yp-iconbtn:hover { border-color: var(--accent); }
.yp-iconbtn.yp-on { background: var(--accent-soft); border-color: var(--accent); }

/* Nav chips row */
.yp-nav {
	display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 10px;
	scrollbar-width: none; -ms-overflow-style: none;
}
.yp-nav::-webkit-scrollbar { display: none; }
.yp-chip {
	flex: 0 0 auto;
	padding: 4px 14px; border-radius: 999px;
	background: var(--surface-2); border: 1px solid var(--border);
	color: var(--text) !important; font-size: 13.5px; white-space: nowrap;
}
.yp-chip:hover, .yp-chip.yp-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2) !important; }
.yp-chip.yp-chip-r18 { border-color: var(--r18); color: var(--r18) !important; }

/* Mobile search */
.yp-mobile-search { display: none; padding: 0 0 10px; }
.yp-mobile-search.yp-open { display: block; }
@media (min-width: 768px) { .yp-mobile-search { display: none !important; } }

/* Search form */
.yp-searchform { display: flex; gap: 0; }
.yp-searchform input[type="search"] {
	flex: 1; min-width: 0;
	background: var(--bg); border: 1px solid var(--border);
	border-radius: 999px 0 0 999px; border-right: 0;
	padding: 8px 16px; color: var(--text); font-size: 14px; font-family: inherit;
	outline: none;
}
.yp-searchform input[type="search"]:focus { border-color: var(--accent); }
.yp-searchform button {
	background: var(--accent); color: #fff; border: 0;
	border-radius: 0 999px 999px 0; padding: 8px 18px; cursor: pointer; font-size: 15px;
}

/* ==================== Sections ==================== */
.yp-main { padding: 18px 0 40px; min-height: 60vh; }
.yp-section { margin-bottom: 30px; }
.yp-section-head {
	display: flex; align-items: center; justify-content: space-between;
	margin-bottom: 12px; gap: 10px;
}
.yp-section-head h2 {
	margin: 0; font-size: 18px; font-weight: 700;
	display: flex; align-items: center; gap: 8px;
}
.yp-section-head h2::before {
	content: ""; display: block; width: 4px; height: 20px;
	background: var(--accent); border-radius: 2px;
}
.yp-section-head .yp-more { font-size: 13px; color: var(--muted); white-space: nowrap; }
.yp-section-head .yp-more:hover { color: var(--accent-2); }

/* ==================== Card grid ==================== */
.yp-grid {
	display: grid; gap: 12px;
	grid-template-columns: repeat(3, 1fr);
}
@media (min-width: 480px) { .yp-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .yp-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .yp-grid { grid-template-columns: repeat(6, 1fr); } }

/* Horizontal scroll row (popular) */
.yp-hscroll {
	display: grid; grid-auto-flow: column; grid-auto-columns: 31%;
	gap: 12px; overflow-x: auto; padding-bottom: 6px;
	scrollbar-width: thin;
}
@media (min-width: 480px) { .yp-hscroll { grid-auto-columns: 23%; } }
@media (min-width: 768px) { .yp-hscroll { grid-auto-columns: 18%; gap: 16px; } }
@media (min-width: 1000px) { .yp-hscroll { grid-auto-columns: 15%; } }

/* Card */
.yp-card { position: relative; }
.yp-card-thumb {
	position: relative; display: block; overflow: hidden;
	border-radius: var(--radius); background: var(--surface-2);
	aspect-ratio: 3 / 4;
	border: 1px solid var(--border);
}
.yp-card-thumb img {
	width: 100%; height: 100%; object-fit: cover; object-position: top center;
	display: block; transition: transform 0.25s ease;
}
.yp-card:hover .yp-card-thumb img { transform: scale(1.04); }
.yp-card-title {
	display: block; margin-top: 7px;
	font-size: 13.5px; font-weight: 500; line-height: 1.45;
	color: var(--text) !important;
	overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.yp-card-title:hover { color: var(--accent-2) !important; }
.yp-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; justify-content: space-between; gap: 6px; }
.yp-card-sub .yp-ch { color: var(--accent-2); white-space: nowrap; }
.yp-badge {
	position: absolute; top: 6px; left: 6px;
	background: rgba(0, 0, 0, 0.62); color: #fff;
	backdrop-filter: blur(2px);
	font-size: 10.5px; padding: 2px 8px; border-radius: 999px; line-height: 1.5;
}
.yp-badge-r18 {
	left: auto; right: 6px;
	background: var(--r18); font-weight: 700;
}
.yp-badge-status { top: auto; bottom: 6px; background: rgba(0,0,0,0.62); }

/* Genre chip cloud */
.yp-genre-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.yp-genre-cloud .yp-chip small { color: var(--muted); margin-left: 4px; }

/* ==================== Series page ==================== */
.yp-series-head {
	display: grid; grid-template-columns: 120px 1fr; gap: 16px;
	margin-bottom: 20px;
}
@media (min-width: 768px) { .yp-series-head { grid-template-columns: 220px 1fr; gap: 24px; } }
.yp-series-cover img, .yp-series-cover { border-radius: var(--radius); width: 100%; display: block; }
.yp-series-cover img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top center; border: 1px solid var(--border); }
.yp-series-info h1 { margin: 0 0 8px; font-size: 20px; line-height: 1.4; }
@media (min-width: 768px) { .yp-series-info h1 { font-size: 26px; } }
.yp-meta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.yp-meta-chips .yp-chip { font-size: 12px; padding: 2px 11px; }
.yp-series-facts { font-size: 13.5px; color: var(--muted); margin: 6px 0; }
.yp-series-facts b { color: var(--text); font-weight: 500; }
.yp-series-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.yp-btn {
	display: inline-flex; align-items: center; gap: 6px;
	background: var(--accent); color: #fff !important; border: 0;
	padding: 8px 18px; border-radius: 999px; font-size: 14px; cursor: pointer;
	font-family: inherit; line-height: 1.6;
}
.yp-btn:hover { background: var(--accent-2); }
.yp-btn-ghost {
	background: var(--surface-2); color: var(--text) !important;
	border: 1px solid var(--border);
}
.yp-btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-2) !important; }
.yp-synopsis { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; font-size: 14px; }
.yp-synopsis p:first-child { margin-top: 0; }
.yp-synopsis p:last-child { margin-bottom: 0; }

/* Chapter list */
.yp-chapter-list { list-style: none; margin: 10px 0 0; padding: 0; }
.yp-chapter-list li { border-bottom: 1px solid var(--border); }
.yp-chapter-list li:last-child { border-bottom: 0; }
.yp-chapter-list a {
	display: flex; justify-content: space-between; align-items: center; gap: 10px;
	padding: 11px 6px; color: var(--text) !important; font-size: 14px;
}
.yp-chapter-list a:hover { color: var(--accent-2) !important; }
.yp-chapter-list a small { color: var(--muted); white-space: nowrap; }
.yp-chapter-list .yp-read { color: var(--muted) !important; }
.yp-listbox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px; }

/* ==================== Reader ==================== */
.yp-reader-wrap { max-width: 100%; }
.ypt-reader { margin: 0 -12px; } /* edge-to-edge on phone (container padding 12px) */
.ypt-reader img { display: block; width: 100%; height: auto; margin: 0; border: 0; background: var(--surface-2); min-height: 80px; }
@media (min-width: 900px) { .ypt-reader { margin: 0 auto; width: 860px; max-width: 100%; } }
.yp-reader-bar {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 10px 0; font-size: 13.5px; flex-wrap: wrap;
}
.yp-reader-bar select {
	background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
	border-radius: 8px; padding: 5px 8px; font-family: inherit; font-size: 13px; max-width: 150px;
}
.yp-chapter-nav { display: flex; justify-content: space-between; gap: 8px; margin: 20px 0; }
.yp-chapter-nav .yp-btn { flex: 1; justify-content: center; max-width: 200px; }
.yp-chapter-nav .yp-disabled { opacity: 0.4; pointer-events: none; }

/* ==================== Share ==================== */
.yp-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.yp-share-btn {
	display: inline-flex; align-items: center; gap: 6px;
	background: var(--surface-2); border: 1px solid var(--border); color: var(--text) !important;
	padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; line-height: 1.6;
}
.yp-share-btn:hover { border-color: var(--accent); color: var(--accent-2) !important; }
.yp-share-btn.yp-copied { border-color: #2ecc71; color: #2ecc71 !important; }

/* ==================== Archive / misc ==================== */
.yp-archive-head { margin-bottom: 16px; }
.yp-archive-head h1 { margin: 0 0 6px; font-size: 21px; }
.yp-archive-head .yp-archive-desc { color: var(--muted); font-size: 13.5px; max-width: 760px; }
.yp-filterbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.yp-filterbar::-webkit-scrollbar { display: none; }

.yp-pagination { display: flex; justify-content: center; gap: 6px; margin: 26px 0 0; flex-wrap: wrap; }
.yp-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
	background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
	font-size: 14px;
}
.yp-pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.yp-pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent-2); }

.yp-empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.yp-empty .yp-empty-icon { font-size: 40px; }

/* Breadcrumb */
.yp-breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.yp-breadcrumb a { color: var(--muted); }
.yp-breadcrumb a:hover { color: var(--accent-2); }

/* ==================== Footer ==================== */
.yp-footer {
	border-top: 1px solid var(--border); background: var(--surface);
	margin-top: 30px; padding: 24px 0 90px; color: var(--muted); font-size: 13px;
}
@media (min-width: 768px) { .yp-footer { padding-bottom: 24px; } }
.yp-footer a { color: var(--muted); }
.yp-footer a:hover { color: var(--accent-2); }
.yp-footer-links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }

/* Regular WP content (page.php etc.) */
.yp-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px; }
.yp-content h1 { font-size: 22px; margin-top: 0; }

/* Toast */
.yp-toast {
	position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
	background: var(--surface-2); color: var(--text); border: 1px solid var(--accent);
	padding: 9px 20px; border-radius: 999px; font-size: 13.5px; z-index: 10000;
	box-shadow: var(--shadow); opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.yp-toast.yp-show { opacity: 1; }

/* v0.9.11 — 🧩 Ads Code slots (Appearance → Ads Code) */
.yp-ad { margin: 14px 0; text-align: center; overflow: hidden; max-width: 100%; }
.yp-ad:empty { display: none; }
.yp-ad iframe, .yp-ad img, .yp-ad ins { max-width: 100%; }
.ypt-reader .yp-ad { margin: 10px 12px; }
