/* =========================================================
   PTK HOME BLOCKS v1.1.0
   SAFE MODE / FRONTEND ONLY
   PREMIUM CLEAN / MOBILE SAFE
========================================================= */

/* =========================================================
   BASE / RESET
========================================================= */

.ptk-home-section,
.ptk-home-hero {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 0 28px;
}

.ptk-home-section *,
.ptk-home-section *::before,
.ptk-home-section *::after,
.ptk-home-hero *,
.ptk-home-hero *::before,
.ptk-home-hero *::after {
  box-sizing: border-box;
}

.ptk-home-section img,
.ptk-home-hero img {
  max-width: 100%;
  height: auto;
}

.ptk-home-section a,
.ptk-home-hero a {
  -webkit-tap-highlight-color: rgba(245, 208, 97, 0.18);
}

/* =========================================================
   SECTION HEADER
========================================================= */

.ptk-home-section-head {
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ptk-home-section-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  color: #f5d061;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ptk-home-section-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

/* =========================================================
   EMPTY STATE
========================================================= */

.ptk-home-empty {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(245, 208, 97, 0.2);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(0,0,0,0.24));
  color: rgba(255, 255, 255, 0.72);
}

/* =========================================================
   HERO
========================================================= */

.ptk-home-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  min-height: 360px;
  background: #111;
  border: 1px solid rgba(245, 208, 97, 0.26);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

.ptk-home-hero-track {
  position: relative;
  min-height: 360px;
}

.ptk-home-hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 42px;
  background-size: cover;
  background-position: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.ptk-home-hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.ptk-home-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 35%, rgba(245,208,97,0.14), transparent 34%),
    linear-gradient(90deg, rgba(0,0,0,0.86), rgba(0,0,0,0.52), rgba(0,0,0,0.18));
  z-index: 1;
}

.ptk-home-hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  color: #fff;
}

.ptk-home-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(196, 154, 61, 0.16);
  border: 1px solid rgba(245, 208, 97, 0.3);
  color: #f5d061;
  font-size: 13px;
  font-weight: 800;
}

.ptk-home-hero h1 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.18;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.ptk-home-hero p {
  margin: 0 0 18px;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 16px;
  line-height: 1.7;
}

.ptk-home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ptk-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  background: linear-gradient(180deg, #f5d061, #c49a3d);
  color: #111 !important;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.25;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ptk-home-btn:hover,
.ptk-home-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(245, 208, 97, 0.16);
}

.ptk-home-btn--ghost {
  background: rgba(0, 0, 0, 0.32);
  color: #f5d061 !important;
  border-color: rgba(245, 208, 97, 0.36);
}

.ptk-home-btn--small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.ptk-home-hero-dots {
  position: absolute;
  z-index: 5;
  left: 42px;
  bottom: 24px;
  display: flex;
  gap: 7px;
}

.ptk-home-hero-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
}

.ptk-home-hero-dots button.is-active {
  width: 24px;
  background: #f5d061;
}

/* =========================================================
   GRID SYSTEM
========================================================= */

