/* =========================================================
   yedmang.css — สไตล์คัสตอมของ Blogsy child theme
   ========================================================= */

:root {
  --bg-main: #eef0f3;
  --bg-card: #e5e7eb;
  --text-main: #111827;
  --text-sub: #4b5563;
  --red-main: #e11d48;
  --border-soft: rgba(0, 0, 0, 0.08);
}

/* =========================================================
   Tags
   ========================================================= */
.post-tags a,
.tagcloud a,
.entry-tags a {
  display: inline-block;
  padding: 6px 12px;
  margin: 3px;
  background: #f1f5f9;
  color: #333;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  transition: 0.2s;
  border: 1px solid #e2e8f0;
}

.post-tags a:hover,
.tagcloud a:hover,
.entry-tags a:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* =========================================================
   Breadcrumb
   ========================================================= */
.blogsy-breadcrumb {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  padding: 10px 16px;
  margin-bottom: 30px;
  margin-top: -20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 1);
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.blogsy-breadcrumb .current {
  max-width: 800px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
  font-weight: 500;
  color: #333;
}

.blogsy-breadcrumb a {
  color: #cc0000;
  text-decoration: none;
  opacity: 0.9;
  padding: 4px 6px;
  transition: 0.2s;
}

.blogsy-breadcrumb a:hover {
  opacity: 1;
  text-decoration: underline;
}

.blogsy-breadcrumb .delimiter {
  opacity: 0.5;
}

/* =========================================================
   Feature list / cards
   ========================================================= */
.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.feature-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, #f3f4f6, #dcdfe4);
  border: 1px solid var(--border-soft);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 25px rgba(0, 0, 0, 0.12),
    0 0 15px rgba(225, 29, 72, 0.15);
}

.feature-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 30%;
  width: 3px;
  height: 40%;
  background: var(--red-main);
  border-radius: 2px;
}

.feature-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--red-main), transparent);
  opacity: 0.4;
}

.icon-box {
  min-width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 32px;
  background: linear-gradient(145deg, #d1d5db, #f3f4f6);
  color: var(--red-main);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.08),
    0 5px 10px rgba(0, 0, 0, 0.08);
}

.content h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
}

.content p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-sub);
}

.highlight {
  position: relative;
  color: var(--red-main);
}

.highlight::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--red-main);
}

@media (max-width: 1024px) {
  .feature-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .feature-list { grid-template-columns: 1fr; }
}

/* =========================================================
   Fast Grid (เดสก์ท็อป 3 คอลัมน์ / มือถือ 1)
   ========================================================= */
.fast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: start; /* ไม่ยืดแถว (กัน skeleton สูงยักษ์ตอน min-height) */
  gap: 12px;
}

@media (max-width: 768px) {
  .fast-grid { grid-template-columns: 1fr; }
}

.thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
}

.thumb img {
  width: 100%;
  display: block;
}

/* ----- Badges (รวมเป็นชุดเดียว) ----- */
.cat-badge,
.view-badge,
.duration-badge {
  position: absolute;
  z-index: 11;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.cat-badge      { top: 8px; right: 8px; }      /* หมวดหมู่ */
.view-badge     { bottom: 8px; left: 8px; }    /* ยอดวิว */
.duration-badge { bottom: 8px; right: 8px; }   /* ความยาว */

/* ----- Title ----- */
.title {
  font-size: 18px;
  text-align: center;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 0, 0, 0.2);
}

.title a {
  color: #111;          /* light mode */
  text-decoration: none;
  display: block;
}

html[scheme="dark"] .title a { color: #fff; }  /* dark mode (Blogsy) */

/* ----- ปุ่ม Load more ----- */
#loadMore {
  display: block;
  margin: 20px auto;
  padding: 12px 24px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff2d2d, #ff6a00);
  border: none;
  border-radius: 999px;
  transition: all 0.25s ease;
  cursor: pointer;
}

#loadMore:hover { transform: scale(1.05); }

/* ----- หัวข้อ section ----- */
.section-title {
  margin: 30px 0 10px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

/* =========================================================
   คำอธิบายในแต่ละ post (info-box)
   ========================================================= */
.info-box { padding: 20px 0; }

.item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 165, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #1c2e2e;
  font-size: 15px;
}

.icon {
  font-size: 18px;
  opacity: 0.9;
}

/* description (ตัวบนสุด) — เด่นกว่ากล่องอื่น */
.item.desc {
  display: block;
  line-height: 1.7;
  font-size: 14px;
  text-align: center;
  color: #444;
  padding: 20px 12px;
  border-radius: 20px;
  margin-bottom: 30px;
}

/* ----- Dark mode (Blogsy scheme) ----- */
html[scheme="dark"] .item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 165, 0, 0.4);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #f5b041;
}

