/* ──────────────────────────────────────────────────────────────────────────
   contact.php — ติดต่อโรงเรียน (หน้าสาธารณะ)

   รูปทรง: แผ่นติดต่อราชการของโรงเรียน กระดาษแผ่นเดียวมีสันน้ำเงินซ้าย 12px
       ชุดเดียวกับหน้าข่าวและหน้าแรก หัวกระดาษบอกสถานะเปิดปิดตอนนี้
       ถัดมาเป็นช่องทางติดต่อสามช่องคู่กับเวลาทำการ ที่อยู่คู่กับแผนที่
       รายการ "ติดต่อเรื่องใด" และคำถามที่พบบ่อยที่เปิดให้เห็นทั้งหมด

   สี: alias ของ --tb1-* เท่านั้น
   ความเฉพาะของเว็บ: ธีมบังคับ font-family บน p/span/div/li/a ตัวเซริฟจึงอยู่ที่ h1–h3, b
       และคลาส tb1-font-display กฎสีของ <a> มีคลาสสองชั้นเพื่อชนะ tb1-display-scale.css
   ────────────────────────────────────────────────────────────────────────── */

.ct {
    --ct-paper: var(--tb1-surface, #ffffff);
    --ct-paper-alt: var(--tb1-surface-alt, #f1f5f9);
    --ct-ink: var(--tb1-ink-1, #0f172a);
    --ct-ink-2: var(--tb1-ink-2, #334155);
    --ct-muted: var(--tb1-ink-3, #5a697f);
    --ct-line: var(--tb1-border, #e2e8f0);
    --ct-line-bold: var(--tb1-border-bold, #cbd5e1);
    --ct-brand: var(--tb1-brand, #1d4ed8);
    --ct-wash: var(--tb1-brand-50, #eff6ff);
    --ct-wash-2: var(--tb1-brand-100, #dbeafe);
    --ct-navy: var(--tb1-banner-1, #1d4ed8);
    --ct-spine: var(--tb1-brand-strong, #1e3a8a);
    --ct-gold: var(--tb1-warning-soft, #fbbf24);
    --ct-ok: var(--tb1-text-success, #047857);
    --ct-ok-mark: var(--tb1-success, #10b981);
    --ct-serif: var(--tb1-font-display, "Noto Serif Thai", serif);
    --ct-sans: var(--tb1-font-body, "Sarabun", system-ui, sans-serif);
    --ct-lift: 0 12px 30px -22px rgba(15, 23, 42, .5);
    --ct-lift-hi: 0 20px 40px -24px rgba(15, 23, 42, .55);
    --ct-edge: inset 0 1px 0 rgba(255, 255, 255, .6);

    color: var(--ct-ink);
    font-family: var(--ct-sans);
    font-size: 1rem;
    line-height: 1.65;
}

:is(html.dark, html.dark-mode, html[data-theme="dark"],
    body.dark-mode, body[data-theme="dark"]) .ct {
    --ct-spine: var(--tb1-banner-4, #2563eb);
    /* banner-1 เกือบดำในโหมดมืด ปุ่มและวงไอคอนจะจมหายไปกับพื้น ใช้น้ำเงินสดแทน (ขาวบน #2563eb = 5.2:1) */
    --ct-navy: var(--tb1-banner-4, #2563eb);
    --ct-lift: 0 16px 36px -24px rgba(0, 0, 0, .9);
    --ct-lift-hi: 0 22px 44px -24px rgba(0, 0, 0, .95);
    --ct-edge: inset 0 1px 0 rgba(255, 255, 255, .055);
}

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

.ct :where(h1, h2, h3, p, ol, ul, dl, dd, address) {
    margin: 0;
}

.ct :where(ol, ul) {
    list-style: none;
    padding: 0;
}

.ct address {
    font-style: normal;
}

.ct [hidden] {
    display: none !important;
}

.ct .ct-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.ct :focus-visible {
    outline: 3px solid var(--ct-brand);
    outline-offset: 2px;
}

.ct .ct-link {
    color: var(--ct-brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.ct .ct-link:hover {
    text-decoration-thickness: 2px;
}

/* ── เปลือกหน้า ─────────────────────────────────────────────────────────── */
body.ct-page {
    margin: 0;
    background: var(--tb1-page, #f8fafc);
    color: var(--tb1-ink-1, #0f172a);
}

html:has(body.ct-page) {
    scroll-padding-top: 4.5rem;
}

.ct-shell {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: var(--tb1-page-max-width, 1440px);
    margin-inline: auto;
    padding: 1.5rem var(--tb1-shell-gutter, 20px) 3rem;
}

.ct-shell:focus {
    outline: none;
}

body.ct-page a.ct-skip {
    position: absolute;
    top: 8px;
    left: -9999px;
    z-index: 2000;
    padding: 10px 16px;
    color: #ffffff;
    background: var(--tb1-banner-1, #1d4ed8);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}

body.ct-page a.ct-skip:focus {
    left: 12px;
    outline: 3px solid var(--tb1-brand-300, #93c5fd);
    outline-offset: 2px;
}

/* ── กระดาษ ─────────────────────────────────────────────────────────────── */
.ct-paper {
    padding: 1.4rem 1.75rem 2.25rem;
    background: var(--ct-paper);
    border: 1px solid var(--ct-line);
    border-left: 12px solid var(--ct-spine);
    border-radius: 14px;
    box-shadow: var(--ct-lift), var(--ct-edge);
}

/* ── หัวกระดาษ ─────────────────────────────────────────────────────────── */
.ct-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    font-size: .88rem;
    color: var(--ct-muted);
}

.ct-crumbs li + li::before {
    content: "";
    display: inline-block;
    width: 1px;
    height: .8em;
    margin: 0 .7rem;
    vertical-align: -.05em;
    background: var(--ct-line-bold);
    transform: skewX(-18deg);
}

.ct .ct-crumbs a {
    display: inline-block;
    min-height: 24px;
    padding-block: .1rem;
}

.ct-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: .35rem 0 1.4rem;
    border-bottom: 1px solid var(--ct-line);
}

.ct-head-text {
    min-width: 0;
}

.ct-title {
    font-family: var(--ct-serif);
    font-size: clamp(1.8rem, 1.35rem + 1.8vw, 2.5rem);
    font-weight: 600;
    line-height: 1.3;
}

.ct-lead {
    margin-top: .3rem;
    color: var(--ct-ink-2);
}

/* สถานะตอนนี้: จุดสี คำ และกรอบ สามสัญญาณ ไม่อาศัยสีอย่างเดียว */
.ct-now {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.1rem .7rem .95rem;
    background: var(--ct-paper);
    border: 1px solid var(--ct-line-bold);
    border-radius: 12px;
}

.ct-now-dot {
    flex: none;
    width: .8rem;
    height: .8rem;
    border-radius: 50%;
    background: var(--ct-muted);
}

.ct-now.is-open {
    border-color: color-mix(in srgb, var(--ct-ok) 55%, var(--ct-line));
}

.ct-now.is-open .ct-now-dot {
    background: var(--ct-ok-mark);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ct-ok-mark) 22%, transparent);
}

.ct-now-text {
    display: flex;
    flex-direction: column;
    line-height: 1.45;
}

.ct-now-text b {
    font-family: var(--ct-serif);
    font-size: 1.1rem;
    font-weight: 600;
}

.ct-now.is-open .ct-now-text b {
    color: var(--ct-ok);
}

.ct-now-text span {
    font-size: .88rem;
    color: var(--ct-muted);
}

/* ── ช่องทางติดต่อ คู่กับเวลาทำการ ─────────────────────────────────────
   จอกว้าง: ช่องทางสามแถวซ้อนกันทางซ้าย สูงเท่าตารางเวลาทำการทางขวา */
.ct-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.ct-channels {
    display: grid;
    grid-auto-rows: 1fr;
    gap: 1rem;
}

.ct-channels > li {
    display: flex;
    min-width: 0;
}

.ct .ct-channel {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-content: center;
    column-gap: 1rem;
    flex: 1 1 auto;
    padding: 1.15rem 1.25rem 1.2rem;
    color: var(--ct-ink);
    background: var(--ct-paper);
    border: 1px solid var(--ct-line);
    border-radius: 14px;
    box-shadow: var(--ct-lift), var(--ct-edge);
    text-decoration: none;
    transition: translate .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.ct .ct-channel:hover {
    translate: 0 -2px;
    border-color: var(--ct-brand);
    box-shadow: var(--ct-lift-hi), var(--ct-edge);
}

.ct-channel-icon {
    grid-row: 1 / span 3;
    align-self: center;
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    color: #ffffff;
    background: var(--ct-navy);
    border-radius: 50%;
    font-size: 1.2rem;
}

/* ไอคอนเพจใช้สีของ Facebook ผู้ใช้จำได้ทันทีว่าเป็นช่องทางใด (ขาวบน #1877f2 = 4.2:1) */
.ct-channel-icon.is-fb {
    background: #1877f2;
}

.ct-channel-k {
    font-size: .86rem;
    color: var(--ct-muted);
}

.ct-channel-v {
    font-family: var(--ct-serif);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.ct .ct-channel:hover .ct-channel-v {
    color: var(--ct-brand);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.ct-channel-note {
    margin-top: .1rem;
    font-size: .86rem;
    color: var(--ct-ink-2);
}

/* ── กล่องพื้นเทา: เวลาทำการ และที่อยู่ ─────────────────────────────── */
.ct-block {
    min-width: 0;
    padding: 1.25rem 1.4rem 1.35rem;
    background: var(--ct-paper-alt);
    border: 1px solid var(--ct-line);
    border-radius: 14px;
}

.ct-block-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .8rem;
    font-family: var(--ct-serif);
    font-size: 1.12rem;
    font-weight: 600;
}

.ct-block-title i {
    color: var(--ct-brand);
    font-size: .95em;
}

.ct-addr {
    font-size: 1.08rem;
    line-height: 1.8;
    color: var(--ct-ink);
}

.ct-addr b {
    font-family: var(--ct-serif);
    font-weight: 600;
}

.ct-acts {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1rem;
}

/* ไม่มี JavaScript ปุ่มคัดลอกยังซ่อนอยู่ แถวปุ่มจึงไม่ควรกินที่ว่าง */
.ct-acts:not(:has(> :not([hidden]))) {
    display: none;
}

.ct .ct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.5rem;
    padding: 0 1.05rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: .93rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.ct .ct-btn:active {
    transform: translateY(1px);
}

.ct .ct-btn-brand {
    color: #ffffff;
    background: var(--ct-navy);
    border-color: var(--ct-navy);
}

.ct .ct-btn-brand:hover {
    box-shadow: 0 10px 22px -14px var(--ct-navy);
}

.ct .ct-btn-line {
    color: var(--ct-brand);
    background: var(--ct-paper);
    border-color: var(--ct-line-bold);
}

.ct .ct-btn-line:hover {
    border-color: var(--ct-brand);
    background: var(--ct-wash);
}

.ct .ct-btn.is-done {
    color: var(--ct-ok);
    border-color: currentColor;
}

/* ตารางเวลาทำการ: หนึ่งแถวต่อหนึ่งวัน วันนี้มีสันซ้ายและป้าย */
.ct-week {
    width: 100%;
    border-collapse: collapse;
}

.ct-week th,
.ct-week td {
    padding: .45rem .7rem;
    text-align: left;
    border-top: 1px solid var(--ct-line);
    font-variant-numeric: tabular-nums;
}

.ct-week tr:first-child th,
.ct-week tr:first-child td {
    border-top: 0;
}

.ct-week th {
    font-weight: 600;
    color: var(--ct-ink);
    white-space: nowrap;
}

.ct-week td {
    text-align: right;
    color: var(--ct-ink-2);
}

.ct-week tr.is-off td {
    color: var(--ct-muted);
}

.ct-week tr.is-today th,
.ct-week tr.is-today td {
    background: var(--ct-paper);
}

.ct-week tr.is-today th {
    box-shadow: inset 4px 0 0 var(--ct-brand);
}

.ct-week tr.is-today td {
    font-weight: 700;
    color: var(--ct-ink);
}

.ct-today-tag {
    display: inline-block;
    margin-left: .4rem;
    padding: 0 .55rem;
    font-size: .76rem;
    font-weight: 700;
    color: var(--ct-brand);
    border: 1px solid currentColor;
    border-radius: 999px;
    vertical-align: .08em;
}

.ct-note {
    margin-top: .9rem;
    font-size: .9rem;
    color: var(--ct-ink-2);
}

.ct-note b {
    display: block;
    color: var(--ct-ink);
}

.ct-holiday {
    display: block;
}

/* ── ส่วนถัดไปในกระดาษ ───────────────────────────────────────────────── */
.ct-sec {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--ct-line);
    scroll-margin-top: 4.5rem;
}

.ct-sec-head {
    margin-bottom: 1.2rem;
}

.ct-sec-title {
    font-family: var(--ct-serif);
    font-size: clamp(1.4rem, 1.15rem + .9vw, 1.8rem);
    font-weight: 600;
    line-height: 1.3;
}

/* ขีดทองเหนือหัวข้อ ชุดเดียวกับหน้าแรก */
.ct-sec-title::before {
    content: "";
    display: block;
    width: 2.75rem;
    height: 4px;
    margin-bottom: .55rem;
    border-radius: 4px;
    background: var(--ct-gold);
}

.ct-sec-head p {
    margin-top: .25rem;
    color: var(--ct-muted);
}

/* ติดต่อเรื่องใด: รายการมีเส้นแบ่ง ข้อความยาวอ่านง่ายกว่าการ์ด */
/* ติดต่อเรื่องใด: หนึ่งเรื่องต่อหนึ่งแถว จอกว้างหัวเรื่องอยู่ซ้าย คำอธิบายกับปุ่มอยู่ขวา
   อ่านไล่ลงมาแบบสารบัญ ไม่มีการ์ดเศษเหลือท้ายแถว */
.ct-routes {
    border-bottom: 1px solid var(--ct-line);
}

.ct-route {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1.1rem .5rem 1.1rem 0;
    border-top: 1px solid var(--ct-line);
    scroll-margin-top: 4.5rem;
}

.ct-route-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    color: var(--ct-brand);
    background: var(--ct-wash);
    border-radius: 50%;
}

@media (min-width: 1000px) {
    .ct-route-body {
        display: grid;
        grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
        column-gap: 2rem;
        align-items: start;
    }

    .ct-route-title {
        grid-row: 1 / span 2;
        padding-top: .45rem;
    }

    .ct .ct-route-how {
        margin-top: 0;
        max-width: 60rem;
    }
}

.ct-route-title {
    font-family: var(--ct-serif);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.45;
}

.ct-route-how {
    margin-top: .25rem;
    font-size: .95rem;
    color: var(--ct-ink-2);
}

.ct-route-links {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .65rem;
}

.ct .ct-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0 .85rem;
    color: var(--ct-brand);
    background: var(--ct-paper);
    border: 1px solid var(--ct-line-bold);
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .16s ease, background-color .16s ease;
}

.ct .ct-pill:hover {
    border-color: var(--ct-brand);
    background: var(--ct-wash);
}

/* :target — มาจากลิงก์ตรง เช่น contact.php#ct-password */
.ct-route:target {
    box-shadow: inset 4px 0 0 var(--ct-brand);
    padding-left: .9rem;
    background: var(--ct-wash);
    border-radius: 0 10px 10px 0;
}

/* ── แผนที่ ─────────────────────────────────────────────────────────── */
.ct-map-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
    gap: 1rem;
    align-items: stretch;
}

.ct-map {
    position: relative;
    min-height: 21rem;
    overflow: hidden;
    border: 1px solid var(--ct-line);
    border-radius: 14px;
    background-color: var(--ct-wash);
    background-image:
        linear-gradient(var(--ct-wash-2) 1px, transparent 1px),
        linear-gradient(90deg, var(--ct-wash-2) 1px, transparent 1px);
    background-size: 2.5rem 2.5rem;
}

.ct-map-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 100%;
    min-height: 21rem;
    padding: 1.5rem;
    text-align: center;
}

.ct-map-pin {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: .25rem;
    color: #ffffff;
    background: var(--ct-navy);
    border-radius: 50%;
    font-size: 1.45rem;
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--ct-navy) 18%, transparent);
}

.ct-map-name {
    font-family: var(--ct-serif);
    font-size: 1.15rem;
    font-weight: 600;
}

.ct-map-note {
    font-size: .88rem;
    color: var(--ct-ink-2);
}

.ct-map .ct-btn {
    margin-top: .5rem;
}

.ct-map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.ct-map-side {
    display: flex;
    flex-direction: column;
}

.ct-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 2rem;
    margin-top: 1rem;
    padding-top: .9rem;
    border-top: 1px solid var(--ct-line);
}

.ct-facts dt {
    font-size: .82rem;
    color: var(--ct-muted);
}

.ct-facts dd {
    font-weight: 600;
    color: var(--ct-ink);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.ct-map-side .ct-acts {
    margin-top: auto;
    padding-top: 1rem;
}

/* ── คำถามที่พบบ่อย ─────────────────────────────────────────────────── */
.ct-faq {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(30rem, 100%), 1fr));
    gap: 1rem;
}

.ct-faq-item {
    padding: 1.1rem 1.25rem 1.2rem;
    background: var(--ct-paper);
    border: 1px solid var(--ct-line);
    border-radius: 12px;
    box-shadow: inset 4px 0 0 var(--ct-wash-2);
}

.ct-faq-q {
    font-weight: 700;
    color: var(--ct-ink);
}

.ct-faq-a {
    margin-top: .35rem;
    font-size: .95rem;
    color: var(--ct-ink-2);
}

.ct-faq-a .ct-link {
    display: inline-block;
    min-height: 24px;
    margin-left: .25rem;
}

/* ── จอแคบ ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .ct-top,
    .ct-map-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ct-channels {
        grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
        grid-auto-rows: auto;
    }
}

@media (max-width: 640px) {
    .ct-shell {
        padding: .9rem 12px 2rem;
    }

    .ct-paper {
        padding: 1rem 1rem 1.6rem;
        border-left-width: 8px;
        border-radius: 12px;
    }

    .ct-now {
        width: 100%;
    }

    .ct .ct-channel {
        grid-template-columns: 2.75rem minmax(0, 1fr);
        padding: 1rem;
    }

    .ct-channel-icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.05rem;
    }

    .ct-block {
        padding: 1.1rem 1rem;
    }

    .ct-route {
        grid-template-columns: 2.4rem minmax(0, 1fr);
        gap: .8rem;
    }

    .ct-route-icon {
        width: 2.4rem;
        height: 2.4rem;
    }

    .ct-map,
    .ct-map-cover {
        min-height: 16rem;
    }
}

/* ── การเคลื่อนไหว (ตัดทั้งหมดเมื่อผู้ใช้ตั้งค่าลดการเคลื่อนไหว) ─────────── */
@media screen and (prefers-reduced-motion: no-preference) {
    /* จุดสถานะ "เปิดทำการอยู่" กระพริบครั้งเดียวตอนโหลด ไม่วนซ้ำ */
    .ct-now.is-open .ct-now-dot {
        animation: ct-ping 1.6s ease-out .4s both;
    }

    /* ส่วนต่าง ๆ เลื่อนขึ้นตามการเลื่อนหน้า เบราว์เซอร์ที่ไม่รองรับเห็นทุกอย่างตามปกติ */
    @supports (animation-timeline: view()) {
        .ct .ct-reveal {
            animation: ct-rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 85%;
        }
    }
}

@keyframes ct-ping {
    from {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--ct-ok-mark) 55%, transparent);
    }
    to {
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--ct-ok-mark) 22%, transparent);
    }
}

@keyframes ct-rise {
    from {
        opacity: .3;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ct *,
    .ct *::before,
    .ct *::after {
        animation: none !important;
        transition: none !important;
    }

    .ct .ct-channel:hover {
        translate: none;
    }
}

/* ── โหมดคอนทราสต์สูง ─────────────────────────────────────────────────
   ไฟล์กลางบังคับพื้นดำ ตัวอักษรขาว ลิงก์เหลือง ที่นี่เขียนเฉพาะสิ่งที่ไฟล์กลางไม่รู้จัก */
html.tb1-contrast-high body.ct-page {
    background: #000000;
}

html.tb1-contrast-high .ct {
    --ct-lift: none;
    --ct-lift-hi: none;
    --ct-edge: 0 0 0 transparent;
}

html.tb1-contrast-high .ct :is(.ct-week th, .ct-week td) {
    background: #000000 !important;
}

html.tb1-contrast-high .ct :where(.ct-paper, .ct-now, .ct-channel, .ct-block, .ct-faq-item, .ct-map, .ct-route:target) {
    background: #000000 !important;
    border-color: #facc15 !important;
}

html.tb1-contrast-high .ct .ct-paper {
    border-left-color: #facc15 !important;
}

html.tb1-contrast-high .ct :where(b, dt, dd, address, .ct-lead, .ct-channel-k, .ct-channel-note, .ct-now-text span, .ct-note, .ct-route-how, .ct-map-note, .ct-faq-a, .ct-crumbs) {
    color: #ffffff !important;
}

html.tb1-contrast-high .ct :is(.ct-channel-icon, .ct-route-icon, .ct-map-pin) {
    color: #facc15 !important;
    background: #000000 !important;
    border: 1px solid #facc15;
    box-shadow: none !important;
}

html.tb1-contrast-high .ct .ct-now.is-open .ct-now-dot {
    background: #facc15;
    box-shadow: none;
}

/* ปุ่มและลิงก์ที่มีพื้นของตัวเอง: พื้นดำตามตัวอักษรเหลืองที่ไฟล์กลางบังคับ
   <button> ตอนชี้ปล่อยให้ไฟล์กลางกลับสีเป็นดำบนเหลืองตามปกติของทั้งเว็บ */
html.tb1-contrast-high .ct :is(.ct-btn, .ct-pill):not(:hover),
html.tb1-contrast-high .ct :is(a.ct-btn, a.ct-pill):hover,
html.tb1-contrast-high .ct .ct-channel:hover {
    color: #facc15 !important;
    background: #000000 !important;
    border-color: #facc15 !important;
    box-shadow: none !important;
}

html.tb1-contrast-high .ct .ct-week tr.is-today th {
    box-shadow: inset 4px 0 0 #facc15;
}

html.tb1-contrast-high .ct .ct-today-tag {
    color: #facc15 !important;
}

html.tb1-contrast-high .ct .ct-sec-title::before {
    background: #facc15;
}

html.tb1-contrast-high .ct .ct-map {
    background-image: none;
}

html.tb1-contrast-high .ct :is(.ct-facts, .ct-routes, .ct-route, .ct-head-row, .ct-sec, .ct-week th, .ct-week td) {
    border-color: #ffffff;
}

html.tb1-contrast-high .ct .ct-faq-item {
    box-shadow: inset 3px 0 0 #facc15 !important;
}

/* ── ฉบับพิมพ์ ───────────────────────────────────────────────────────── */
@media print {
    body.ct-page {
        background: #ffffff;
    }

    .ct-shell {
        max-width: none;
        padding: 0;
    }

    .ct-paper {
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    /* สถานะเปิดปิดเป็นเรื่องของ "ตอนนี้" บนกระดาษไม่มีความหมาย ตารางเวลาทำการบอกครบแล้ว */
    .ct-crumbs,
    .ct-now,
    .ct-acts,
    .ct-map,
    .ct-skip {
        display: none !important;
    }

    .ct-top {
        grid-template-columns: minmax(0, 1fr);
    }

    .ct-channels {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: auto;
    }

    .ct .ct-channel {
        grid-template-columns: minmax(0, 1fr);
        padding: .7rem .8rem;
    }

    .ct-channel-icon {
        display: none;
    }

    .ct-channel-v {
        font-size: 1rem;
        overflow-wrap: normal;
        word-break: normal;
    }

    .ct-sec {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .ct-sec-head {
        break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

    .ct *,
    .ct *::before,
    .ct *::after {
        animation: none !important;
        transition: none !important;
    }

    .ct-map-grid {
        grid-template-columns: 1fr;
    }

    .ct .ct-channel {
        box-shadow: none;
    }

    .ct-channel-icon,
    .ct-map-pin {
        color: #000000;
        background: #ffffff;
        border: 1px solid #000000;
    }

    .ct-block,
    .ct-faq-item,
    .ct-route,
    .ct-channel {
        break-inside: avoid;
    }


    /* ลิงก์พิมพ์ที่อยู่ปลายทางไว้ด้วย ใครถือกระดาษจะเปิดตามได้ */
    .ct .ct-pill[href^="admission"]::after,
    .ct .ct-pill[href$=".php"]::after {
        content: " (tb1.ac.th/" attr(href) ")";
        font-weight: 400;
    }
}
