/* บ้านลูกดาว — สไตล์หลักของทั้งเว็บ
   แนวทาง: มุมเหลี่ยม ไม่มีเงา เส้นบางแบ่งพื้นที่ จัดวางไม่สมมาตร เว้นที่ว่างเยอะ
   สี: กระดาษขาวนวล + หมึกดำ + เขียวเข้ม + ทองเก่า (ใช้นิดเดียว) */

:root {
  /* โทนเดียวกับโลโก้: น้ำตาลโลโก้ + สีเพิ่ม 1 สี = พีชอ่อน (จากแคตตาล็อกของร้าน) */
  --paper: #FBF7F2;      /* พื้นหลักขาวนวล */
  --paper-2: #F5E6DA;    /* พีชอ่อน — สีที่เพิ่ม */
  --ink: #2B2118;        /* ตัวหนังสือน้ำตาลเข้มเกือบดำ */
  --muted: #6E5E4E;
  --rule: #E4D6C8;
  --band: #5B4226;       /* แถบสีเข้ม = น้ำตาลโลโก้เข้มขึ้น */
  --band-ink: #FBF1E7;
  --band-rule: #7A5F40;
  --gold: #6F532E;       /* จุดเน้น = น้ำตาลโลโก้ */
  --accent-on-band: #F2C9AE; /* พีชเข้มบนแถบสีเข้ม */
  --logo: #6F532E;
  --font-d: 'Maitree', Georgia, serif;
  --font-b: 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1A1410; --paper-2: #2A1F18; --ink: #F3E9DE; --muted: #B3A18E;
    --rule: #3A2E24; --band: #2E2218; --band-ink: #F3E9DE; --band-rule: #4A3A2C;
    --gold: #D9B48A; --accent-on-band: #E9BFA2; --logo: #D9B48A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1A1410; --paper-2: #2A1F18; --ink: #F3E9DE; --muted: #B3A18E;
  --rule: #3A2E24; --band: #2E2218; --band-ink: #F3E9DE; --band-rule: #4A3A2C;
  --gold: #D9B48A; --accent-on-band: #E9BFA2; --logo: #D9B48A; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--font-b); font-size: 16px; line-height: 1.7;
  margin: 0; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-d); font-weight: 600; line-height: 1.25; margin: 0; text-wrap: balance; }
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 99; }
.skip:focus { left: 16px; }

.wrap { max-width: 1060px; margin: 0 auto; padding-inline: 24px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } }

.label { font-size: 11.5px; letter-spacing: .16em; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.lead { color: var(--muted); font-size: 17px; max-width: 58ch; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---- masthead ---- */
header.site { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 1px solid var(--rule); }
.mast { display: flex; align-items: center; gap: 20px; padding-block: 16px; flex-wrap: wrap; }
.word { display: flex; align-items: center; gap: 9px; margin-right: auto; text-decoration: none; }
.word .mark { width: 40px; height: 40px; color: var(--logo); flex: none; margin-top: -4px; }
.word b { font-family: var(--font-d); font-weight: 600; font-size: 21px; letter-spacing: .01em; }
.word i { font-style: normal; font-size: 10.5px; letter-spacing: .12em; color: var(--muted); display: block; margin-top: -4px; }
nav.tabs { display: flex; gap: 22px; }
nav.tabs a {
  font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; padding: 2px 0 4px;
}
nav.tabs a:hover { color: var(--ink); }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--band); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) nav.tabs a[aria-current="page"] { border-bottom-color: var(--gold); } }
:root[data-theme="dark"] nav.tabs a[aria-current="page"] { border-bottom-color: var(--gold); }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: end; padding-block: 64px 44px; }
.hero h1 { font-size: clamp(31px, 4.6vw, 49px); letter-spacing: -.01em; }
.hero .label { margin-bottom: 18px; }
.hero .lead { margin-top: 20px; }
.actions { display: flex; align-items: center; gap: 24px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  font-family: var(--font-b); font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--band); color: var(--band-ink); border: 1px solid var(--band);
  padding: 12px 26px; border-radius: 0; text-decoration: none; display: inline-block;
}
.btn:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.line:hover { background: var(--ink); color: var(--paper); }
.textlink { font-size: 15px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 2px; color: var(--ink); }
.textlink:hover { border-bottom-color: var(--ink); }

