/* ช่างหลังคาปลวกแดง.com — main stylesheet */
:root {
  --ink: #13202A;
  --ink-2: #1C2D3A;
  --ink-line: #2E4352;
  --ground: #F3F4F2;
  --white: #FFFFFF;
  --line: #D9DDDB;
  --line-2: #B9C1C7;
  --muted: #4A5560;
  --muted-dk: #B8C4CD;
  --accent: #C2410C;
  --accent-dk: #9A3412;
  --accent-lt: #F59E5B;
  --accent-bg: #FBE8DC;
  --line-green: #00813A;
  --line-green-dk: #006B30;
  --radius: 14px;
  --font-body: 'IBM Plex Sans Thai', system-ui, sans-serif;
  --font-head: 'Bai Jamjuree', 'IBM Plex Sans Thai', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--ground); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-dk); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; margin: 0; }
p { margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-lt); outline-offset: 2px; }

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--white); padding: 8px 16px; z-index: 100; }
.skip:focus { left: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 24px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding-inline: 24px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 32px; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px 16px; justify-content: space-between; align-items: flex-end; }
.center { text-align: center; align-items: center; }
.center-row { display: flex; justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- placeholders / pattern ---------- */
.ph { background-color: #DCE1DE; background-image: repeating-linear-gradient(135deg, rgba(19,32,42,.06) 0 12px, transparent 12px 24px); }
.ph-label { background: var(--white); padding: 6px 12px; border-radius: 6px; font-size: 14px; color: var(--muted); }
.sheet { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 28px); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; }
.btn-lg { min-height: 58px; padding: 0 26px; border-radius: 10px; font-size: 19px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-call { background: var(--accent); color: var(--white); }
.btn-call:hover { background: var(--accent-dk); color: var(--white); }
.btn-line { background: var(--line-green); color: var(--white); }
.btn-line:hover { background: var(--line-green-dk); color: var(--white); }
.btn-white { background: var(--white); color: var(--accent-dk); }
.btn-white:hover { background: #FFF1E8; color: var(--accent-dk); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #000; color: var(--white); }
.btn-outline { background: var(--white); color: var(--ink); border: 1px solid var(--line-2); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--white); color: #B42318; border: 1px solid #E4A9A3; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- top bar & header ---------- */
.topbar { background: var(--ink); color: #E6EBEF; font-size: 14px; }
.topbar a { color: var(--white); text-decoration: none; }
.topbar-in { display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; padding-block: 8px; }
.topbar-r { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-in { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 44px; height: 44px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 22px; }
.brand-tag { font-size: 13px; color: var(--muted); }
.accent { color: var(--accent); }
.accent-lt { color: var(--accent-lt); }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 26px; font-weight: 500; }
.main-nav a { color: var(--ink); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero { background-color: var(--ink); color: var(--white); }
.hero.rounded { border-radius: 16px; }
.hero-pad { padding: 24px; }
.hero-in { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-block: 64px 72px; }
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero-badge { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid #3B4D5B; border-radius: 999px; font-size: 15px; color: #E6EBEF; }
.hero h1 { font-size: clamp(38px, 5.2vw, 60px); line-height: 1.15; letter-spacing: -0.5px; }
.hl { color: var(--accent-lt); }
.hero-lead { font-size: 20px; color: #D5DDE3; max-width: 580px; }
.crumbs-dark, .crumbs-dark a { color: var(--muted-dk); }

.trust { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; color: var(--white); }
.trust li { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 12px; }
.trust svg { flex: none; }
.trust strong { display: block; font-size: 17px; }
.trust span { display: block; font-size: 14px; color: var(--muted-dk); line-height: 1.5; }

/* ---------- booking ---------- */
.booking-card { flex: 1 1 380px; min-width: 0; max-width: 480px; background: var(--white); color: var(--ink); border-radius: 16px; padding: 28px; box-shadow: 0 24px 48px rgba(0,0,0,.22); scroll-margin-top: 96px; }
.booking-form { display: flex; flex-direction: column; gap: 16px; }
.booking-title { font-size: 26px; }
.booking-sub, .booking-note { font-size: 15px; color: var(--muted); }
.booking-note { font-size: 13px; text-align: center; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 600; font-size: 15px; padding: 0; }
.field > legend { margin-bottom: 8px; }
input[type=text], input[type=tel], input[type=search], input[type=password], input[type=date], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--white); color: var(--ink);
}
textarea { padding: 12px 14px; resize: vertical; min-height: 0; }
[aria-invalid="true"] { border-color: #B42318; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); font-size: 15px; }
.chip input:checked + span { border: 1.5px solid var(--accent); background: var(--accent-bg); color: var(--accent-dk); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--accent-lt); outline-offset: 2px; }
.alert { padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.alert-error { background: #FDECEA; border: 1px solid #F2B8B5; color: #8A1C12; }
.alert-ok { background: #E3F2E8; border: 1px solid #9BCBAA; color: #0B4F26; }

/* ---------- sections ---------- */
.sec { padding-block: 80px; }
.sec-tight { padding-block: 40px 80px; }
.sec-white { background: var(--white); border-block: 1px solid var(--line); }
.sec-head { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.sec-head.row-between { max-width: none; flex-direction: row; }
.eyebrow { font-weight: 600; color: var(--accent); letter-spacing: .5px; }
.h2 { font-size: clamp(28px, 3.4vw, 40px); }
.h3 { font-family: var(--font-head); font-weight: 700; font-size: 21px; line-height: 1.3; }
.more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.empty { padding: 32px; text-align: center; background: var(--white); border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); }

.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.split > * { flex: 1 1 420px; min-width: 0; }
.split-top { align-items: flex-start; }
.about-img { min-height: 400px; border-radius: 16px; display: flex; align-items: flex-end; padding: 20px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.checks li { padding-left: 34px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 22px; height: 22px; background: no-repeat center/22px url("data:image/changna.jpg' viewBox='0 0 24 24' fill='none' stroke='%23C2410C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E"); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.gap-sm { gap: 16px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1.4; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.service { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.service-no { width: 48px; height: 48px; border-radius: 10px; background: var(--accent-bg); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; color: var(--accent-dk); font-size: 18px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.step-no { font-family: var(--font-head); font-weight: 700; font-size: 44px; color: var(--accent); line-height: 1; }

.work-card { overflow: hidden; display: flex; flex-direction: column; }
.work-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.ba { position: relative; aspect-ratio: 4 / 3.4; overflow: hidden; }
.ba img, .ba .ph { width: 100%; height: 100%; object-fit: cover; }
.ba .tag { position: absolute; top: 10px; left: 10px; }
.tag { display: inline-block; color: var(--white); font-size: 13px; padding: 2px 10px; border-radius: 4px; font-family: var(--font-body); font-weight: 600; }
.tag-dark { background: var(--ink); }
.tag-accent { background: var(--accent); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.pill { background: var(--ground); padding: 2px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; }
a.pill:hover { color: var(--accent); }
.pill-accent { background: var(--accent-bg); color: var(--accent-dk); font-weight: 600; }
.pills-dark .pill { background: var(--ink-2); color: #E6EBEF; border: 1px solid var(--ink-line); }

.post-card { text-decoration: none; color: var(--ink); overflow: hidden; display: flex; flex-direction: column; }
.post-card:hover { color: var(--ink); border-color: var(--line-2); }
.post-card:hover .card-title { color: var(--accent); }
.post-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.kicker { font-size: 13px; color: var(--accent-dk); font-weight: 600; }
.meta { font-size: 14px; color: var(--muted); margin-top: auto; }

.area-card { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--white); }
.area-card:hover { border-color: var(--accent); color: var(--ink); }
.area-card svg { flex: none; margin-top: 2px; }
.area-card strong { display: block; font-size: 18px; }
.area-card .muted { display: block; font-size: 15px; }

.cta-band { background-color: var(--accent); color: var(--white); }
.cta-band-in { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; padding-block: 56px; }
.cta-band-in > div:first-child { flex: 1 1 480px; display: flex; flex-direction: column; gap: 8px; }
.cta-band p { font-size: 18px; color: #FFF1E8; }

/* ---------- inner pages ---------- */
.page-head { background: var(--ink); color: var(--white); padding-block: 48px; }
.page-head h1 { font-size: clamp(32px, 4vw, 46px); margin-block: 6px 10px; }
.page-head p { color: #D5DDE3; font-size: 18px; max-width: 680px; }
.crumbs { font-size: 14px; color: var(--muted-dk); }
.crumbs a { color: var(--muted-dk); }
.search { display: flex; gap: 8px; max-width: 560px; margin-top: 8px; }
.search input { flex: 1; border: 0; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--white); color: var(--ink); text-decoration: none; font-size: 15px; }
.cat-chips a:hover { border-color: var(--ink); }
.cat-chips a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--white); font-weight: 600; }
.cat-chips.small a { min-height: 36px; padding: 0 12px; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filters .field { flex: 0 1 260px; }

.featured { overflow: hidden; display: flex; flex-wrap: wrap; }
.featured-img { flex: 1 1 480px; min-width: 0; min-height: 320px; }
.featured-img img, .featured-img .ph { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.featured-body { flex: 1 1 400px; min-width: 0; padding: 36px; justify-content: center; }
.featured-body h2 a { color: inherit; text-decoration: none; }
.with-aside { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.with-aside > :first-child { flex: 999 1 600px; min-width: 0; }
.with-aside > aside { flex: 1 1 300px; min-width: 0; }
.with-aside aside .card { padding: 24px; }
.dark-card { background: var(--ink); color: var(--white); border-color: var(--ink); padding: 24px; }
.dark-card p { color: #D5DDE3; }

.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pager a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pager a[aria-current="page"] { background: var(--ink); color: var(--white); border-color: var(--ink); font-weight: 600; }

.ba-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.gallery-img { width: 100%; border-radius: 12px; min-height: 240px; object-fit: cover; }
.prose-card { padding: 28px; }
.inline-cta { padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }

.post-head { background: var(--ink); color: var(--white); padding-block: 48px 120px; }
.post-head h1 { font-size: clamp(30px, 4vw, 44px); }
.post-head .meta { color: var(--muted-dk); }
.post-body { margin-top: -88px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 32px; }
.post-hero { width: 100%; border-radius: 16px; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--line); }
.post-body > .prose { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 48px); }
.post-body:not(:has(.post-hero)) > .prose { margin-top: 0; }
.post-areas .pill { background: var(--white); border: 1px solid var(--line); }
.post-areas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }

.prose { font-size: 18px; line-height: 1.85; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 28px; margin-top: 1.6em; }
.prose h3 { font-size: 22px; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose .post-figure { margin: 1.6em 0; }
.prose .post-figure img { width: 100%; border-radius: 12px; }
.prose figcaption { font-size: 15px; color: var(--muted); text-align: center; margin-top: 8px; }
.prose .tip { margin: 1.4em 0; padding: 16px 20px; background: var(--accent-bg); border-radius: 12px; color: var(--accent-dk); }
.video-embed { position: relative; aspect-ratio: 16 / 9; margin: 1.6em 0; border-radius: 12px; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.contact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.contact-item { display: flex; gap: 16px; align-items: center; padding: 20px; text-decoration: none; color: var(--ink); }
a.contact-item:hover { border-color: var(--accent); color: var(--ink); }
.contact-item .muted { display: block; font-size: 14px; }
.contact-item strong { display: block; }
.contact-item .big { font-family: var(--font-head); font-size: 24px; }
.contact-ico { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--ground); color: var(--ink); flex: none; }
.ico-call { background: var(--accent); color: var(--white); }
.ico-line { background: var(--line-green); color: var(--white); }
.area-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.split-top .booking-card { box-shadow: none; border: 1px solid var(--line); max-width: none; }
.ok-ico { width: 72px; height: 72px; border-radius: 50%; background: #E3F2E8; display: flex; align-items: center; justify-content: center; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #C9D2D9; font-size: 15px; padding-block: 64px 32px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 40px; }
.footer-cols > div { flex: 1 1 180px; min-width: 0; }
.footer-cols > .f-about { flex: 1.4 1 280px; display: flex; flex-direction: column; gap: 12px; }
.footer-cols > .f-areas { flex: 1.5 1 300px; }
.f-brand { font-family: var(--font-head); font-weight: 700; font-size: 24px; color: var(--white); }
.f-head { color: var(--white); font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.f-list, .f-contact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.f-contact { color: var(--white); gap: 4px; }
.flink { color: #C9D2D9; text-decoration: none; }
.flink:hover { color: var(--white); text-decoration: underline; }
.f-bottom { border-top: 1px solid var(--ink-line); margin-top: 40px; padding-top: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.f-keywords { line-height: 1.9; }
.f-copy { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: #9FAEB9; }

.mobile-cta { display: none; }

@media (max-width: 760px) {
  body { font-size: 16px; padding-bottom: 76px; }
  .wrap, .wrap-narrow { padding-inline: 16px; }
  .topbar-in > div:first-child { display: none; }
  .header-cta { display: none; }
  .header-in { gap: 8px; }
  .main-nav { width: 100%; gap: 0 18px; font-size: 15px; }
  .hero-in { padding-block: 36px 48px; gap: 32px; }
  .hero-lead { font-size: 18px; }
  .btn-lg { width: 100%; }
  .booking-card { padding: 20px; }
  .sec { padding-block: 56px; }
  .grid-3, .grid-auto { grid-template-columns: 1fr; }
  .featured-body { padding: 24px; }
  .mobile-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0,0,0,.08); }
  .mobile-cta .btn { min-height: 50px; font-size: 17px; }
}
