/* ฟอนต์กลางของทั้งระบบ — ประกาศที่นี่ที่เดียว ทุก layout ลิงก์มาที่ไฟล์นี้ */

/* ชุดฟอนต์เดียวกับ research.uru.ac.th (Sarabun + IBM Plex Sans Thai)
   โหลดแค่น้ำหนักถึง 700 — ยกเว้นโลโก้ URU REC ใช้ Arial Black แยก */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=IBM+Plex+Sans+Thai:wght@300;400;500;600;700&display=swap');

/* ตัวสำรองเผื่อโหลดฟอนต์ไม่ขึ้น เรียงตาม research.uru.ac.th */
:root {
    --font-sans: 'Sarabun', 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
}

/* ฟอนต์หลัก Sarabun ทั้งระบบ — ใช้ !important กัน Tailwind CDN preflight ทับ */
html,
body {
    font-family: var(--font-sans) !important;
}

.font-sans,
.font-heading {
    font-family: var(--font-sans) !important;
}

/* โลโก้ URU REC — 3D เรียบ (extrude ชั้นเดียว + ไล่สี) */
.font-logo,
.font-logo span,
.site-logo-text,
.site-logo-text span {
    font-family: 'Arial Black', 'Arial Bold', Impact, sans-serif !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em !important;
    font-style: normal !important;
}