.ptk-home-cat-grid,
.ptk-home-card-grid,
.ptk-home-shop-grid,
.ptk-home-sponsor-grid,
.ptk-home-forum-grid {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* หมวดหมู่พระ: Desktop 5 / Mobile 2 */
.ptk-home-cat-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* การ์ดทั่วไป */
.ptk-home-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* บทความ: Desktop 4 / Mobile 2 */
.ptk-home-card-grid--posts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ร้าน VIP: Desktop 5 / Mobile 2 */
.ptk-home-shop-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Sponsor */
.ptk-home-sponsor-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* กระทู้: Desktop 3 / Mobile 2 */
.ptk-home-forum-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =========================================================
   CARDS BASE
========================================================= */

.ptk-home-cat-card,
.ptk-home-card,
.ptk-home-shop-card,
.ptk-home-sponsor-card,
.ptk-home-list-item,
.ptk-home-forum-item {
  position: relative;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(196, 154, 61, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  border-radius: 18px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  outline: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.ptk-home-cat-card:hover,
.ptk-home-card:hover,
.ptk-home-shop-card:hover,
.ptk-home-sponsor-card:hover,
.ptk-home-list-item:hover,
.ptk-home-forum-item:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 208, 97, 0.55);
  background: linear-gradient(180deg, rgba(245,208,97,0.095), rgba(255,255,255,0.03));
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(245, 208, 97, 0.06);
}

.ptk-home-cat-card:active,
.ptk-home-card:active,
.ptk-home-shop-card:active,
.ptk-home-sponsor-card:active,
.ptk-home-list-item:active,
.ptk-home-forum-item:active {
  transform: translateY(-1px);
  border-color: #f5d061;
  background: rgba(245, 208, 97, 0.12);
  box-shadow: 0 0 0 2px rgba(245, 208, 97, 0.3);
}

.ptk-home-cat-card:focus,
.ptk-home-cat-card:focus-visible,
.ptk-home-card:focus-within,
.ptk-home-shop-card:focus,
.ptk-home-shop-card:focus-visible,
.ptk-home-sponsor-card:focus-within,
.ptk-home-list-item:focus,
.ptk-home-list-item:focus-visible,
.ptk-home-forum-item:focus,
.ptk-home-forum-item:focus-visible {
  border-color: #f5d061;
  box-shadow:
    0 0 0 3px rgba(245, 208, 97, 0.32),
    0 14px 32px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   CATEGORY CARDS
========================================================= */

.ptk-home-cat-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 115px;
}

.ptk-home-cat-card strong,
.ptk-home-card h3,
.ptk-home-shop-card strong,
.ptk-home-list-item strong,
.ptk-home-forum-item strong {
  color: #fff;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ptk-home-cat-card em,
.ptk-home-shop-card em,
.ptk-home-list-item em {
  font-style: normal;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  line-height: 1.45;
}

.ptk-home-cat-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(196, 154, 61, 0.18);
  color: #f5d061;
}

/* =========================================================
   CONTENT / ARTICLE CARDS
========================================================= */

.ptk-home-card a {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
  min-width: 0;
}

.ptk-home-thumb {
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.ptk-home-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.ptk-home-card:hover .ptk-home-thumb img {
  transform: scale(1.04);
}

.ptk-home-card-body {
  padding: 13px;
  min-width: 0;
}

.ptk-home-card-body h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.ptk-home-card-body p {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* =========================================================
   LIST / FORUM
========================================================= */

.ptk-home-list {
  display: grid;
  gap: 10px;
}

.ptk-home-list-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
}

.ptk-home-list-item span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(196, 154, 61, 0.12);
  color: #f5d061;
}

.ptk-home-list-item div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ptk-home-forum-item {
  border-radius: 14px;
  border-color: rgba(196, 154, 61, 0.2);
}

.ptk-home-forum-item strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ptk-home-forum-item:hover {
  border-color: rgba(245, 208, 97, 0.6);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.22),
    0 8px 22px rgba(245, 208, 97, 0.13);
}

.ptk-home-forum-item:active {
  border-color: #f5d061;
  background: rgba(245, 208, 97, 0.13);
  box-shadow: 0 0 0 2px rgba(245, 208, 97, 0.35);
}

.ptk-home-forum-item:focus,
.ptk-home-forum-item:focus-visible {
  border-color: #f5d061;
  box-shadow: 0 0 0 3px rgba(245, 208, 97, 0.35);
}

/* =========================================================
   TAGS
========================================================= */

.ptk-home-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.ptk-home-tag-cloud a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(196, 154, 61, 0.16);
  color: #f5d061;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  transition: all 0.2s ease;
}

.ptk-home-tag-cloud a:hover,
.ptk-home-tag-cloud a:active,
.ptk-home-tag-cloud a:focus {
  border-color: rgba(245, 208, 97, 0.55);
  background: rgba(245, 208, 97, 0.11);
  box-shadow: 0 0 0 2px rgba(245, 208, 97, 0.18);
}

