/*
Theme Name: JAV Theme
Theme URI: https://jav25hd.com
Author: JAV
Author URI: https://jav25hd.com
Description: JAV Theme
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jav25hd.com
*/

/* ตัวปรับแต่งพื้นฐานของธีม */
body {
  background-color: #0b0b0f;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Post Meta (single) */
.post-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: .6rem;
  padding: .75rem;
}

@media (min-width: 768px) {
  .post-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1rem;
  }
}

.post-meta .meta-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .35rem .5rem;
  border-radius: .5rem;
}

.post-meta .meta-icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: 0 0 auto;
}

.post-meta .meta-label {
  color: var(--muted);
  font-weight: 600;
  margin-right: .25rem;
}

.post-meta .meta-value {
  color: var(--text);
}

.post-meta .tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.post-meta .tag-item {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .8rem;
  line-height: 1;
  color: var(--text);
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.post-meta .tag-item:hover {
  background: #263243;
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

a {
  color: #ffffff;
  text-decoration: none;
}

a:hover {
  color: #a855f7;
  text-decoration: none;
}

/* โทนสีใกล้เคียงเว็บอ้างอิง */
:root {
  --bg: #0b0b0f;
  --panel: #12121a;
  --panel-2: #1a1b24;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #a855f7;
}

.header-shadow {
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.03), 0 1px 0 rgba(0, 0, 0, 0.6) inset;
}

.bg-panel {
  background-color: var(--panel) !important;
}

.bg-panel-2 {
  background-color: var(--panel-2) !important;
}

.text-muted-2 {
  color: var(--muted) !important;
}

/* Site logo above navbar */
.site-logo img {
  max-height: 48px;
  height: 48px;
  width: auto;
  display: block;
}

.site-logo-link {
  gap: .5rem;
  min-height: 48px;
}

.site-logo-link img {
  height: 48px;
  width: auto;
  display: block;
}

.topbar {
  min-height: 60px;
  align-items: center;
}

.topbar .top-search {
  flex: 0 0 260px;
  max-width: 260px;
}

.topbar .top-search .form-control {
  height: 40px;
}

.topbar .top-search .btn {
  height: 40px;
}

@media (max-width: 575.98px) {
  .topbar {
    gap: .75rem;
  }

  .topbar .top-search {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* Navbar */
.navbar-dark .navbar-nav .nav-link {
  color: #e5e7eb;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
}

/* Long-label menu support */
@media (min-width: 992px) {

  /* apply on lg and up (when navbar is expanded) */
  .navbar .navbar-nav {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .navbar .navbar-nav .nav-item {
    flex: 0 0 auto;
    max-width: 160px;
  }

  .navbar .navbar-nav .nav-link {
    white-space: normal;
    /* allow wrapping */
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.3;
    padding: .45rem .5rem;
    font-size: .95rem;
    text-align: center;
  }
}

@media (max-width: 991.98px) {

  /* In collapsed menu, let items be full width and readable */
  .navbar .navbar-nav .nav-item {
    max-width: 100%;
  }

  .navbar .navbar-nav .nav-link {
    white-space: normal;
    line-height: 1.4;
  }
}

/* เมนูแนวนอนหลายบรรทัด/หมวดหมู่ */
.menu-scroller {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  scrollbar-width: thin;
}

.menu-chip {
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 999px;
  padding: .4rem .8rem;
  white-space: nowrap;
  font-size: .9rem;
}

.menu-chip.active,
.menu-chip:hover {
  background: #374151;
}

/* การ์ดรายการวิดีโอ/คอนเทนต์ */
.card-media {
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: .5rem;
  overflow: hidden;
  position: relative;
}

.card-media .thumb {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  display: block;
}

.card-media .thumb-container {
  position: relative;
  overflow: hidden;
  border-radius: .5rem .5rem 0 0;
}

.card-media .duration-overlay {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
}

.card-media .title {
  font-size: .85rem;
  line-height: 1.3;
  margin: .5rem .5rem .3rem;
  color: var(--text);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-media .meta {
  color: var(--muted);
  font-size: .75rem;
  margin: 0 .5rem .5rem;
}

/* Tabs/แถบหัวข้อ */
.tab-line {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: .75rem;
}

.tab-line a {
  color: var(--muted);
  padding: .6rem 0;
  display: inline-block;
  border-bottom: 2px solid transparent;
}

.tab-line a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ส่วน footer */
.site-footer {
  color: var(--muted);
  font-size: .9rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* Utilities */
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.section-subtitle {
  color: var(--muted);
  font-size: .95rem;
}

/* ปรับ spacing */
.container-narrow {
  max-width: 1200px;
}

/* ปรับแต่ง bootstrap */
/* Improve contrast for accessibility (meets WCAG AA for normal text) */
.btn-accent {
  background: #7c3aed;
  color: #ffffff;
  border: none;
}

.btn-accent:hover {
  background: #6d28d9;
  color: #ffffff;
}

.btn-accent:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .35);
}

/* ==============================
   Pixel-perfect refinements
   ============================== */
/* Typography */
h1,
.h1 {
  font-size: clamp(1.6rem, 2vw + 1rem, 2rem);
  font-weight: 700;
}

h2,
.h2 {
  font-size: clamp(1.3rem, 1.6vw + .8rem, 1.6rem);
  font-weight: 600;
}

h3,
.h3 {
  font-size: 1rem;
  font-weight: 600;
}

small,
.small {
  color: var(--muted);
}

/* Links subtle underlines on hover */
a {
  transition: color .15s ease, opacity .15s ease;
}

.nav-link {
  padding: .6rem .8rem;
}

.navbar-brand {
  letter-spacing: .5px;
}

/* Navbar heights and paddings */
.navbar {
  min-height: 56px;
}

.navbar .form-control {
  height: 38px;
  border-radius: .5rem;
}

.navbar .btn {
  height: 38px;
  border-radius: .5rem;
  padding: .375rem .9rem;
}

/* Chips scroller */
.menu-scroller {
  padding-top: .4rem;
  padding-bottom: .4rem;
}

.menu-chip {
  padding: .45rem .85rem;
  font-size: .92rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-chip.active {
  border-color: rgba(249, 115, 22, .5);
}

/* Cards */
.card-media {
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.card-media:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-media .thumb {
  background: #0f1117;
}

.card-media .title {
  margin-top: .5rem;
  font-weight: 600;
}

.card-media .meta {
  margin-top: .15rem;
}

/* Tabs */
.tab-line {
  gap: 1.25rem;
}

.tab-line a {
  font-weight: 600;
}

.tab-line a:hover {
  color: #fff;
}

/* Containers responsive width close to reference */
@media (min-width: 1400px) {
  .container-narrow {
    max-width: 1280px;
  }
}

@media (max-width: 575.98px) {
  .container-narrow {
    padding-left: .9rem;
    padding-right: .9rem;
  }
}

/* Single page */
.single-hero {
  position: relative;
  border-radius: .6rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--panel-2);
}

.single-hero .thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.single-hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0));
}

.single-meta {
  color: var(--muted);
}

.single-content {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
}

.single-content a {
  color: #f59e0b;
}

.single-actions .btn {
  border-radius: .5rem;
}

/* Footer spacing tweak */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Video section (single) */
.video-section .video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: .6rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.video-section .video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Pagination circular UI */
.pagination-circ {
  display: flex;
  justify-content: center;
}

.pagination-circ .page-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  line-height: 1;
  font-weight: 600;
  font-size: .95rem;
  transition: border-color .15s ease, color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.pagination-circ a.page-dot:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background-color: rgba(255, 255, 255, 0.04);
}

.pagination-circ .page-dot.is-current {
  border-color: #a855f7;
  /* purple */
  box-shadow: 0 0 0 2px rgba(168, 85, 247, .35);
  color: #c084fc;
}

.pagination-circ .page-dot.dots {
  opacity: .6;
}

.pagination-circ .page-dot[aria-disabled="true"],
.pagination-circ .page-dot.disabled {
  opacity: .4;
  pointer-events: none;
}

/* Top-up (Back to Top) button */
.topup-btn {
  position: fixed;
  right: 20px;
  left: auto;
  transform: none;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #14141c;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .15s ease, border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  z-index: 1040;
}

.topup-btn.show {
  opacity: 1;
  pointer-events: auto;
}

.topup-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background-color: #191a23;
}

