/* ═══════════════════════════════════════════════════════════════
   site.css — หน้าเว็บสาธารณะ สหกรณ์ออมทรัพย์โรงพยาบาลลำปาง
   ไม่พึ่ง CDN/ไลบรารีภายนอก · ฟอนต์ Sarabun (เนื้อหา) + Prompt (หัวข้อ) โหลดจาก assets/fonts/fonts.css
   ขนาด/ฟอนต์ ยึดตามเว็บคณะเทคโนโลยีการเกษตร (container 1280px, เมนู 72px .87rem, หัวข้อ Prompt 1.6rem)
   ═══════════════════════════════════════════════════════════════ */
:root {
  --navy:   #12306b;
  --blue:   #1d4fb8;
  --blue-2: #2f6fe0;
  --sky:    #e8f0fb;
  --sky-2:  #d4e3f7;
  --gold:   #c99a1d;
  --ink:    #1b2740;
  --muted:  #5d6b85;
  --line:   #dbe3f0;
  --bg:     #f1f4f9;
  --card:   #ffffff;
  --red:    #d3262f;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(18, 48, 107, .08);
  --font:   'Sarabun', 'Noto Sans Thai', 'Leelawadee UI', 'Tahoma', sans-serif;
  --font-head: 'Prompt', 'Sarabun', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--font-head); }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.ic { flex: none; vertical-align: -.2em; }
.wrap { max-width: 1280px; margin-inline: auto; padding-inline: 24px; }
.topbar .wrap, .site-head .wrap { max-width: 1400px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }

