/* Base Styles */
:root {
  --primary-color: #e74c3c;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --bg-light: #f9f9f9;
  --spacing-unit: 16px;
  --border-radius: 8px;
  --box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

body {
  font-family: "Sarabun", "Kanit", "Prompt", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  line-height: 1.7;
  background-color: #fff;
}

/* Hero Section */
.blog-hero {
  height: 400px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  margin-bottom: 40px;
  background-position: center;
  background-size: cover;
}

.blog-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

.blog-hero-layer {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
}
figcaption {
  z-index: -2;
}
.blog-hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Content Layout */
.CONTENT-BLOG-LAYER {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Blog Container with Sidebar Layout */
.blog-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  min-width: 0; /* Prevents flex item from overflowing */
}

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Responsive Layout */
@media (max-width: 992px) {
  .blog-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .blog-sidebar {
    order: 2;
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .blog-container {
    gap: 20px;
    padding: 0 15px;
  }

  .CONTENT-BLOG-LAYER {
    padding: 0 10px;
  }
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-light);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.sidebar-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.widget-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

/* Related Articles Widget */
.related-articles-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.related-article-item {
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.related-article-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.related-article-link {
  text-decoration: none;
  color: inherit;
}

.related-article-image {
  width: 100%;
  height: auto;
  flex-shrink: 0;
  overflow: hidden;
}

.related-article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.related-article-item:hover .related-article-image img {
  transform: scale(1.05);
}

.related-article-content {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.related-article-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 5px;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-article-excerpt {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.related-article-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: #999;
}

.related-article-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Categories Widget */
.categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.categories-list li {
  margin-bottom: 10px;
}

.categories-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text-color);
  border-radius: 6px;
  transition: var(--transition);
  background: white;
  border: 1px solid var(--border-color);
}

.categories-list a:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(5px);
}

.categories-list span {
  background: var(--bg-light);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.categories-list a:hover span {
  background: rgba(255, 255, 255, 0.2);
}

/* Tags Widget */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud-item {
  display: inline-block;
  padding: 6px 12px;
  background: white;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 15px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.tag-cloud-item:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* Mobile Responsive for Sidebar */
@media (max-width: 992px) {
  .related-article-link {
    flex-direction: column;
  }

  .related-article-image {
    width: 100%;
    height: 180px;
  }

  .related-article-content {
    padding: 15px;
  }

  .related-article-title {
    font-size: 1.05rem;
  }

  .related-article-excerpt {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 768px) {
  .sidebar-widget {
    padding: 20px;
  }

  .widget-title {
    font-size: 1.2rem;
  }

  .related-article-image {
    height: 150px;
  }
}

.article-content p {
  margin-bottom: 1.5em;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: 30px 0;
  box-shadow: var(--box-shadow);
}

.article-content h2,
.article-content h3 {
  margin: 1.8em 0 1em;
  color: #222;
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  position: relative;
  padding-bottom: 10px;
}

.article-content h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
}
.article-content h1 {
  position: relative;
  padding-bottom: 10px;
}
.article-content h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
}

.article-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Author and Date */
.article-meta {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  color: var(--text-light);
  font-size: 0.95rem;
}

.article-meta .author {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.article-meta .author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
}

.article-meta .publish-date {
  display: flex;
  align-items: center;
}

.article-meta .publish-date i {
  margin-right: 5px;
}

/* Social Sharing */
.article-share {
  margin: 40px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.share-title {
  font-weight: 600;
  margin-bottom: 15px;
  display: block;
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  background: #3b5998;
  transition: var(--transition);
}

.share-btn.facebook {
  background: #3b5998;
}
.share-btn.twitter {
  background: #1da1f2;
}
.share-btn.line {
  background: #00b900;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Related Articles */
.related-articles {
  margin: 60px 0;
}

.related-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.article-card {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  background: white;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.article-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.article-card-content {
  padding: 20px;
}

.article-card h3 {
  font-size: 1.1rem;
  margin: 0 0 10px;
  line-height: 1.4;
}

.article-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0;
}

.tag {
  display: inline-block;
  padding: 5px 15px;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
  transition: var(--transition);
}

.tag:hover {
  background: #e0e0e0;
  color: var(--text-color);
}
.LINK-E {
  text-decoration: none;
  color: #000000;
}
/* Responsive Adjustments */
@media (max-width: 768px) {
  .blog-hero {
    height: 300px;
  }

  .blog-hero h1 {
    font-size: 2rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }

  .article-content h3 {
    font-size: 1.3rem;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-meta .author {
    margin-bottom: 10px;
  }
}
.h2_blog {
  font-size: 22px;
  font-weight: bold;
  color: #000000;
}
.pv__description {
  margin-bottom: unset;
  font-size: 15px;
  color: #c28559;
}

.pv__title {
  font-size: 15px;
  color: #c28559;
  margin: 8px 0;
  font-weight: 600;
}

:root {
  --pv-brand: #d38e5c;
  --pv-text: #222;
  --pv-gap: 8px;

  --pv-speed: 1000ms;
  --pv-speed-short: 120ms;
  --pv-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --pv-move: 5px;
  --pv-chev-move: 8px;
  --pv-chev-size: 5px;
  /* กว้างลูกศร (SVG) */
  --pv-underline: #a9a9a9ff;
  --pv-underline-thick: 0.5px;

  /* ความยาว “ส่วนต่อ” ให้ถึงปลายลูกศร = ช่องว่าง + กว้างลูกศร + ระยะเลื่อน */
  --pv-extend: calc(var(--pv-gap) + var(--pv-chev-size) + var(--pv-chev-move));
  /* กรณีกดค้าง (active) ลูกศรเลื่อนเพิ่มอีก ~3px */
  --pv-extend-active: calc(var(--pv-extend) + 10px);
}

:root {
  --pv-gap: 3px;
  /* ระยะห่าง label ↔ icon */
  --pv-chev-size: 14px;
  /* ความกว้าง SVG ลูกศร */
  --pv-chev-move: 4px;
  /* ระยะที่ลูกศรเลื่อนตอน hover */
  --pv-extend: calc(var(--pv-gap) + var(--pv-chev-size) + var(--pv-chev-move));
  --pv-extend-active: calc(var(--pv-extend) + 3px);
}

.pv__container {
  max-width: 97%;
  margin-inline: auto;
  padding-inline: 12px;
}

.pv__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  align-items: start;
}

.pv__card {
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pv__image {
  aspect-ratio: 1/1;
  width: 100%;
  overflow: hidden;
}

.pv__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--pv-ease);
}

.pv__card:hover .pv__image img {
  transform: scale(1.03);
}

.pv__imageLink {
  display: block;
  text-decoration: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-text {
  flex: 1;
  margin-bottom: 1rem;
}

.pv__actions {
  display: flex;
  gap: 6px;
  padding-bottom: 0;
  margin-top: auto;
}

.pv__actions1 {
  gap: 6px;
  padding: 10px;
  padding-bottom: unset;
}

.pv__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--pv-gap);
  border-radius: 20px;
  font-size: 14px;
  border: unset;
  white-space: nowrap;
  text-decoration: none;
  background: unset;
  color: #333;
  transition: all 0.3s ease;
  margin-top: auto;
}

.pv__btn:hover {
  transform: translateY(-2px);
  background: #fff;
}

/* ===== เส้นใต้แบบ “สองท่อน” ===== */
.pv__label {
  position: relative;
  display: inline-block;
  font-weight: 600;
  color: #5f5f5fff;
}

/* ท่อนหลัก: ยาวเท่าข้อความเสมอ */
.pv__label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: var(--pv-underline-thick);
  width: 100%;
  background: var(--pv-underline);
  opacity: 0.9;
  transition: opacity var(--pv-speed-short) var(--pv-ease);
}

/* ท่อนต่อ: เริ่ม 0 แล้วค่อยขยายไปหาลูกศร */
.pv__label::before {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 100%;
  /* <<< เปลี่ยนจาก right:-0.5px เป็นยึดปลายข้อความฝั่งซ้าย */
  height: var(--pv-underline-thick);
  width: 0;
  /* เริ่ม 0 แล้วค่อยขยาย */
  background: var(--pv-underline);
  opacity: 0.9;
  transition: width var(--pv-speed) var(--pv-ease);
}

/* hover: ต่อหางไปจนถึงปลายลูกศร */
.pv__btn:hover .pv__label::before {
  width: var(--pv-extend);
}

.pv__btn:active .pv__label::before {
  width: var(--pv-extend-active);
}

/* ===== ลูกศรยืด-หด ===== */
.pv__chevIcon {
  width: var(--pv-chev-size);
  height: var(--pv-chev-size);
  flex: 0 0 auto;
  opacity: 0;
  transform: translateX(0) scaleX(1);
  transition: transform var(--pv-speed) var(--pv-ease),
    opacity var(--pv-speed-short) var(--pv-ease);
}

.pv__btn:hover .pv__chevIcon {
  opacity: 0.5;
  transform: translateX(var(--pv-chev-move)) scaleX(1.35);
}

.pv__btn:active .pv__chevIcon {
  transform: translateX(calc(var(--pv-chev-move) + 3px)) scaleX(1.5);
}

/* ปฏิสัมพันธ์ระหว่างปุ่ม */
.pv__btn--ghost {
  transition: transform var(--pv-speed) var(--pv-ease),
    opacity var(--pv-speed) var(--pv-ease);
}

.pv__btn--primary:hover + .pv__btn--ghost {
  transform: translateX(5px);
  opacity: 0.95;
}

/* Line button styles */
.btn-line {
  background-color: #00b900 !important;
  color: white !important;
  border: none;
  transition: all 0.3s ease;
}

.btn-line:hover {
  background-color: #00a000;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-line:active {
  transform: translateY(0);
  box-shadow: none;
}
.CONTENT-BLOG-LAYER {
  max-width: 1000px !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
.card-img,
.card-img-top {
  height: 300px;
  object-fit: cover;
}
.blog-hero-layer-TITLE {
  font-size: 42px;
}
.FONT-CONTENT-BLOG-H1 {
  font-size: 28px;
  font-weight: bold;
}
/* --- NEW: meta เพิ่มเติม (ยอดวิว / เวลาอ่าน / หมวดหมู่) --- */
.article-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f5f5f5;
  font-size: 0.85rem;
  color: var(--text-light);
}

.meta-item i {
  font-size: 0.9rem;
}

/* กล่องสรุปบทความด้านบน */
.article-summary-box {
  background: #f9f9f9;
  padding: 20px 20px 10px;
  margin-bottom: 30px;
  border: 1px solid #eee;
}

.article-summary-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.article-summary-box ul {
  padding-left: 18px;
  margin-bottom: 10px;
}

/* ไฮไลต์จุดเด่น */
.article-highlight {
  background: #fff7f2;
  border-radius: 10px;
  padding: 20px;
  margin: 30px 0;
  border-left: 4px solid #d38e5c;
}

.article-highlight h2 {
  margin-top: 0;
}

/* FAQ */
.article-faq {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.article-faq h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.faq-item + .faq-item {
  margin-top: 15px;
}

.faq-item h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.faq-item p {
  margin-bottom: 0;
}

/* responsive meta */
@media (max-width: 768px) {
  .blog-container {
    gap: 20px;
    padding: 0 15px; /* Keep small padding on edges */
  }

  .CONTENT-BLOG-LAYER {
    padding: 0; /* Remove double padding */
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .article-stats {
    margin-left: 0;
  }

  /* Restore sidebar widget styling on mobile but keep it clean */
  .sidebar-widget {
    padding: 20px;
    background: var(--bg-light);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
  }
}

@media screen and (max-width: 1100px) {
  .blog-hero-layer-TITLE {
    font-size: 26px;
  }
  .search-box .form-control {
    font-size: 13px;
  }
  .LAYOUT-BLOG-INDEX {
    padding-left: unset !important;
    padding-right: unset !important;
    padding: 0px 20px 0px 20px !important;
  }
}
@media screen and (max-width: 768px) {
}
