/* หน้ารวม /dhammasuksa ธรรมศึกษา ตรี โท เอก — ส่วนเฉพาะหน้า (ฐานธีมห้องฉายอยู่ app/css/study-cinema.css)
   สี = ความหมาย: ชั้นตรี คราม · ชั้นโท เขียว · ชั้นเอก อำพัน (ชุดเดียวกับตารางกระทู้และปีที่มี)
   ป้ายใหญ่ทุกใบมีกรอบรอบทั้งใบ (ไม่ใช้แถบขอบซ้าย/ขอบบน) · ตัวอักษรทุกตัวผูก --reading-scale */
@media (prefers-reduced-motion: no-preference) { html:has(body.dsh-page) { scroll-behavior: smooth; } }

.dsh-bill-art { object-position: 64% 45%; }
.dsh-lead { font-size: max(1rem, calc(1.02rem * var(--reading-scale, 1))); }

/* สถิติคลังในป้ายใหญ่ */
.dsh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.dsh-stat { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1.1rem; }
.dsh-stat + .dsh-stat { border-left: 1px solid var(--sc-line); }
.dsh-stat b { color: var(--ui-strong); font-weight: 800; line-height: 1.3; font-size: calc(1.45rem * var(--reading-scale, 1)); }
.dsh-stat span { color: var(--sc-muted); font-weight: 700; line-height: 1.4; font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }

/* แถบชิป: ชิปชั้นมีจุดสีของชั้น */
.dsh-chip-dot { width: 10px; height: 10px; flex: none; border-radius: 999px; background: var(--t); }
.dsh-chips a.sc-chip { text-decoration: none; }

.dsh-sec, .dsh-level { scroll-margin-top: 8rem; }
.dsh-sec + .dsh-sec { margin-top: 3.4rem; }
.dsh-sec-lead { font-size: max(.875rem, calc(.92rem * var(--reading-scale, 1))); }