/* ---- photo frames (ช่องรูป — เมื่อได้รูปจริง ใส่ <img> แทน <span>) ---- */
.frame { background: var(--paper-2); border: 1px solid var(--rule); display: grid; place-items: center; max-width: 100%; position: relative; overflow: hidden; }
.frame span { font-size: 10.5px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame.portrait { aspect-ratio: 4/5; }
.frame.land { aspect-ratio: 4/3; }

/* ---- facts strip ---- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts > div { padding: 22px 0 22px 26px; border-left: 1px solid var(--rule); }
.facts > div:first-child { border-left: 0; padding-left: 0; }
.facts .k { font-size: 11.5px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.facts .v { font-family: var(--font-d); font-size: 19px; font-weight: 600; margin-top: 2px; }

/* ---- sections ---- */
section { padding-block: 66px; }
.sechead { display: flex; align-items: baseline; gap: 20px; margin-bottom: 34px; }
.sechead h2 { font-size: clamp(24px, 3.2vw, 31px); white-space: nowrap; }
.sechead .fill { flex: 1; height: 1px; background: var(--rule); }
.sechead .aside { font-size: 13px; color: var(--muted); white-space: nowrap; text-decoration: none; }
.sechead a.aside { border-bottom: 1px solid var(--rule); }
.sechead a.aside:hover { color: var(--ink); border-bottom-color: var(--ink); }
.pagehead h1 { font-size: clamp(28px, 4vw, 42px); }
.pagehead .label { margin-bottom: 16px; }
.pagehead .lead { margin-top: 16px; }

/* ---- dark band ---- */
.band { background: var(--band); color: var(--band-ink); }
.band .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.band .col { border-top: 2px solid var(--accent-on-band); padding-top: 18px; }
.band h3 { font-size: 20px; margin-bottom: 10px; }
.band p { font-size: 15px; color: color-mix(in srgb, var(--band-ink) 75%, transparent); }
.band .label { color: var(--accent-on-band); margin-bottom: 28px; }

/* ---- menu ---- */
.catline { display: flex; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.catline h2, .catline h3 { font-size: 23px; white-space: nowrap; }
.catline .fill { flex: 1; height: 1px; background: var(--rule); }
.catnote { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.item .frame { margin-bottom: 14px; }
.item .nm { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.item .nm h3, .item .nm h4 { font-family: var(--font-b); font-size: 16px; font-weight: 600; }
.item .pr { font-family: var(--font-d); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .pr.ask { font-family: var(--font-b); font-size: 13px; font-weight: 500; color: var(--muted); }
.item p { font-size: 14px; color: var(--muted); margin-top: 3px; }
.cat + .cat { margin-top: 54px; }

/* ---- spec list ---- */
dl.spec { margin: 0; border-top: 1px solid var(--rule); }
dl.spec > div { display: grid; grid-template-columns: 34% 1fr; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--rule); align-items: start; }
dl.spec dt { font-size: 12.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; margin: 0; padding-top: 3px; }
dl.spec dd { margin: 0; font-weight: 500; word-break: break-word; }
dl.spec dd .sub { font-weight: 400; color: var(--muted); font-size: 14px; }
dl.spec dd a { text-decoration: none; border-bottom: 1px solid var(--rule); }
dl.spec dd a:hover { border-bottom-color: var(--ink); }
.copy { font-family: var(--font-b); font-size: 12px; color: var(--muted); background: none; border: 0; border-bottom: 1px solid var(--rule); cursor: pointer; padding: 0 0 1px; margin-left: 10px; }
.copy:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- steps (วิธีสั่ง) ---- */
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; border-top: 1px solid var(--rule); }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding-block: 16px; border-bottom: 1px solid var(--rule); }
ol.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--font-d); font-weight: 600; color: var(--gold); padding-top: 1px; }
ol.steps b { display: block; font-weight: 600; }
ol.steps span { color: var(--muted); font-size: 15px; }