.topup-btn:active {
  transform: scale(.98);
}

.topup-btn .topup-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.topup-btn .topup-icon::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 12px solid #cbd5e1;
  /* arrow color */
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
}

.topup-btn:hover .topup-icon {
  box-shadow: inset 0 0 0 2px rgba(168, 85, 247, .45);
}

@media (max-width: 575.98px) {
  .topup-btn {
    bottom: 24px;
    right: 16px;
    width: 52px;
    height: 52px;
  }

  .topup-btn .topup-icon {
    width: 34px;
    height: 34px;
  }
}

/* ==============================
   Mobile Off-canvas Menu Styles
   ============================== */

/* Mobile Menu Toggle Button (Hamburger) */
.mobile-menu-toggle {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.mobile-menu-toggle:hover {
  transform: scale(1.05);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

.mobile-menu-toggle .menu-icon {
  width: 28px;
  height: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-menu-toggle .menu-icon span {
  display: block;
  width: 100%;
  height: 3px;
  background: #e5e7eb;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover .menu-icon span {
  background: #a855f7;
}

/* Off-canvas Mobile Menu */
.mobile-offcanvas {
  background: linear-gradient(135deg, #12121a 0%, #1a1b24 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  width: 280px !important;
  max-width: 85vw;
}

.mobile-offcanvas .offcanvas-header {
  background: rgba(168, 85, 247, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem 1.5rem;
}

.mobile-offcanvas .offcanvas-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  margin: 0;
}

.mobile-offcanvas .btn-close-custom {
  background: transparent;
  border: none;
  color: #e5e7eb;
  padding: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.mobile-offcanvas .btn-close-custom:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mobile-offcanvas .offcanvas-body {
  padding: 1rem 0;
}

/* Mobile Navigation Menu */
.mobile-nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-menu li {
  margin: 0;
}

.mobile-nav-menu a {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.5rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.mobile-nav-menu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.15) 0%, transparent 100%);
  transition: width 0.3s ease;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-left-color: #a855f7;
}

.mobile-nav-menu a:hover::before {
  width: 100%;
}

.mobile-nav-menu .current-menu-item>a,
.mobile-nav-menu .current_page_item>a {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.1);
  border-left-color: #a855f7;
  font-weight: 600;
}

/* Submenu styles for mobile */
.mobile-nav-menu .sub-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.2);
}

.mobile-nav-menu .sub-menu a {
  padding-left: 2.5rem;
  font-size: 0.95rem;
  font-weight: 400;
}

/* Backdrop overlay enhancement */
.offcanvas-backdrop {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

/* Desktop menu alignment */
@media (min-width: 992px) {
  .desktop-menu .navbar-nav {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .desktop-menu .navbar-nav .nav-item {
    flex: 0 0 auto;
    max-width: 160px;
  }

  .desktop-menu .navbar-nav .nav-link {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.3;
    padding: 0.45rem 0.5rem;
    font-size: 0.95rem;
    text-align: center;
    color: #e5e7eb;
    transition: color 0.2s ease;
  }

  .desktop-menu .navbar-nav .nav-link:hover {
    color: #fff;
  }

  .desktop-menu .navbar-nav .current-menu-item>a,
  .desktop-menu .navbar-nav .current_page_item>a {
    color: #c084fc;
  }
}