/* Wrapper */
.pung-step-wrap{
  max-width: 1200px;
  margin: 0 auto;
  font-family: 'Kanit', sans-serif;
}

/* Grid: มือถือ = 1 คอลัมน์, PC = 40:60 */
.pung-step-grid{
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;   /* มือถือปล่อยสูงตามเนื้อหา */
  gap: 0;
}
@media (min-width: 768px){
  .pung-step-grid{
    grid-template-columns: 43.3% 56.7%;
    align-items: stretch; /* ให้คอลัมน์สูงเท่ากัน */

    /* ความสูงกล่องรูป (ปรับได้) */
    --step-h: clamp(230px, 26vw, 280px);
  }
}

/* คอลัมน์และลิงก์ให้เป็นบล็อกเต็มพื้นที่ */
.pung-step-col{ position: relative; }
.pung-step-col a{ display: block; }

/* --- ทำให้คอลัมน์มีความสูงคงที่ร่วมกัน และลูกตัวแรกกินเต็มกล่อง --- */
@media (min-width: 768px){
  .pung-step-col{
    display: grid;
    min-height: var(--step-h);   /* สำคัญ: ตั้งความสูงกล่องเท่ากันทั้งสองคอลัมน์ */
  }
  .pung-step-col > *:first-child{
    display: grid !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
  }
}

/* รูปภาพ: มือถือสูงตามสัดส่วน, PC สูงเต็มกล่องแบบไม่ครอป */
.pung-step-col img{
  width: 100%;
  height: auto;
  display: block;
}
@media (min-width: 768px){
  .pung-step-col img{
    height: 100% !important;     /* เติมเต็มความสูงกล่อง */
    object-fit: contain !important; /* แสดงเต็มรูป ไม่ครอป */
    object-position: center center;
  }
}

/* Placeholder กรณีไม่มีรูป */
.pung-step-empty{
  border: 1px dashed #d0d7de;
  background: #f8fafc;
  color: #64748b;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  border-radius: 6px;
}

/* ซ่อนหัวเรื่อง/วันที่บนหน้า public (ถ้าธีมมี) */
.has-pung-step .entry-title,
.has-pung-step .page-title,
.pung-step-wrap .entry-title,
.pung-step-wrap .page-title,
.pung-step-wrap .posted-on,
.pung-step-wrap .entry-meta{
  display: none !important;
}

/* ระยะห่างรายการ */
.pung-step-item{ margin: 16px 0; }

/* เส้นคั่นบาง ๆ ระหว่างคู่รูป (ตามสไตล์ที่ใช้กัน) */
.pung-step-sep{
  height: 1px;
  background: #eee;
  margin: 12px 0;
}

/* Pagination (สำหรับ [pung_step_archive]) */
.pung-step-pagination{
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 20px 0 0;
  flex-wrap: wrap;
}
.pung-step-pagination a,
.pung-step-pagination span{
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  color: #111827;
  background: #fff;
}
.pung-step-pagination .current{
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* ปรับ margin ภาพให้แนบขอบกล่อง (ถ้า Theme ใส่ค่า default มา) */
.pung-step-col img{ margin: 0; }

/* เผื่อ Builder/Theme บางตัวห่อด้วย figure ให้กว้าง 100% */
.pung-step-col figure{ margin: 0; width: 100%; height: 100%; }

/* ป้องกัน container ที่มี padding ทำให้เห็นเส้นขาวข้างรูป */
.pung-step-col,
.pung-step-grid{ background: transparent; }

/* ==== THEME COLORS: คืนหัวข้อ/พื้นหลังโทนเขียว ==== */
.pung-step-wrap{
  /* ปรับค่านี้ได้ตามใจ */
  --step-title-bg: #185730;    /* เขียวหัวข้อ */
  --step-title-text: #ffffff;  /* สีตัวหนังสือบนหัวข้อ */
  --step-card-bg: #ffffff;     /* พื้นหลังการ์ดรูป */
  --step-card-border: #d7e7df; /* เส้นขอบการ์ด */
}

/* หัวข้อ/แถบชื่อส่วน (พยายามครอบหลาย selector ที่เจอได้บ่อย) */
.pung-step-wrap .pung-step-title,
.pung-step-wrap .pung-step-header,
.pung-step-wrap .pung-step-date,
.pung-step-wrap .pung-step-archive-date,
.pung-step-wrap .pung-step-heading{
  background: var(--step-title-bg);
  color: var(--step-title-text);
  padding: 10px 14px;
  font-weight: 400;
  line-height: 1.3;
  margin: 20px 0 2px;
  gap: 8px;
}

/* การ์ดพื้นหลังรอบชุดรูป (ถ้าใช้ .pung-step-item อยู่แล้วจะได้สีทันที) */
.pung-step-item{
  background: var(--step-card-bg);
  border: 1px solid var(--step-card-border);
  border-radius: 10px;
  padding: 10px;
}

/* กันธีมทับสีหัวข้อ */
.pung-step-wrap .pung-step-title a,
.pung-step-wrap .pung-step-header a,
.pung-step-wrap .pung-step-date a{ color: inherit; text-decoration: none; }
