/* =======================================================
   PR NEWS GLOBAL STRUCTURE
   ======================================================= */
.pr-main-section {
  padding-top: 5px !important; /* บังคับให้ดันขึ้นไปชิดเมนูด้านบนสุด */
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  background: transparent !important;
}

.pr-content-wrapper {
  padding: 0 !important; /* ให้คอนเทนต์ขยายเต็มพื้นที่ตาม Global Layout */
}

/* =======================================================
   CATEGORY PILLS (ปุ่มเลือกหมวดหมู่)
   ======================================================= */
.cat-pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
  padding-bottom: 0;
  border-bottom: none;
  justify-content: center; /* จัดให้อยู่กึ่งกลางหน้าจอ */
}

.cat-pill {
  cursor: pointer;
  padding: 8px 22px;
  border-radius: 50px;
  background: #fff;
  border: 1px solid #eee;
  color: #555;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.cat-pill:hover {
  background-color: var(--pill-color);
  color: #fff !important;
  border-color: var(--pill-color);
  transform: translateY(-2px);
}

.cat-pill.active {
  background-color: var(--pill-color);
  color: #fff !important;
  border-color: var(--pill-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: bold;
}

.layout_padding {
  padding-top: 20px;
  padding-bottom: 30px;
}
/* =======================================================
   ACTIVITY CARD (การ์ดข่าวประชาสัมพันธ์)
   ======================================================= */
.activity-card {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  /* เอา Hover ออกจากตัวการ์ดตรงๆ แล้วใส่ will-change เพื่อให้การ์ดลอยนิ่งๆ */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  will-change: transform;
  height: 100%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.pr-card-item:hover .activity-card {
  transform: translateY(-6px); /* ลดระยะเด้งลงนิดนึงให้ดูสมูท */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12) !important;
}

.activity-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.activity-img-box {
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
}

.activity-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  will-change: transform;
}

.pr-card-item:hover .activity-img-box img {
  transform: scale(1.1);
}

.activity-card:hover .activity-img-box img {
  transform: scale(1.1); /* ซูมรูปภาพตอน Hover */
}

.activity-content {
  padding: 25px 20px 20px 20px;
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* ปรับตำแหน่ง Badge ใหม่ไม่ให้ลอยเคว้ง */
.category-badge {
  position: absolute;
  top: -15px;
  left: 20px;
  padding: 4px 15px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: bold;
  color: #fff !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
  text-transform: uppercase;
}

.activity-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
  height: 45px;
  margin-top: 5px;
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* =======================================================
   1. แก้ปัญหาช่องว่างด้านบน (Gap Fix)
   ======================================================= */
.pr-main-section {
  padding-top: 5px !important; /* บังคับให้ดันขึ้นไปชิดเมนูด้านบนสุด */
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  background: transparent !important;
}

.pr-content-wrapper {
  padding-top: 0 !important;
}

/* =======================================================
   2. แก้ปัญหาการ์ดสั่นตอนเลื่อนเมาส์ (Hover Jitter Fix)
   ======================================================= */
.activity-card {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  /* เอา Hover ออกจากตัวการ์ดตรงๆ แล้วใส่ will-change เพื่อให้การ์ดลอยนิ่งๆ */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  will-change: transform;
  height: 100%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

/* 🌟 เคล็ดลับ: จับ Hover ที่กล่องครอบด้านนอก (ซึ่งมันอยู่นิ่งไม่ขยับ) แทนตัวการ์ด */
.pr-card-item:hover .activity-card {
  transform: translateY(-6px); /* ลดระยะเด้งลงนิดนึงให้ดูสมูท */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12) !important;
}

.activity-img-box {
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
}

.activity-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  will-change: transform;
}

/* ซูมรูปภาพตอนเอาเมาส์ชี้ที่กล่องครอบ */
.pr-card-item:hover .activity-img-box img {
  transform: scale(1.1);
}

/* =======================================================
   ส่วนอื่นๆ (หมวดหมู่, ตัวหนังสือ ฯลฯ) คงเดิม
   ======================================================= */
.category-badge {
  position: absolute;
  top: -15px;
  left: 20px;
  padding: 4px 15px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: bold;
  color: #fff !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
  text-transform: uppercase;
}

.activity-content {
  padding: 25px 20px 20px 20px;
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.activity-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
  height: 45px;
  margin-top: 5px;
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.activity-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #777;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
  text-indent: 30px;
}

/* ข้อมูลวันที่และยอดวิว */
.activity-meta {
  border-top: 1px solid #f1f1f1;
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #888 !important;
}

.activity-meta i {
  color: #bbb !important;
  margin-right: 4px;
}

/* =======================================================
   DETAIL PAGE (หน้ารายละเอียดข่าว)
   ======================================================= */
.main-cover-img {
  display: block;
  width: 100%;
  max-width: 800px;
  max-height: 450px;
  margin: 0 auto 30px auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  background-color: #f8f9fa;
}

.pr-detail-content {
  color: #444;
  line-height: 1.8;
  font-size: 1.1rem;
}

.pr-detail-content p {
  text-indent: 50px; /* ย่อหน้าเนื้อหา 50px */
  margin-bottom: 1.5rem;
}

/* =======================================================
   ADMIN ACTIONS (ปุ่มแก้ไข/ลบ บนการ์ด)
   ======================================================= */
.card-actions {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  gap: 5px;
}

.activity-card:hover .card-actions {
  opacity: 1;
}

.btn-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: 0.2s;
}

.btn-action:hover {
  transform: scale(1.1);
}

.btn-edit {
  color: #ffc107;
}
.btn-delete {
  color: #dc3545;
}

/* =======================================================
   CUSTOM BUTTONS
   ======================================================= */
.btn-primary-custom {
  background: #680268;
  color: #fff !important;
  border: none;
  padding: 8px 25px;
  border-radius: 30px;
  font-weight: 600;
  transition: 0.3s;
  box-shadow: 0 4px 10px rgba(104, 2, 104, 0.2);
}

.btn-primary-custom:hover {
  background: #4a014a;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(104, 2, 104, 0.3);
}

.btn-outline-custom {
  border: 1px solid #680268;
  color: #680268 !important;
  background: #fff;
  padding: 8px 25px;
  border-radius: 30px;
  font-weight: 600;
  transition: 0.3s;
}

.btn-outline-custom:hover {
  background: #fdf2fd;
}