/* ---- prose ---- */
.prose .first { font-family: var(--font-d); font-size: 20px; line-height: 1.65; margin-bottom: 18px; }
.prose p + p { margin-top: 14px; }
.prose p { color: var(--muted); }
.two { display: grid; grid-template-columns: 6fr 5fr; gap: 56px; align-items: start; }

/* ---- journal ---- */
.entry { display: grid; grid-template-columns: 150px 1fr; gap: 28px; padding-block: 26px; border-bottom: 1px solid var(--rule); align-items: start; }
.entry:first-of-type { border-top: 1px solid var(--rule); }
.entry .meta { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 6px; }
.entry .meta b { display: block; color: var(--gold); font-weight: 600; margin-bottom: 3px; }
.entry h2, .entry h3 { font-size: 22px; margin-bottom: 7px; }
.entry h2 a, .entry h3 a { text-decoration: none; }
.entry h2 a:hover, .entry h3 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.entry p { font-size: 15px; color: var(--muted); }

/* ---- article (บทความเต็ม) ---- */
.article { max-width: 680px; }
.article h2 { font-size: 24px; margin: 40px 0 12px; }
.article p, .article li { color: var(--ink); font-size: 17px; line-height: 1.85; }
.article p + p { margin-top: 16px; }
.article ul, .article ol { padding-left: 1.3em; margin: 14px 0; }

/* ---- CTA line ---- */
.cta { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: end; }
.cta h2 { font-size: clamp(24px, 3.2vw, 31px); }
.cta .actions { margin-top: 0; justify-content: flex-start; }

/* ---- footer ---- */
footer.site { background: var(--band); color: var(--band-ink); margin-top: 0; }
footer.site .wrap { padding-block: 44px; display: grid; grid-template-columns: 1fr auto auto; gap: 48px; align-items: start; }
footer.site .word { margin: 0; }
footer.site .word b, footer.site .word i { color: var(--band-ink); }
footer.site .word .mark { color: var(--band-ink); }
footer.site .fin { font-size: 14px; color: color-mix(in srgb, var(--band-ink) 72%, transparent); line-height: 1.9; }
footer.site .fin b { color: var(--band-ink); font-weight: 600; }
footer.site .fin a { text-decoration: none; }
footer.site .fin a:hover { color: var(--band-ink); text-decoration: underline; }
footer.site .base { grid-column: 1 / -1; border-top: 1px solid var(--band-rule); padding-top: 18px; font-size: 12.5px; color: color-mix(in srgb, var(--band-ink) 60%, transparent); }

/* ---- แถบโทร/LINE ด้านล่างจอ (มือถือเท่านั้น) ---- */
.callbar { display: none; }

/* ---- responsive ---- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 44px 34px; }
  .hero .frame { max-width: 320px; }
  .two, .cta { grid-template-columns: 1fr; gap: 36px; }
  .cta { gap: 24px; }
  .band .cols { grid-template-columns: 1fr; gap: 28px; }
  .items { grid-template-columns: 1fr 1fr; gap: 24px; }
  section { padding-block: 48px; }
  footer.site .wrap { grid-template-columns: 1fr 1fr; gap: 28px; }
  footer.site .wrap > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .items { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts > div { border-left: 0; padding: 14px 0; border-top: 1px solid var(--rule); }
  .facts > div:first-child { border-top: 0; }
  .entry { grid-template-columns: 1fr; gap: 8px; }
  .entry .meta { padding-top: 0; }
  dl.spec > div { grid-template-columns: 1fr; gap: 4px; }
  .mast { gap: 12px; padding-block: 12px; }
  .word { margin-right: 0; }
  nav.tabs { gap: 18px; width: 100%; overflow-x: auto; scrollbar-width: none; }
  nav.tabs a { white-space: nowrap; font-size: 14px; }
  footer.site .wrap { grid-template-columns: 1fr; }
  .sechead { flex-wrap: wrap; gap: 10px; }
  .sechead .fill { display: none; }
  .sechead h2 { white-space: normal; }

  body { padding-bottom: 52px; }
  .callbar {
    display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--band); border-top: 1px solid var(--band-rule);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .callbar a { color: var(--band-ink); text-decoration: none; text-align: center; font-weight: 600; font-size: 15px; padding: 13px 8px; }
  .callbar a + a { border-left: 1px solid var(--band-rule); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { header.site, .callbar, footer.site { display: none; } }

/* ภาษาไทยไม่ควรถ่างตัวอักษรมาก — ลดระยะห่างสำหรับป้ายที่เป็นภาษาไทย */
.label, .frame span, .facts .k, dl.spec dt, .entry .meta { letter-spacing: .05em; }
.word i { letter-spacing: .12em; }

