/* =====================================================================
   เว็บไซต์โครงการสะพานปทุมธานี 3 — CMS ใหม่
   หน้าตาเดียวกับเว็บ WordPress เดิม (ธีม Customify + Elementor) แต่เขียนใหม่ทั้งหมด
   ===================================================================== */
:root {
  --blue: #2b3990;          /* หัวข้อ */
  --line: #5b6fce;          /* เส้นใต้หัวข้อ */
  --orange: #f14a14;        /* เมนูที่เลือก / hover */
  --pill: #8f8271;          /* ปุ่มเมนู */
  --navbg: #e0e0e0;
  --text: #686868;
  --muted: #7a7a7a;
  --side: #d1d3d4;          /* พื้นแถบขวา */
  --footer: #1c75bc;
  --topbar: #235787;
  --dash: #b9b9b9;
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Kanit", sans-serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 27px;
  color: var(--text);
  background: #fff;
}
img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--orange); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 14px; z-index: 99; }
.skip:focus { left: 10px; }

/* ---------------- แถบบน ---------------- */
.topbar { background-color: #1c75bc; background-repeat: no-repeat; background-position: left top; height: 29px; }
.topbar-in { display: flex; justify-content: flex-end; align-items: center; height: 29px; }
.socials { display: flex; gap: 6px; }
.soc { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50%; color: #fff; }
.soc-facebook { background: #3b5998; }
.soc-youtube { background: #e52d27; }
.soc-instagram { background: #262626; }
a.soc:hover { color: #fff; filter: brightness(1.15); }

/* ---------------- หัวเว็บ ---------------- */
.site-header { position: relative; height: 250px; overflow: hidden; isolation: isolate; background-color: #cfe8f7; }
/* ภาพแบนเนอร์จริง (กว้าง 1400px) วางกลางจอ ให้ตรงกับโลโก้ทุกขนาดจอ */
.site-header::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1400px; transform: translateX(-50%); z-index: -1; background: var(--hb) center top / auto 100% no-repeat; }
@media (min-width: 1440px) {
  /* ขอบซ้าย-ขวาของภาพค่อย ๆ จางเข้ากับพื้นหลัง ไม่เห็นรอยต่อ */
  .site-header::after { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 160px, #000 calc(100% - 160px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 160px, #000 calc(100% - 160px), transparent 100%); }
}
/* จอกว้างกว่าภาพ: เติมขอบซ้าย-ขวาด้วยภาพเดียวกันแบบเบลอ ไม่ให้เห็นช่องว่าง */
.site-header::before { content: ""; position: absolute; inset: -60px; z-index: -2; background: var(--hb) center / cover no-repeat; filter: blur(40px); }
.header-in { position: relative; height: 250px; display: flex; align-items: flex-start; }
.logo { display: block; width: 182px; margin-top: 18px; }
.logo img { width: 182px; height: auto; display: block; }
.nav-toggle { display: none; }
.site-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* ---------------- เมนู (ปุ่มแคปซูล) ---------------- */
.mainnav { background: var(--navbg); height: 40px; position: relative; z-index: 20; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; }
.menu > li { position: relative; margin-right: 30px; }
.menu > li:last-child { margin-right: 0; }
.pill {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 80px;
  font-size: 15px; font-weight: 600; font-style: oblique; letter-spacing: .4px; line-height: 15px; white-space: nowrap;
  color: #000; background: var(--pill); border: 1px dotted #000; border-radius: 30px;
  transition: background .2s, color .2s;
}
.pill:hover, .pill.on, .has-sub:hover > .pill, .has-sub:focus-within > .pill { background: var(--orange); color: #fff; border-color: var(--orange); }
.caret { margin-top: 2px; }
.sub {
  list-style: none; margin: 0; padding: 6px 0; position: absolute; left: 0; top: 100%; min-width: 196px;
  background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.12); border-radius: 0 0 4px 4px;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s;
}
.has-sub:hover .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.sub a { display: block; padding: 9px 15px; font-size: 15.4px; font-weight: 200; line-height: 23px; color: rgba(0,0,0,.55); white-space: nowrap; }
.sub a:hover { color: var(--orange); }
.titlebar { height: 43px; background: #f9f9f9; border-bottom: 1px solid #ececec; }

/* ---------------- โครงหน้า: เนื้อหา 9 / แถบขวา 3 ---------------- */
.site-body { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 3fr); }
.content { padding: 36px 28px 60px 0; border-right: 1px solid #eaecee; min-width: 0; }
.sidebar { padding: 36px 0 36px 14px; }

/* หัวข้อ (italic น้ำเงิน + เส้นคู่) */
.sec-title {
  margin: 20px 10px 52px; padding: 0 20px 6px; border-bottom: 3px double var(--line);
  font-size: 29.4px; line-height: 1.15; font-weight: 600; font-style: italic; color: var(--blue);
  animation: slideIn .6s ease both;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* กล่องเส้นประมุมมน */
.box { display: block; border: 1px dashed #8a8a8a; border-radius: 16px; padding: 20px; background: #fff; }
.entry { margin: 0 0 30px 0; padding: 20px 20px 24px; }

/* ---------------- การ์ดข่าว (หน้าแรก) ---------------- */
.news-card {
  display: grid; grid-template-columns: 368px minmax(0, 1fr); gap: 20px;
  border: 1px dashed var(--dash); padding: 20px; margin: 0 0 40px 0; background: #fff;
  animation: fadeUp .5s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.nc-media { display: block; align-self: start; }
.nc-media img { width: 100%; display: block; }
.nc-ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 16/10; background: #f2f2f2; }
.nc-ph img { width: 90px; opacity: .6; }
.nc-body h3 { margin: 0 0 18px; font-size: 14px; line-height: 27px; font-weight: 700; font-style: italic; }
.nc-body h3 a { color: var(--muted); }
.nc-body h3 a:hover { color: var(--orange); }
.nc-body p { margin: 0 0 24px; font-style: italic; font-weight: 400; color: var(--muted); }
.btn-more {
  display: inline-block; padding: 10px 20px; border-radius: 39px; font-size: 13px; font-weight: 500; line-height: 13px; color: #fff;
  background: linear-gradient(180deg, #697def 0%, rgba(242, 41, 91, .02) 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.btn-more:hover { color: #fff; background: linear-gradient(180deg, #f14a14 0%, rgba(242, 74, 20, .15) 100%); }
.empty { color: var(--muted); font-style: italic; padding: 0 20px; }

/* ---------------- เนื้อหา rich text ---------------- */
.rich { font-style: italic; color: var(--muted); }
.rich p { margin: 0 0 14px; }
.rich h2, .rich h3, .rich h4 { color: var(--blue); font-style: italic; font-weight: 600; line-height: 1.4; margin: 10px 0 12px; }
.rich img { display: block; margin: 16px auto; }
.rich a { color: var(--blue); text-decoration: underline; }
.rich ul, .rich ol { padding-left: 22px; }
.rich table { border-collapse: collapse; max-width: 100%; }
.rich td, .rich th { border: 1px solid #ddd; padding: 6px 10px; }
.rich .img-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; margin: 40px 0 10px; }
.rich .img-row img { margin: 0; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.rich .video { position: relative; padding-top: 56.25%; margin: 16px 0; }
.rich .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rich iframe { max-width: 100%; }

.gallery { display: grid; gap: 22px; margin-top: 20px; }
.gallery figure { margin: 0; text-align: center; }
.gallery img { max-width: 724px; width: 100%; }
.docs { margin-top: 24px; border-top: 1px dashed #ccc; padding-top: 14px; }
.docs h4 { margin: 0 0 8px; color: var(--blue); font-style: italic; }
.docs ul { list-style: none; margin: 0; padding: 0; }
.docs li { padding: 4px 0; }
.ext { display: inline-block; min-width: 38px; padding: 0 6px; margin-right: 6px; border-radius: 4px; background: #c0392b; color: #fff; font-size: 11px; font-weight: 600; text-align: center; line-height: 20px; font-style: normal; }
.back { margin: 0 10px; font-style: italic; }

/* เกี่ยวกับโครงการ: รายการกล่อง */
.link-boxes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.link-boxes .box { padding: 14px 20px; font-size: 17px; font-weight: 600; font-style: italic; color: var(--muted); }
.link-boxes .box:hover { color: var(--blue); border-color: var(--line); }

/* ติดต่อเรา */
.contact-list { display: grid; gap: 30px; }
.contact-card { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 30px; align-items: start; border: 1px dashed #8a8a8a; border-radius: 16px; padding: 30px 30px 40px; }
.contact-card .contact-logo { text-align: center; }
.contact-card .contact-logo img { margin: 0 auto; }
.contact-card h4 { margin: 0 0 18px; font-size: 15px; font-weight: 700; color: var(--muted); }
.contact-card p { margin: 0 0 12px; }

/* เลขหน้า */
.pager { display: flex; gap: 6px; justify-content: center; margin: 10px 0 30px; }
.pager a, .pager span { min-width: 34px; height: 34px; line-height: 34px; text-align: center; border-radius: 17px; border: 1px dotted #000; color: #000; background: var(--navbg); font-style: italic; }
.pager span, .pager a:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ---------------- แถบขวา ---------------- */
.sidebar-in { background: var(--side); padding: 14px 14px 34px; }
.sb-group { margin: 0 0 32px; }
.sb-head { margin: 0 0 14px; font-size: 0; line-height: 0; }
.sb-head img { width: 100%; display: block; }
.sb-head-text { font-size: 16px; line-height: 1.4; }
.sb-head-text span { display: block; padding: 22px 12px; text-align: center; color: var(--blue); background: #e5e6e8; border: 1px solid #bcbec0; border-radius: 12px; font-weight: 400; }
.sb-box { background: #fff; padding: 2px 0; }
.sb-documents .sb-box { background: #f8f8f8; padding: 0; }
.sb-item { display: block; }
.sb-item img { width: 100%; display: block; }
a.sb-item:hover img { opacity: .82; }
.sb-text { display: block; padding: 12px 18px; border-bottom: 1px dashed #aaa; color: var(--blue); line-height: 1.5; }
.sb-qr { background: #fff; padding: 4px; }
.sb-qr img { width: 100%; display: block; }

/* ---------------- ท้ายเว็บ ---------------- */
.site-footer { background: var(--footer); color: #fff; }
.footer-in { display: grid; grid-template-columns: 3fr 9fr; align-items: center; min-height: 35px; }
.counter { display: flex; align-items: center; gap: 6px; }
.counter h4 { margin: 0; font-size: 16px; font-weight: 600; color: #fff; }
.digits { display: inline-flex; background: #1d1d1d; border: 3px inset #fff; border-radius: 2px; padding: 0 3px; height: 30px; align-items: center; }
.digits i { font-style: italic; font-family: "Kanit", monospace; font-weight: 500; font-size: 22px; line-height: 1; width: 16px; text-align: center; color: #e632e6; text-shadow: 0 0 4px rgba(230, 50, 230, .55); }
.digits i.off { color: #3a2a3a; text-shadow: none; }
.copy { margin: 0 0 0 60px; font-size: 13px; font-weight: 200; font-style: italic; color: rgba(255,255,255,.85); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1199px) {
  .pill { padding: 0 44px; }
  .menu > li { margin-right: 16px; }
}
@media (max-width: 991px) {
  .site-header { height: 160px; }
  .site-header::after { left: 0; width: 100%; transform: none; background-position: 30% top; }
  .header-in { height: 160px; align-items: center; }
  .logo { width: 120px; margin-top: 0; }
  .logo img { width: 120px; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    width: 54px; height: 46px; padding: 0 12px; background: rgba(255,255,255,.85); border: 1px solid #ccc; border-radius: 6px; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: #333; }
  .nav-toggle em { font-size: 9px; line-height: 1; font-style: normal; color: #333; text-align: center; margin-top: 2px; }
  .mainnav { height: auto; display: none; padding: 10px 0; }
  .mainnav.open { display: block; }
  .menu { flex-direction: column; gap: 8px; }
  .menu > li { margin: 0; }
  .pill { padding: 0 24px; justify-content: center; }
  .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: transparent; padding: 4px 0 0; }
  .sub a { text-align: center; }
  .site-body { grid-template-columns: 1fr; }
  .content { padding: 24px 0 30px; border-right: 0; }
  .sidebar { padding: 0 0 30px; }
  .sidebar-in { max-width: 420px; margin: 0 auto; }
  .titlebar { height: 14px; }
}
@media (max-width: 700px) {
  .container { padding: 0 16px; }
  .site-header { height: auto; }
  .site-header::after { left: 0; width: 100%; transform: none; background: linear-gradient(90deg, rgba(255,255,255,.96) 60%, rgba(255,255,255,.8)), var(--hb) right top / cover no-repeat; }
  .header-in { height: auto; min-height: 104px; padding-top: 10px; padding-bottom: 10px; gap: 12px; padding-right: 76px; }
  .logo, .logo img { width: 80px; flex: 0 0 80px; position: relative; }
  .site-name { position: relative; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; font-size: 14px; line-height: 1.45; font-weight: 600; color: #1d3f8f; }
  .nav-toggle { right: 16px; }
  .sec-title { font-size: 22px; margin: 6px 0 28px; padding: 0 4px 6px; }
  .news-card { grid-template-columns: 1fr; padding: 14px; margin-bottom: 24px; }
  .entry { padding: 16px 14px; }
  .rich .img-row { grid-template-columns: 1fr; }
  .contact-card { grid-template-columns: 1fr; padding: 20px; gap: 14px; }
  .contact-card .contact-logo img { max-width: 140px; }
  .footer-in { grid-template-columns: 1fr; gap: 4px; padding: 8px 16px; text-align: center; }
  .counter { justify-content: center; }
  .copy { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sec-title, .news-card { animation: none; }
}
.sec-title.sm { font-size: 22px; line-height: 1.35; }