.site-logo-text {
    display: inline-flex;
    align-items: baseline;
    gap: 0.22rem;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.site-logo-text .logo-uru,
.site-logo-text .logo-rec {
    position: relative;
    display: inline-block;
    z-index: 0;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

/* ชั้นความลึก — offset เล็ก ไม่ทับบรรทัดล่าง */
.site-logo-text .logo-uru::before,
.site-logo-text .logo-rec::before {
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    -webkit-text-fill-color: currentColor;
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    transform: translate(2px, 2px);
    pointer-events: none;
    filter: none;
}

.site-logo-text .logo-uru::before {
    content: 'URU';
    color: #1e4229;
}

.site-logo-text .logo-rec::before {
    content: 'REC';
    color: #6a5212;
}

.site-logo-text .logo-uru {
    background-image: linear-gradient(180deg, #6ecf88 0%, #458a58 38%, #325a39 72%, #2a4d32 100%) !important;
}

.site-logo-text .logo-rec {
    background-image: linear-gradient(180deg, #f2cc58 0%, #d9b03a 38%, #c99c35 72%, #b08828 100%) !important;
}

.site-logo-sub {
    margin-top: 0.35rem;
    color: #64748b !important;
    text-shadow: none !important;
    filter: none !important;
}

/* บังคับฟอนต์ Sarabun ทั้งระบบ — ทุก element ใช้ฟอนต์เดียวกัน ยกเว้น .font-logo */
html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
span,
div,
li,
td,
th,
button,
input,
select,
textarea,
label,
legend,
fieldset {
    font-family: var(--font-sans) !important;
    font-weight: 400;
}

/* ลบตัวหนาเทอะทะออกทั้งหมด และปรับให้เป็นทรงเพรียวผอม เรียบหรู มาตรฐานเดียวสไตล์ research.uru.ac.th */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 500 !important;
}

.font-black,
.font-extrabold,
.font-bold,
.font-semibold,
.font-medium,
[class*="font-black"],
[class*="font-extrabold"],
[class*="font-bold"],
[class*="font-semibold"],
b,
strong,
th {
    font-weight: 500 !important;
}

.font-normal,
.font-light,
.font-thin,
[class*="font-normal"],
[class*="font-light"] {
    font-weight: 400 !important;
}

/* ปิดการปั๊มตัวหนาปลอม (Synthetic Bold) เพื่อให้ฟอนต์เนียนเรียบสม่ำเสมอทั้งเว็บ */
html {
    font-synthesis: none;
    font-synthesis-weight: none;
    font-synthesis-style: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* มาตรฐานตัวอักษรแบบเมนู sidebar — Sarabun ตรง กลาง ไม่เอียง ไม่เว้นตัวพิเศษ */
body,
h1, h2, h3, h4, h5, h6,
p, a, span, div, li, td, th,
button, input, select, textarea, label, legend, fieldset {
    font-style: normal !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.uppercase {
    text-transform: none !important;
    letter-spacing: normal !important;
}

.tracking-wide,
.tracking-wider,
.tracking-tight,
.tracking-tighter,
.tracking-wideest {
    letter-spacing: normal !important;
}

/* ไอคอน Phosphor ต้องใช้ฟอนต์ของตัวเอง */
i[class*="ph"],
[class^="ph-"],
[class*=" ph-"] {
    font-family: "Phosphor" !important;
    font-style: normal !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}



/* ============================================================ */

/* --- 1. ป้องกันข้อความล้นกรอบ/คำตก เมื่อขยายฟอนต์ --- */
body {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ตาราง: อนุญาตให้ข้อความตัดบรรทัดได้ ไม่ล้นออกข้าง */
table {
    table-layout: auto;
    word-break: break-word;
}

table td,
table th {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ปุ่มและ badge: อนุญาตให้ข้อความตัดบรรทัดได้เมื่อจำเป็น */
button,
a,
span {
    overflow-wrap: break-word;
}

/* flex/grid item ไม่ให้ล้นออกนอก container */
.flex>*,
.grid>* {
    min-width: 0;
}

/* ยกเว้น header navigation จากการขยายฟอนต์ */
.site-header nav,
.site-header nav * {
    font-size: inherit !important;
}





/* --- 2–4. ขยายขนาดตัวอักษร — ขั้นต่ำ 15px ทุกจอ --- */
.text-\[6px\],
.text-\[7px\],
.text-\[8px\],
.text-\[8\.5px\],
.text-\[9px\],
.text-\[9\.5px\],
.text-\[10px\],
.text-\[10\.5px\],
.text-\[11px\],
.text-xs {
    font-size: 15px !important;
}

.text-\[12px\] {
    font-size: 16px !important;
}

.text-\[13px\] {
    font-size: 17px !important;
}

.text-\[13\.5px\] {
    font-size: 17px !important;
}

.text-\[14px\] {
    font-size: 18px !important;
}

.text-\[15px\] {
    font-size: 19px !important;
}

.text-\[16px\] {
    font-size: 20px !important;
}

.text-sm {
    font-size: 16px !important;
}

.text-base {
    font-size: 18px !important;
}

.text-lg {
    font-size: 20px !important;
}

.text-xl {
    font-size: 22px !important;
}

.text-2xl {
    font-size: 26px !important;
}

.text-3xl {
    font-size: 32px !important;
}

.text-4xl {
    font-size: 38px !important;
}

/* ฐานตัวอักษรระบบ portal — ขั้นต่ำ 15px */
body.font-sans {
    font-size: 15px;
}

/* กัน element ที่ไม่ได้ใส่ class ขนาด แต่ inherit เล็กเกิน */
body.font-sans main,
body.font-sans table,
body.font-sans aside nav {
    font-size: 15px;
}

/* --- Home Page Custom Styles --- */
.hero-gradient {
    background: radial-gradient(circle at top right, rgba(27, 77, 62, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(201, 162, 39, 0.05), transparent);
}
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f1f1f1; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #1B4D3E; border-radius: 10px; }

.home-page {
    font-size: 21px;
    color: #24352f;
    background: #f2f2f6;
}
.home-page p {
    line-height: 1.65;
}
.home-page .content-card {
    border-radius: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, #ececf1 55%, #dfe0e7 100%) !important;
    border: 1px solid #c4c5cc !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.98),
        inset 0 -1px 2px rgba(0, 0, 0, 0.06),
        0 4px 14px rgba(0, 0, 0, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.06) !important;
}

.svc-diamonds-frame {
    position: relative;
    width: 518px;
    height: 518px;
}
.svc-diamonds {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    grid-template-columns: repeat(2, 176px);
    grid-auto-rows: 176px;
    gap: 14px;
    transform: translate(-50%, -50%) rotate(45deg);
}
.svc-diamond {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, #ececf1 55%, #dfe0e7 100%);
    color: #1B4D3E;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.98),
        inset 0 -1px 2px rgba(0, 0, 0, 0.07),
        0 6px 16px rgba(0, 0, 0, 0.1),
        0 14px 34px rgba(0, 0, 0, 0.06);
    transition: transform .35s cubic-bezier(.165, .84, .44, 1), box-shadow .35s ease, border-color .35s ease, background-color .35s ease;
}
.svc-diamond:hover {
    z-index: 5;
    border-color: #C9A227;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f5f0e0 55%, #ececf1 100%);
    transform: scale(1.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 2px rgba(0, 0, 0, 0.05),
        0 10px 22px rgba(0, 0, 0, 0.12),
        0 20px 40px rgba(0, 0, 0, 0.08);
}
.svc-diamond__in {
    display: flex;
    width: 160px;
    height: 88px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotate(-45deg);
    text-align: center;
}
.svc-band {
    background: linear-gradient(100deg, #0D2F25 0%, #1B4D3E 45%, #2e7f69 100%);
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
}
.svc-band h2,
.svc-band p {
    color: #ffffff !important;
}