/*
 * paiyaadd – single-responsive.css
 * Responsive สำหรับหน้ารีวิว single post
 * โหลดเฉพาะ is_singular() ผ่าน functions.php enqueue
 */

/* BASE */
.single-post-header { overflow-wrap: break-word; word-break: break-word; }

.single-hero-img { border-radius: var(--radius); overflow: hidden; margin: 20px 0; line-height: 0; }
.single-hero-img img { width: 100%; max-width: 100%; height: auto; display: block; }

/* ป้องกัน WP width/height attr ทำให้ล้น */
.single-post-header img,
.single-hero-img img,
.entry-content img,
img.wp-post-image,
img[class*="attachment-"],
img[class*="size-"] {
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
}

.entry-content { max-width: 100%; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content iframe, .entry-content video, .entry-content embed { max-width: 100%; }
.entry-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.score-bar-label { min-width: 56px; width: 72px; flex-shrink: 0; color: var(--color-text-muted); font-size: .8rem; }
.score-bar-val   { min-width: 28px; text-align: right; font-size: .8rem; flex-shrink: 0; }

.single-title { overflow-wrap: break-word; word-break: break-word; hyphens: auto; }
.badge--price { background: var(--color-accent-light); color: var(--color-accent-dark); }

.single-top-cta__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.single-top-cta__links { display: flex; flex-wrap: wrap; gap: 8px; }
.aff-cta-wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin: 28px 0; }

/* TABLET <= 900px */
@media (max-width: 900px) {
  .single-post-header { padding: 24px 20px; }
  .review-score-box { gap: 20px; padding: 20px; }
  .score-bars { min-width: unset; width: 100%; }
}

/* MOBILE <= 768px */
@media (max-width: 768px) {
  .single-post-header { padding: 20px 16px; border-radius: var(--radius-sm); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
  .post-meta { gap: 8px 12px; font-size: .78rem; }
  .single-title { font-size: 1.35rem; line-height: 1.4; margin-top: 10px; }
  .single-hero-img { border-radius: var(--radius-sm); margin: 16px 0; }

  .review-score-box { flex-direction: column; align-items: stretch; padding: 16px; gap: 14px; }
  .score-circle { align-self: center; width: 76px; height: 76px; }
  .score-circle .score-num { font-size: 1.5rem; }
  .score-details { width: 100%; }
  .score-details h4 { font-size: .9rem; margin-bottom: 10px; }
  .score-bars { width: 100%; min-width: unset; gap: 8px; }
  .score-bar-item { font-size: .78rem; }
  .score-bar-label { width: 60px; min-width: 60px; font-size: .75rem; }
  .score-bar-val { font-size: .75rem; }

  .single-top-cta__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .single-cta-pill { font-size: .8rem; padding: 5px 12px; }

  .entry-content { font-size: .95rem; line-height: 1.8; }
  .entry-content h2 { font-size: 1.2rem; margin-top: 1.75em; }
  .entry-content h3 { font-size: 1.05rem; }
  .entry-content img { border-radius: var(--radius-sm); }

  .pros-cons-box { grid-template-columns: 1fr; gap: 12px; }

  .aff-cta-wrap { flex-direction: column; align-items: stretch; gap: 10px; margin: 20px 0; }
  .btn-cta-shopee, .btn-cta-lazada, .btn-cta-tiktok {
    width: 100%; justify-content: center; padding: 14px 20px; font-size: 1rem; min-height: 48px;
  }
  .aff-disclaimer { text-align: center; }

  .related-posts__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .related-post-card { flex-direction: column; max-height: none; }
  .related-post-card__thumb { width: 100%; aspect-ratio: 16/9; height: auto; }
  .related-post-card__body { padding: 10px; }
  .related-post-card__title { font-size: .82rem; }
}

/* SMALL MOBILE <= 480px */
@media (max-width: 480px) {
  .single-post-header { padding: 16px 14px; }
  .single-title { font-size: 1.2rem; }
  .score-circle { width: 68px; height: 68px; }
  .score-circle .score-num { font-size: 1.3rem; }
  .score-bar-label { width: 52px; min-width: 52px; font-size: .72rem; }
  .entry-content { font-size: .93rem; line-height: 1.75; }
  .entry-content h2 { font-size: 1.1rem; }
  .entry-content h3 { font-size: 1rem; }
  .related-posts__grid { grid-template-columns: 1fr; }
  .related-post-card { flex-direction: row; max-height: 90px; }
  .related-post-card__thumb { width: 90px; min-width: 90px; aspect-ratio: unset; height: 90px; }
}

/* EXTRA SMALL <= 360px */
@media (max-width: 360px) {
  .single-post-header { padding: 14px 12px; }
  .single-title { font-size: 1.1rem; }
  .review-score-box { padding: 14px 12px; }
  .btn-cta-shopee, .btn-cta-lazada, .btn-cta-tiktok { font-size: .9rem; padding: 12px 16px; }
}
