/*
 Theme Name:   Kingster Child
 Theme URI:    http://demo.goodlayers.com/kingster
 Description:  Goodlayers Kingster Child Theme
 Author:       Goodlayers
 Author URI:   http://goodlayers.com
 Template:     kingster
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         light, dark, right-sidebar, responsive-layout
 Text Domain:  kingster-child

 START YOUR CHILD THEME CSS HERE
*/
/* ---------------------------------------------------------------------------
   2026-10-13 หน้าแรก: counter ตัวเลขวิ่ง (Undergraduate Programmes, 87.63% ฯลฯ)
   ปัญหา: ตัวเลขกับหน่วย (% / th) เป็น inline span ในคอลัมน์กว้าง 1/6 ที่ font 59px
   ระหว่างวิ่ง ความกว้างข้อความเปลี่ยนทุกเฟรม พอยาวเกินคอลัมน์ "%" จะตกไปบรรทัดใหม่
   ความสูงของแถวเปลี่ยน (59px -> 118px) ทำให้คอลัมน์ที่ float อยู่และทุกอย่างด้านล่างกระตุก
   แก้: ห้ามตกบรรทัด + ใช้ตัวเลขความกว้างคงที่ + ลดขนาดเฉพาะคอลัมน์แคบให้ "87.63%" อยู่บรรทัดเดียว
   --------------------------------------------------------------------------- */
.gdlr-core-counter-item .gdlr-core-counter-item-number{
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.gdlr-core-column-10 .gdlr-core-counter-item .gdlr-core-counter-item-number{ font-size: 48px; }
@media only screen and (max-width: 999px){
	.gdlr-core-column-10 .gdlr-core-counter-item .gdlr-core-counter-item-number{ font-size: 34px; }
}
/* มือถือ (คอลัมน์กว้าง 100%) กลับไปใช้ขนาดเดิมของธีม */
@media only screen and (max-width: 767px){
	.gdlr-core-column-10 .gdlr-core-counter-item .gdlr-core-counter-item-number{ font-size: 59px; }
}

/* 2026-10-13 Lighthouse ระยะ 2: ไอคอนฟอนต์ของ goodlayers-core ประกาศ font-display:block (ซ่อนไอคอนจนโหลดเสร็จ)
   ประกาศ @font-face ซ้ำด้วยชื่อ/น้ำหนักเดิมแต่ใส่ font-display:swap ไฟล์นี้โหลดหลัง CSS ของปลั๊กอิน จึงทับได้
   path ชี้ไปไฟล์เดิมของปลั๊กอิน (../../plugins/goodlayers-core/plugins/...) ถ้าย้ายปลั๊กอินต้องแก้ตาม */
@font-face{font-family:'FontAwesome';font-weight:normal;font-style:normal;font-display:swap;
  src:url(../../plugins/goodlayers-core/plugins/fontawesome/fontawesome-webfont.woff2?v=4.7.0) format('woff2'),
      url(../../plugins/goodlayers-core/plugins/fontawesome/fontawesome-webfont.woff?v=4.7.0) format('woff');}
@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:swap;
  src:url(../../plugins/goodlayers-core/plugins/fa5/fa-brands-400.woff2) format("woff2"),
      url(../../plugins/goodlayers-core/plugins/fa5/fa-brands-400.woff) format("woff");}
@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:swap;
  src:url(../../plugins/goodlayers-core/plugins/fa5/fa-regular-400.woff2) format("woff2"),
      url(../../plugins/goodlayers-core/plugins/fa5/fa-regular-400.woff) format("woff");}
@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:swap;
  src:url(../../plugins/goodlayers-core/plugins/fa5/fa-solid-900.woff2) format("woff2"),
      url(../../plugins/goodlayers-core/plugins/fa5/fa-solid-900.woff) format("woff");}
@font-face{font-family:ElegantIcons;font-weight:400;font-style:normal;font-display:swap;
  src:url(../../plugins/goodlayers-core/plugins/elegant/ElegantIcons.woff) format('woff'),
      url(../../plugins/goodlayers-core/plugins/elegant/ElegantIcons.ttf) format('truetype');}
@font-face{font-family:simple-line-icons;font-weight:400;font-style:normal;font-display:swap;
  src:url(../../plugins/goodlayers-core/plugins/simpleline/Simple-Line-Icons.woff2?v=2.4.0) format('woff2'),
      url(../../plugins/goodlayers-core/plugins/simpleline/Simple-Line-Icons.woff?v=2.4.0) format('woff');}