.ptk-home-tag-cloud small {
  color: rgba(255, 255, 255, 0.56);
  font-weight: 600;
}

/* =========================================================
   VIP SHOPS
========================================================= */

.ptk-home-shop-card {
  padding: 16px 12px;
  display: flex;
  align-items: center;
  text-align: center;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.ptk-home-avatar {
  max-width: 72px;
  max-height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(245, 208, 97, 0.42);
  box-shadow: 0 0 0 3px rgba(196, 154, 61, 0.08);
}

/* =========================================================
   SPONSORS
========================================================= */

.ptk-home-sponsor-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.ptk-home-sponsor-card img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}

.ptk-home-sponsor-card h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.ptk-home-sponsor-html {
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  overflow-wrap: anywhere;
}

/* =========================================================
   LATEST AMULETS - COMPACT SHOP CARD
   ใช้กับ shortcode: [ptk_home_latest_amulets]
========================================================= */

.ptk-home-amulets .ptk-home-section-head {
  margin-bottom: 10px;
}

.ptk-home-amulets .ptk-home-section-head h2 {
  font-size: 22px;
  line-height: 1.25;
}

.ptk-home-amulets .ptk-home-section-head p {
  font-size: 13px;
  line-height: 1.45;
  max-width: 420px;
}

.ptk-home-amulets .ptk-home-amulet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.ptk-home-amulets .ptk-home-amulet-shop-card-wrap,
.ptk-home-amulets .ptk-amulet-card,
.ptk-home-amulets .ptk-amulet-shop__card {
  height: auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.ptk-home-amulets .ptk-amulet-shop__thumb-link {
  display: block;
  overflow: hidden;
}

.ptk-home-amulets .ptk-amulet-shop__image,
.ptk-home-amulets .ptk-amulet-shop__thumb-link img {
  width: 100%;
  aspect-ratio: 4 / 2.75;
  object-fit: cover;
  display: block;
}

.ptk-home-amulets .ptk-amulet-shop__content {
  padding: 10px 11px 11px !important;
}

.ptk-home-amulets .ptk-amulet-shop__title {
  margin: 0 0 6px !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.ptk-home-amulets .ptk-amulet-shop__title,
.ptk-home-amulets .ptk-amulet-shop__title a {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  visibility: visible !important;
  opacity: 1 !important;
  color: #fff !important;
  text-decoration: none !important;
}

.ptk-home-amulets .ptk-amulet-shop__price,
.ptk-home-amulets .ptk-amulet-shop__price *,
.ptk-home-amulets .ptk-amulet-price {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #f5d061 !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  margin: 0 !important;
}

.ptk-home-amulets .ptk-amulet-shop__meta,
.ptk-home-amulets .ptk-amulet-shop__meta--category,
.ptk-home-amulets .ptk-amulet-shop__meta--status {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  margin-top: 5px !important;
  color: rgba(255, 255, 255, 0.62) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ซ่อน status ซ้ำ เพราะมี badge อยู่แล้ว */
.ptk-home-amulets .ptk-amulet-shop__meta--status {
  display: none !important;
}

.ptk-home-amulets .ptk-amulet-shop__actions {
  margin-top: 8px !important;
}

.ptk-home-amulets .ptk-amulet-shop__view-btn {
  min-height: 32px !important;
  padding: 7px 10px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
}

.ptk-home-amulets .ptk-amulet-shop__badge,
.ptk-home-amulets .ptk-amulet-badge {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 11px !important;
  padding: 5px 8px !important;
  border-radius: 999px !important;
}

.ptk-home-amulets .ptk-home-amulet-shop-card-wrap:hover {
  transform: translateY(-2px);
}

/* =========================================================
   RESPONSIVE - TABLET
========================================================= */

@media (max-width: 1024px) {
  .ptk-home-cat-grid,
  .ptk-home-card-grid,
  .ptk-home-card-grid--posts,
  .ptk-home-amulets .ptk-home-amulet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ptk-home-shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ptk-home-forum-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   RESPONSIVE - MOBILE
========================================================= */

@media (max-width: 768px) {
  .ptk-home-section,
  .ptk-home-hero {
    margin-bottom: 22px;
  }

  .ptk-home-hero {
    border-radius: 18px;
    min-height: 310px;
  }

  .ptk-home-hero-track {
    min-height: 310px;
  }

  .ptk-home-hero-slide {
    padding: 26px 18px 52px;
  }

  .ptk-home-eyebrow {
    margin-top: 6px;
    margin-bottom: 8px;
  }

  .ptk-home-hero h1 {
    font-size: 28px;
  }

  .ptk-home-hero p {
    font-size: 14px;
  }

  .ptk-home-hero-dots {
    left: 18px;
    bottom: 18px;
  }

  .ptk-home-cat-grid,
  .ptk-home-card-grid,
  .ptk-home-card-grid--posts,
  .ptk-home-shop-grid,
  .ptk-home-forum-grid,
  .ptk-home-amulets .ptk-home-amulet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ptk-home-sponsor-grid {
    grid-template-columns: 1fr;
  }

  .ptk-home-section-head h2 {
    font-size: 21px;
  }

  .ptk-home-card-body {
    padding: 11px;
  }

  .ptk-home-card-body h3 {
    font-size: 14px;
  }

  .ptk-home-amulets .ptk-home-section-head h2 {
    font-size: 20px;
  }

  .ptk-home-amulets .ptk-home-section-head p {
    font-size: 12.5px;
  }

  .ptk-home-amulets .ptk-amulet-shop__content {
    padding: 9px 9px 10px !important;
  }

  .ptk-home-amulets .ptk-amulet-shop__title {
    font-size: 13px !important;
  }

  .ptk-home-amulets .ptk-amulet-shop__actions {
    display: none !important;
  }
}

/* =========================================================
   RESPONSIVE - SMALL MOBILE
========================================================= */

@media (max-width: 520px) {
  .ptk-home-hero {
    min-height: 300px;
  }

  .ptk-home-hero-track {
    min-height: 300px;
  }

  .ptk-home-hero-slide {
    padding: 24px 16px 50px;
  }

  .ptk-home-hero h1 {
    font-size: 25px;
  }

  .ptk-home-cat-card,
  .ptk-home-shop-card,
  .ptk-home-sponsor-card,
  .ptk-home-list-item {
    border-radius: 15px;
  }
}

@media (max-width: 420px) {
  .ptk-home-btn {
    width: 100%;
  }

  .ptk-home-hero-actions {
    width: 100%;
  }

  .ptk-home-cat-card {
    padding: 13px;
    min-height: 105px;
  }

  .ptk-home-shop-card {
    padding: 14px 10px;
  }
}


/* ================================
   PTK HOME - AMULET CATEGORIES CLEAN
================================ */

.ptk-home-cat-card--clean {
  padding: 15px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border-radius: 18px;
  text-decoration: none;
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease,
    transform .2s ease;
}

/* hover */
.ptk-home-cat-card--clean:hover {
  border-color: rgba(245,208,97,.62);
  background: linear-gradient(
    180deg,
    rgba(245,208,97,.12),
    rgba(255,255,255,.035)
  );
  box-shadow: 0 10px 26px rgba(245,208,97,.12);
  transform: translateY(-2px);
}

/* active touch */
.ptk-home-cat-card--clean:active {
  transform: translateY(1px);
  border-color: #f5d061;
  box-shadow: 0 0 0 2px rgba(245,208,97,.24);
}

/* title */
.ptk-home-cat-card--clean strong {
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.35;
}

/* count */
.ptk-home-cat-card--clean em {
  color: rgba(255,255,255,.62);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
}