/* =====================================================
   RESET SAFE + BASE
   ===================================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: "TH Sarabun New", "Noto Sans Thai", "Sarabun", Arial, sans-serif;
}

/* =====================================================
   NAVBAR / MENU - แก้ล้น + สวยขึ้น
   ===================================================== */
.navbar-default {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-default .container {
  padding: 0 15px;
}

.navbar-default .navbar-nav>li>a,
.navbar-default #navigationUser>li>a {
  font-size: 15px !important;
  line-height: 1.4;
  padding: 15px 14px !important;
  color: #374151 !important;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.navbar-default .navbar-nav>li>a:hover,
.navbar-default #navigationUser>li>a:hover {
  color: #111827 !important;
  background-color: #f3f4f6;
  border-radius: 4px;
}

.navbar-default .navbar-nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.navbar-default .navbar-nav>li {
  flex: 0 0 auto;
  min-width: 110px;
  text-align: center;
}

/* Dropdown */
.dropdown-menu {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-menu li>a {
  font-size: 14px !important;
  padding: 8px 16px;
  white-space: nowrap;
  color: #374151;
}

.dropdown-menu li>a:hover {
  background-color: #f3f4f6;
  color: #111827;
}

/* =====================================================
   HEADER + LOGO
   ===================================================== */
.pkp_head_wrapper {
  background: linear-gradient(to right, #1e40af, #3b82f6);
  color: white;
  padding: 20px 0;
}

.pkp_site_name {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.pkp_site_description {
  font-size: 16px;
  opacity: 0.9;
  margin-top: 8px;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.pkp_page_content {
  max-width: 960px;
  margin: 30px auto;
  font-size: 16.5px;
  line-height: 1.85;
  color: #1f2937;
}

.pkp_page_content p {
  margin-bottom: 1.4em;
  text-align: justify;
  hyphens: auto;
}

/* Headings in content */
.pkp_page_content h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 40px 0 16px;
  padding-left: 14px;
  border-left: 5px solid #4f46e5;
}

.pkp_page_content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: #3730a3;
}

/* Links */
.pkp_page_content a {
  color: #2563eb;
  text-decoration: underline;
}

.pkp_page_content a:hover {
  color: #1d4ed8;
}

/* Article list */
.media {
  padding: 20px 0;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.media:hover {
  background: #f8fafc;
}

.media-heading a {
  font-size: 19px;
  font-weight: 600;
  color: #111827;
}

.media-body .authors {
  font-size: 15px;
  color: #4b5563;
}

.media-body .date {
  font-size: 13px;
  color: #9ca3af;
}

/* Sidebar blocks */
.pkp_block {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.pkp_block .title {
  background: #f1f5f9;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.pkp_block .content {
  padding: 12px 14px;
}

/* Buttons */
.btn-primary {
  background-color: #2563eb;
  border-color: #2563eb;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

/* Footer */
footer[role="contentinfo"] {
  background: #f3f4f6;
  border-top: 1px solid #e5e7eb;
  padding: 40px 0 20px;
  color: #4b5563;
  font-size: 14px;
  text-align: center;
}

/* =====================================================
   RESPONSIVE - NAVBAR & GENERAL
   ===================================================== */
@media (max-width: 992px) {
  .navbar-default .navbar-nav>li>a {
    padding: 12px 10px !important;
    font-size: 14px !important;
  }

  .navbar-default .navbar-nav>li {
    min-width: 90px;
  }
}

@media (max-width: 768px) {
  .pkp_page_content {
    padding: 0 15px;
    font-size: 15.5px;
  }

  .navbar-default .navbar-nav {
    flex-wrap: wrap;
  }
}

/* =====================================================
   TABLES in CONTENT (เฉพาะใน .pkp_page_content เพื่อไม่กระทบส่วนอื่น)
   ===================================================== */
.pkp_page_content table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0 35px;
  font-size: 16px;
  line-height: 1.7;
}

.pkp_page_content table td {
  padding: 10px 15px;
  vertical-align: top;
  border-bottom: 1px solid #e5e7eb;
}

/* หัวข้อใหญ่ (colspan=3) */
.pkp_page_content table td[colspan="3"] {
  background: #f1f5f9;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  padding: 12px;
  border-bottom: 2px solid #4f46e5;
}

/* หัวข้อย่อยกลุ่ม (เช่น มหาวิทยาลัยราชภัฏสุรินทร์) */
.pkp_page_content table tr.group-header td[colspan="3"] {
  font-size: 17px;
  background: #f9fafb;
  text-align: left;
  padding-left: 20px;
  font-weight: bold;
}

/* ชื่อคนทั่วไป - ไม่หนา */
.pkp_page_content table td:not([colspan]) {
  font-weight: normal;
}

/* ตำแหน่งในกองเลขานุการ (strong) - ขนาดปกติ */
.pkp_page_content table td strong {
  font-size: 16px;
  font-weight: bold;
}

/* Indent ชื่อคนในกลุ่มย่อย (ถ้าใช้ padding-left ใน HTML) */
.pkp_page_content table td[style*="padding-left: 40px"] {
  padding-left: 40px !important;
}

/* Responsive tables - บนมือถือเรียงแนวตั้งชัดเจน */
@media (max-width: 768px) {

  .pkp_page_content table,
  .pkp_page_content table thead,
  .pkp_page_content table tbody,
  .pkp_page_content table tr,
  .pkp_page_content table td {
    display: block;
    width: 100%;
  }

  .pkp_page_content table td {
    border: none;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    padding-left: 50%;
  }

  .pkp_page_content table td:before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    width: 45%;
    font-weight: bold;
    white-space: nowrap;
  }

  .pkp_page_content table td[colspan="3"] {
    text-align: center;
    padding-left: 15px;
  }

  /* สำหรับชื่อคนในกลุ่มย่อย */
  .pkp_page_content table td[style*="padding-left"] {
    padding-left: 15px !important;
  }
}

.sidebar-journal-info {
  font-size: 13px;
  line-height: 1.6;
  color: #333;
}

.sidebar-journal-info hr {
  border: 0;
  border-top: 1px solid #e0e0e0;
  margin: 10px 0;
}

.sidebar-journal-info .issn {
  font-size: 12px;
  color: #555;
}


/* =====================================================
   SIDEBAR MENU สำหรับ "ขั้นตอนการดำเนินงานวารสาร"
   ===================================================== */
.sidebar-menu {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.sidebar-menu>div {
  background: #f1f5f9;
  padding: 12px 16px;
  font-weight: bold;
  font-size: 16px;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.sidebar-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu li {
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-menu li:last-child {
  border-bottom: none;
}

.sidebar-menu a {
  display: block;
  padding: 12px 16px;
  color: #2563eb;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.2s ease;
}

.sidebar-menu a:hover {
  background: #f3f4f6;
  color: #1d4ed8;
  padding-left: 20px;
  /* เลื่อนขวานิดให้มีเอฟเฟกต์ */
}

/* Responsive - บนมือถือให้เมนูเล็กลงนิด */
@media (max-width: 768px) {
  .sidebar-menu a {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* =====================================================
   SIDEBAR BLOCK - ปรับให้เรียบ กรอบไม่ซ้อน + สวยขึ้น
   ===================================================== */

/* ลบหรือ override กรอบเก่าของ .pkp_block ที่ซ้อนกัน */
.pkp_block.sidebar-menu-block {
  /* ถ้าคุณตั้ง class บล็อกนี้เป็น sidebar-menu-block */
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  margin-bottom: 24px;
}

.pkp_block.sidebar-menu-block .title {
  background: #f1f5f9;
  color: #111827;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px 8px 0 0;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  text-align: center;
  margin-bottom: 0;
}

.pkp_block.sidebar-menu-block .content {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 0;
  overflow: hidden;
}

/* ลิสต์เมนูใน Sidebar */
.sidebar-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu li {
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-menu li:last-child {
  border-bottom: none;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #2563eb;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.2s ease;
}

.sidebar-menu a:hover {
  background: #f8fafc;
  color: #1d4ed8;
  padding-left: 24px;
}

/* ปุ่ม MAKE A SUBMISSION - ปรับให้เล็กลง + สวยขึ้น */
.make-submission-btn {
  display: block;
  width: 90%;
  margin: 16px auto;
  padding: 10px 16px;
  background: #6d28d9;
  /* ม่วงเข้ม ทันสมัยกว่า */
  color: white !important;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(109, 40, 217, 0.2);
}

.make-submission-btn:hover {
  background: #5b21b6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar-menu a {
    padding: 10px 16px;
    font-size: 14px;
  }

  .make-submission-btn {
    font-size: 14px;
    padding: 9px 14px;
  }
}

/* ปรับกองเลขานุการวารสารให้ข้อความไม่ล้น + อ่านง่าย */
.gong-lekha .content {
  padding: 0 !important;
}

.gong-lekha-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 20px !important;
}

.gong-lekha-card {
  background: white !important;
  border-radius: 10px !important;
  padding: 20px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  min-height: 120px !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  word-break: break-word !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;
}

.gong-lekha-card strong {
  font-size: 17px !important;
  color: #111827 !important;
  display: block !important;
  margin-bottom: 4px !important;
}

.gong-lekha-card span {
  font-size: 15px !important;
  color: #334155 !important;
  line-height: 1.5 !important;
}

/* หัวข้อ */
.gong-lekha h3 {
  text-align: center !important;
  color: #1e293b !important;
  font-size: 22px !important;
  margin: 0 0 25px !important;
  font-weight: 600 !important;
  border-bottom: 2px solid #cbd5e1 !important;
  padding-bottom: 12px !important;
}

/* Responsive มือถือ */
@media (max-width: 768px) {
  .gong-lekha-card {
    padding: 16px !important;
  }

  .gong-lekha-card strong {
    font-size: 16px !important;
  }

  .gong-lekha-card span {
    font-size: 14px !important;
  }
}

/* ปรับลิงก์ในส่วนข้อมูลวารสารให้สวยและเป็นทางการ */
.journal-info a {
  color: #2563eb !important;
  text-decoration: underline !important;
  transition: color 0.2s ease !important;
}

.journal-info a:hover {
  color: #1d4ed8 !important;
  text-decoration: none !important;
}

/* ปรับปุ่มลิงก์ใหญ่ให้เด่นขึ้น */
.journal-info a[href*="drive.google.com"] {
  display: inline-block !important;
  padding: 10px 20px !important;
  background: #2563eb !important;
  color: white !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2) !important;
  transition: all 0.2s ease !important;
}

.journal-info a[href*="drive.google.com"]:hover {
  background: #1d4ed8 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
  transform: translateY(-1px) !important;
}

/* ถ้าคุณเพิ่ม class="journal-info" ให้ div หลักใน HTML จะช่วยให้ CSS แรงขึ้น */