/* ---------------------------------------------------------------------------
   2026-10-15 Responsive ระยะ 1 (RESPONSIVE-PLAN.md) แยกบล็อกตามกลุ่ม F1-F6 ลบทีละบล็อกได้
   ต้นเหตุ: ธีม/page builder เรียงคอลัมน์ซ้อนกันเฉพาะจอ <= 767px ช่วง 768-999px คอลัมน์แคบจึงยังวางเคียงกัน
   ทุกกฎจำกัดด้วย media query จอ >= 1200px ไม่เปลี่ยน ยกเว้น F5 (รูปพื้นหลัง contain/repeat -> cover) ที่แก้ทุกขนาดจอ
   --------------------------------------------------------------------------- */

/* F1 footer 4 คอลัมน์ -> 2 คอลัมน์ที่ 768-999px ("SUT Internationalisation" เคยถูกตัดคำ) */
@media only screen and (min-width: 768px) and (max-width: 999px){
	.kingster-footer-column.kingster-column-15{ width: 50%; }
	.kingster-footer-column.kingster-column-15:nth-child(2n+1){ clear: left; }
}

/* F2 คอลัมน์แคบและ sidebar ของ page builder ที่ 768-999px
   - sidebar (gdlr-core-pbf-sidebar-*) ย้ายลงใต้เนื้อหา เหมือนที่ธีมทำบนมือถือ
   - คอลัมน์ 1/6 1/5 -> 1/3, 1/4 -> 1/2, คู่ 3/4 + 1/4 -> เต็มแถวทั้งคู่
   - ใช้ flex แทน float ไม่ให้คอลัมน์ที่สูงไม่เท่ากันค้างผิดแถว */
@media only screen and (min-width: 768px) and (max-width: 999px){
	.gdlr-core-pbf-sidebar-wrapper{ overflow: visible; }
	.gdlr-core-pbf-sidebar-container{ display: flex; flex-direction: column; }
	.gdlr-core-pbf-sidebar-container > .gdlr-core-pbf-sidebar-content,
	.gdlr-core-pbf-sidebar-container > .gdlr-core-pbf-sidebar-left,
	.gdlr-core-pbf-sidebar-container > .gdlr-core-pbf-sidebar-right{ width: 100%; float: none; height: auto !important; }
	.gdlr-core-pbf-sidebar-container > .gdlr-core-pbf-sidebar-left{ order: 2; }

	:is(.gdlr-core-pbf-wrapper-container, .gdlr-core-pbf-sidebar-content-inner, .gdlr-core-pbf-column-content):has(> .gdlr-core-pbf-column){
		display: flex; flex-wrap: wrap; align-items: flex-start; }
	:is(.gdlr-core-pbf-wrapper-container, .gdlr-core-pbf-sidebar-content-inner, .gdlr-core-pbf-column-content):has(> .gdlr-core-pbf-column) > :not(.gdlr-core-pbf-column){
		width: 100%; }
	:is(.gdlr-core-pbf-wrapper-container, .gdlr-core-pbf-sidebar-content-inner, .gdlr-core-pbf-column-content):has(> .gdlr-core-pbf-column)::before,
	:is(.gdlr-core-pbf-wrapper-container, .gdlr-core-pbf-sidebar-content-inner, .gdlr-core-pbf-column-content):has(> .gdlr-core-pbf-column)::after{
		display: none; }
	.gdlr-core-pbf-column.gdlr-core-column-10,
	.gdlr-core-pbf-column.gdlr-core-column-12{ width: 33.3333%; }
	/* ตารางคอลัมน์ 1/6 ตั้งแต่ 6 ช่องขึ้นไป (ตารางสี "โลโก้ | ช่องสี" หน้า Identity) -> 1/2 ให้คู่อยู่แถวเดียวกัน แถวตัวเลขหน้าแรก (1/6 x4 + 1/3) คง 1/3 */
	:has(> .gdlr-core-pbf-column.gdlr-core-column-10 ~ .gdlr-core-pbf-column.gdlr-core-column-10 ~ .gdlr-core-pbf-column.gdlr-core-column-10 ~ .gdlr-core-pbf-column.gdlr-core-column-10 ~ .gdlr-core-pbf-column.gdlr-core-column-10 ~ .gdlr-core-pbf-column.gdlr-core-column-10) > .gdlr-core-pbf-column.gdlr-core-column-10{ width: 50%; }
	.gdlr-core-pbf-column.gdlr-core-column-15{ width: 50%; }
	:has(> .gdlr-core-pbf-column.gdlr-core-column-45) > .gdlr-core-pbf-column:is(.gdlr-core-column-45, .gdlr-core-column-15){ width: 100%; }
	/* คู่ 2/3 + 1/3 (เช่น News & Updates + Quick Links หน้าแรก) ซ้อนกันเต็มแถว คอลัมน์ 1/3 กว้างแค่ 256px */
	:has(> .gdlr-core-pbf-column.gdlr-core-column-40) > .gdlr-core-pbf-column:is(.gdlr-core-column-40, .gdlr-core-column-20){ width: 100%; }
	/* sidebar ที่ย้ายลงล่างแล้วกว้างเต็ม คอลัมน์ข้างในกลับไปแบ่งตามปกติ */

	/* กล่องเมนูไอคอนซ้าย (หน้าแรก ฯลฯ) ตั้ง padding ซ้าย 66px ไว้ใน page builder */
	.gdlr-core-pbf-column:has(.gdlr-core-column-service-icon-left) > .gdlr-core-pbf-column-content-margin{ padding-left: 0 !important; }

	/* รายชื่อบุคลากรแบบรูปซ้ายในคอลัมน์ครึ่งจอ: เอารูปไว้บนข้อความ ให้อีเมลมีที่พอ */
	:is(.gdlr-core-column-15, .gdlr-core-column-20, .gdlr-core-column-30) .gdlr-core-personnel-list .gdlr-core-personnel-list-image{ float: none; margin-right: 0; margin-bottom: 20px; }

	/* กล่องที่ตั้ง margin ซ้ายขวาไว้ใน page builder และมีคอลัมน์ย่อยข้างใน (รายชื่อนักวิจัยหน้ากลุ่มวิจัย) */
	.gdlr-core-pbf-element > :is([style*="margin-left"], [style*="margin: "]):has(.gdlr-core-row-shortcode){ margin-left: 0 !important; margin-right: 0 !important; }
}

