/* =========================================================
   Suriya9 — Blog (บทความ)  — พอร์ตจาก Figma export ให้ตรงดีไซน์
   โหลดเฉพาะ template-blog.php — ใช้ header/footer ของธีม
   ========================================================= */

.blog-wrap {
  width: min(1312px, calc(100% - 128px));
  margin-inline: auto;
}

/* ===== HERO ===== */
.page-hero {
  position: relative;
  height: 433px;
  overflow: hidden;
}
.page-hero-image {
  position: absolute;
  inset: 0 0 65px;
  background: url("../images/blog/funeral-article-hero.webp") center 42% / cover no-repeat;
}
.page-hero-fade {
  position: absolute;
  inset: 0 0 65px;
  background: linear-gradient(to top, #fff 0%, rgba(255, 255, 255, 0) 100%);
}
.page-title-wrap {
  position: absolute;
  top: 236px;
  width: 100%;
}
.page-title-wrap h1 {
  margin: 0;
  color: #8c0e0f;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  line-height: normal;
  text-align: center;
}
.title-divider {
  display: flex;
  width: calc(100% - 128px);
  margin: 24px auto 0;
  align-items: center;
  gap: 18px;
}
.title-divider span {
  height: 1.5px;
  flex: 1;
  background: linear-gradient(90deg, #bd9a4b, #d1ab35);
}
.title-divider .ornament {
  width: 150px;
  height: 73px;
  transform: rotate(180deg);
  background: url("../images/blog/gold-ornament-pattern.webp") 52% 32% / 301px 300px no-repeat;
}

/* ===== FEATURED ===== */
.featured {
  display: grid;
  grid-template-columns: 866px 1fr;
  gap: 42px;
  align-items: center;
  margin-top: 56px;
}
.featured-image {
  width: 866px;
  max-width: 100%;
  height: 433px;
  border-radius: 8px;
  object-fit: cover;
}
.featured-copy h2 {
  margin: 0 0 29px;
  color: #000;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: normal;
}
.featured-copy p {
  width: 322px;
  max-width: 100%;
  margin: 0 0 31px;
  color: #000;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: normal;
}
.gold-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border: 1px solid #fff;
  border-radius: 100px;
  color: #fffdf6;
  background: linear-gradient(92.82deg, #a67c1e 1.52%, #d4af37 99.43%);
  box-shadow: 0 10px 12px rgba(166, 124, 30, 0.4);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.16px;
}

/* ===== ARTICLE SECTION ===== */
.article-section {
  position: relative;
  margin-top: 64px;
  padding: 0 0 100px;
}
.article-section::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: -17px;
  left: 0;
  height: 280px;
  background: url("../images/common/white-rose-flowers-decoration.webp") center bottom / cover no-repeat;
  pointer-events: none;
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px 24px;
}
.article-card {
  height: 449px;
  overflow: hidden;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  background: #fff;
}
/* รูป + เส้นทองบางใต้รูป (เอียงตามขอบรูป) */
.article-card > a {
  display: block;
  position: relative;
  height: 244px;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}
.article-card img {
  display: block;
  width: 100%;
  height: 244px;
  border-radius: 6px 6px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 99%, 0 87%);
  object-fit: cover;
  object-position: bottom;
}
.article-card > a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(92.82deg, #a67c1e 1.52%, #d4af37 99.43%);
  clip-path: polygon(0 87%, 100% 99%, 100% 100%, 0 88%);
  pointer-events: none;
}
.card-body {
  display: flex;
  height: 205px;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
}
.card-body h3 {
  margin: 0 0 15px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: normal;
  color: #121416;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.card-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #6c757d;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.card-body a {
  margin-top: auto;
  color: #94641e;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14px;
  text-decoration: underline;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  margin-top: 64px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: grid;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid #f1f1f1;
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #121416;
}
.pagination span.dots {
  border-color: transparent;
}
.pagination .active,
.pagination .current {
  border-color: #d4af37;
  color: #fff;
  background: #d4af37;
}
.pagination img {
  width: 16px;
  height: 16px;
}

/* ===== FLOATING DECORATIONS ===== */
.floating-left,
.floating-right {
  position: fixed;
  z-index: 15;
  pointer-events: none;
}
.floating-left {
  bottom: 143px;
  left: 24px;
}
.floating-right {
  right: 24px;
  bottom: 143px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.floating-left img,
.floating-right img {
  width: 90px;
  height: 90px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .blog-wrap { width: calc(100% - 48px); }
  .featured { grid-template-columns: 1fr; gap: 24px; }
  .featured-image { width: 100%; height: auto; aspect-ratio: 2 / 1; }
  .article-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 20px; }
  .floating-left, .floating-right { display: none; }
}
@media (max-width: 640px) {
  .page-hero { height: 320px; }
  .page-title-wrap { top: 150px; }
  .page-title-wrap h1 { font-size: 36px; }
  .article-grid { grid-template-columns: 1fr; }
}

/* ===== หน้ารายการ: หมวด/แท็กบทความ (archive.php) + ผลการค้นหา (search.php) — template-parts/listing.php ===== */
.bl-intro { margin-top: 28px; text-align: center; }
.bl-intro__text { margin: 0; font-family: var(--font-body); font-size: 18px; line-height: 1.6; color: #545454; }
.bl-search { display: flex; gap: 10px; width: min(560px, 100%); margin: 0 auto 18px; }
.bl-search input { flex: 1; min-width: 0; height: 50px; padding: 0 22px; border: 1px solid rgba(166, 124, 30, 0.45); border-radius: 100px; background: #fff; font-family: var(--font-body); font-size: 16px; color: #1f1f1f; outline: 0; }
.bl-search input:focus { border-color: #a67c1e; box-shadow: 0 0 0 3px rgba(166, 124, 30, 0.12); }
.bl-search button { flex: none; height: 50px; padding: 0 30px; border: 0; border-radius: 100px; background: linear-gradient(92.82deg, #a67c1e 1.52%, #d4af37 99.43%); font-family: var(--font-body); font-size: 16px; font-weight: 600; color: #fff; cursor: pointer; }
.bl--list .article-section { margin-top: 48px; }
.bl--list .article-card { position: relative; }
/* ป้ายประเภท (สินค้า / บทความ / รายการบริจาค) มุมบนซ้ายของรูป — เฉพาะผลการค้นหา */
.bl-type { position: absolute; top: 14px; left: 14px; z-index: 1; padding: 4px 14px; border-radius: 100px; background: rgba(255, 255, 255, 0.92); font-family: var(--font-body); font-size: 13px; font-weight: 600; color: #94641e; }
.bl-empty { padding: 40px 0 60px; text-align: center; }
.bl-empty p { margin: 0 0 24px; font-family: var(--font-body); font-size: 18px; color: #545454; }
.bl-empty__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.bl--list .pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: inherit; margin: 0; padding: 0; list-style: none; }
@media (max-width: 767px) {
  .bl-intro__text { font-size: 16px; }
  .bl-search button { padding: 0 22px; }
}
