/*
Theme Name: Javscat
Theme URI: http://localhost:10030/
Author: javscat.org
Description: ธีมเว็บดูหนัง AV โทนกุหลาบอ่อน ใช้ง่ายทั้งเดสก์ท็อปและมือถือ — แถวแนะนำ/มาแรง, กริดเรื่องล่าสุดพร้อมแท็บเรียง, ดารา/ค่าย/แท็ก, นับวิว/ไลก์, แถบเมนูล่างบนมือถือ
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: javscat
*/

:root {
	--bg: #faf6f8;
	--surface: #ffffff;
	--soft: #fdeef4;
	--line: #f0e2ea;
	--text: #251a21;
	--muted: #8b7883;
	--primary: #e0367f;
	--primary-ink: #b8215f;
	--accent: linear-gradient(135deg, #ff7d6b 0%, #e0367f 100%);
	--good: #2f9d58;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(60, 20, 40, .06), 0 4px 14px rgba(60, 20, 40, .05);
	--shadow-hover: 0 8px 24px rgba(180, 40, 100, .14);
	--wrap: 1200px;
	--gutter: 16px;
	--head-font: "Kanit", "IBM Plex Sans Thai", system-ui, sans-serif;
	--body-font: "IBM Plex Sans Thai", "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--text);
	font-family: var(--body-font); font-size: 15px; line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head-font); font-weight: 600; letter-spacing: .1px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.jc-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
[hidden] { display: none !important; }

/* ================= Header ================= */
.jc-header { background: var(--surface); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(60, 20, 40, .04); }
.admin-bar .jc-header { top: 32px; }
.jc-header__top { display: flex; align-items: center; gap: 20px; height: 64px; }
.jc-logo { flex: 0 0 auto; display: flex; align-items: center; }
.jc-logo img { height: 52px; width: auto; max-width: none; }
.jc-footer__seo .jc-logo img { height: 72px; }
.jc-logo__text {
	font-family: "Kanit", sans-serif; font-size: 26px; font-weight: 700; letter-spacing: .3px; line-height: 1;
	background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.jc-header__search { flex: 1; max-width: 560px; margin-left: auto; }
.jc-iconbtn { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; }
.jc-iconbtn:hover { background: var(--soft); color: var(--primary); }
.jc-iconbtn svg { width: 22px; height: 22px; }
.jc-search-toggle { display: none; }

.jc-searchform { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 3px 3px 16px; transition: border-color .15s, box-shadow .15s; }
.jc-searchform:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(224, 54, 127, .12); background: #fff; }
.jc-searchform input[type=search] { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 7px 0; font-size: 15px; }
.jc-searchform input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.jc-searchform button { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
.jc-searchform button svg { width: 18px; height: 18px; }

/* แถบหมวดหมู่ — เลื่อนแนวนอนได้ทุกขนาดจอ */
.jc-nav { border-top: 1px solid var(--line); }
.jc-nav ul {
	list-style: none; margin: 0; padding: 8px 0; display: flex; gap: 6px;
	overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.jc-nav ul::-webkit-scrollbar { display: none; }
.jc-nav li { flex: 0 0 auto; }
.jc-nav a {
	display: block; padding: 7px 15px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
	color: #4d3d47; white-space: nowrap; transition: background .15s, color .15s;
}
.jc-nav a:hover { background: var(--soft); color: var(--primary-ink); }
.jc-nav .current-menu-item > a, .jc-nav .current-cat > a, .jc-nav .is-home > a { background: var(--text); color: #fff; }

/* ================= Sections ================= */
.jc-main { padding: 20px 0 36px; }
.jc-section { margin: 0 0 32px; }
.jc-section__head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; min-height: 36px; }
.jc-section__title { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 8px; }
.jc-section__title::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: var(--accent); }
.jc-section__title svg { color: #ff6a4d; }
.jc-section__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.jc-btn-more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--primary); padding: 6px 4px 6px 10px; border-radius: 999px; }
.jc-btn-more:hover { background: var(--soft); color: var(--primary-ink); }
.jc-select { appearance: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 30px 6px 14px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b7883' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; font-size: 14px; cursor: pointer; }

/* ================= Carousel ================= */
.jc-carousel { position: relative; }
.jc-carousel__track {
	--cols: 5;
	display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--cols) - 1) * 14px) / var(--cols));
	gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none; padding: 2px 0 8px; overscroll-behavior-x: contain;
}
.jc-carousel__track::-webkit-scrollbar { display: none; }
.jc-carousel__track > * { scroll-snap-align: start; }
.jc-carousel__btn {
	position: absolute; top: calc(50% - 26px); transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
	border: 0; background: #fff; color: var(--text); cursor: pointer; display: grid; place-items: center; z-index: 2;
	box-shadow: 0 4px 14px rgba(40, 10, 30, .18); transition: opacity .2s, transform .2s;
}
.jc-carousel__btn:hover { color: var(--primary); transform: translateY(-50%) scale(1.06); }
.jc-carousel__btn--prev { left: -14px; }
.jc-carousel__btn--next { right: -14px; }
.jc-carousel__btn svg { width: 16px; height: 16px; }
.jc-carousel.at-start .jc-carousel__btn--prev, .jc-carousel.at-end .jc-carousel__btn--next { opacity: 0; pointer-events: none; }