/* ── แถบบนสุด ─────────────────────────────────────────── */
.topbar { background: var(--navy); color: #dfe8fa; font-size: .8rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: center; justify-content: space-between; padding-block: 5px; }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; }
.topbar li { display: inline-flex; align-items: center; gap: 7px; }
.topbar a { color: #fff; }
.topbar .fb { display: inline-flex; align-items: center; gap: 6px; background: #1877f2; color: #fff; padding: 2px 12px; border-radius: 99px; font-weight: 600; }
.topbar .fb:hover { text-decoration: none; background: #0f63d1; }

/* ── หัวเว็บ + เมนู ─────────────────────────────────────── */
.site-head { background: #fff; box-shadow: 0 1px 0 var(--line); position: sticky; top: 0; z-index: 50; }
.site-head { border-bottom: 3px solid var(--blue); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); font-weight: 700; line-height: 1.25; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 52px; width: auto; max-width: 240px; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-text b { display: block; font: 700 1rem/1.25 var(--font-head); color: var(--navy); }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--navy); cursor: pointer; }
.nav { display: flex; align-items: stretch; height: 100%; gap: 0; margin: 0; padding: 0; list-style: none; }
.nav > li { position: relative; display: flex; align-items: stretch; }
.nav > li > a, .nav > li > button { display: flex; align-items: center; gap: 4px; padding: 0 12px; font: 500 .87rem/1.2 var(--font); color: var(--navy); background: none; border: 0; cursor: pointer; white-space: nowrap; transition: color .2s; }
.nav > li > a:hover, .nav > li > button:hover, .nav > li.open > button, .nav > li:hover > button, .nav > li > a.is-active { color: var(--blue); text-decoration: none; }
.nav .sub { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; background: #fff; border-top: 3px solid var(--blue); border-radius: 0 0 8px 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .14); padding: 6px 0; list-style: none; margin: 0; z-index: 60; }
.nav li.open > .sub, .nav li:hover > .sub, .nav li:focus-within > .sub { display: block; }
.nav .sub.wide { min-width: 340px; max-width: min(420px, 92vw); }
.nav .sub a { display: block; padding: 11px 18px; color: #475569; font-size: .88rem; line-height: 1.4; transition: all .2s; }
.nav .sub a[aria-current] { background: #eef4fd; color: var(--blue); font-weight: 600; }
.nav .sub a:hover { background: #eef4fd; color: var(--blue); text-decoration: none; }

/* เมนูย่อยชั้นที่ 2 (ข้อมูลพื้นฐาน → ผู้บริหาร/ส่วนราชการ · ศูนย์ข้อมูลข่าวสาร · ITA) — เปิดไปทางขวา */
.nav .sub .has-sub { position: relative; }
.nav .sub .has-sub > button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 18px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; font-size: .88rem; line-height: 1.4; color: #475569; transition: all .2s; }
.nav .sub .has-sub > button:hover, .nav .sub .has-sub.open > button, .nav .sub .has-sub:hover > button { background: #eef4fd; color: var(--blue); }
.nav .sub2 { display: none; position: absolute; top: -9px; left: 100%; min-width: 280px; max-width: min(380px, 80vw); background: #fff; border-top: 3px solid var(--blue); border-radius: 0 8px 8px 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .14); padding: 6px 0; list-style: none; margin: 0; z-index: 62; }
.nav .has-sub:hover > .sub2, .nav .has-sub.open > .sub2, .nav .has-sub:focus-within > .sub2 { display: block; }

/* เมนูหลัก 9 รายการ + ชื่อสั้นข้างโลโก้: ≥1401px อยู่แถวเดียวกัน (ลด padding ให้พอดี) ·
   1281–1400px แยกโลโก้/ชื่อ (แถวบน) กับเมนู (แถวล่าง) · ≤1280px เมนูแบบปุ่มสามขีด */
.brand-text.brand-short b { font-size: 1.15rem; }
@media (min-width: 1401px) {
  .site-head .nav > li > a, .site-head .nav > li > button { padding: 0 10px; }
}
@media (min-width: 1281px) and (max-width: 1400px) {
  .site-head .wrap { flex-wrap: wrap; height: auto; row-gap: 0; }
  .site-head .brand { flex: 1 1 100%; min-height: 72px; }
  .site-head .nav { flex: 1 1 100%; height: 46px; border-top: 1px solid var(--line); justify-content: flex-start; }
  .site-head .nav > li > a, .site-head .nav > li > button { padding: 0 14px; }
}
}

/* ── Hero slider ────────────────────────────────────────── */
.hero { position: relative; background: var(--navy); overflow: hidden; }
.hero .track { display: flex; align-items: flex-start; transition: transform .7s cubic-bezier(.4, 0, .2, 1), height .4s ease; }
.hero .slide { flex: 0 0 100%; display: block; }
.hero .slide img { display: block; width: 100%; height: auto; }
.hero .nav-btn { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(18,48,107,.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.hero .nav-btn:hover { background: var(--blue); }
.hero .prev { left: 14px; } .hero .next { right: 14px; }
.hero .dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; }
.hero .dots button { width: 11px; height: 11px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; }
.hero .dots button[aria-current="true"] { background: var(--gold); border-color: var(--gold); }

/* ── โครงหน้าหลัก ──────────────────────────────────────── */
main { display: block; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; padding-block: 22px; align-items: start; }
.stack { display: grid; gap: 22px; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; border: 1px solid #e9eef7; }
.card > h2, .sec-title { margin: 0 0 16px; font-size: 1.6rem; font-weight: 700; line-height: 1.3; color: var(--navy); display: flex; align-items: center; gap: 9px; }
.card > h2 .ic, .sec-title .ic { color: var(--blue); }
.sec-title.rate { color: var(--red); } .sec-title.rate .ic { color: var(--red); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border-radius: 99px; background: var(--blue); color: #fff; font-weight: 600; border: 0; cursor: pointer; font-family: var(--font); font-size: .9rem; }
.btn:hover { background: var(--navy); text-decoration: none; }
.more { margin-top: 14px; }

/* แท็บข่าว */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0 0 12px; border-bottom: 1px solid var(--line); list-style: none; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font: 500 .9rem var(--font); color: var(--ink); cursor: pointer; }
.tabs button:hover { background: var(--sky); }
.tabs button[aria-selected="true"] { background: var(--blue); color: #fff; }
.tabpanel[hidden] { display: none; }
.items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; margin: 0; padding: 0; list-style: none; }
.item { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.item .th { flex: none; width: 140px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--sky); display: grid; place-items: center; color: var(--blue-2); }
.item .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .tx { min-width: 0; }
.item time { display: block; color: var(--muted); font-size: .78rem; }
.item a.tt { color: var(--navy); font-size: .95rem; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item a.tt:hover { color: var(--blue); }
.items.list { grid-template-columns: 1fr; gap: 0; }
.items.list .item { padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.items.list .item:last-child { border-bottom: 0; }
.items.list .item .th { width: 44px; aspect-ratio: 1; }
.badge-new { display: inline-block; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; padding: 0 7px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.empty { color: var(--muted); margin: 0; }
.empty-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 16px 30px; text-align: center; color: var(--muted); background: var(--sky); border: 1px dashed var(--line); border-radius: 12px; }
.empty-box svg { opacity: .45; margin-bottom: 6px; }
.empty-box p { margin: 0; font: 500 1rem var(--font-head); color: var(--ink); }
.empty-box small { font-size: .85rem; }

/* มุมสมาชิก */
.corner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.corner a, .corner span { display: block; border-radius: 12px; overflow: hidden; background: var(--sky); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.corner a:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(18, 48, 107, .16); }
.corner img { display: block; width: 100%; height: auto; }

/* อัตราดอกเบี้ย */
.rates .rate-block + .rate-block { margin-top: 22px; }
.rates .body { font-size: .88rem; overflow-x: auto; }
.rates .body table { width: 100%; border-collapse: collapse; }
.rates .body th, .rates .body td { padding: 7px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.rates .body th { background: var(--sky); color: var(--navy); }
.rates .body p { margin: 0 0 .6em; }
.rates .body img { height: auto; }

/* แบนเนอร์คั่น */
.break { margin-top: 6px; display: block; }
.break img { display: block; width: 100%; height: auto; }

/* E-Book / ลิงก์ / วิดีโอ */
.band { padding-block: 0 22px; display: grid; gap: 22px; }
.covers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.covers a { display: block; color: var(--ink); text-align: center; font-size: .85rem; line-height: 1.4; }
.covers a:hover { text-decoration: none; color: var(--blue); }
.covers .cv { display: block; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; background: var(--sky); box-shadow: 0 4px 14px rgba(18, 48, 107, .18); margin-bottom: 8px; display: grid; place-items: center; color: var(--blue-2); transition: transform .2s; }
.covers a:hover .cv { transform: translateY(-4px); }
.covers .cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.linkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.linkgrid a { display: flex; align-items: center; gap: 16px; min-height: 96px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfcff; height: 100%; }
.linkgrid a:hover { border-color: var(--blue-2); background: var(--sky); text-decoration: none; }
.linkgrid .ini { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; }
.linkgrid .lg { flex: none; width: 104px; height: 104px; display: block; background: #fff; border-radius: 8px; overflow: hidden; }
.linkgrid .lg img { width: 100%; height: 100%; object-fit: contain; display: block; }
.linkgrid .lt { min-width: 0; line-height: 1.35; font-size: .88rem; overflow-wrap: anywhere; }
.videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.video .frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.video .frame img, .video .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video .frame button { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: #fff; }
.video .frame .pl { width: 62px; height: 62px; border-radius: 50%; background: rgba(211, 38, 47, .92); display: grid; place-items: center; transition: transform .2s; }
.video .frame button:hover .pl { transform: scale(1.1); }
/* ลิงก์ไป YouTube (เปิดแท็บใหม่) แทนปุ่มเล่นในหน้า */
.video .frame a.yt { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-decoration: none; }
.video .frame a.yt:hover .pl, .video .frame a.yt:focus-visible .pl { transform: scale(1.1); }
.video p { margin: 8px 0 0; font-size: .95rem; font-weight: 600; color: var(--navy); line-height: 1.5; text-align: center; }

/* ── ท้ายเว็บ ──────────────────────────────────────────── */
.site-foot { background: var(--navy); color: #dbe5fa; margin-top: 10px; }
.site-foot .wrap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 26px; align-items: center; padding-block: 28px; }
.site-foot .ct { display: grid; gap: 10px; font-size: .9rem; }
.site-foot .ct div { display: flex; gap: 10px; align-items: flex-start; }
.site-foot .ct .ic { margin-top: 4px; color: var(--gold); }
.site-foot a { color: #fff; }
.site-foot .logo img { height: 110px; width: auto; display: block; margin-inline: auto; }
.stats { justify-self: end; width: min(280px, 100%); font-size: .92rem; }
.stats dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 16px; }
.stats dt { color: #b8c8ec; } .stats dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.copy { background: #0c2150; color: #aebde0; text-align: center; font-size: .86rem; padding: 10px 16px; }
.copy a { color: #fff; }
.fab { position: fixed; left: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 40; }
.fab a { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.fab a:hover { transform: scale(1.08); text-decoration: none; }
.fab .f-fb { background: #1877f2; } .fab .f-tel { background: #1a9b4b; }
.totop { position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 10px; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); border: 0; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
.totop.show { opacity: 1; pointer-events: auto; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1060px) {
  .home-grid { grid-template-columns: 1fr; }
  .covers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-foot .wrap { grid-template-columns: 1fr; text-align: left; }
  .stats { justify-self: start; }
}
@media (max-width: 1280px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; height: auto; background: #fff; border-top: 1px solid var(--line); padding: 8px 16px 16px; flex-direction: column; align-items: stretch; max-height: calc(100vh - 130px); overflow: auto; box-shadow: 0 14px 24px rgba(18,48,107,.12); }
  .nav > li { display: block; border-bottom: 1px solid #eef2f8; }
  .nav > li > a, .nav > li > button { padding: 13px 8px; font-size: .95rem; }
  .nav.open { display: flex; }
  .nav > li > a, .nav > li > button { width: 100%; justify-content: space-between; }
  .nav .sub, .nav .sub.wide { position: static; box-shadow: none; border: 0; border-radius: 0; padding: 0 0 6px 12px; min-width: 0; max-width: none; }
  .nav li:hover > .sub, .nav li:focus-within > .sub { display: none; }
  .nav li.open > .sub { display: block; }
  .nav .sub .has-sub > button { padding: 11px 8px; }
  .nav .sub2 { position: static; box-shadow: none; border: 0; border-radius: 0; padding: 0 0 4px 14px; min-width: 0; max-width: none; }
  .nav .has-sub:hover > .sub2, .nav .has-sub:focus-within > .sub2 { display: none; }
  .nav .has-sub.open > .sub2 { display: block; }
}
@media (max-width: 680px) {
  .items { grid-template-columns: 1fr; }
  .item .th { width: 110px; }
  .corner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .videos { grid-template-columns: 1fr; }
  .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar .hide-sm { display: none; }
  .card { padding: 16px; }
  .brand img { height: 44px; }
  .brand-text b { font-size: .88rem; }
  .brand small { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── index3: layout ใหม่ (การ์ดข่าวเต็มแถว + แถวมุมสมาชิก | อัตราดอกเบี้ย) ── */
.v3 { display: grid; gap: 22px; padding-block: 22px; }
.v3 .tabs button { padding: 10px 18px; font-size: .95rem; }
.v3 .items { gap: 20px 40px; }
.v3 .item .th { width: 204px; }
.v3 .item a.tt { font-size: 1.02rem; font-weight: 500; }
.v3-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.v3-row.one { grid-template-columns: 1fr; }
@media (max-width: 1060px) { .v3-row { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .v3 .item .th { width: 110px; } .v3 .tabs button { padding: 8px 12px; font-size: .88rem; } }
.corner8 { gap: 16px 14px; }
.corner8 a, .corner8 span { background: transparent; border: 0; }
.v3-rates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 32px; }
.v3-rates .rate-block + .rate-block { margin-top: 0; }
@media (max-width: 1060px) { .v3-rates { grid-template-columns: 1fr; } }

/* หัวข้อเด่น "ภาพกิจกรรม" (index3) */
.act-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.act-head h2 { margin: 0; font-size: 1.6rem; font-weight: 700; line-height: 1.3; color: var(--navy); display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 5px solid var(--blue); }
.act-head h2 .ic { color: var(--blue); }
.act-head p { margin: 2px 0 0 19px; color: var(--muted); }
.act-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.act-grid a { display: flex; flex-direction: column; height: 100%; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(18, 48, 107, .06); transition: transform .2s, box-shadow .2s; }
.act-grid a:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(18, 48, 107, .16); }
.act-grid .ph { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--sky); color: var(--blue-2); overflow: hidden; }
.act-grid .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.act-grid a:hover .ph img { transform: scale(1.05); }
.act-grid .tag { position: absolute; left: 14px; top: 14px; padding: 4px 14px; border-radius: 99px; background: var(--blue); color: #fff; font: 600 .85rem var(--font-head); }
.act-grid .bd { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.act-grid .tt { color: var(--navy); font-weight: 600; font-size: 1.05rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.act-grid time { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 600; font-size: .88rem; }
@media (max-width: 1060px) { .act-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .act-grid { grid-template-columns: 1fr; gap: 16px; } .act-head h2 { font-size: 1.35rem; } }

/* ไอคอนตามชนิดไฟล์ (แท็บเอกสาร) */
.item .th { position: relative; }
.th.ft { background: var(--bg, #eef2f9); color: var(--c, #5b6b8c); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.th.ft b { font: 700 .72rem/1 var(--font-head); letter-spacing: .04em; }
.items.list .item .th.ft { width: 52px; aspect-ratio: 1; gap: 2px; border-radius: 10px; }
.items.list .item .th.ft b { font-size: .6rem; }
.ft-pdf   { --c: #d32f2f; --bg: #fdecec; }
.ft-word  { --c: #1e63c6; --bg: #e6effc; }
.ft-excel { --c: #1f8a4c; --bg: #e5f5ec; }
.ft-ppt   { --c: #d9622b; --bg: #fdeee5; }
.ft-zip   { --c: #8a6d1d; --bg: #f8f0d9; }
.ft-img   { --c: #8e44ad; --bg: #f3e8f9; }
.ft-video { --c: #c62828; --bg: #fdeaea; }
.ft-cloud { --c: #0b7a9a; --bg: #e2f4f9; }
.ft-link  { --c: #2f6f9f; --bg: #e8f1f8; }
.ft-file  { --c: #5b6b8c; --bg: #eef2f9; }
.ftag { position: absolute; right: 6px; bottom: 6px; padding: 3px 8px; border-radius: 6px; background: var(--c); color: #fff; font: 700 .68rem/1 var(--font-head); letter-spacing: .04em; }

/* แถวบน: ข่าว (แท็บ) + อัตราดอกเบี้ย (การ์ดแท็บเด่น) */
.v3-top { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 22px; align-items: start; }
.v3-top.one { grid-template-columns: 1fr; }
.v3-top .items { gap: 18px 24px; }
.v3-top .item .th { width: 128px; }
.v3-top .tabs button { padding: 9px 13px; font-size: .9rem; }
.rate-card { padding: 0; overflow: hidden; border: 0; background: #fff; box-shadow: 0 10px 30px rgba(18, 48, 107, .2); }
.rate-head { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; padding: 18px 22px 0; }
.rate-head h2 { margin: 0; color: #fff; font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.rate-head h2 .ic { color: #f0c040; }
.rate-head .asof { display: block; margin-top: 2px; font-size: .82rem; color: #c9d7f5; }
.rate-card .rtabs { background: var(--blue); margin: 0; padding: 14px 16px 0; border: 0; gap: 6px; flex-wrap: nowrap; }
.rate-head + .rtabs { margin-top: 0; }
.rate-card .rtabs button { flex: 1; justify-content: center; border-radius: 12px 12px 0 0; color: #fff; font: 600 .95rem var(--font-head); padding: 11px 10px; }
.rate-card .rtabs button:hover { background: rgba(255, 255, 255, .15); }
.rate-card .rtabs button[aria-selected="true"] { background: #fff; color: var(--blue); }
.rate-body { padding: 14px 20px 20px; }
.rate-body .rb { font-size: .92rem; overflow-x: auto; }
.rate-body .rb table { width: 100%; border-collapse: collapse; }
.rate-body .rb th { text-align: right; color: var(--blue); border-bottom: 2px solid var(--blue); padding: 6px 8px; }
.rate-body .rb td { padding: 7px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.rate-body .rb td:last-child { text-align: right; font-weight: 700; color: var(--navy); white-space: nowrap; }
.rate-body .rb p { margin: 0 0 .5em; }
.rate-body .rb img { max-width: 100%; height: auto; }
.rate-body .more { margin-top: 12px; }
@media (max-width: 1060px) { .v3-top { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .v3-top .item .th { width: 104px; } }
/* ให้การ์ดข่าวสูงเท่าการ์ดอัตราดอกเบี้ย (ปุ่ม "แสดงทั้งหมด" ชิดล่าง) */
.v3-top { align-items: stretch; }
.v3-top > .card { display: flex; flex-direction: column; }
.v3-top > .card > .tabpanel:not([hidden]) { flex: 1; display: flex; flex-direction: column; }
.v3-top > .card > .tabpanel:not([hidden]) > .more { margin-top: auto; padding-top: 16px; }
.v3-top > .rate-card > .rate-body { flex: 1; display: flex; flex-direction: column; }
.v3-top > .rate-card .rate-body > .tabpanel:not([hidden]) { flex: 1; display: flex; flex-direction: column; }
.v3-top > .rate-card .rate-body > .tabpanel:not([hidden]) > .more { margin-top: auto; padding-top: 12px; }
/* แท็บทั้งหมด: ฟอนต์/ขนาดเดียวกับเมนู nav (Sarabun 500 .87rem) */
.tabs button, .v3 .tabs button, .v3-top .tabs button, .rate-card .rtabs button { font: 500 .87rem/1.2 var(--font); }
@media (max-width: 680px) { .v3 .tabs button { font-size: .87rem; } }
/* ภาพกิจกรรม 4 ใบ/แถว */
.act-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.act-grid .bd { padding: 14px 16px 16px; gap: 8px; }
.act-grid .tt { font-size: .98rem; }
.act-grid .tag { left: 10px; top: 10px; padding: 3px 12px; font-size: .78rem; }
@media (max-width: 1060px) { .act-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .act-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .act-grid .tt { font-size: .9rem; } .act-grid .bd { padding: 10px 12px 12px; } }

/* E-Book (index3): ชั้นหนังสือ + จำนวนทั้งหมด */
.ebook { background: linear-gradient(180deg, #fff 0%, var(--sky) 100%); }
.eb-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.eb-head h2 { margin: 0; font-size: 1.6rem; font-weight: 700; line-height: 1.3; color: var(--navy); display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.eb-head h2 .ic { color: var(--blue); }
.eb-head p { margin: 2px 0 0; color: var(--muted); }
.eb-count { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 14px; border-radius: 99px; background: var(--blue); color: #fff; font: 500 .85rem var(--font); }
.eb-count b { font: 700 1.05rem var(--font-head); }
.shelf { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0 0 16px; list-style: none; position: relative; }
.shelf::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: 0; height: 10px; border-radius: 4px; background: linear-gradient(180deg, #cfdaf0, #aebfe0); box-shadow: 0 6px 12px rgba(18, 48, 107, .15); }
.shelf a { display: flex; flex-direction: column; gap: 6px; color: var(--ink); position: relative; z-index: 1; }
.shelf a:hover { text-decoration: none; }
.shelf .bk { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 4px 8px 8px 4px; overflow: hidden; background: #fff; color: var(--blue-2); box-shadow: 0 8px 18px rgba(18, 48, 107, .28), inset 6px 0 8px -4px rgba(0, 0, 0, .25); transition: transform .25s, box-shadow .25s; }
.shelf .bk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf a:hover .bk { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 16px 28px rgba(18, 48, 107, .35), inset 6px 0 8px -4px rgba(0, 0, 0, .25); }
.shelf .rd { position: absolute; inset: auto 0 0 0; padding: 8px; text-align: center; font: 600 .85rem var(--font); font-style: normal; color: #fff; background: linear-gradient(0deg, rgba(18, 48, 107, .92), rgba(18, 48, 107, 0)); opacity: 0; transition: opacity .2s; }
.shelf a:hover .rd, .shelf a:focus-visible .rd { opacity: 1; }
.shelf .bt { margin-top: 8px; font-weight: 600; font-size: .92rem; line-height: 1.4; color: var(--navy); text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf a:hover .bt { color: var(--blue); }
.shelf .by { text-align: center; font-size: .78rem; color: var(--muted); }
@media (max-width: 1060px) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; } }
@media (max-width: 680px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; } .eb-head h2 { font-size: 1.35rem; } }

/* E-Book: ตู้/ชั้นวางหนังสือไม้ (override ชุดก่อนหน้า) */
.ebook { background: #fff; }
.shelf { --gap: 24px; gap: 26px var(--gap); padding: 30px 30px 14px; border: 10px solid #3a2414; border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, rgba(255,255,255,0) 2px 46px),
    linear-gradient(180deg, #6a4527 0%, #4f321b 100%);
  box-shadow: inset 0 10px 24px rgba(0,0,0,.45), inset 0 -4px 10px rgba(0,0,0,.25), 0 10px 24px rgba(58,36,20,.28); }
.shelf::after { content: none; }
.shelf li { min-width: 0; }
.shelf a { gap: 0; }
.shelf .bk { order: 0; margin-bottom: -1px; }
.shelf a::before { content: ""; order: 1; display: block; height: 16px; margin-inline: calc(var(--gap) / -2);
  background: linear-gradient(180deg, #d1a46b 0 5px, #a97b46 5px 9px, #7d5530 9px 100%); box-shadow: 0 8px 12px rgba(0,0,0,.45); }
.shelf .bt { order: 2; margin-top: 14px; color: #f7e9d2; font-size: .92rem; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.shelf .by { order: 3; margin-top: 2px; color: #d9bd93; }
.shelf a:hover .bt { color: #fff; }
.shelf .bk { box-shadow: 0 -2px 0 rgba(255,255,255,.08), 8px 0 14px rgba(0,0,0,.35), inset 6px 0 8px -4px rgba(0,0,0,.3); }
.shelf a:hover .bk { transform: translateY(-8px) rotate(-1deg); box-shadow: 10px 0 20px rgba(0,0,0,.45), inset 6px 0 8px -4px rgba(0,0,0,.3); }
@media (max-width: 1060px) { .shelf { padding: 24px 22px 12px; } }
@media (max-width: 680px) { .shelf { --gap: 16px; border-width: 7px; padding: 18px 14px 10px; row-gap: 22px; } .shelf .bt { font-size: .85rem; } }

/* ชั้นไม้ต่อเนื่อง + ช่องว่างบนชั้น (เมื่อมีหนังสือน้อยกว่า 6 เล่ม) */
.shelf { --pad: 30px; }
.shelf a::before, .shelf .slot::after { margin-inline: calc(var(--gap) / -2); }
.shelf .slot { display: flex; flex-direction: column; }
.shelf .slot .bk { visibility: hidden; box-shadow: none; }
.shelf .slot::after { content: ""; display: block; height: 16px; order: 1;
  background: linear-gradient(180deg, #d1a46b 0 5px, #a97b46 5px 9px, #7d5530 9px 100%); box-shadow: 0 8px 12px rgba(0,0,0,.45); }
.shelf li:first-child a::before, .shelf li:first-child.slot::after { margin-left: calc(var(--pad) * -1); }
.shelf li:last-child a::before, .shelf li:last-child.slot::after { margin-right: calc(var(--pad) * -1); }
@media (max-width: 1060px) {
  .shelf { --pad: 22px; }
  .shelf .slot { display: none; }
  .shelf li:first-child a::before { margin-left: calc(var(--gap) / -2); }
  .shelf li:last-child a::before { margin-right: calc(var(--gap) / -2); }
  .shelf li:nth-child(3n+1) a::before { margin-left: calc(var(--pad) * -1); }
  .shelf li:nth-child(3n), .shelf li:last-child { }
  .shelf li:nth-child(3n) a::before { margin-right: calc(var(--pad) * -1); }
}
@media (max-width: 680px) {
  .shelf { --pad: 14px; }
  .shelf li:nth-child(3n+1) a::before { margin-left: calc(var(--gap) / -2); }
  .shelf li:nth-child(3n) a::before { margin-right: calc(var(--gap) / -2); }
  .shelf li:nth-child(2n+1) a::before { margin-left: calc(var(--pad) * -1); }
  .shelf li:nth-child(2n) a::before { margin-right: calc(var(--pad) * -1); }
}

/* E-Book: โทนไม้โอ๊กอ่อน (อ้างอิงภาพไม้ที่ให้มา) */
.shelf { border-color: #a9803f;
  background:
    repeating-linear-gradient(97deg, rgba(120,80,25,.10) 0 1px, rgba(255,255,255,0) 1px 7px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.10) 0 3px, rgba(255,255,255,0) 3px 60px),
    linear-gradient(180deg, #dcb877 0%, #c9a263 100%);
  box-shadow: inset 0 10px 22px rgba(110,70,20,.38), inset 0 -4px 10px rgba(110,70,20,.2), 0 10px 24px rgba(120,85,35,.3); }
.shelf a::before, .shelf .slot::after {
  background: linear-gradient(180deg, #efd7a6 0 5px, #d3ab68 5px 9px, #a9803f 9px 100%); box-shadow: 0 8px 12px rgba(90,60,20,.4); }
.shelf .bt { color: #4a2f12; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.shelf a:hover .bt { color: #1b3f9a; }
.shelf .by { color: #6d4d24; }
.shelf .bk { box-shadow: 8px 0 14px rgba(90,60,20,.35), inset 6px 0 8px -4px rgba(0,0,0,.3); }
.shelf a:hover .bk { box-shadow: 10px 0 20px rgba(90,60,20,.45), inset 6px 0 8px -4px rgba(0,0,0,.3); }

.shelf.is-empty .slot { display: flex; }
.eb-empty { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: .92rem; }
@media (max-width: 1060px) { .shelf.is-empty .slot:nth-child(n+4) { display: none; } .shelf.is-empty .slot:nth-child(1) a::before { } }
@media (max-width: 680px) { .shelf.is-empty .slot:nth-child(n+3) { display: none; } }
@media (max-width: 1060px) { .shelf .slot:nth-child(3n+1)::after { margin-left: calc(var(--pad) * -1); } .shelf .slot:nth-child(3n)::after { margin-right: calc(var(--pad) * -1); } }
@media (max-width: 680px) { .shelf .slot:nth-child(3n+1)::after { margin-left: calc(var(--gap) / -2); } .shelf .slot:nth-child(3n)::after { margin-right: calc(var(--gap) / -2); }
  .shelf .slot:nth-child(2n+1)::after { margin-left: calc(var(--pad) * -1); } .shelf .slot:nth-child(2n)::after { margin-right: calc(var(--pad) * -1); } }
.shelf.is-empty .slot .bk { aspect-ratio: 3 / 1.7; }

/* ปกแสดงเต็มภาพ 100% (ไม่ crop) — ปรับตามสัดส่วนจริงของภาพ วางชิดชั้นไม้ */
.shelf li:not(.slot) .bk { display: flex; align-items: flex-end; justify-content: center; background: transparent; overflow: visible; box-shadow: none; border-radius: 0; }
.shelf .im { position: relative; display: block; max-width: 100%; max-height: 100%; line-height: 0; border-radius: 3px 7px 7px 3px; overflow: hidden; background: #fff;
  box-shadow: 8px 0 14px rgba(90,60,20,.35), inset 6px 0 8px -4px rgba(0,0,0,.3); transition: transform .25s, box-shadow .25s; }
.shelf .im img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.shelf .im.noimg { width: 100%; height: 100%; display: grid; place-items: center; background: var(--sky); color: var(--blue-2); }
.shelf a:hover .im { transform: translateY(-8px) rotate(-1deg); box-shadow: 10px 0 20px rgba(90,60,20,.45), inset 6px 0 8px -4px rgba(0,0,0,.3); }
.shelf a:hover .bk { transform: none; box-shadow: none; }
/* ความสูงช่องปกคงที่ (3:4) เพื่อให้ชั้นไม้เสมอกันทุกเล่ม · ปกวางชิดชั้น ย่อพอดีช่องโดยไม่ crop */
.shelf li:not(.slot) .bk { position: relative; display: block; container-type: size; }
.shelf li:not(.slot) .im { position: absolute; left: 0; right: 0; bottom: 0; margin-inline: auto; width: fit-content; max-width: 100%; max-height: 100%; }
.shelf li:not(.slot) .im img { max-width: 100cqw; max-height: 100cqh; }
.shelf li:not(.slot) .im.noimg { width: 100%; height: 100%; }