/* F3 ชื่อ/หัวข้อยาวในคอลัมน์แคบที่ 768-1199px
   ชื่อบุคลากรตั้งขนาด 23px แบบ inline ใน page builder ("Janjira Aphirakmethawong" ล้นกล่อง 213px)
   การ์ดข่าวแบบ modern มี padding ซ้ายขวา 60/45px เหลือที่ให้หัวข้อ 73px ที่ 1024 */
@media only screen and (min-width: 768px) and (max-width: 1199px){
	:is(.gdlr-core-column-10, .gdlr-core-column-12, .gdlr-core-column-15, .gdlr-core-column-20) .gdlr-core-personnel-list-title{ font-size: 16px !important; }
	:is(.gdlr-core-column-10, .gdlr-core-column-12, .gdlr-core-column-15, .gdlr-core-column-20) .gdlr-core-feature-box-item-title{ font-size: 15px !important; }
	:is(.gdlr-core-column-15, .gdlr-core-column-20) .gdlr-core-image-content-text p{ font-size: 14px; }
	/* หัวข้อ page builder ที่ตั้งตัวใหญ่แบบ inline ในคอลัมน์แคบ ("Organisational" 65px ในคอลัมน์ 290px, "Accommodation" 29px ในคอลัมน์ 242px) */
	:is(.gdlr-core-column-10, .gdlr-core-column-12, .gdlr-core-column-15, .gdlr-core-column-20) .gdlr-core-title-item-title:is([style*="font-size: 25"], [style*="font-size: 26"], [style*="font-size: 27"], [style*="font-size: 28"], [style*="font-size: 29"], [style*="font-size: 3"], [style*="font-size: 4"], [style*="font-size: 5"], [style*="font-size: 6"], [style*="font-size: 7"], [style*="font-size: 8"], [style*="font-size: 9"]){ font-size: 24px !important; }
	:is(.gdlr-core-column-24, .gdlr-core-column-30) .gdlr-core-title-item-title:is([style*="font-size: 4"], [style*="font-size: 5"], [style*="font-size: 6"], [style*="font-size: 7"], [style*="font-size: 8"], [style*="font-size: 9"]){ font-size: 32px !important; }
	/* กล่องเมนูไอคอนซ้ายในคอลัมน์ 1/3 ("EVENING/WEEKEND PROGRAMMES") ย้ายไอคอนไปไว้บนข้อความ */
	.gdlr-core-column-20 :is(.gdlr-core-column-service-icon-left, .gdlr-core-column-service-icon-left-title) .gdlr-core-column-service-media{ float: none; margin-right: 0; margin-bottom: 15px; }
	:is(.gdlr-core-column-10, .gdlr-core-column-12, .gdlr-core-column-15, .gdlr-core-column-20) .gdlr-core-blog-modern-content{ padding-left: 20px !important; padding-right: 20px !important; }
	/* คอลัมน์แคบที่ตั้ง margin ซ้ายขวาไว้ใน page builder (เช่น 50px ในคอลัมน์รายชื่อนักวิจัย เหลือที่ให้ชื่อ 106px) */
	.gdlr-core-pbf-column:is(.gdlr-core-column-10, .gdlr-core-column-12, .gdlr-core-column-15, .gdlr-core-column-20) > .gdlr-core-pbf-column-content-margin:is([style*="margin-left"], [style*="margin: "]){ margin-left: 0 !important; margin-right: 0 !important; }
	/* คำภาษาอังกฤษยาว ("COMMERCIALISATION", "Telecommunication", นามสกุล) ในคอลัมน์แคบ: ตัดตามพยางค์พร้อมขีด แทนการตัดกลางคำ (html lang="en-US") */
	:is(.gdlr-core-column-10, .gdlr-core-column-12, .gdlr-core-column-15, .gdlr-core-column-20) :is(h1, h2, h3, h4, h5, h6, p, .gdlr-core-personnel-list-position){ -webkit-hyphens: auto; hyphens: auto; }
	:is(.gdlr-core-column-10, .gdlr-core-column-12, .gdlr-core-column-15, .gdlr-core-column-20) .kingster-personnel-info-list.kingster-type-email{ font-size: 14px; }
}
@media only screen and (min-width: 1000px) and (max-width: 1199px){
	.gdlr-core-column-10 .gdlr-core-counter-item-bottom-text{ font-size: 14px; }
	.gdlr-core-pbf-column:has(.gdlr-core-column-service-icon-left) > .gdlr-core-pbf-column-content-margin{ padding-left: 0 !important; }
}

