/* ==========================================================================
   tt-contrast.css — ตัวอักษรสีเข้ม อ่านง่ายทั้งระบบ (v1)
   - โหลดเป็นไฟล์สุดท้ายของหน้า เพื่อให้มีผลเหนือสีตัวอักษรอ่อนเดิม
   - ปรับเฉพาะ "สีตัวอักษรรอง" (ป้ายกำกับ / คำอธิบาย / ตัวเลขย่อย / คำอธิบายสัญลักษณ์)
     ไม่เปลี่ยนโครงสร้าง ขนาด หรือสีพื้นหลังของส่วนใด
   - ส่วนที่เป็นพื้นเข้ม (แถบเมนูซ้าย / ส่วนท้าย OPAC / ปุ่มสี) ไม่ได้รับผล
   ========================================================================== */

/* ---------- 1) ตัวแปรสีตัวอักษรรอง → เข้มขึ้น ---------- */
html:root,
html:root body {
    --u-ink: #101828 !important;
    --u-ink-2: #1d2939 !important;
    --u-muted: #344054 !important;
    --tt-ink-2: color-mix(in srgb, var(--tt-s, #c2410c) 8%, #1d2939) !important;
    --tt-muted: color-mix(in srgb, var(--tt-s, #c2410c) 6%, #344054) !important;
}
/* หน้า OPAC */
html body.opx:not(#_ct1) {
    --a-ink2: #1d2939 !important;
    --a-muted: #344054 !important;
}
/* หน้าสมาชิก */
html:root:not(#_ct1) {
    --ink2: #2b2622;
    --muted: #4a4038;
}
/* หน้ารายงาน / สำรวจทรัพยากร / ตรวจสอบระบบ (ตัวแปรสีประจำหน้า) */
html body .rp:not(#_ct1) { --mute: #3d4252 !important; --ink-soft: #3b2a1e !important; }
html body .inventory-page:not(#_ct1) { --inventory-muted: #3d3e52 !important; }
html body .hc:not(#_ct1) { --hc-mute: #4a3424 !important; }

/* ---------- 2) ป้ายกำกับ + ตัวเลขย่อยของการ์ดสถิติ (ภาพ 3 / 5) ---------- */
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) :is(
    .tt-stat-label, .mbr-type .l, .borrow-list-count .label, .bc-stat span, .resv-stat-label,
    .res-summary-label, .inventory-stat-label, .al-stat-label, .rp-stat span, .rp-stat-label, .hc-stat span
) {
    color: #1d2939 !important;
    -webkit-text-fill-color: currentColor !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) :is(
    .tt-stat-sub, .al-stat-unit, .tt-stat-value small, .inventory-stat-sub, .resv-stat-sub
) {
    color: #344054 !important;
    -webkit-text-fill-color: currentColor !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) :is(
    .tt-stat-value, .inventory-stat-value, .resv-stat-value, .al-stat-number, .res-summary-value
) {
    color: #101828 !important;
    -webkit-text-fill-color: currentColor !important;
}

/* ---------- 3) คำอธิบายสัญลักษณ์ / สถานะ (ภาพ 4) ---------- */
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) .sv-legend,
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) .sv-legend span:not(.hint) {
    color: #1d2939 !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) .sv-legend i:not(.bi) {
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .22), 0 1px 0 rgba(16, 24, 40, .18) !important;
}

/* ---------- 4) คำอธิบายใต้หัวข้อ / คำแนะนำ / ข้อความรองทั่วไป (พื้นขาว) ---------- */
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) .main-content-full :is(
    .tt-page-head p, .tt-card-head p, .tt-card-sub, .tt-sub, .page-subtitle, .card-subtitle,
    .text-muted, .text-secondary, .form-text, .hint, .help-text, .settings-help, .settings-toggle-desc,
    .sv-daytitle, .sv-empty p, .tt-empty p, .borrow-muted, .inventory-muted, .al-muted, .resv-muted,
    .rp-sub, .rp-head p, .rp-desc, .rp-note
) {
    color: #475467 !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: 1 !important;
}
/* หัวตารางในการ์ดขาว */
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) .main-content-full :is(.tt-table, .table, .sv-tl-head) th {
    color: #1d2939;
}
/* ป้ายชื่อช่องกรอกข้อมูล */
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) .main-content-full :is(label.fl, .settings-label, .form-label, .tt-label, .rp-filter label, .filter-label) {
    color: #1d2939 !important;
    opacity: 1 !important;
}
/* แถบหัวด้านบน: บทบาทผู้ใช้ */
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) :is(.global-user-copy small, .opx-umenu .opx-u-copy small, .global-brand small) {
    color: #344054 !important;
}

/* ---------- 5) หน้าสมาชิก ---------- */
html body:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) :is(.mp-vh p, .mp-card-h p, .mp-stat .l, .mp-flabel, .mp-count, .mp-bk small, .mp-me small, .mp-empty span, .mp-tbl td[data-label]::before) {
    color: #3f3731 !important;
    opacity: 1 !important;
}

/* ---------- 6) หน้า OPAC (ส่วนพื้นขาว) ---------- */
html body.opx:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) :is(.opx-title p, .opx-book p, .opx-copies, .opx-brand-text span, .opx-rainbow) {
    color: #344054 !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: 1 !important;
}
html body.opx:not(#_ct1):not(#_ct2):not(#_ct3):not(#_ct4):not(#_ct5):not(#_ct6):not(#_ct7):not(#_ct8) .opx-q input::placeholder { color: #667085 !important; }
