/* ดาวน์โหลดการ์ดสรุปไวยากรณ์ ๗ ข้อ ๒ เล่ม (app/includes/exam_cards_download.php) — หน้าแรก + /pali-grammar
 * สีประจำเล่มตามปก: ประโยค ๑-๒ = คราม · ป.ธ.๓ = แดงเข้ม · โหมดสว่าง/มืดตาม <html data-ui> */
.ec-wrap { --ec-card: #fff; --ec-ink: #141a33; --ec-ink2: #475069; --ec-ring: rgba(20, 26, 51, .1); }
html[data-ui="dark"] .ec-wrap { --ec-card: #131c38; --ec-ink: #f3f6ff; --ec-ink2: #c3cbe3; --ec-ring: rgba(255, 255, 255, .1); }
.ec-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .9rem; }
.ec-head h2 { margin: 0; color: var(--ec-ink); font-size: calc(1.3rem * var(--reading-scale, 1)); font-weight: 800; line-height: 1.3; }
.ec-head p { margin: .15rem 0 0; color: var(--ec-ink2); font-size: calc(.92rem * var(--reading-scale, 1)); line-height: 1.55; }
.ec-head-ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: #fff1f2; color: #be123c; box-shadow: inset 0 0 0 1.5px rgba(225, 29, 72, .3); font-size: 1.05rem; }
html[data-ui="dark"] .ec-head-ic { background: rgba(244, 63, 94, .14); color: #fda4af; }
.ec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ec-book { --ec-c: #312e81; --ec-soft: #eef2ff; display: flex; gap: 1rem; padding: .9rem; border-radius: 18px; background: var(--ec-card); box-shadow: inset 0 0 0 1px var(--ec-ring), 0 14px 30px -24px rgba(20, 26, 51, .5); }
.ec-book.is-p3 { --ec-c: #9f1239; --ec-soft: #fff1f2; }
html[data-ui="dark"] .ec-book { --ec-c: #c7d2fe; --ec-soft: rgba(129, 140, 248, .16); }
html[data-ui="dark"] .ec-book.is-p3 { --ec-c: #fda4af; --ec-soft: rgba(244, 63, 94, .14); }
.ec-cover { flex: none; display: block; width: 118px; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .2s ease; }
.ec-cover:hover { transform: translateY(-3px) rotate(-1deg); }
.ec-cover img { display: block; width: 100%; height: auto; }
.ec-body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: .3rem; }
.ec-level { align-self: flex-start; padding: .1rem .6rem; border-radius: 999px; background: var(--ec-soft); color: var(--ec-c); font-weight: 800; font-size: calc(.8rem * var(--reading-scale, 1)); }
.ec-body h3 { margin: 0; color: var(--ec-ink); font-size: calc(1.12rem * var(--reading-scale, 1)); font-weight: 800; line-height: 1.35; }
.ec-body p { margin: 0; color: var(--ec-ink2); font-size: calc(.88rem * var(--reading-scale, 1)); line-height: 1.55; }
.ec-body .ec-meta { color: var(--ec-ink2); font-weight: 700; font-size: calc(.82rem * var(--reading-scale, 1)); }
.ec-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: auto; padding-top: .4rem; }
.ec-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .3rem .85rem; border-radius: 10px; color: var(--ec-c); background: var(--ec-soft); font-weight: 800; font-size: calc(.88rem * var(--reading-scale, 1)); text-decoration: none; transition: filter .15s ease; }
.ec-btn:hover { filter: brightness(.96); }
.ec-btn.is-main { background: var(--ec-c); color: #fff; }
html[data-ui="dark"] .ec-btn.is-main { color: #0a0f1e; }
.ec-btn:focus-visible, .ec-cover:focus-visible { outline: 3px solid #f5bf45; outline-offset: 2px; }
@media (max-width: 760px) { .ec-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) { .ec-cover { width: 96px; } }
@media (prefers-reduced-motion: reduce) { .ec-cover { transition: none; } }
.ec-nowrap { white-space: nowrap; }
/* ปกสูงเท่าการ์ด ไม่มีที่โล่งใต้ปก (ภาพปกตัดล่างได้ ส่วนสำคัญอยู่ครึ่งบน) */
.ec-book { align-items: stretch; }
.ec-cover { align-self: stretch; }
.ec-cover img { height: 100%; object-fit: cover; object-position: top; }