html[scheme="dark"] .item.desc { color: #ddd; }

/* =========================================================
   Video Preview (hover/scroll autoplay)
   ========================================================= */
.preview-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  /* shimmer ระหว่างรอโหลด */
  background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Video meta bar (แถบล่างรูปใน grid: หมวด/วิว/เวลา/ไลก์) ===== */
.video-meta-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 8px 12px 3px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55) 35%, rgba(0,0,0,0.88));
  backdrop-filter: blur(2px);
  font-size: 14px; color: #fff; flex-wrap: nowrap; overflow: hidden;
}
.video-meta-bar span { display: flex; align-items: center; gap: 5px; padding: 0 10px; white-space: nowrap; }
.video-meta-bar span + span { border-left: 1px solid rgba(255,255,255,0.1); }

/* ===== Skeleton loading ===== */
.skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.skeleton-item { aspect-ratio: 16/9; border-radius: 12px; background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@media (max-width: 768px) { .skeleton-grid { grid-template-columns: 1fr; } }

/* ===== Pagination เลขหน้า ===== */
.pagination-wrap { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; background: rgba(0,0,0,0.06); color: #333; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1; text-decoration: none; transition: 0.2s; }
.page-btn:hover { background: #e11d48; color: #fff; border-color: #e11d48; }
.page-btn.active { background: #e11d48; color: #fff; border-color: #e11d48; font-weight: 700; }
.page-dots { color: #999; font-size: 14px; }
html[scheme="dark"] .page-btn { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.15); }

.static-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.preview-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.thumb.is-playing .preview-video { opacity: 1; }

/* แถบความคืบหน้า */
.preview-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}

.thumb.is-playing .preview-progress { opacity: 1; }

.progress-bar {
  width: 0%;
  height: 100%;
  background: #ff0000;
  transition: width 0.1s linear;
}

/* =========================================================
   Video Category Grid
   ========================================================= */
.video-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 12px;
}

.video-cat-item { position: relative; margin-bottom: 10px; }

@media (max-width: 768px) {
  .video-cat-grid { grid-template-columns: 1fr; }
}

#loadMoreCat {
  display: block;
  margin: 25px auto;
  padding: 12px 28px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

#loadMoreCat:hover { transform: scale(1.05); }

/* =========================================================
   ยอดคนดู (post-views card)
   ========================================================= */
.post-views.entry-meta {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  padding: 7px 50px;
  margin: -30px auto 10px;
  width: fit-content;
  color: #ff3333;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.post-views i,
.post-views svg {
  color: #00d2ff;
  filter: drop-shadow(0 0 5px rgba(0, 210, 255, 0.5));
}

.post-views-count {
  font-weight: 600;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* =========================================================
   Top 10 Grid (Netflix-style rank)
   ========================================================= */
.top-tier-section {
  background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
  padding: 15px 5px 5px 5px;
  border-radius: 20px;
  margin-bottom: 5px;
  border: 1px solid #333;
}

.top-tier-section .section-title {
  color: #ffca2c;
  text-shadow: 0 0 10px rgba(255, 202, 44, 0.5);
  margin-top: 0;
  margin-bottom: 20px;
}

.top-grid-container {
  position: relative;
  display: block;
}

.top-grid-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;   /* ซ่อน scrollbar (ใช้ปุ่มลูกศรแทน) */
}

.top-grid-wrapper::-webkit-scrollbar { display: none; }

.top-grid-scroll {
  display: flex;
  gap: 0;
  padding-left: 10px;
  padding-bottom: 5px;
  align-items: flex-start; /* ทุก item เริ่มจากขอบบนพร้อมกัน */
  user-select: none;
  -webkit-user-drag: none;
}

.premium-rank-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-left: 45px;   /* เว้นที่ให้ตัวเลขโผล่ด้านซ้าย */
  margin-right: 15px;
  flex: 0 0 auto;
}

.rank-bg-number {
  font-size: 110px;
  font-weight: 900;
  line-height: 0.8;
  position: absolute;
  left: -5px;
  bottom: 60px;
  z-index: 1;
  font-family: 'Arial Black', sans-serif;
  color: #000;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.3);
  pointer-events: none;
  letter-spacing: -5px;
}

.premium-rank-card:nth-child(-n+3) .rank-bg-number {
  -webkit-text-stroke: 2px rgba(255, 202, 44, 0.5);
}

.premium-item-inner {
  position: relative;
  z-index: 2;
  width: 320px;
  order: 1;
}

.premium-item-inner .thumb {
  border-radius: 15px !important;
  overflow: hidden;
  position: relative;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.premium-item-inner .thumb img {
  z-index: 1 !important;
  position: relative !important;
  width: 100%;
  display: block;
}

.premium-item-inner .preview-video {
  z-index: 2 !important;
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-grid-scroll .fast-item .title {
  order: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.8em;
  line-height: 1.4em;
  margin-top: 10px;
  width: 100%;
}

.top-grid-scroll .fast-item .title a {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-size: 15px;
  text-decoration: none;
}

.top-grid-scroll .fast-item .thumb .duration-badge {
  display: block !important;
  bottom: 10px !important;
  right: 10px !important;
  background: rgba(0, 0, 0, 0.6) !important;
  color: #eeeeee !important;
  font-weight: 800 !important;
  padding: 3px 8px !important;
  border-radius: 5px !important;
  font-size: 12px !important;
}

/* ----- ลูกศร Navigation ----- */
.nav-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  background: rgba(255, 202, 44, 0.8);
  color: #000;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 110;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.nav-indicator.prev { left: 10px; }
.nav-indicator.next { right: 10px; }

@media (max-width: 768px) {
  .premium-item-inner { width: 260px; }
  .rank-bg-number { font-size: 90px; left: -5px; bottom: 55px; }
  .premium-rank-card { padding-left: 30px; margin-right: 10px; }
  .nav-indicator { width: 35px; height: 35px; opacity: 0.5; }
}

/* =========================================================
   ซ่อนกล่องท้าย single post
   - single-author-box-container  = กล่อง Author / Follow Me
   - single-next-prev-posts-container = Other Articles (Previous/Next)
   ========================================================= */
.single-author-box-container,
.single-next-prev-posts-container {
  display: none;
}

/* =========================================================
   Single post: video + meta bar + card (port จากตำหมอย)
   ========================================================= */
:root {
  --accent: #00e5ff;
  --card-bg: rgba(14, 17, 24, 0.55);
  --card-border: rgba(0, 229, 255, 0.18);
  --tm-text: #ffffff;
  --text-dim: #aab2c5;
  --text-key: #9aa3b8;
}

.video-container { margin-bottom: 18px; }
.video-container .wrap { width: 100%; max-width: 1200px; margin: 16px auto 0; display: flex; flex-direction: column; gap: 16px; }

/* วิดีโอ 16:9 */
.video-frame { width: 100%; margin: 0 auto; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-frame .presto-player__wrapper,
.video-frame video { width: 100% !important; height: 100% !important; object-fit: contain; }

/* short desc ใต้ title */
.vd-short-desc { font-size: 14.5px; line-height: 1.55; color: #c2c7d0; margin: 10px 0 14px; padding: 3px 0 3px 12px; border-left: 3px solid #ff7a12; }

/* ===== แถบ META (engagement) ===== */
.custom-post-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0; }
.custom-post-meta > span,
.custom-post-meta > a {
  text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 52px; padding: 8px 6px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 165, 0, 0.3); border-radius: 14px;
  font-size: 17px; font-weight: 700; color: #1c2e2e; white-space: nowrap;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.meta-comments { color: #1c2e2e; }
.meta-like, .meta-like * { margin: 0 !important; padding: 0 !important; }
.meta-like { display: inline-flex !important; align-items: center !important; line-height: 1 !important; }
.meta-like .count-box, .meta-like .wp_ulike_counter_up { margin-left: 6px !important; }
.custom-post-meta > span.meta-share { padding: 0; }
.custom-post-meta > span.meta-share > .meta-share { display: flex; width: 100%; }
.share-btn { flex: 1; width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: none; color: #e11d48; font: inherit; font-weight: 700; font-size: 17px; border-radius: 14px; cursor: pointer; }
.share-btn:active { background: rgba(225, 29, 72, 0.12); }

/* dark mode (Blogsy scheme) — แถบ engagement */
html[scheme="dark"] .custom-post-meta > span,
html[scheme="dark"] .custom-post-meta > a,
html[scheme="dark"] .meta-comments {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 165, 0, 0.4);
  color: #f5b041;
}
.custom-post-meta .pm-ico { width: 24px; height: 24px; flex: 0 0 auto; }
.custom-post-meta.meta-row2 { grid-template-columns: repeat(2, 1fr); margin-top: 8px; }
.custom-post-meta.meta-row2 > span { font-size: 15px; font-weight: 600; }
@media (max-width: 430px) {
  .custom-post-meta { gap: 6px; }
  .custom-post-meta > span { font-size: 15px; min-height: 50px; padding: 6px 3px; gap: 4px; }
  .share-btn { font-size: 15px; }
  .custom-post-meta .pm-ico { width: 20px; height: 20px; }
}

/* ===== การ์ดรายละเอียด (โทน yedmang เดิม: ขาว/ส้ม) ===== */
.desc-card {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #1c2e2e;
}
.desc-card .badge { display: none; }
.desc-card .desc-body { color: #444; font-size: 15px; line-height: 1.85; margin: 0; }
@media (max-width: 480px) { .desc-card { padding: 18px; } }

/* ===== การ์ดข้อมูล (พิลล์ขาว ขอบส้ม แบบ .item เดิม) ===== */
.info-card { display: flex; flex-direction: column; gap: 12px; }
.info-card .row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 40px;
  padding: 12px 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #1c2e2e;
}
.info-card .ico { font-size: 18px; opacity: 0.9; flex-shrink: 0; }
.info-card .k { color: #5a6b6b; font-size: 14.5px; font-weight: 500; }
.info-card .val { color: #1c2e2e; font-weight: 500; font-size: 14.5px; }

/* dark mode (Blogsy scheme) */
html[scheme="dark"] .desc-card,
html[scheme="dark"] .info-card .row {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 165, 0, 0.4);
  color: #f5b041;
}
html[scheme="dark"] .desc-card .desc-body { color: #ddd; }
html[scheme="dark"] .info-card .k { color: #c9a86a; }
html[scheme="dark"] .info-card .val { color: #f5b041; }
