.container {
  max-width: 1920px;
  width: 100%;
  margin: auto;
  padding-top: 0px;
}

body {
  background: #000;
  overflow-x: hidden;
}

.page-not-found {
  text-align: center;
  color: white;
}

.tagrow {
  display: flex;
  justify-content: center;
  width: 100%;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 10px;
  padding-top: 5px;
}

span.tagx a {
  font-size: 14px;
  background: #aa0000;
  color: #ffffff;
  margin: 5px;
  padding: 3px;
  float: left;
  border-radius: 7px;
  font-weight: bold;
}

a {
  text-decoration: none;
}

.count1 {
  width: 100%;
  font-size: 20px;
  font-weight: 600;
  background: #bb0000;
  text-align: center;
  border-style: groove;
  border-color: #00ff8f;
  border-radius: 3px;
  color: white;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr); /* mobile first */
  gap: 5px;
}

@media screen and (min-width: 600px) {
  .movie-grid {
    grid-template-columns: repeat(3, 1fr); /* tablet */
  }
}

@media screen and (min-width: 992px) {
  .movie-grid {
    grid-template-columns: repeat(6, 1fr); /* desktop */
  }
}

.movie-box {
  background: #222;
  padding: 2px;
  border-radius: 5px;
  text-align: center;
  margin: 0;
}

.movie-box img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  object-fit: scale-down;
  aspect-ratio: 16 / 9;
}

.movie-title {
    font-size: 16px;
    margin-top: 8px;
    color: #ffffff;
}

.container h1.movie-title {
  font-size: 18px;
  margin-top: 0px;
  text-align: center;
 background: #aa0000;
 padding: 5px;
}

