/*
Theme Name: XGAMBET Base
Theme URI: https://xgambetvip.com/
Author: XGAMBET
Description: ธีมโครงน้ำหนักต่ำสำหรับ XGAMBET ทำหน้าที่วาง Document Shell, Base CSS และ Single Post Breadcrumb ส่วน Header/Footer และ Content Components ให้ XGAMBET Control/แต่ละ Content เป็นเจ้าของ
Version: 1.5.3
Requires at least: 6.4
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: xgambet-base
*/

/* =========================================================
   ไฟล์นี้ตั้งใจให้เล็กที่สุด
   CSS ของ header / footer / section อยู่ในปลั๊กอินหรือ CSS ราย Content
   Theme เก็บเฉพาะ Base CSS + Single Post Breadcrumb ที่เป็น Site-level navigation
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* จำเป็นสำหรับ section ที่ใช้ full-bleed (margin-inline: calc(50% - 50vw))
     ใช้ clip ไม่ใช่ hidden เพราะ hidden จะทำให้ position:sticky ตาย */
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #FFF;
  color: #171719;
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* ลิงก์ข้ามไปเนื้อหาหลัก สำหรับผู้ใช้คีย์บอร์ด */
.xgb-skip-link {
  position: absolute;
  z-index: 100000;
  top: -100px;
  left: 8px;
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  background: #C23A00;
  color: #FFF;
  font-weight: 800;
  text-decoration: none;
}

.xgb-skip-link:focus {
  top: 0;
}

/* กล่องเนื้อหาเริ่มต้น ใช้เฉพาะหน้าที่ไม่ได้จัด layout เอง เช่น 404 / search */
.xgb-shell {
  width: min(880px, 100% - 40px);
  margin: 0 auto;
  padding: 56px 0 72px;
}

.xgb-shell h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.018em;
}

.xgb-shell a {
  color: #C23A00;
}

.xgb-shell a:hover {
  color: #A33000;
}

:focus-visible {
  outline: 3px solid #C23A00;
  outline-offset: 2px;
}



/* =========================================================
   GLOBAL SINGLE POST BREADCRUMB
   Site-level navigation only. Article components remain per-content CSS.
   ========================================================= */

.xgb-global-breadcrumb {
  width: min(1110px, calc(100% - 40px));
  margin: 26px auto 22px;
  color: #4f4f53;
  font-size: 13px;
  line-height: 1.6;
}

.xgb-global-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.xgb-global-breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.xgb-global-breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 6px;
  color: #a3a3a8;
}

.xgb-global-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.xgb-global-breadcrumb a:hover {
  color: #c23a00;
}

.xgb-global-breadcrumb [aria-current="page"] {
  overflow: hidden;
  color: #252529;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .xgb-global-breadcrumb {
    width: min(100% - 28px, 1110px);
    margin-top: 18px;
    margin-bottom: 18px;
    font-size: 12px;
  }
}


/* =========================================================
   FALLBACK ARCHIVE / BLOG
   ใช้เฉพาะ index.php เมื่อไม่มี archive controller เฉพาะ
   ไม่ render post_content เต็มก้อน เพื่อไม่ดึง HTML/CSS ของ Single Post มาชนกัน
   ========================================================= */

.xgb-archive-fallback {
  width: min(1040px, 100% - 40px);
}

.xgb-archive-fallback__header {
  margin-bottom: 28px;
}

.xgb-archive-fallback__description {
  max-width: 760px;
  color: #646469;
}

.xgb-archive-fallback__list {
  display: grid;
  gap: 18px;
}

.xgb-archive-fallback__item {
  padding: 24px;
  border: 1px solid #e6e6e3;
  border-radius: 18px;
  background: #fff;
}

.xgb-archive-fallback__item h2 {
  margin: 0 0 10px;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.35;
}

.xgb-archive-fallback__item h2 a {
  color: #171719;
  text-decoration: none;
}

.xgb-archive-fallback__item h2 a:hover {
  color: #C23A00;
}

.xgb-archive-fallback__item p {
  margin: 0;
  color: #5f5f64;
}

.xgb-archive-fallback .navigation.pagination {
  margin-top: 30px;
}


/* Control plugin safety fallback — visible only when xgb_site_header/footer have no owner. */
.xgb-base-fallback-header,
.xgb-base-fallback-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  font: 600 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.xgb-base-fallback-header a { color: #171719; text-decoration: none; }
.xgb-base-fallback-footer { border-top: 1px solid #ececeb; color: #646469; }
