/* ธีมมืดของแบนเนอร์คุกกี้กลาง (web-consent.psu.ac.th) — ไลบรารีมีแต่สีสว่างและฉีด <style> ของตัวเองลง <head>
   ตอนเริ่มทำงาน (หลังไฟล์นี้) จึงต้องนำหน้าด้วย :root[data-theme="dark"] ให้ specificity ชนะ
   เกาะ data-theme ไม่ใช่ prefers-color-scheme เพราะธีมมาจากคุกกี้ EESTheme (ดู theme.css) */
:root[data-theme="dark"] {
    --psu-consent-gray-100: #2A313B;
    --psu-consent-gray-200: #363F4C;
    --psu-consent-gray-300: #4A5463;
    --psu-consent-gray-400: #8A95A5;
    --psu-consent-gray-500: #9AA5B4;
    --psu-consent-gray-600: #B3BDCB;
    --psu-consent-gray-800: #E5E9F0;
}

:root[data-theme="dark"] .psu-consent-banner,
:root[data-theme="dark"] .psu-consent-edit-button,
:root[data-theme="dark"] #psu-consent-modal-content {
    background-color: #1E242C;
    color: #E5E9F0;
}

:root[data-theme="dark"] .psu-consent-banner {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .psu-consent-banner p {
    color: #E5E9F0;
}

:root[data-theme="dark"] .psu-consent-accept-all:hover {
    background-color: transparent;
}

:root[data-theme="dark"] #psu-consent-modal-footer {
    background-color: #181D23;
}

:root[data-theme="dark"] #psu-consent-modal-body table,
:root[data-theme="dark"] #psu-consent-modal-body th,
:root[data-theme="dark"] #psu-consent-modal-body td {
    border-color: var(--psu-consent-gray-300);
}

/* ทั้งสองธีม: ไลบรารีไม่กำหนดขนาดตัวอักษรของหัวข้อหมวด (h3) จึงได้ขนาดหัวเรื่องของเว็บซึ่งใหญ่เกิน
   และตรึงความสูงตัวกล่องไว้ 80vh ทั้งที่เหลือแค่ 2 หมวด (ปิดหมวดวิเคราะห์/การตลาดไว้) กล่องจึงโล่งครึ่งจอ */
#psu-consent-modal .psu-consent-category-title {
    font-size: 1rem;
    line-height: 1.5;
}

#psu-consent-modal #psu-consent-modal-body {
    height: auto;
}

/* ปุ่มแก้ไขความยินยอมมุมขวาล่าง: ไลบรารีให้ 60px (ไอคอน 36px) ใหญ่จนบังเนื้อหามุมจอ ย่อลงราว 80%
   นำหน้า :root ให้ชนะ <style> ที่ไลบรารีฉีดทีหลัง */
:root .psu-consent-edit-button {
    width: 48px;
    height: 48px;
    transition: box-shadow 0.15s ease, scale 0.15s ease;
}

/* ไลบรารีไม่มีสถานะ hover/กด: ยกเงาขึ้นตอนชี้ ยุบลงตอนกด ใช้ scale ไม่ใช่ transform เพื่อไม่ทับ translateX ของตำแหน่งกลางจอ (วงโฟกัสคีย์บอร์ดมาจาก [tabindex]:focus-visible ใน theme.css) */
:root .psu-consent-edit-button:hover {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

:root .psu-consent-edit-button:active {
    scale: 0.94;
}

@media (prefers-reduced-motion: reduce) {
    :root .psu-consent-edit-button {
        transition: none;
    }

    :root .psu-consent-edit-button:active {
        scale: none;
    }
}

:root .psu-consent-edit-button-icon {
    width: 28px;
    height: 28px;
}