.screen-reader-text {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Pagination Container */
.pagination {
  text-align: center;
  margin: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 6px; /* เพิ่มช่องว่างทั้งแนวนอนและแนวตั้ง */
}

.pagination .page-numbers {
  display: inline-block;
  padding: 8px 12px;
  background-color: #333;
  color: #fff;
  border-radius: 5px;
  text-decoration: none;
  font-size: 16px;
  transition: 0.3s;
  margin-top: 10px;
}

.pagination .page-numbers:hover {
  background-color: red;
  color: #fff;
}

.pagination .page-numbers.current {
  background-color: red;
  font-weight: bold;
}

.pagination .page-numbers.dots {
  background: transparent;
  color: #aaa;
  cursor: default;
}

/* ===== Enhanced Single Page Styles ===== */
.single-movie {
  padding: 5px;
  background-color: #111;
  color: #fff;
}

.movie-player {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 แนะนำแทน 60% */
  overflow: hidden;
  background: #000;
}

/* iframe + video + embed ต้องถูกตรึง */
.movie-player iframe,
.movie-player video,
.movie-player embed,
.movie-player object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.movie-description {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.movie-excerpt {
  font-size: 16px;
  line-height: 1.7;
  padding-right: 10px;
  padding-left: 10px;
}

.tags {
  display: block;
}

.tags a {
  font-size: 0.9em;
  color: #FFF;
  background-color: #00317a;
  padding: 3px;
  margin: 0 3px 3px 0;
  border-radius: 5px;
  font-weight: bold;
}

span.cattx a {
  background: #840000;
}

span.textstar a {
  background: #ff006a;
}

span.studios a {
  background: #046944;
}

span.seq1 {
  color: var(--wp--preset--color--luminous-vivid-amber);
  font-weight: bold;
}

.related-movies {
  padding: 5px;
}

.movie-content {
    background: #ffcc00;
    padding: 0px 5px 0px 5px;
    margin-top: -10px;
    margin-bottom: -10px;
    color: black;
    font-weight: 600;
}

.movie-poster {
  text-align: center;
}

.movie-poster img {
  max-width: 100%;
  height: auto;
}

.pornstar-box {
  background: #111;
  border: 2px solid green;
  padding: 5px;
  border-radius: 6px;
  text-align: center;
  position: relative;
}

.related-title {
  background-color: #330085;
  color: white;
  text-align: center;
  font-size: 20px;
  margin-bottom: 5px;
  padding: 3PX;
}

/* ==== HEADER STRUCTURE ==== */
.header-wrapper {
  background: #111;
  color: white;
  padding: 10px 20px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}

.header-logo {
  flex: 0 0 auto;
}

.header-logo img {
  height: auto;
}

.header-search {
  flex: 1;
  text-align: right;
  width: 100%;
  margin-right: 40px;
}

.header-search form {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.header-search input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
  width: 200px;
  font-size: 16px;
}

.header-search button {
  padding: 6px 12px;
  background: #8d0000;
  color: #fff;
  border: none;
  font-size: 16px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.header-search button:hover {
  background: #c40812;
}

/* ==== NAVBAR MENU (DESKTOP DEFAULT) ==== */
.navbar {
  display: block;
  margin-top: 20px;
}

.menu {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  position: relative;
}

.menu li {
  position: relative;
  border: 2px solid #d50e0e;
}

.menu li a {
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  display: block;
  background: #370963;
  transition: background 0.3s;
}

.menu li a:hover {
  background: #222;
  border-radius: 5px;
}

/* === Submenu === */
.menu li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #222;
  padding: 0;
  margin: 0;
  list-style: none;
  z-index: 1000;
  min-width: 160px;
}

.menu li ul li a {
  padding: 10px 15px;
  background: #370963;
  border-bottom: 1px solid #444;
  white-space: nowrap;
}

.menu li ul li a:hover {
  background: #555;
}

/* ✅ Desktop Hover */
@media (min-width: 640px) {
  .menu li:hover > ul {
    display: block;
  }
}

/* ✅ Mobile: เปิดด้วย class .open */
.menu li.open > ul {
  display: block;
}

/* ลูกศร ▼/▲ ด้วย pseudo-element / dropdown */
.menu li.menu-item-has-children > a::after {
  content: " ▼";
  font-size: 16px;
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.menu li.menu-item-has-children.open > a::after {
  content: " ▲";
}

/* ==== HAMBURGER ==== */
.hamburger {
  display: none;
  flex-direction: column;
  background: transparent;
  padding: 0;
  border: 0;
  gap: 5px;
  position: absolute;
  top: 25px;
  right: 25px;
  cursor: pointer;
  z-index: 100;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
  display: block;
  transition: 0.3s;
}

/* กากบาท (×) ตอน active */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ==== MOBILE STYLES ==== */
@media (max-width: 639px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-logo,
  .header-search {
    width: 100%;
    text-align: center;
  }

  .header-search form {
    justify-content: flex-start;
  }

  .header-search input[type="text"] {
    width: 100%;
    max-width: 100%;
    border-radius: 4px 0 0 4px;
  }

  .header-search button {
    border-radius: 0 4px 4px 0;
  }

  .hamburger {
    display: flex; /* show hamburger on mobile */
  }

  .navbar {
    display: none; /* hidden by default on mobile */
    width: 100%;
  }

  .navbar.active {
    display: block !important; /* show on toggle */
    margin-top: 10px;
  }

  .menu {
    flex-direction: column;
    gap: 10px;
  }
}

.movie-duration {
  font-size: 1.1em;
  color: #ffcc00; /* หรือสีที่เข้ากับธีม */
  margin: 8px 0;
  font-weight: bold;
  text-align: center;
}

/* =======================================================
 * ADS (ลดซ้ำ + รวมกฎร่วม)
 * ======================================================= */

#ads-header,
#ads-footer,
#ads-single {
  text-align: center;
}

img.ads728x130 {
  max-width: 100%;
  height: auto;
}

/* base: ads728 ใช้ทุกจอ (ไม่ต้องซ้ำใน media) */
img.ads728 {
  max-width: 40%;
  height: auto;
}

/* base: 140x250 */
img.ads140s {
  width: 140px;
  height: 250px;
}

img.ads300s {
  width: 300px;
  height: 100px;
}

/* รวม rule ที่เหมือนกันของ slider ซ้าย/ขวา */
#slider-r,
#slider-l {
  position: fixed;
  top: 160px;
  width: 140px;
  text-align: center;
  line-height: 0;
}

#slider-r { right: 3px; }
#slider-l { left: 3px; }

#slider-f {
  width: 300px;
  right: 30px;
  left: 0;
  bottom: 5px;
  margin: 0 auto;
  position: fixed;
  text-align: center;
  line-height: 0;
}