/* ================= Cards ================= */
.jc-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; min-width: 0; }
@media (hover: hover) {
	.jc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
	.jc-card:hover .jc-card__thumb img { transform: scale(1.04); }
	.jc-card:hover .jc-card__play { opacity: 1; }
}
.jc-card__thumb { position: relative; aspect-ratio: 3 / 2; background: var(--soft); overflow: hidden; display: block; }
.jc-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.jc-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #e3b5ca; }
.jc-card__badge { position: absolute; font-size: 11.5px; font-weight: 600; line-height: 1; color: #fff; background: rgba(20, 10, 16, .72); padding: 4px 6px; border-radius: 6px; backdrop-filter: blur(4px); }
.jc-card__badge--dur { right: 6px; bottom: 6px; }
.jc-card__badge--hd { left: 6px; top: 6px; background: var(--accent); }
.jc-card__play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: rgba(37, 26, 33, .25); }
.jc-card__play span { width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .95); display: grid; place-items: center; color: var(--primary); }
.jc-card__body { padding: 9px 11px 11px; display: flex; flex-direction: column; flex: 1; }
.jc-card__title { font-family: var(--body-font); font-size: 14px; font-weight: 500; margin: 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.jc-card--slim .jc-card__title { -webkit-line-clamp: 1; min-height: 0; font-size: 13.5px; }
.jc-card__meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.jc-card__meta > span { display: inline-flex; align-items: center; gap: 3px; }
.jc-card__meta .is-good { color: var(--good); font-weight: 600; }
.jc-card__count { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.jc-term .jc-card__title { -webkit-line-clamp: 1; min-height: 0; font-weight: 600; }

/* ================= Grid / tabs ================= */
.jc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.jc-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.jc-tabs { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.jc-tabs::-webkit-scrollbar { display: none; }
.jc-tabs a { flex: 0 0 auto; padding: 7px 16px; font-size: 14.5px; font-weight: 500; color: #5a4954; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.jc-tabs a:hover { border-color: var(--primary); color: var(--primary); }
.jc-tabs a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.jc-empty { background: var(--surface); border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--muted); }

/* ================= Pagination ================= */
.jc-pagination { display: flex; justify-content: center; gap: 6px; margin: 28px 0 6px; flex-wrap: wrap; }
.jc-pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; font-weight: 500; }
.jc-pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.jc-pagination a.page-numbers:hover { border-color: var(--primary); color: var(--primary); }
.jc-pagination .dots { border: 0; background: none; }

/* ================= Archive head / chips ================= */
.jc-archive-head { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 16px; box-shadow: var(--shadow); display: flex; gap: 16px; align-items: center; }
.jc-archive-head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 3px solid var(--soft); }
.jc-archive-head h1 { font-size: 24px; margin: 0; line-height: 1.3; }
.jc-archive-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.jc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.jc-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); padding: 6px 13px; border-radius: 999px; font-size: 14px; }
.jc-chip::before { content: "#"; color: var(--primary); font-weight: 600; }
.jc-chip:hover { border-color: var(--primary); color: var(--primary); }
.jc-chip small { color: var(--muted); font-size: 12px; }

