/* ═══════════════════════════════════════════════════════════════
   home3.css — หน้าแรกแบบที่ 3 (index3.php): คอลัมน์เดียวเต็มความกว้าง ตามหน้าเว็บเดิมของ อบต.บ้านโป่ง
   ใช้ตัวแปร/คอมโพเนนต์จาก site.css (.card .tabs .items .act-grid .videos .btn) — ไฟล์นี้เพิ่มเฉพาะส่วนที่หน้านี้ใช้
   ═══════════════════════════════════════════════════════════════ */
.h3-wrap { display: grid; gap: 22px; padding-block: 22px 32px; min-width: 0; }
.h3-wrap > * { min-width: 0; }

/* ── ปุ่มด่วน 4 ช่อง ─────────────────────────────────────── */
.h3-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--navy); }
.h3-tiles .tile { display: flex; align-items: center; gap: 14px; padding: 18px 20px; color: #fff; min-height: 88px; transition: filter .2s; }
.h3-tiles .tile:hover { text-decoration: none; filter: brightness(1.12); color: #fff; }
.h3-tiles .t1 { background: var(--blue); }
.h3-tiles .t2 { background: var(--navy); }
.h3-tiles .t3 { background: #174596; }
.h3-tiles .t4 { background: #0e2a63; }
.h3-tiles .ico { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.h3-tiles .tx { min-width: 0; display: grid; gap: 1px; line-height: 1.4; }
.h3-tiles .tx b { font: 600 .92rem/1.4 var(--font-head); overflow-wrap: anywhere; }
.h3-tiles .tx small { font-size: .78rem; opacity: .9; overflow-wrap: anywhere; }

/* ── บริการประชาชน (E-Service): ปุ่มไอคอนขนาดเล็ก แสดงทุกปุ่ม เกิน 1 แถวขึ้นบรรทัดใหม่ ─────────── */
.h3-svc { padding-block: 16px 18px; }
.h3-svc .svc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.h3-svc .svc-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 1.1rem/1.4 var(--font-head); color: var(--navy); }
.h3-svc .svc-head h2 .ic { color: var(--blue); }
.svc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }   /* 6 ปุ่ม/แถว เกินขึ้นบรรทัดใหม่ */
.svc-grid li { display: flex; min-width: 0; }
.svc { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 12px 8px 10px; text-align: center;
       background: var(--sky, #eaf2ff); border: 1px solid #d3e2f8; border-radius: 10px; color: var(--navy); line-height: 1.3; transition: transform .2s, box-shadow .2s, border-color .2s, background .2s; }
.svc:hover { text-decoration: none; color: var(--navy); background: #fff; border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(18, 48, 107, .14); }
.svc:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.svc-ic { display: grid; place-items: center; height: 30px; margin-bottom: 3px; color: var(--navy); }
.svc-ic .ic { width: 26px; height: 26px; }
.svc b { font: 600 .84rem/1.35 var(--font-head); overflow-wrap: anywhere; }
.svc small { font-size: .73rem; color: #5b6b8a; overflow-wrap: anywhere; }

/* ── แท็บประกาศ: 1 แถว ฟอนต์เล็ก (จอแคบเลื่อนแนวนอนในแถบ ไม่ขึ้นบรรทัดใหม่) ─────────── */
.h3 [data-tabs] .tabs { flex-wrap: nowrap; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding-bottom: 6px; }
.h3 [data-tabs] .tabs [role="tab"] { flex: 0 0 auto; white-space: nowrap; font-size: .82rem; padding: 6px 10px; gap: 5px; }
.h3 [data-tabs] .tabs [role="tab"] .ic { width: 14px; height: 14px; }

/* ── โปสเตอร์เด่น (center) ─────────────────────────────── */
.h3-posters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.h3-posters .poster { display: block; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
a.poster:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(18, 48, 107, .16); }
.h3-posters .poster img { display: block; width: 100%; height: auto; }

/* ── ภาพกิจกรรม / กิจกรรมโครงการ: 3 คอลัมน์ ───────────── */
.act-grid.h3-acts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.h3-acts .tt { font-size: .88rem; -webkit-line-clamp: 3; line-clamp: 3; }
.h3-acts .tag.is-new { background: var(--red); }

/* ── ภาพกิจกรรมแบบ feature: สไลด์เด่น (ซ้าย) + รายการล่าสุด (ขวา) ─────────── */
.fp-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.fp-grid.solo { grid-template-columns: minmax(0, 1fr); }
.fp-main { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 2px 10px rgba(18, 48, 107, .06); }
.fp-slides { display: block; flex: 1; }
.fp[data-ready] .fp-slides { display: grid; }
.fp[data-ready] .fp-slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; }
.fp[data-ready] .fp-slide.is-on { opacity: 1; visibility: visible; }
.fp-slide { display: flex; flex-direction: column; min-width: 0; }
.fp-ph { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); }
.fp-ph .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.8); transform: scale(1.15); }
.fp-ph .fg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; }
.fp-ph .none { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: .5; }
.fp-ph .tag { position: absolute; z-index: 2; left: 14px; top: 14px; padding: 4px 14px; border-radius: 99px; background: var(--blue); color: #fff; font: 600 .85rem var(--font-head); }
.fp-ph .tag.is-new { background: var(--red); }
.fp-bd { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 22px 8px; }
.fp-bd h3 { margin: 0; font: 600 1.05rem/1.5 var(--font-head); color: var(--navy); overflow-wrap: anywhere; }   /* หัวเรื่องแสดงครบ ไม่จำกัดบรรทัด */
.fp-bd h3 a { color: inherit; }
.fp-bd h3 a:hover { color: var(--blue); text-decoration: none; }
.fp-bd .ds { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fp-ft { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.fp-ft time { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 600; font-size: .82rem; }
.fp-ft .btn { padding: 8px 26px; }
.fp-ctl { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 0 14px; }
.fp-ctl[hidden] { display: none; }
.fp-ctl .pv, .fp-ctl .nx { border: 0; background: transparent; color: var(--navy); font: 700 1.5rem/1 sans-serif; cursor: pointer; padding: 0 8px 3px; border-radius: 8px; }
.fp-ctl .pv:hover, .fp-ctl .nx:hover { background: var(--sky); }
.fp-ctl .dots { display: inline-flex; gap: 9px; }
.fp-ctl .dt { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: var(--sky-2); cursor: pointer; }
.fp-ctl .dt[aria-current="true"] { background: var(--blue); transform: scale(1.25); }

.fp-side { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 2px 10px rgba(18, 48, 107, .06); padding: 6px 18px 10px; }
.fp-sh { margin: 0; padding: 14px 0 10px 12px; border-left: 5px solid var(--blue); font: 700 1rem/1.3 var(--font-head); color: var(--navy); margin-top: 10px; margin-bottom: 4px; }
.fp-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; flex: 1; }
.fp-side li { flex: 1 1 auto; border-bottom: 1px solid var(--line); }
.fp-side li:last-child { border-bottom: 0; }
.fp-side li a { display: flex; gap: 14px; align-items: center; height: 100%; padding: 12px 4px; color: inherit; }
.fp-side li a:hover { background: var(--sky); text-decoration: none; }
.fp-side .th { flex: none; width: 104px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--sky); display: grid; place-items: center; color: var(--blue-2); }
.fp-side .th img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.fp-side .tx { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fp-side .tt { color: var(--navy); font-weight: 600; font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }   /* หัวเรื่องแสดงครบ ไม่จำกัดบรรทัด */
.fp-side .mt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fp-side time { color: var(--muted); font-size: .78rem; }
.fp-side .chip { padding: 1px 12px; border-radius: 99px; background: var(--sky); color: var(--blue); font: 600 .75rem/1.6 var(--font-head); }
.fp-side .chip.is-new { background: #fde8ea; color: var(--red); }

@media (max-width: 1000px) {
  .fp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .fp-bd { padding: 14px 16px 6px; }
  .fp-bd h3 { font-size: 1rem; }
  .fp-side { padding-inline: 12px; }
  .fp-side .th { width: 84px; }
}

/* ── การ์ดรายการ ─────────────────────────────────────── */
.h3 .card > h2, .h3 .act-head h2 { font-size: 1.35rem; }   /* เท่าหัวการ์ดหน้าแรกปงเตา (.hm-center .card > h2) */
/* รายการเอกสาร/ข่าว (แท็บ ·ประกาศการเลือกตั้ง): ฟอนต์เท่าหน้าแรกปงเตา (.hm-list: ชื่อ .88rem · วันที่ .78rem) */
.h3 .items .item a.tt, .h3 .items .item .tt { font-size: .88rem; font-weight: 500; }
.h3 .items .item time { font-size: .78rem; }
.h3-more { margin-top: 14px; text-align: center; }
.h3 .tabs { gap: 4px 6px; }

/* ── แบนเนอร์คั่น ────────────────────────────────────── */
.h3-break { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.h3-break img { display: block; width: 100%; height: auto; }

/* ── วิดีโอ / หน่วยงานภายนอก ─────────────────────────── */
.videos.h3-videos { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.h3-cols { list-style: none; margin: 0; padding: 0; columns: 3 260px; column-gap: 32px; }
.h3-cols li { break-inside: avoid; padding: 7px 0 7px 18px; position: relative; border-bottom: 1px dashed var(--line); }
.h3-cols li::before { content: ""; position: absolute; left: 4px; top: 1.15em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.h3-cols a { color: var(--navy); overflow-wrap: anywhere; }
.h3-cols a:hover { color: var(--blue); }

/* ── ประกาศ กองคลัง: แท็บ 3 หมวด · รายการมีรูปย่อ 2 คอลัมน์ (หัวเรื่องแสดงครบทุกบรรทัด) ───────── */
.fin-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.fin-list li { min-width: 0; border-bottom: 1px solid var(--line); }
.fin-list a { display: flex; gap: 14px; align-items: center; height: 100%; padding: 10px 4px; color: inherit; }
.fin-list a:hover { background: var(--sky); text-decoration: none; }
.fin-list a:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.fin-list .th { flex: none; width: 96px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--sky); display: grid; place-items: center; color: var(--blue-2); }
.fin-list .th img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.fin-list .tx { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.fin-list .tt { color: var(--navy); font-weight: 500; font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }
.fin-list .mt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fin-list time { color: var(--muted); font-size: .78rem; }
.fin-list .chip { padding: 1px 12px; border-radius: 99px; background: var(--sky); color: var(--blue); font: 600 .75rem/1.6 var(--font-head); }
.fin-list .chip.is-new { background: #fde8ea; color: var(--red); }
@media (max-width: 1000px) { .fin-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .fin-list .th { width: 80px; } }

/* ── ปุ่มเลือกภาษา / ข้อความต้อนรับ (เหมือน home.css) ───── */
.hm-tr { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; margin: -8px 0 -6px; }
.hm-tr-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--navy); font: 500 .88rem var(--font); cursor: pointer; box-shadow: var(--shadow); }
.hm-tr-btn:hover, .hm-tr-btn[aria-expanded="true"] { background: var(--sky); border-color: var(--blue); }
.hm-tr-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.hm-intro { overflow-x: auto; }
.hm-intro img { max-width: 100%; height: auto; }

/* ── จอเล็ก ──────────────────────────────────────────── */
@media (max-width: 1000px) {
  .h3-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .h3-posters, .act-grid.h3-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .videos.h3-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .h3-wrap { padding-inline: 14px; gap: 16px; }
  .h3-tiles, .h3-posters, .act-grid.h3-acts, .videos.h3-videos { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .h3 .card { padding: 16px 14px; }
}