.xcc {
  width: 30px;
  height: 100px;
  position: absolute;
  left: 100%;
  top: 0px;
}

img.close {
  height: auto;
}

/* ads before video */
.video-wrapper {
  position: relative;
  width: 100%;
  background: #000;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
}

/* overlay ครอบ iframe */
.movie-player .video-ad-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0,0,0,.55);
  text-align: center;
  align-items: center;
  justify-content: center;
  display: flex;
}

/* กล่องโฆษณา */
.video-ad-box {
  position: relative;
  max-width: 95%;
  top: -20px;
}

.video-ad-box img {
  max-width: 400px;
  height: 150px;
}

/* ปุ่ม X แบบไม่ล้น */
.video-ad-close {
  position: absolute;
  top: 0px;
  left: 100%;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  font-weight: bold;
  justify-content: center;
  align-items: center;
  display: flex;
  border: 2px solid white;
}

/* ====== BREAKPOINTS ADS ====== */

@media (min-width: 768px) and (max-width: 959px) {
  img.ads140s {
    width: 120px;
    max-height: 200px;
  }

  #slider-r,
  #slider-l {
    width: 120px;
    top: 130px;
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  img.ads140s {
    width: 100px;
    max-height: 200px;
  }

  #slider-r,
  #slider-l {
    width: 100px;
    top: 120px;
  }
}

@media (min-width: 319px) and (max-width: 639px) {
  img.ads728 {
    max-width: 95%;
  }

  img.ads728x130 {
    max-width: 98%;
  }

  img.ads140s {
    width: 90px;
    max-height: 150px;
  }

  #slider-r,
  #slider-l {
    width: 90px;
    top: 95px;
  }

  img.ads300s {
    width: 250px;
    max-height: 80px;
  }

  #slider-f {
    width: 250px;
  }

  .xcc {
    width: 25px;
    height: 80px;
  }

  .video-ad-box img {
    max-width: 75%;
    height: auto;
  }

  .video-ad-close {
    left: 88%;
  }
}

@media (max-width: 318px) {
  img.ads728,
  img.ads728x130,
  img.ads140s,
  img.ads300s,
  #slider-r,
  #slider-l,
  #slider-f,
  #videoAd,
  .xcc {
    display: none;
  }
}

.share-buttons { text-align: center; margin: 5px 0; }
.share-buttons a, .share-buttons button { margin: 0 5px; vertical-align: middle; }
.share-buttons img { transition: transform .2s; }
.share-buttons img:hover { transform: scale(1.15); }
.share-btn.copy-link { background: none; border: none; padding: 0; cursor: pointer; }

.home-intro {
  margin: 0px 10px 10px;
  color: #fff;
}

.home-intro h1 {
  font-size: 17px;
  line-height: 1.3;
  margin: 0 0 10px;
  color: #fff;
    background-color: #8d0000;
    text-align: center;
}

.home-intro p {
  margin: 0 0 12px;
  line-height: 1.7;
  color: #ddd;
}

.home-intro a {
  color: #8ec5ff;
}

.view-count {
  display: inline;
  margin: 0;
  color: #ffcc00;
  font-size: 18px;
  font-weight: 600;
}

.logo-text {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

p.movie-meta {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 8px 0 14px;
  color: #ffcc00;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

p.movie-meta > .movie-duration,
p.movie-meta > .view-count {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  float: none;
  white-space: nowrap;
  text-align: center;
  color: #ffcc00;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.home-intro-body p{margin:0 0 12px;line-height:1.7;color:#ddd}.home-intro-body a{color:#8ec5ff}

.movie-box .movie-title {
  display: block;
  overflow: hidden;
  line-height: 1.4;
  height: 2.8em;        /* ล็อกไว้ที่ 2 บรรทัดพอดี (1.4 x 2) เกินจากนี้จะถูกซ่อน */
  margin: 8px 0 0;
  font-size: 14px;      /* ขนาดตัวหนังสือ ปรับตามต้องการ */
  text-overflow: clip;  /* ตัดตัวอักษรทันทีโดยไม่ใส่ ... */
}