/* โทนสี — ชั้น และป้ายใหญ่ */
.dsh--tri { --t: var(--ui-indigo); --t-solid: #6366f1; --t-deep: #312e81; }
.dsh--tho { --t: var(--ui-green); --t-solid: #10b981; --t-deep: #064e3b; }
.dsh--ek { --t: var(--ui-gold-ink); --t-solid: #d97706; --t-deep: #78350f; }
.dsh--arena { --t: var(--ui-gold); --t-solid: #d99a16; --t-deep: #6b4a12; }
.dsh--study { --t: var(--ui-violet); --t-solid: #7c3aed; --t-deep: #3730a3; }
.dsh--readings { --t: var(--ui-orange); --t-solid: #c2410c; --t-deep: #7f1d1d; }

/* ── ป้ายใหญ่ (สนามฝึก · บทเรียน · เรื่องอ่านเสริม) — ทั้งใบเป็นลิงก์เดียว ภาพซ้าย ข้อความขวา ── */
.dsh-feature {
	display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); overflow: hidden; border-radius: 18px; color: var(--ui-strong); text-decoration: none;
	border: 1.5px solid color-mix(in srgb, var(--t-solid) 55%, rgba(var(--ui-tint), .1));
	background: linear-gradient(120deg, color-mix(in srgb, var(--t-solid) 18%, transparent) 0%, transparent 60%), var(--ui-lpanel, var(--ui-lpanel, var(--ui-lpanel, var(--ui-lpanel, #18223f))));
	box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .85);
	transition: transform .3s cubic-bezier(.25, 1, .5, 1), box-shadow .25s ease, border-color .2s ease;
}
.dsh-feature:hover { transform: translateY(-4px); border-color: var(--t); box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .95), 0 0 0 3px color-mix(in srgb, var(--t-solid) 22%, transparent); }
.dsh-feature:focus-visible { outline: 3px solid var(--sc-gold); outline-offset: 3px; }
.dsh-feature-art { position: relative; min-height: 280px; overflow: hidden; background: var(--sc-panel); }
.dsh-feature-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.dsh-feature:hover .dsh-feature-art img { transform: scale(1.04); }
.dsh-feature-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .8rem; padding: 1.6rem 1.8rem; }
.dsh-tag { display: inline-flex; align-items: center; gap: .45rem; padding: .2rem .7rem; border-radius: 999px; background: color-mix(in srgb, var(--t-solid) 22%, transparent); border: 1px solid color-mix(in srgb, var(--t) 35%, transparent); color: var(--t); font-weight: 800; line-height: 1.5; font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }
.dsh-feature-copy p { margin: 0; max-width: 34rem; color: var(--ui-ink2); line-height: 1.8; font-size: max(.95rem, calc(1rem * var(--reading-scale, 1))); }
.dsh-feature-copy p b { color: var(--ui-strong); }
.dsh-cta { display: inline-flex; align-items: center; gap: .6rem; min-height: 50px; margin-top: .3rem; padding: .5rem 1.3rem; border-radius: 12px; background: var(--ui-sel-bg); color: var(--ui-sel-ink); font-weight: 800; font-size: calc(1rem * var(--reading-scale, 1)); transition: background-color .15s ease; }
.dsh-cta i { font-size: calc(.85rem * var(--reading-scale, 1)); }
.dsh-feature:hover .dsh-cta { background: var(--sc-gold-fill, var(--sc-gold)); }

/* ── การ์ดชั้น ตรี โท เอก ── */
.dsh-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.dsh-level {
	display: flex; flex-direction: column; gap: 1rem; padding: 1.3rem 1.3rem 1.4rem; border-radius: 18px; color: var(--ui-strong);
	border: 1.5px solid color-mix(in srgb, var(--t-solid) 55%, rgba(var(--ui-tint), .1));
	background: linear-gradient(180deg, color-mix(in srgb, var(--t-solid) 20%, transparent) 0%, transparent 42%), var(--ui-lpanel, var(--ui-lpanel, var(--ui-lpanel, var(--ui-lpanel, #18223f))));
	box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .85);
	transition: transform .3s cubic-bezier(.25, 1, .5, 1), box-shadow .25s ease, border-color .2s ease;
}
.dsh-level:hover, .dsh-level:focus-within { transform: translateY(-4px); border-color: var(--t); box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .95), 0 0 0 3px color-mix(in srgb, var(--t-solid) 22%, transparent); }
.dsh-level:target { border-color: var(--t); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-solid) 45%, transparent), 0 22px 44px -18px rgba(0, 0, 0, .95); }
.dsh-level-head { display: flex; align-items: center; gap: .85rem; }
.dsh-level-no { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--t-solid), var(--t-deep)); color: var(--ui-strong); font-weight: 800; font-size: calc(1.5rem * var(--reading-scale, 1)); box-shadow: inset 0 0 0 1px rgba(var(--ui-tint), .18); }
.dsh-level-head h3 { margin: 0; color: var(--ui-strong); font-weight: 800; line-height: 1.35; font-size: calc(1.25rem * var(--reading-scale, 1)); }
.dsh-level-head p { margin: .1rem 0 0; color: var(--t); font-weight: 700; font-size: max(.875rem, calc(.9rem * var(--reading-scale, 1))); }
.dsh-level-desc { margin: 0; color: var(--ui-ink2); line-height: 1.75; font-size: max(.875rem, calc(.95rem * var(--reading-scale, 1))); }
.dsh-subjects { display: flex; flex-direction: column; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.dsh-subjects li { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: .4rem .8rem; border-radius: 10px; border: 1px solid var(--sc-line); background: rgba(var(--ui-tint), .04); font-size: max(.875rem, calc(.95rem * var(--reading-scale, 1))); }
.dsh-subjects li > i { width: 1.1rem; text-align: center; color: var(--t); font-size: calc(.85rem * var(--reading-scale, 1)); }
.dsh-subjects b { color: var(--ui-ink2); font-weight: 800; }
.dsh-kind { margin-left: auto; flex: none; padding: .05rem .5rem; border-radius: 6px; background: rgba(var(--ui-tint), .07); color: var(--sc-muted); font-weight: 700; white-space: nowrap; font-size: max(.875rem, calc(.8rem * var(--reading-scale, 1))); }
.dsh-kind.is-essay { background: rgba(245, 191, 69, .16); color: var(--sc-gold); }
.dsh-years { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.dsh-years-label { margin-right: .2rem; color: var(--sc-muted); font-weight: 800; font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }
.dsh-year { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 44px; padding: 0 .85rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--t) 35%, transparent); background: color-mix(in srgb, var(--t-solid) 16%, transparent); color: var(--t); font-weight: 800; text-decoration: none; font-size: max(.875rem, calc(.92rem * var(--reading-scale, 1))); transition: background-color .15s ease, color .15s ease; }
.dsh-year:hover { background: var(--t); color: #0a0f1e; }
.dsh-level-btn { display: flex; align-items: center; justify-content: center; gap: .55rem; min-height: 50px; margin-top: auto; padding: .5rem 1rem; border-radius: 12px; background: var(--ui-sel-bg); color: var(--ui-sel-ink); font-weight: 800; text-align: center; text-decoration: none; font-size: calc(.98rem * var(--reading-scale, 1)); transition: background-color .15s ease; }
.dsh-level-btn:hover { background: var(--sc-gold-fill, var(--sc-gold)); }
.dsh-level-btn i { font-size: calc(.85rem * var(--reading-scale, 1)); }
.dsh-year:focus-visible, .dsh-level-btn:focus-visible, .dsh-btn:focus-visible { outline: 3px solid var(--sc-gold); outline-offset: 3px; }

/* ── กระทู้ธรรม ── */
.dsh-panel { padding: 1.6rem 1.7rem; border-radius: 18px; border: 1px solid var(--sc-line); background: var(--ui-panel); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .85); }
.dsh-kratu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 2.2rem; align-items: start; }
.dsh-h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .7rem; color: var(--ui-strong); font-weight: 800; line-height: 1.4; font-size: calc(1.05rem * var(--reading-scale, 1)); }
.dsh-h3 i { color: var(--sc-gold); font-size: calc(.9rem * var(--reading-scale, 1)); }
.dsh-h3 + * { margin-top: 0; }
.dsh-steps-h { margin-top: 1.8rem; }
.dsh-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--sc-line); }
.dsh-table { width: 100%; border-collapse: collapse; font-size: max(.875rem, calc(.95rem * var(--reading-scale, 1))); }
.dsh-table th { padding: .6rem .75rem; background: rgba(var(--ui-tint), .05); color: var(--sc-muted); font-weight: 800; text-align: center; white-space: nowrap; font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }
.dsh-table td { padding: .65rem .75rem; border-top: 1px solid var(--sc-line); color: var(--ui-ink2); font-weight: 800; text-align: center; white-space: nowrap; }
.dsh-table th:first-child, .dsh-table td:first-child { text-align: left; }
.dsh-table td.dsh-ref { color: var(--t); }
.dsh-table td.dsh-time { color: var(--sc-muted); border-left: 1px solid var(--sc-line); }
.dsh-note { margin: .5rem 0 0; color: var(--sc-muted); line-height: 1.6; font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }
.dsh-steps { display: flex; flex-direction: column; gap: .7rem; margin: 0; padding: 0; list-style: none; color: var(--ui-ink2); line-height: 1.7; font-size: max(.875rem, calc(.95rem * var(--reading-scale, 1))); }
.dsh-steps li { display: flex; gap: .8rem; }
.dsh-steps b { color: var(--ui-strong); font-weight: 800; }
.dsh-step-no, .dsh-tagno { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: 999px; color: var(--ui-strong); font-weight: 800; font-size: calc(.95rem * var(--reading-scale, 1)); }
/* สีวงเลขคู่กับป้ายบนแบบฟอร์มด้านขวา — ขั้นเดียวกันสีเดียวกัน */
.dsh-z-indigo { background: #4f46e5; }
.dsh-z-teal { background: #0d9488; }
.dsh-z-amber { background: #d97706; }
.dsh-z-emerald { background: #059669; }
.dsh-z-rose { background: #e11d48; }
.dsh-btn { display: inline-flex; align-items: center; gap: .55rem; min-height: 50px; margin-top: 1.4rem; padding: .5rem 1.2rem; border-radius: 12px; background: var(--ui-sel-bg); color: var(--ui-sel-ink); font-weight: 800; text-decoration: none; font-size: calc(.98rem * var(--reading-scale, 1)); transition: background-color .15s ease; }
.dsh-btn:hover { background: var(--sc-gold-fill, var(--sc-gold)); }
.dsh-btn i { font-size: calc(.85rem * var(--reading-scale, 1)); }

/* แบบฟอร์มคำตอบจำลอง: กระดาษเส้นบรรทัด เขียนเว้นบรรทัดเหมือนสนามจริง (กระดาษสีครีมบนพื้นเข้ม) */
.dsh-paper-col { position: relative; padding-left: 1rem; }
.dsh-cap { margin: 0 0 .55rem; text-align: center; color: var(--sc-muted); font-weight: 800; font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }
.dsh-cap.is-foot { margin: .7rem 0 0; font-weight: 700; line-height: 1.6; }
.dsh-cap i { color: var(--sc-gold); }
.ds-paper { position: relative; padding: 1.2em 1.4em; border-radius: 14px; border: 1px solid #e4d8ba; background: repeating-linear-gradient(#fffdf8 0, #fffdf8 calc(2.05em - 1px), #e7ddc6 calc(2.05em - 1px), #e7ddc6 2.05em); background-origin: content-box; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .8); color: #3b4257; line-height: 2.05em; font-size: max(.875rem, calc(.88rem * var(--reading-scale, 1))); }
.ds-paper p { margin: 0; }
.ds-paper .ppl-center { text-align: center; }
.ds-paper .ppl-pali { font-weight: 800; color: #312e81; }
.ds-paper .ppl-formula { color: #0f766e; font-weight: 700; }
.ds-paper .ppl-dots { display: inline-block; max-width: 100%; overflow: hidden; white-space: nowrap; vertical-align: bottom; color: #b6aa8d; letter-spacing: .1em; }
.ds-paper .ppl-indent { text-indent: 2.5em; }
.ds-paper .dsh-zone { position: relative; }
.ds-paper .dsh-tagno { position: absolute; left: -2.45em; top: .1em; width: 1.9rem; height: 1.9rem; line-height: 1; box-shadow: 0 4px 10px rgba(23, 32, 51, .25); font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }
/* ป้ายเล็กบนปุ่มหลักของป้ายใหญ่ — หน้านี้ให้อ่านได้ ≥ ๑๔px */
.dsh-page .sc-btn-stack small { font-size: max(.875rem, calc(.8rem * var(--reading-scale, 1))); }

/* ── ฝึกอย่างไรให้สอบผ่าน ── */
.dsh-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.dsh-tip { display: flex; gap: .85rem; padding: 1.1rem 1.15rem; border-radius: 16px; border: 1px solid var(--sc-line); background: var(--ui-panel); }
.dsh-tip-no { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(245, 191, 69, .16); color: var(--sc-gold); font-weight: 800; font-size: calc(1.1rem * var(--reading-scale, 1)); }
.dsh-tip b { display: block; color: var(--ui-strong); font-weight: 800; line-height: 1.45; font-size: calc(1.02rem * var(--reading-scale, 1)); }
.dsh-tip p { margin: .2rem 0 0; color: var(--ui-ink2); line-height: 1.7; font-size: max(.875rem, calc(.92rem * var(--reading-scale, 1))); }
.dsh-source { display: flex; gap: .55rem; margin: 1.2rem 0 0; color: var(--sc-muted); line-height: 1.7; font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }
.dsh-source i { margin-top: .35em; color: var(--sc-indigo); }

.dsh-foot { padding: 2rem 1rem 2.6rem; border-top: 1px solid var(--sc-line); text-align: center; color: var(--sc-dim); font-weight: 700; font-size: max(.875rem, calc(.875rem * var(--reading-scale, 1))); }

@media (max-width: 1023px) {
	.dsh-kratu { grid-template-columns: minmax(0, 1fr); }
	.dsh-paper-col { max-width: 520px; width: 100%; margin: 0 auto; }
}
@media (max-width: 900px) {
	.dsh-levels { grid-template-columns: minmax(0, 1fr); }
	.dsh-feature { grid-template-columns: minmax(0, 1fr); }
	.dsh-feature-art { min-height: 0; aspect-ratio: 16 / 8; }
}
@media (max-width: 820px) {
	.dsh-tips { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.dsh-bill-art { object-position: 66% 40%; }
	.dsh-stat { padding: .7rem .75rem; }
	.dsh-stat b { font-size: calc(1.2rem * var(--reading-scale, 1)); }
	.dsh-feature-art { aspect-ratio: 16 / 9; }
	.dsh-feature-copy { padding: 1.1rem 1.1rem 1.25rem; }
	.dsh-cta { width: 100%; justify-content: center; }
	.dsh-level { padding: 1.1rem 1rem 1.2rem; }
	.dsh-panel { padding: 1.15rem 1rem; }
	.dsh-btn { width: 100%; justify-content: center; }
	/* ตารางกติกา: ให้หัวคอลัมน์ขึ้นบรรทัดใหม่ได้ ครบ ๕ คอลัมน์ในจอเดียว ไม่ต้องเลื่อนข้าง */
	.dsh-table th { white-space: normal; padding: .5rem .35rem; line-height: 1.35; }
	.dsh-table td { padding: .6rem .35rem; }
	.dsh-table th:first-child, .dsh-table td:first-child { padding-left: .7rem; }
	.dsh-paper-col { padding-left: .9rem; }
	.ds-paper { padding: 1em .9em 1em 1.4em; }
	.ds-paper .dsh-tagno { left: -2.3em; width: 1.7rem; height: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
	.dsh-feature, .dsh-feature-art img, .dsh-level, .dsh-year, .dsh-level-btn, .dsh-btn, .dsh-cta { transition: none; }
}

/* โหมดสว่าง: ป้ายเลขชั้นพื้นสีอ่อน ไม่ทึบ */
html[data-ui="light"] .dsh-level-no { background: color-mix(in srgb, var(--t-solid) 11%, #fff); color: color-mix(in srgb, var(--t-solid) 72%, #000); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--t-solid) 38%, transparent); }