/* ================= Single ================= */
.jc-single { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.jc-player { position: relative; aspect-ratio: 16 / 9; background: #140b11; border-radius: var(--radius); overflow: hidden; }
.jc-player iframe, .jc-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.jc-player__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.jc-player__note { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; text-align: center; color: #fff; background: linear-gradient(0deg, rgba(0, 0, 0, .8), transparent); font-size: 14px; }
.jc-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-top: 14px; }
.jc-single__title { font-size: 21px; line-height: 1.45; margin: 0 0 10px; }
.jc-single__bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 14px; }
.jc-single__bar > span { display: inline-flex; align-items: center; gap: 4px; }
.jc-vote { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.jc-vote button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; height: 40px; padding: 0 16px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.jc-vote button:hover { border-color: var(--primary); color: var(--primary); }
.jc-vote button.is-voted { background: var(--primary); color: #fff; border-color: var(--primary); }
.jc-vote__pct { font-weight: 600; color: var(--good); }
.jc-info { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; font-size: 14.5px; margin: 0; }
.jc-info dt { color: var(--muted); }
.jc-info dd { margin: 0; }
.jc-info dd a { color: var(--primary); }
.jc-content { font-size: 15px; color: #43343d; }
.jc-content p:first-child { margin-top: 0; }
.jc-side { position: sticky; top: 130px; }
.admin-bar .jc-side { top: 162px; }
.jc-side .jc-box { margin-top: 0; }
.jc-side h3 { font-size: 17px; margin: 0 0 12px; }
.jc-sidelist { display: flex; flex-direction: column; gap: 12px; }
.jc-sideitem { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: start; font-size: 13.5px; line-height: 1.45; }
.jc-sideitem img, .jc-sideitem .jc-noimg { position: static; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; width: 100%; background: var(--soft); }
.jc-sideitem span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ================= Footer ================= */
.jc-footer { margin-top: 10px; background: var(--surface); border-top: 1px solid var(--line); }
.jc-footer__seo { text-align: center; padding: 32px 0 24px; }
.jc-footer__seo .jc-logo { justify-content: center; margin-bottom: 10px; }
.jc-footer__seo h1, .jc-footer__seo h2 { font-size: 20px; margin: 0 0 8px; }
.jc-footer__seo p { max-width: 760px; margin: 0 auto; color: var(--muted); font-size: 14px; }
.jc-footer__bar { border-top: 1px solid var(--line); padding: 16px 0 20px; text-align: center; font-size: 13.5px; color: var(--muted); }
.jc-footer__links { display: flex; justify-content: center; gap: 6px 20px; flex-wrap: wrap; margin: 0 0 6px; padding: 0; list-style: none; }
.jc-footer__links a { color: var(--text); font-weight: 500; }
.jc-footer__links a:hover { color: var(--primary); }
.jc-footer__copy b { color: var(--primary); font-weight: 600; }

.jc-totop { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--text); color: #fff; cursor: pointer; display: none; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); z-index: 40; }
.jc-totop.is-show { display: grid; }
.jc-bottomnav { display: none; }

/* ================= Page / 404 ================= */
.jc-page { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.jc-page h1 { margin-top: 0; }
.jc-page .jc-searchform { max-width: 480px; margin: 16px auto 0; }

/* ================= Tablet ================= */
@media (max-width: 1100px) {
	.jc-carousel__track { --cols: 4; }
	.jc-grid--5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.jc-carousel__btn--prev { left: -6px; }
	.jc-carousel__btn--next { right: -6px; }
}
@media (max-width: 960px) {
	.jc-single { grid-template-columns: 1fr; }
	.jc-side { position: static; }
	.jc-sidelist { display: grid; grid-template-columns: repeat(2, 1fr); }
	.jc-grid, .jc-grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.jc-carousel__track { --cols: 3.3; }
}

/* ================= Mobile ================= */
@media (max-width: 760px) {
	:root { --gutter: 12px; }
	body { font-size: 15px; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
	.admin-bar .jc-header { top: 0; }
	.jc-header { position: sticky; }
	.jc-header__top { height: 56px; gap: 8px; flex-wrap: wrap; }
	.jc-logo__text { font-size: 22px; }
	.jc-logo img { height: 42px; }
	.jc-footer__seo .jc-logo img { height: 56px; }
	.jc-search-toggle { display: grid; margin-left: auto; }
	.jc-header__search { display: none; order: 3; flex: 0 0 100%; max-width: none; margin: 0 0 10px; }
	.jc-header__search.is-open { display: block; }
	.jc-header__top:has(.jc-header__search.is-open) { height: auto; padding-top: 8px; }
	.jc-header__search.is-open ~ .jc-search-toggle { color: var(--primary); background: var(--soft); }
	.jc-nav ul { padding: 6px 0 8px; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
	.jc-nav a { font-size: 14px; padding: 6px 13px; background: var(--bg); }

	.jc-main { padding-top: 14px; }
	.jc-section { margin-bottom: 26px; }
	.jc-section__title { font-size: 18px; }
	.jc-section__title::before { height: 18px; }
	.jc-select { padding: 5px 28px 5px 12px; font-size: 13.5px; }

	/* สไลด์: เห็นการ์ดถัดไปบางส่วน ชวนให้ปัด เต็มขอบจอ */
	.jc-carousel { margin: 0 calc(-1 * var(--gutter)); }
	.jc-carousel__track { --cols: 2.3; gap: 10px; padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding: 0 var(--gutter); }
	.jc-carousel__btn { display: none; }

	.jc-grid, .jc-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.jc-card__body { padding: 8px 9px 10px; }
	.jc-card__title { font-size: 13.5px; }
	.jc-card--slim .jc-card__title { font-size: 13px; }
	.jc-card__meta { font-size: 12px; gap: 8px; }
	.jc-tabs { margin: 0 calc(-1 * var(--gutter)) 12px; padding: 2px var(--gutter); }

	.jc-archive-head { padding: 14px; gap: 12px; }
	.jc-archive-head img { width: 56px; height: 56px; }
	.jc-archive-head h1 { font-size: 20px; }

	/* หน้าเรื่อง: เครื่องเล่นเต็มความกว้างจอ */
	.jc-player { margin: -14px calc(-1 * var(--gutter)) 0; border-radius: 0; }
	.jc-box { padding: 14px; }
	.jc-single__title { font-size: 18px; }
	.jc-vote { margin-left: 0; width: 100%; }
	.jc-vote button { flex: 1; justify-content: center; }
	.jc-info { grid-template-columns: 84px 1fr; font-size: 14px; }
	.jc-sidelist { grid-template-columns: 1fr; }
	.jc-sideitem:nth-child(n+5) { display: none; }

	.jc-pagination .page-numbers { min-width: 40px; height: 40px; }
	.jc-footer__seo { padding: 24px 0 18px; }
	.jc-footer__seo h1, .jc-footer__seo h2 { font-size: 17px; }
	.jc-footer__seo p { font-size: 13.5px; }

	.jc-totop { bottom: calc(74px + env(safe-area-inset-bottom)); right: 12px; width: 40px; height: 40px; }

	/* แถบเมนูล่าง */
	.jc-bottomnav {
		display: grid; grid-template-columns: repeat(5, 1fr);
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
		background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
		border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
	}
	.jc-bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 60px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
	.jc-bottomnav svg { width: 22px; height: 22px; }
	.jc-bottomnav a.is-active { color: var(--primary); }
	.jc-bottomnav a:active { background: var(--soft); }
}
@media (max-width: 380px) {
	.jc-carousel__track { --cols: 2.1; }
	.jc-card__meta .jc-hide-xs { display: none; }
}
