/*
Theme Name: JAV Theme
Description: ธีมเว็บวิดีโอสไตล์ javxstar — Homepage / Single / Archive (actress, studio, category, type, year) / Search / View counter
Version: 1.1.0
Author: Publisher Pipeline
Text Domain: javtheme
*/

:root {
  /* สีทั้งหมดผูกกับ palette ใน Appearance > Editor > Styles > Colors
     เปลี่ยนที่นั่นแล้วมีผลทั้งเว็บทันที (ค่าหลัง , คือ fallback) */
  --bg: var(--wp--preset--color--bg, #0d0f14);
  --bg-card: var(--wp--preset--color--card, #161923);
  --bg-elev: var(--wp--preset--color--elev, #1c202e);
  --border: var(--wp--preset--color--border, #262b3a);
  --text: var(--wp--preset--color--text, #e8eaf0);
  --muted: var(--wp--preset--color--muted, #99a0b0);
  --accent: var(--wp--preset--color--accent, #ff3d6e);
  --accent-2: var(--wp--preset--color--accent-2, #7cb7ff);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "Noto Sans Thai", Tahoma, sans-serif;
  line-height: 1.65; font-size: 15px; }
a { color: var(--text); text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50;
  background: rgba(13,15,20,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); }
.site-header .topbar { display: flex; align-items: center; gap: 22px;
  padding: 13px 0; flex-wrap: wrap; }
.site-title { font-size: 22px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--accent), #ff8fb0);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; transition: .15s; }
.site-nav a:hover { color: #fff; background: var(--bg-elev); }
.search-form { margin-left: auto; display: flex; }
.search-form input { background: var(--bg-elev); border: 1px solid var(--border);
  border-right: 0; color: var(--text); padding: 8px 14px; width: 210px;
  border-radius: 8px 0 0 8px; outline: none; font-size: 14px; }
.search-form input:focus { border-color: var(--accent); }
.search-form button { background: var(--accent); color: #fff; border: 0;
  padding: 8px 16px; border-radius: 0 8px 8px 0; cursor: pointer;
  font-weight: 700; font-size: 14px; }

/* core blocks ใน header part (site-title / navigation / search / logo) */
.site-header .topbar { padding: 13px 0; gap: 20px; }
.wp-block-site-title { margin: 0; }
.wp-block-site-title a { font-size: 22px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--accent), #ff8fb0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-decoration: none; }
.wp-block-site-logo img { border-radius: 8px; }
.site-header .wp-block-navigation a { color: var(--muted); font-size: 14px;
  font-weight: 600; padding: 6px 12px; border-radius: 8px; transition: .15s;
  text-decoration: none; }
.site-header .wp-block-navigation a:hover { color: #fff;
  background: var(--bg-elev); }
.site-header .wp-block-search { margin-left: auto; }
.site-header .wp-block-search .wp-block-search__inside-wrapper {
  display: flex; border: 0; padding: 0; }
.site-header .wp-block-search input.wp-block-search__input {
  background: var(--bg-elev); border: 1px solid var(--border); border-right: 0;
  color: var(--text); padding: 8px 14px; width: 210px;
  border-radius: 8px 0 0 8px; outline: none; font-size: 14px; }
.site-header .wp-block-search input.wp-block-search__input:focus {
  border-color: var(--accent); }
.site-header .wp-block-search button.wp-block-search__button {
  background: var(--accent); color: #fff; border: 0; padding: 8px 16px;
  border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 700;
  font-size: 14px; margin-left: 0; }
.site-footer p { margin: 0; }
/* category strip */
.cat-strip { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 12px;
  scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip a { flex: 0 0 auto; background: var(--bg-elev);
  border: 1px solid var(--border); color: var(--muted); font-size: 13px;
  padding: 4px 13px; border-radius: 20px; transition: .15s; }
.cat-strip a:hover { color: #fff; border-color: var(--accent); }

/* ---------- sections ---------- */
.section-title { display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; margin: 34px 0 16px; }
.section-title::before { content: ""; width: 5px; height: 22px;
  background: var(--accent); border-radius: 3px; }
.section-title a.more { margin-left: auto; font-size: 13px; font-weight: 600;
  color: var(--muted); }
.section-title a.more:hover { color: var(--accent-2); }

/* ---------- video grid / cards ---------- */
.video-grid { display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.video-card { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; transition: .18s; }
.video-card:hover { transform: translateY(-4px); border-color: #3a415a;
  box-shadow: 0 10px 28px rgba(0,0,0,.45); }
.video-card .thumb { position: relative; aspect-ratio: 16/10.5;
  background: #090b10; overflow: hidden; }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover;
  display: block; transition: transform .3s; }
.video-card:hover .thumb img { transform: scale(1.06); }
.video-card .thumb::after { content: "▶"; position: absolute; inset: 0;
  display: grid; place-items: center; font-size: 34px; color: #fff;
  background: rgba(0,0,0,.35); opacity: 0; transition: .2s; }
.video-card:hover .thumb::after { opacity: 1; }
.video-card .dur { position: absolute; right: 8px; bottom: 8px; z-index: 2;
  background: rgba(0,0,0,.8); font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 5px; }
.video-card .code-badge { position: absolute; left: 8px; top: 8px; z-index: 2;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 2px 9px; border-radius: 5px; letter-spacing: .3px; }
.video-card .body { padding: 12px 14px 13px; }
.video-card .title { font-size: 14px; margin: 0; font-weight: 600;
  line-height: 1.5; min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.video-card .title:hover { color: var(--accent-2); }
.video-card .meta { font-size: 12.5px; color: var(--muted); margin-top: 7px;
  display: flex; gap: 10px; }

/* ---------- actress chips (homepage) ---------- */
.actress-grid { display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.actress-card { display: flex; align-items: center; gap: 11px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 13px; transition: .15s; }
.actress-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.actress-card .avatar { width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8438ff);
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
  color: #fff; flex: 0 0 auto; }
.actress-card .avatar-img { width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto; border: 2px solid var(--accent); }

/* favorite button */
.video-card { position: relative; }
.fav-btn { position: absolute; right: 8px; top: 8px; z-index: 5;
  background: rgba(0,0,0,.6); border: 0; color: #777; font-size: 15px;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  transition: .15s; line-height: 1; }
.fav-btn:hover { color: #fff; transform: scale(1.15); }
.fav-btn.active { color: var(--accent); }

/* letter nav (actress A-Z) */
.letter-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.letter-nav a { background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--muted); min-width: 34px; text-align: center; padding: 5px 0;
  border-radius: 7px; font-size: 14px; font-weight: 700; }
.letter-nav a:hover { color: #fff; border-color: var(--accent); }

/* term header (actress/category archive) */
.term-head { display: flex; gap: 20px; align-items: center; margin: 26px 0 6px; }
.term-head .term-photo { width: 110px; height: 110px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--accent); flex: 0 0 auto; }
.term-head .archive-head { margin: 0 0 4px; }
.term-desc { color: var(--muted); font-size: 14px; margin: 6px 0 0;
  max-width: 700px; }
.actress-card .name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.actress-card .count { font-size: 12px; color: var(--muted); }

/* ---------- tag chips ---------- */
.tags a { display: inline-block; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 20px; color: var(--muted);
  padding: 4px 14px; margin: 0 7px 8px 0; font-size: 13.5px; transition: .15s; }
.tags a:hover { color: #fff; border-color: var(--accent); }
.tags .n { color: var(--accent-2); font-size: 12px; }

/* ---------- single video ---------- */
.single-video h1, h1.wp-block-post-title { font-size: 23px;
  line-height: 1.45; margin: 20px 0 8px; font-weight: 800; }
.wp-block-post-date.archive-sub { display: block; margin: 0 0 10px; }
body .wp-block-group.wrap { max-width: 1280px; margin: 0 auto;
  padding: 0 18px; }
.single-video .player { position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: 12px; overflow: hidden; margin-top: 20px;
  border: 1px solid var(--border); }
.single-video .player iframe { position: absolute; inset: 0; width: 100%;
  height: 100%; border: 0; }
.sub-meta { display: flex; gap: 16px; color: var(--muted); font-size: 13.5px;
  align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.sub-meta .code-badge { background: var(--accent); color: #fff;
  font-weight: 700; padding: 2px 11px; border-radius: 5px; font-size: 13px; }
.info-panel { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px; margin: 14px 0; }
.info-table { font-size: 14.5px; width: 100%; border-collapse: collapse; }
.info-table td { padding: 7px 16px 7px 0; vertical-align: top;
  border-bottom: 1px solid rgba(255,255,255,.04); }
.info-table tr:last-child td { border-bottom: 0; }
.info-table td:first-child { color: var(--muted); white-space: nowrap;
  width: 110px; }
.content-box { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 22px; margin: 16px 0; font-size: 15.5px;
  color: #d5d9e4; }

/* ---------- archive ---------- */
.archive-head { margin: 28px 0 4px; font-size: 24px; font-weight: 800; }
.archive-head em { color: var(--accent); font-style: normal; }
.archive-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 8px; margin: 32px 0; flex-wrap: wrap;
  justify-content: center; }
.pagination .page-numbers { background: var(--bg-card);
  border: 1px solid var(--border); padding: 8px 15px; border-radius: 8px;
  font-size: 14px; color: var(--muted); }
.pagination a.page-numbers:hover { color: #fff; border-color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff;
  border-color: var(--accent); }

/* ---------- block content / บทความ ---------- */
.entry-content { font-size: 15.5px; color: #d5d9e4; }
.entry-content h1, .entry-content h2, .entry-content h3 {
  color: var(--text); line-height: 1.4; }
.entry-content h2 { font-size: 21px; margin: 30px 0 10px;
  border-left: 4px solid var(--accent); padding-left: 10px; }
.entry-content h3 { font-size: 17px; }
.entry-content a { color: var(--accent-2); }
.entry-content img { border-radius: 10px; }
.entry-content blockquote { border-left: 3px solid var(--accent);
  margin: 14px 0; padding: 6px 16px; background: var(--bg-card);
  border-radius: 0 8px 8px 0; }
.entry-content .wp-block-separator { border-color: var(--border); }
.blog-list .blog-item { background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 14px; transition: .15s; }
.blog-list .blog-item:hover { border-color: var(--accent); }
.blog-list h2 { margin: 0 0 4px; font-size: 18px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 56px;
  padding: 26px 0; color: var(--muted); font-size: 13.5px; }

@media (max-width: 640px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .video-card .title { font-size: 13px; }
  .search-form { width: 100%; }
  .search-form input { flex: 1; }
}