/* F4 มือถือ <= 767px (ตารางรวมแท็บเล็ต <= 999px) */
@media only screen and (max-width: 999px){
	/* ตารางหลายคอลัมน์: เลื่อนซ้ายขวาแทนการบีบคอลัมน์ */
	.gdlr-core-text-box-item-content table,
	.kingster-single-article-content table{ display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.gdlr-core-text-box-item-content table :is(th, td),
	.kingster-single-article-content table :is(th, td){ min-width: 110px; }
}
@media only screen and (max-width: 767px){
	/* กล่องที่ตั้ง margin ซ้ายขวา (เช่น 120px, ทั้งแบบ margin-left และ margin: 0 120px) ใน page builder บนมือถือเหลือที่ให้ข้อความ 16-50px */
	.gdlr-core-pbf-element > :is([style*="margin-left"], [style*="margin: "]){ margin-left: 0 !important; margin-right: 0 !important; }
	/* หัวข้อใหญ่ที่มีคำยาวกว่าความกว้างจอ: หัวข้อ page builder ตั้ง 30-59px แบบ inline (เช่น "EVENING/WEEKEND" 32px ตัวพิมพ์ใหญ่) */
	:is(.gdlr-core-page-builder-body, .kingster-page-title-wrap) :is(h1, h2, h3, h4){ -webkit-hyphens: auto; hyphens: auto; }
	.gdlr-core-title-item-title:is([style*="font-size: 3"], [style*="font-size: 4"], [style*="font-size: 5"]){ font-size: 24px !important; }
	/* หัวข้อหน้าตั้ง 30-59px แบบ inline ยาวเกินจอ (เฉพาะที่ตั้งขนาดไว้ หัวข้อแบบซ่อนของธีมไม่ต้องขยาย) (26px ให้ "Telecommunication" พอดี 290px) */
	.kingster-page-title-wrap .kingster-page-title:is([style*="font-size: 3"], [style*="font-size: 4"], [style*="font-size: 5"]){ font-size: 26px !important; }
	.kingster-single-article-title{ font-size: 24px !important; }
}

/* F5 รูปพื้นหลังที่ตั้ง contain (14 หน้า) หรือ repeat (4 หน้า ทุกรูปเป็นภาพถ่าย) ใน page builder แสดงซ้ำเป็นแถบ -> cover */
.gdlr-core-pbf-background[style*="background-size: contain"],
.gdlr-core-pbf-background[style*="background-repeat: repeat"]{ background-size: cover !important; }

/* ---------------------------------------------------------------------------
   2026-10-15 Responsive ระยะ 2 (RESPONSIVE-PLAN.md) แยกบล็อกตามข้อ ลบทีละบล็อกได้
   --------------------------------------------------------------------------- */

/* R4 หน้าแรก "Quick Links for Students": หัวข้อส้ม #f26522 บนคอลัมน์เทา #6d6e70 (+รูป 25%) contrast ~1.6:1
   ลิงก์ #e2e2e2 ~3.9:1 -> หัวข้อและลิงก์สีขาว + เงาบาง (ตรวจแล้วมีที่หน้าแรกหน้าเดียว) */
.gdlr-core-pbf-column:has(> .gdlr-core-pbf-column-content-margin > .gdlr-core-pbf-background-wrap[style*="#6d6e70"]) .gdlr-core-title-item-title[style*="#f26522"]{ color: #fff !important; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.gdlr-core-pbf-column:has(> .gdlr-core-pbf-column-content-margin > .gdlr-core-pbf-background-wrap[style*="#6d6e70"]):has(.gdlr-core-title-item-title[style*="#f26522"]) .gdlr-core-pbf-column-content a{ color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }

/* R6 หัวข่าวสีขาวบนรูปพื้นหลังสว่าง: ใช้ชั้น overlay ที่ธีมมีอยู่แล้ว (ตั้ง opacity 0 ไว้) เป็นไล่เฉดเข้มลงล่าง */
.kingster-blog-title-wrap .kingster-blog-title-overlay{ opacity: 1 !important; background: linear-gradient(to bottom, rgba(0, 0, 0, .25), rgba(0, 0, 0, .6)) !important; }

/* R7 หน้าที่หัวข้อหน้า (page title) ตั้งให้มองไม่เห็น (ตัวขาว ไม่มีรูปพื้นหลัง padding 0 เช่น หน้ารายชื่อคณาจารย์)
   บนมือถือธีมบังคับ padding 60/50px เหลือเป็นที่ว่าง ~128px -> คืน padding 0 เหมือนจอใหญ่ */
@media only screen and (max-width: 767px){
	.kingster-page-title-wrap.kingster-style-custom:not([style*="background-image"]) .kingster-page-title-content{ padding-top: 0 !important; padding-bottom: 0 !important; }
}

/* F6 (ใหม่) แถบสีว่างใต้ News หน้าแรก: ซ่อนเฉพาะคอลัมน์ที่ไม่มีเนื้อหา มีสีพื้น และไม่มีรูปพื้นหลัง
   (ตรวจแล้ว: หน้าอื่นที่มีคอลัมน์แบบนี้สูง 0px อยู่แล้ว F6 เดิมซ่อนรูปคณบดีเพราะไม่ได้กันคอลัมน์ที่มีรูป) */
@media only screen and (max-width: 999px){
	.gdlr-core-pbf-column:has(> .gdlr-core-pbf-column-content-margin > .gdlr-core-pbf-column-content:empty):has(> .gdlr-core-pbf-column-content-margin > .gdlr-core-pbf-background-wrap[style*="background-color"]):not(:has(.gdlr-core-pbf-background)){ display: none; }
}

/* ---------------------------------------------------------------------------
   2026-10-16 หน้า Schools (page-id-7375) กล่อง 17 สาขา: ระยะห่างและความสูงไม่เท่ากัน
   ต้นเหตุ: ตั้งค่าแต่ละคอลัมน์ใน page builder ไม่เหมือนกัน (บางคอลัมน์ padding ล่าง 50px, margin -3/-7px,
   padding ในกล่อง 5/20/30/35px) -> ใช้ค่าเดียวกันทุกกล่อง + ความสูงขั้นต่ำเท่ากัน (เท่ากล่องที่สูงสุดในแต่ละช่วงจอ) จัดข้อความกลางแนวตั้ง
   --------------------------------------------------------------------------- */
.page-id-7375 .gdlr-core-pbf-column:has(> .gdlr-core-pbf-column-content-margin .gdlr-core-feature-box) > .gdlr-core-pbf-column-content-margin{ margin-left: 0 !important; margin-right: 0 !important; padding-bottom: 0 !important; }
.page-id-7375 .gdlr-core-feature-box{ padding-left: 20px !important; padding-right: 20px !important; display: flex; flex-direction: column; justify-content: center; min-height: 130px; }
@media only screen and (min-width: 1200px) and (max-width: 1299px){ .page-id-7375 .gdlr-core-feature-box{ min-height: 156px; } }
@media only screen and (min-width: 768px) and (max-width: 1199px){ .page-id-7375 .gdlr-core-feature-box{ min-height: 152px; } }
@media only screen and (max-width: 767px){ .page-id-7375 .gdlr-core-feature-box{ min-height: 111px; } }