/* ---- แคตตาล็อกเมนู (รูปสินค้าพื้นใส ช่องสี่เหลี่ยมจัตุรัสขนาดเท่ากันทุกช่อง) ---- */
.items.grid6 { grid-template-columns: repeat(6, 1fr); gap: 28px 22px; }
.items.grid3 { grid-template-columns: repeat(3, minmax(0, 168px)); gap: 28px; }
.tile .frame.sq { aspect-ratio: 1 / 1; border: 0; margin-bottom: 10px; }
.tile .frame.sq img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 13%; }
.tile .frame.sq span { letter-spacing: .05em; }
.tile h3, .tile h4 { font-family: var(--font-b); font-size: 15px; font-weight: 500; line-height: 1.45; }
.catline .count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.catnav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 32px; padding-block: 14px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.catnav a { font-size: 14.5px; text-decoration: none; color: var(--muted); }
.catnav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.cat { scroll-margin-top: 90px; }

/* เมนูแนะนำหน้าแรก: หัวข้อซ้าย รูปขวา */
.pickrow { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; padding-block: 28px; border-top: 1px solid var(--rule); align-items: start; }
.pickrow:last-child { border-bottom: 1px solid var(--rule); }
.pickhead h3 { font-size: 22px; margin-bottom: 8px; }
.pickhead p { font-size: 14px; color: var(--muted); max-width: 30ch; }

@media (max-width: 880px) {
  .items.grid6 { grid-template-columns: repeat(4, 1fr); }
  .pickrow { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 600px) {
  .catline h2, .catline h3 { white-space: normal; font-size: 20px; }
  .items.grid6 { grid-template-columns: repeat(3, 1fr); gap: 20px 12px; }
  .items.grid6 .tile h3 { font-size: 13px; }
  .items.grid3 { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .items.grid3 .tile h4 { font-size: 13px; }
  .cat { scroll-margin-top: 130px; }
}


/* ---- รูปถ่าย (โรงงาน) ---- */
figure.photo { margin: 0; }
figure.photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--paper-2); }
figure.photo figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.hero figure.photo img { aspect-ratio: 4 / 3; }
.photos3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.factory { margin-top: 64px; }

/* ---- สโลแกน ---- */
.slogan { font-family: var(--font-d); font-size: 15px; color: var(--accent-on-band); margin-top: 12px; }

/* ---- เมนูแบบตัวหนังสือ ---- */
.catlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 48px; }
.catlist li { border-bottom: 1px solid var(--rule); }
.catlist a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; text-decoration: none; }
.catlist b { font-family: var(--font-d); font-weight: 600; font-size: 19px; }
.catlist span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.catlist a:hover b { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.namelist { list-style: none; margin: 4px 0 0; padding: 0; columns: 4 180px; column-gap: 32px; }
.namelist li { padding: 7px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; font-size: 15px; }
@media (max-width: 880px) { .photos3 { grid-template-columns: 1fr 1fr; } .catlist { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .photos3 { grid-template-columns: 1fr; } .namelist { columns: 2; column-gap: 18px; } .namelist li { font-size: 14px; } }

/* ---- แถบพีช (สีที่เพิ่ม) ---- */
.peach { background: var(--paper-2); }
.peach + footer.site { margin-top: 0; }
