/*
Theme Name: Ratchakan Online
Theme URI: https://ratchakan-online.example.com
Author: Ratchakan Online Team
Author URI: https://ratchakan-online.example.com
Description: Theme รวมข้อมูลบริการภาครัฐสำหรับประชาชน — มี Custom Post Type "บริการ" และ Taxonomy "จังหวัด" / "หน่วยงาน" รองรับภาษาไทยเต็มรูปแบบ ใช้ฟอนต์ IBM Plex Sans Thai
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ratchakan-online
Tags: thai, government, services, custom-post-type, sticky-header
*/

/* ===== CSS VARIABLES ===== */
:root {
  --navy:       #00204B;
  --navy-90:    #0a2e5c;
  --navy-10:    #e7ebf2;
  --navy-05:    #f3f5f9;
  --navy-hover: #dce4f0;
  --red:        #E62020;
  --red-dark:   #c71414;
  --red-10:     #fde9e9;
  --green:      #35bb6d;
  --green-dark: #28a05d;
  --green-soft: #eaf9f1;
  --ink:        #101522;
  --ink-2:      #3a4256;
  --ink-3:      #6b7388;
  --rule:       #d9dde5;
  --rule-2:     #ecedf1;
  --bg:         #ffffff;
  --bg-soft:    #f6f7f9;
  --bg-cream:   #f4efe8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); -webkit-clip-path: inset(50%); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}

/* ===== UTILITY BAR ===== */
.util { background: var(--navy); color: #c7d0df; font-size: 13px; }
.util-inner { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.util a { color: #c7d0df; }
.util a:hover { color: #fff; text-decoration: none; }
.util-left, .util-right { display: flex; gap: 22px; align-items: center; }
.util-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 6px; }

/* ===== HEADER ===== */
header.site { border-bottom: 1px solid var(--rule-2); background: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 8px rgba(0,32,75,.06); }
.brandrow { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.crest { width: 60px; height: 60px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.crest img { width: 60px; height: 60px; object-fit: contain; display: block; }
.brand-txt .name { font-weight: 600; font-size: 17px; color: var(--navy); }
.brand-txt .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--rule); background: #fff; padding: 9px 16px; border-radius: 4px; font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--navy); background: var(--navy-hover); text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-90); border-color: var(--navy-90); }
nav.main { border-top: 1px solid var(--rule-2); }
.navlist { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.navlist a { display: block; padding: 14px 18px; font-size: 15px; font-weight: 500; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; transition: color .12s; }
.navlist a:hover { color: var(--navy); border-bottom-color: var(--navy); text-decoration: none; }
.navlist a.active,
.navlist .current-menu-item > a,
.navlist .current_page_item > a,
.navlist .current-menu-ancestor > a { color: var(--navy); border-bottom-color: var(--navy); }

/* Hamburger button — hidden on desktop */
.menu-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: #fff; border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; flex-direction: column; gap: 5px; transition: border-color .15s, background .15s; }
.menu-toggle:hover { border-color: var(--navy); background: var(--navy-hover); }
.menu-toggle-bar { display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] { background: var(--navy); border-color: var(--navy); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar { background: #fff; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== BREADCRUMB ===== */
.breadcrumb-bar { background: var(--bg-soft); border-bottom: 1px solid var(--rule-2); }
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 14px 0; font-size: 14px; color: var(--ink-3); flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--navy); text-decoration: none; }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--ink); font-weight: 500; }

/* ===== HOMEPAGE: HERO ===== */
.hero { background: var(--bg-cream); border-bottom: 1px solid var(--rule-2); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; align-items: stretch; min-height: 480px; }
.hero-left { padding: 72px 0 64px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.hero h1 { font-size: clamp(40px, 5vw, 64px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; color: var(--navy); margin: 0 0 16px; max-width: 12ch; }
.hero-lead { font-size: 18px; color: var(--ink-2); margin: 0 0 32px; max-width: 40ch; }
.searchbox { display: flex; align-items: stretch; background: #fff; border: 2px solid var(--navy); border-radius: 6px; box-shadow: 0 4px 24px rgba(0,32,75,.1); max-width: 560px; }
.searchbox svg.si { align-self: center; margin: 0 14px; color: var(--ink-3); flex-shrink: 0; }
.searchbox input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; padding: 18px 0; color: var(--ink); }
.searchbox input::placeholder { color: var(--ink-3); }
.searchbox button { background: var(--navy); color: #fff; border: 0; padding: 0 28px; font: inherit; font-size: 16px; font-weight: 600; border-radius: 0 3px 3px 0; cursor: pointer; white-space: nowrap; transition: background .15s; }
.searchbox button:hover { background: var(--navy-90); }
.hints { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--ink-3); max-width: 560px; }
.hints strong { color: var(--ink-2); font-weight: 500; margin-right: 2px; }
.hints a { color: var(--navy); font-weight: 500; border-bottom: 1px solid transparent; }
.hints a:hover { border-bottom-color: var(--navy); text-decoration: none; }
.hero-right { position: relative; overflow: hidden; background: var(--navy); }
.hero-right img.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }
.hero-right .photo-tag { position: absolute; left: 24px; bottom: 24px; background: #fff; color: var(--navy); padding: 12px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,32,75,.2); display: flex; align-items: center; gap: 10px; }
.photo-tag .dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; flex-shrink: 0; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ===== ANNOUNCEMENT ===== */
.ann { border-bottom: 1px solid var(--rule-2); background: #fff; }
.ann-inner { display: flex; align-items: center; gap: 16px; padding: 13px 0; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.ann-badge { background: var(--red); color: #fff; padding: 2px 10px; border-radius: 3px; font-size: 11px; font-weight: 700; letter-spacing: .05em; flex-shrink: 0; }
.ann-sep { color: var(--rule); }
.ann-inner a { color: var(--navy); font-weight: 600; }
.ann-inner a:hover { text-decoration: underline; }

/* ===== SECTIONS ===== */
.section { padding: 80px 0; border-bottom: 1px solid var(--rule-2); }
.section.alt { background: var(--bg-soft); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 36px; gap: 24px; }
.sec-head h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 600; color: var(--navy); margin: 0; letter-spacing: -0.015em; }
.sec-head p { font-size: 16px; color: var(--ink-3); margin: 8px 0 0; }
.sec-see-all { color: var(--green-dark); font-size: 15px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.sec-see-all:hover { text-decoration: underline; }

/* ===== POPULAR SERVICES GRID ===== */
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.svc { background: #fff; padding: 26px 24px 22px; display: flex; flex-direction: column; min-height: 180px; transition: background .15s; text-decoration: none; color: inherit; position: relative; }
.svc:hover { background: var(--navy-hover); text-decoration: none; }
.svc-num { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .08em; margin-bottom: 14px; }
.svc h3 { font-size: 17px; font-weight: 600; color: var(--navy); margin: 0 0 6px; line-height: 1.3; letter-spacing: -0.005em; }
.svc p { font-size: 13px; color: var(--ink-3); margin: 0; line-height: 1.5; }
.svc-meta { margin-top: auto; padding-top: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-3); }
.svc-time { display: flex; align-items: center; gap: 5px; }
.svc-arrow { color: var(--green-dark); font-size: 18px; font-weight: 600; transition: transform .18s; }
.svc:hover .svc-arrow { transform: translateX(4px); }

/* ===== LIFE EVENTS ===== */
.life-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.life { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 28px 24px; display: flex; gap: 18px; align-items: flex-start; transition: border-color .15s, box-shadow .15s; text-decoration: none; color: inherit; }
.life:hover { border-color: var(--navy); box-shadow: 0 4px 16px rgba(0,32,75,.08); text-decoration: none; }
.life-ico { width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; background: var(--navy-05); display: grid; place-items: center; color: var(--navy); }
.life h3 { font-size: 18px; font-weight: 600; color: var(--navy); margin: 4px 0 6px; }
.life p { font-size: 13px; color: var(--ink-3); margin: 0 0 12px; line-height: 1.55; }
.life .count { font-size: 13px; font-weight: 600; color: var(--green-dark); display: inline-flex; align-items: center; gap: 5px; }

/* ===== PROVINCES STRIP ===== */
.province-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.prov-cell { background: #fff; padding: 20px 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: background .12s; }
.prov-cell:hover { background: var(--navy-hover); text-decoration: none; }
.prov-cell.featured { background: var(--navy); color: #fff; }
.prov-cell.featured:hover { background: var(--navy-90); }
.prov-cell .pname { font-size: 15px; font-weight: 600; color: var(--navy); }
.prov-cell.featured .pname { color: #fff; }
.prov-cell .pcount { font-size: 12px; color: var(--ink-3); }
.prov-cell.featured .pcount { color: rgba(255,255,255,.55); }
.prov-see-all { background: var(--bg-soft); border: 1px solid var(--rule); border-radius: 6px; padding: 16px 24px; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; color: var(--ink-2); transition: background .15s; text-decoration: none; }
.prov-see-all:hover { background: var(--navy-hover); text-decoration: none; }
.prov-see-all strong { color: var(--navy); font-weight: 600; }

/* ===== TRUST STRIP ===== */
.trust { padding: 48px 0; border-bottom: 1px solid var(--rule-2); background: #fff; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.trust-item { display: flex; flex-direction: column; gap: 6px; }
.trust-item .n { font-size: 40px; font-weight: 700; color: var(--navy); letter-spacing: -0.025em; line-height: 1; }
.trust-item .n span { color: var(--green); }
.trust-item .l { font-size: 14px; color: var(--ink-3); }
.trust-divider { width: 32px; height: 3px; background: var(--green); border-radius: 2px; margin-bottom: 6px; }

/* ===== CTA BANNER ===== */
.cta-banner { background: var(--navy); padding: 64px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.cta-inner h2 { font-size: 32px; font-weight: 600; color: #fff; margin: 0 0 8px; letter-spacing: -0.015em; }
.cta-inner p { font-size: 16px; color: rgba(255,255,255,.6); margin: 0; }
.cta-btns { display: flex; gap: 12px; flex-shrink: 0; }
.btn-green-lg { background: var(--green); color: #fff; padding: 14px 28px; border-radius: 4px; font: inherit; font-size: 16px; font-weight: 700; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; transition: background .15s; }
.btn-green-lg:hover { background: var(--green-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; padding: 14px 28px; border-radius: 4px; font: inherit; font-size: 16px; font-weight: 600; border: 1.5px solid rgba(255,255,255,.4); cursor: pointer; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; transition: border-color .15s; }
.btn-ghost:hover { border-color: #fff; text-decoration: none; }

/* ===== SERVICE PAGE: HERO ===== */
.a-hero { background: var(--navy); color: #fff; padding: 56px 0 64px; }
.a-hero .agency-tag { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85); margin-bottom: 20px; }
.a-hero h1 { font-size: clamp(36px, 4.5vw, 56px); letter-spacing: -0.02em; font-weight: 600; margin: 0 0 16px; line-height: 1.1; }
.a-hero .lead { font-size: 18px; color: rgba(255,255,255,.7); max-width: 52ch; margin: 0; }
.a-hero .meta-pills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); padding: 10px 18px; border-radius: 4px; font-size: 15px; color: #fff; }
.pill svg { opacity: .7; flex-shrink: 0; }
.pill strong { font-weight: 600; }

/* ===== SERVICE PAGE: BODY ===== */
.a-body { padding: 56px 0 80px; }
.a-cols { display: grid; grid-template-columns: 1fr 360px; gap: 48px; align-items: start; }
.a-main > * + * { margin-top: 56px; }
.sec-label { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.sec-label .icon-wrap { width: 40px; height: 40px; border-radius: 8px; background: var(--navy-05); color: var(--navy); display: grid; place-items: center; flex-shrink: 0; }
.sec-label h2 { font-size: 24px; font-weight: 600; color: var(--navy); margin: 0; letter-spacing: -0.01em; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: 20px; position: relative; }
.step-left { display: flex; flex-direction: column; align-items: center; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700; flex-shrink: 0; position: relative; z-index: 1; }
.step-line { width: 2px; flex: 1; background: var(--rule); margin: 4px 0; min-height: 20px; }
.step:last-child .step-line { display: none; }
.step-body { padding-bottom: 32px; flex: 1; }
.step-body h3 { font-size: 18px; font-weight: 600; color: var(--navy); margin: 8px 0 6px; }
.step-body p { font-size: 15px; color: var(--ink-2); margin: 0; line-height: 1.6; }
.step-body .note { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--ink-3); background: var(--bg-soft); padding: 6px 12px; border-radius: 4px; }

/* Documents */
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 1px solid var(--rule-2); background: #fff; }
.doc-item:first-child { border-radius: 6px 6px 0 0; }
.doc-item:last-child { border-radius: 0 0 6px 6px; }
.doc-item:only-child { border-radius: 6px; }
.doc-ico { width: 36px; height: 36px; flex-shrink: 0; border-radius: 6px; background: var(--navy-05); color: var(--navy); display: grid; place-items: center; }
.doc-txt strong { font-size: 16px; font-weight: 600; color: var(--navy); display: block; }
.doc-txt span { font-size: 14px; color: var(--ink-3); }
.doc-optional { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink-3); background: var(--bg-soft); border-radius: 3px; padding: 3px 8px; flex-shrink: 0; align-self: flex-start; }

/* Eligibility */
.elig-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.elig-item { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; color: var(--ink-2); }
.elig-item::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); flex-shrink: 0; margin-top: 7px; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 2px; }
.faq-item { border: 1px solid var(--rule-2); background: #fff; border-radius: 0; overflow: hidden; }
.faq-item:first-child { border-radius: 6px 6px 0 0; }
.faq-item:last-child { border-radius: 0 0 6px 6px; }
.faq-q { width: 100%; background: none; border: 0; text-align: left; padding: 18px 20px; font: inherit; font-size: 16px; font-weight: 500; color: var(--navy); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.faq-q:hover { background: var(--bg-soft); }
.faq-q svg { flex-shrink: 0; transition: transform .2s; color: var(--ink-3); }
.faq-item.open .faq-q svg { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 20px 18px; font-size: 15px; color: var(--ink-2); line-height: 1.65; border-top: 1px solid var(--rule-2); margin-top: 0; }
.faq-item.open .faq-a { display: block; }

/* Sidebar */
.a-sidebar { position: sticky; top: 24px; }
.sidebar-card { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #fff; }
.sidebar-card-head { background: var(--navy); color: #fff; padding: 20px 22px; }
.sidebar-card-head h3 { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.sidebar-card-head p { font-size: 13px; opacity: .75; margin: 0; }
.sidebar-meta { padding: 20px 22px; border-bottom: 1px solid var(--rule-2); display: flex; flex-direction: column; gap: 16px; }
.sm-row { display: flex; align-items: flex-start; gap: 12px; }
.sm-ico { width: 36px; height: 36px; flex-shrink: 0; background: var(--navy-05); border-radius: 6px; display: grid; place-items: center; color: var(--navy); }
.sm-lbl { font-size: 12px; color: var(--ink-3); }
.sm-val { font-size: 15px; font-weight: 600; color: var(--navy); }
.sidebar-cta { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.btn-lg { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px; border-radius: 4px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; }
.btn-lg-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-lg-outline:hover { background: var(--navy-hover); text-decoration: none; }
.btn-lg-green { background: var(--green); color: #fff; border: none; }
.btn-lg-green:hover { background: var(--green-dark); text-decoration: none; }
.sidebar-help { padding: 16px 22px; border-top: 1px solid var(--rule-2); background: var(--bg-soft); font-size: 13px; color: var(--ink-3); }
.sidebar-help a { color: var(--navy); font-weight: 500; }

/* Ad */
.sidebar-ad { margin-top: 16px; }
.ad-label { font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 6px; padding-left: 2px; }
.ad-slot { border: 1px solid var(--rule-2); border-radius: 8px; background: var(--bg-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 250px; position: relative; }
.ad-slot-tall { min-height: 340px; }
.ad-slot-tall-spaced { margin-top: 12px; }
.ad-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-3); text-align: center; padding: 24px; }
.ad-icon { width: 56px; height: 56px; border-radius: 12px; background: var(--rule-2); display: grid; place-items: center; color: var(--ink-3); }
.ad-title { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.ad-sub { font-size: 12px; color: var(--rule); }

/* Locations */
.loc-list { display: flex; flex-direction: column; gap: 12px; }
.loc-card { border: 1px solid var(--rule); border-radius: 8px; padding: 22px 24px; background: #fff; }
.loc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.loc-card h3 { font-size: 17px; font-weight: 600; color: var(--navy); margin: 0; }
.loc-badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 3px; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; }
.loc-badge.open { background: #e6f7ee; color: #1a7a42; }
.loc-badge.closed { background: #fde9e9; color: var(--red-dark); }
.loc-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.loc-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); }
.loc-row svg { flex-shrink: 0; margin-top: 2px; color: var(--ink-3); }
.loc-row .hours-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.loc-row .hours-open { color: #1a7a42; font-weight: 600; }
.loc-row .hours-dot { color: var(--ink-3); }
.loc-row .hours-closed { color: var(--red); }
.loc-row .hours-now-closed { color: var(--red-dark); font-weight: 600; }
.loc-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.loc-maps-btn { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--navy); border-radius: 4px; background: #fff; color: var(--navy); padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s; }
.loc-maps-btn:hover { background: var(--navy-05); text-decoration: none; }
.loc-verified { font-size: 12px; color: #1a7a42; display: flex; align-items: center; gap: 5px; }
.loc-show-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border: 1px dashed var(--rule); border-radius: 6px; background: none; font: inherit; font-size: 14px; color: var(--navy); font-weight: 500; cursor: pointer; margin-top: 4px; }
.loc-show-more:hover { background: var(--navy-hover); }

/* Feedback widget */
.feedback-box { border: 1px solid var(--rule); border-radius: 8px; padding: 22px 24px; background: #fff; }
.feedback-box h3 { font-size: 16px; font-weight: 600; color: var(--navy); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.feedback-btns { display: flex; gap: 10px; margin-bottom: 14px; }
.fb-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 4px; border: 1.5px solid var(--rule); background: #fff; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.fb-btn:hover { border-color: var(--navy); color: var(--navy); }
.fb-btn.selected-yes { background: #e6f7ee; border-color: #1a7a42; color: #1a7a42; }
.fb-btn.selected-no { background: #fde9e9; border-color: var(--red); color: var(--red-dark); }
.feedback-bar-wrap { margin-top: 4px; }
.feedback-bar-bg { height: 6px; border-radius: 999px; background: var(--rule-2); overflow: hidden; margin-bottom: 6px; }
.feedback-bar-fill { height: 100%; border-radius: 999px; background: #2eb96a; transition: width .4s ease; }
.feedback-bar-wrap-hidden { display: none; }
.feedback-stat { font-size: 13px; color: var(--ink-3); }
.feedback-thanks { font-size: 14px; color: var(--ink-2); display: none; padding: 10px 0 2px; }
.feedback-thanks.shown { display: block; }

/* Province switcher (on single-service local landing pages) */
.province-switcher { margin-top: 24px; padding: 18px 20px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg-soft); }
.province-switcher-label { font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.province-switcher-list { display: flex; flex-wrap: wrap; gap: 6px; }
.province-switcher-pill { text-decoration: none; padding: 6px 12px; font-size: 13px; transition: background .15s, border-color .15s; }
.province-switcher-pill:hover { text-decoration: none; background: var(--navy-hover); }
.province-switcher-current { pointer-events: none; }

/* Related services */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card { border: 1px solid var(--rule); border-radius: 6px; padding: 20px; background: #fff; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.related-card:hover { border-color: var(--navy); background: var(--navy-hover); box-shadow: 0 4px 16px rgba(0,32,75,.08); text-decoration: none; }
.related-card .tag { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .05em; }
.related-card h3 { font-size: 16px; font-weight: 600; color: var(--navy); margin: 0; line-height: 1.35; }
.related-card .time { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 8px; }
.related-card .arrow { margin-left: auto; color: var(--navy); }

/* ===== PROVINCE LANDING ===== */
body.province-page { background: var(--bg-soft); }
.prov-hero { background: var(--navy); color: #fff; padding: 0; overflow: hidden; }
.prov-hero-inner { display: flex; align-items: stretch; min-height: 200px; }
.prov-hero-content { flex: 1; padding: 40px 0 44px; }
.prov-hero-tag { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.8); margin-bottom: 16px; }
.prov-hero h1 { font-size: clamp(36px, 4vw, 52px); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; line-height: 1.1; }
.prov-hero-sub { font-size: 15px; color: rgba(255,255,255,.55); margin-bottom: 24px; }
.prov-hero-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); padding: 7px 14px; border-radius: 4px; font-size: 13px; color: rgba(255,255,255,.85); }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.prov-hero-illus { width: 240px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0; position: relative; }
.page-body { padding: 28px 0 64px; }
.body-cols { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.agency-list { display: flex; flex-direction: column; gap: 16px; }
.agency-card { background: #fff; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.agency-header { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--rule-2); }
.agency-ico { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.agency-ico.green { background: var(--green-soft); color: var(--green-dark); }
.agency-ico.amber { background: #fff8e6; color: #9a6800; }
.agency-ico.blue  { background: #e8f2fb; color: #1d6fa4; }
.agency-ico.teal  { background: #e4f5f9; color: #167a96; }
.agency-ico.purple{ background: #f0eaff; color: #6134c4; }
.agency-meta { flex: 1; min-width: 0; }
.agency-name { font-size: 16px; font-weight: 600; color: var(--navy); }
.agency-dept { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.agency-see-all { font-size: 13px; color: var(--green-dark); font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 6px 14px; border-radius: 4px; border: 1px solid var(--green); transition: background .15s; }
.agency-see-all:hover { background: var(--green-soft); text-decoration: none; }
.svc-rows { display: flex; flex-direction: column; }
.svc-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule-2); transition: background .12s; text-decoration: none; color: inherit; }
.svc-row:last-child { border-bottom: none; }
.svc-row:hover { background: var(--navy-hover); text-decoration: none; }
.svc-name { flex: 1; font-size: 15px; color: var(--ink); font-weight: 400; }
.svc-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 3px; white-space: nowrap; }
.badge-free { background: var(--green-soft); color: var(--green-dark); }
.badge-cost { background: #fff8e6; color: #8a6000; }
.badge-time { background: var(--bg-soft); color: var(--ink-3); }
.badge-custom { background: var(--navy-05); color: var(--navy); }
.svc-arrow { color: var(--ink-3); font-size: 16px; margin-left: 4px; flex-shrink: 0; }
.svc-see-all { padding: 12px 20px; background: var(--bg-soft); border-top: 1px solid var(--rule-2); text-align: center; }
.svc-see-all a { font-size: 13px; color: var(--green-dark); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.svc-see-all a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sidebar { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.province-card { background: var(--navy); border-radius: 8px; padding: 20px 22px; color: #fff; }
.province-card h3 { font-size: 20px; font-weight: 700; color: #fff; margin: 0 0 3px; }
.province-card .sub { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 18px; letter-spacing: .02em; }
.pc-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.pc-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,.75); }
.pc-row svg { flex-shrink: 0; opacity: .65; }
.pc-cta { display: block; background: var(--green); color: #fff; text-align: center; padding: 12px; border-radius: 5px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s; }
.pc-cta:hover { background: var(--green-dark); text-decoration: none; }
.ad-widget { background: #fff; border: 1px solid var(--rule-2); border-radius: 8px; overflow: hidden; }
.ad-label-bar { background: var(--bg-soft); border-bottom: 1px solid var(--rule-2); padding: 6px 14px; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.ad-slot.compact { display: flex; align-items: center; justify-content: center; min-height: 200px; background: var(--bg-soft); flex-direction: column; gap: 6px; border: none; border-radius: 0; }
.ad-slot-ico { width: 40px; height: 40px; border-radius: 8px; background: var(--rule-2); display: grid; place-items: center; color: var(--ink-3); }
.ad-slot.compact span { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.ad-slot.compact small { font-size: 11px; color: var(--rule); }
.other-provinces { background: #fff; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.op-head { padding: 14px 18px; border-bottom: 1px solid var(--rule-2); font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.op-list { list-style: none; margin: 0; padding: 0; }
.op-list li { margin: 0; }
.op-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--rule-2); font-size: 14px; cursor: pointer; transition: background .12s; text-decoration: none; color: var(--ink-2); }
.op-list li:last-child .op-item { border-bottom: none; }
.op-item:hover { background: var(--navy-hover); text-decoration: none; }
.op-item.active { color: var(--navy); font-weight: 600; background: var(--navy-05); }
.op-count { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.op-item.active .op-count { color: var(--green-dark); font-weight: 700; }
.op-see-more { display: block; padding: 11px 18px; font-size: 13px; color: var(--navy); font-weight: 500; text-align: center; border-top: 1px solid var(--rule-2); background: var(--bg-soft); }
.op-see-more:hover { text-decoration: underline; }

/* ===== FOOTER ===== */
footer.site-footer { background: var(--navy); color: #c7d0df; padding: 64px 0 32px; font-size: 15px; }
footer.site-footer a { color: #c7d0df; }
footer.site-footer a:hover { color: #fff; text-decoration: none; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.foot-brand .name { color: #fff; font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.foot-brand p { font-size: 13px; color: #8d9ab3; max-width: 34ch; line-height: 1.7; }
.foot h4 { color: #fff; font-size: 13px; font-weight: 700; margin: 0 0 16px; letter-spacing: .03em; text-transform: uppercase; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 11px; font-size: 14px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; display: flex; justify-content: space-between; gap: 24px; font-size: 13px; color: #8d9ab3; }
.foot-bottom .links { display: flex; gap: 24px; }

/* ===== 404 / SEARCH / GENERIC PAGE ===== */
.generic-page { padding: 80px 0; min-height: 50vh; }
.generic-page h1 { font-size: clamp(32px, 4vw, 48px); color: var(--navy); margin: 0 0 16px; font-weight: 600; letter-spacing: -0.02em; }
.generic-page p { font-size: 17px; color: var(--ink-2); max-width: 60ch; }
.generic-page .post-content { max-width: 720px; margin-top: 24px; font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.search-results-list { list-style: none; padding: 0; margin: 32px 0; }
.search-results-list li { padding: 16px 0; border-bottom: 1px solid var(--rule-2); }
.search-results-list h3 { margin: 0 0 4px; font-size: 18px; }
.search-results-list h3 a { color: var(--navy); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .btn-login-label { display: none; }
  .btn-login { padding: 9px 12px; }
  nav.main { border-top: none; }
  nav.main > .wrap { padding: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease; background: #fff; border-top: 1px solid var(--rule-2); }
  nav.main.is-open > .wrap { max-height: 480px; box-shadow: 0 8px 16px rgba(0,32,75,.08); padding: 0 32px; }
  .navlist { flex-direction: column; gap: 0; padding: 8px 0; }
  .navlist li { width: 100%; }
  .navlist a { padding: 14px 0; border-bottom: 1px solid var(--rule-2); margin-bottom: 0; font-size: 16px; }
  .navlist li:last-child a { border-bottom: none; }
  .navlist a:hover,
  .navlist a.active,
  .navlist .current-menu-item > a,
  .navlist .current_page_item > a,
  .navlist .current-menu-ancestor > a { border-bottom-color: var(--rule-2); padding-left: 8px; background: var(--navy-05); }
}
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; min-height: auto; }
  .hero-right { min-height: 280px; }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .life-grid { grid-template-columns: 1fr 1fr; }
  .province-strip { grid-template-columns: repeat(3, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .a-cols { grid-template-columns: 1fr; }
  .a-sidebar { position: static; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .body-cols { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  nav.main.is-open > .wrap { padding: 0 20px; }
  .section { padding: 56px 0; }
  .hero-left { padding: 48px 0 40px; }
  .life-grid, .svc-grid { grid-template-columns: 1fr; }
  .province-strip { grid-template-columns: repeat(2, 1fr); }
  .cta-btns { flex-direction: column; }
  .foot-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .prov-hero-illus { display: none; }
}

/* ─── Progressive Disclosure — Local Service Pages ─── */

/* Master link bar */
.local-master-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy-05);
  border: 1px solid var(--navy-10);
  border-left: 3px solid var(--navy);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.local-master-bar svg { color: var(--navy); flex-shrink: 0; }
.local-master-bar__link { color: var(--navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.local-master-bar__link:hover { color: var(--navy-90); }

/* Folded step/doc items — in DOM for SEO, visually hidden until expanded */
.step--folded { display: none; }
.step--folded.is-revealed { display: flex; }
.doc-item--folded { display: none; }
.doc-item--folded.is-revealed { display: flex; }

/* Disclosure footer row (toggle button + master link) */
.disclosure-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-2);
}
.disclosure-footer--link-only { border-top: none; margin-top: 4px; padding-top: 0; }

/* Toggle button */
.disclosure-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.disclosure-toggle:hover { border-color: var(--navy); background: var(--navy-hover); }
.disclosure-toggle.is-open .disclosure-chevron { transform: rotate(180deg); }
.disclosure-chevron { transition: transform .2s ease; flex-shrink: 0; }

/* "ดูหน้าหลัก" anchor link */
.disclosure-master-link {
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 1px;
  transition: color .12s, border-color .12s;
}
.disclosure-master-link:hover { color: var(--navy); border-bottom-color: var(--navy); }
