/* ============================================================
   header.css — Panels 1-3 (brand bar / nav / ticker) + mobile
   sticky bar + bottom sheet + bottom action bar
   prefix: l432a-hdr__   (โครงพาเนลลอยตามสเปก Image A)
   ============================================================ */

/* ---- design tokens (ประกาศครั้งเดียว ใช้ทั้ง header + hero) ---- */
:root{
  --page-bg:      #160505;   /* พื้นหลังหน้า: แดงเลือดหมูเกือบดำ */
  --green-900:    #04211A;
  --green-800:    #062B21;
  --green-600:    #0E5A43;
  --green-400:    #178A66;
  --green-accent: #12A06F;
  --gold-100:     #F7E7A8;
  --gold-300:     #E8C46A;
  --gold-500:     #C79A3C;
  --line-green:   #06C755;
  --danger:       #C81E3A;
  --text:         #EAF5F0;
  /* สเปกให้ .64 แต่วัด contrast บน --green-600 แล้วต่ำกว่า 4.5:1 → เข้มขึ้นเป็น .78 */
  --text-muted:   rgba(234,245,240,.78);
  --panel-border: rgba(232,196,106,.14);
  --radius-panel: 18px;
  --radius-ctl:   10px;
  --gold-fill:    linear-gradient(160deg,var(--gold-100) 0%,var(--gold-300) 45%,var(--gold-500) 100%);
  --f-head:       'Mitr','Noto Sans Thai',sans-serif;
  --f-body:       'Noto Sans Thai',sans-serif;
  --panel-shadow: 0 8px 28px -12px rgba(0,0,0,.6);
}

/* ---- พื้นหลังทั้งหน้า → เขียวเกือบดำ (gutter ของพาเนลต้องเห็นสีนี้) ---- */
body{background:var(--page-bg)}
body::before{background-color:var(--page-bg)}
html{scroll-padding-top:24px}

/* ---- shared container + panel rhythm ---- */
.l432a-container{max-width:1320px;margin-inline:auto;padding-inline:16px;width:100%}
.l432a-panel{
  border:1px solid var(--panel-border);
  border-radius:var(--radius-panel);
  box-shadow:var(--panel-shadow);
}
.l432a-hdr{display:flex;flex-direction:column;gap:12px;padding-top:16px}
.l432a-hdr .l432a-container{display:flex;flex-direction:column;gap:12px}

/* ============ PANEL 1 — logo + account bar ============ */
.l432a-hdr__brandbar{
  height:72px;display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding-inline:20px;
  background:rgba(9,45,34,.85);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
}
.l432a-hdr__brand{display:flex;align-items:center;gap:12px}
.l432a-hdr__brand .brand-seal{width:44px;height:44px}
.l432a-hdr__brandname{line-height:1.2}
.l432a-hdr__brandname strong{
  display:block;font-family:'Chonburi',var(--f-head);font-weight:400;
  font-size:1.15rem;color:var(--gold-100);
}
.l432a-hdr__brandname small{
  display:block;font-size:10px;letter-spacing:.18em;text-transform:uppercase;
  color:var(--text-muted);font-family:var(--f-body);
}
.l432a-hdr__actions{display:flex;align-items:center;gap:10px}
.l432a-hdr__btn{
  height:44px;border-radius:999px;padding-inline:18px;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  font-family:var(--f-head);font-weight:600;font-size:15px;white-space:nowrap;
  transition:transform .15s ease,filter .15s ease,background .15s ease;
}
.l432a-hdr__btn:active{transform:translateY(1px)}
.l432a-hdr__btn svg{width:18px;height:18px;flex-shrink:0}
.l432a-hdr__btn--contact{background:var(--green-accent);color:#fff}
.l432a-hdr__btn--contact:hover{filter:brightness(1.08)}
.l432a-hdr__btn--ghost{background:transparent;color:var(--text)}
.l432a-hdr__btn--ghost:hover{background:rgba(255,255,255,.07)}
.l432a-hdr__btn--gold{
  background:var(--gold-fill);color:#1A1207;
  box-shadow:0 4px 18px rgba(199,154,60,.35),inset 0 1px 0 rgba(255,255,255,.45);
}
.l432a-hdr__btn--gold:hover{filter:brightness(1.05);transform:translateY(-1px)}
.l432a-hdr__chev{font-weight:600;margin-left:2px}

/* ============ PANEL 2 — primary nav ============ */
.l432a-hdr__nav{
  min-height:64px;display:flex;align-items:center;
  background:rgba(64,10,8,.92);padding:6px 20px;
}
.l432a-hdr__navlogo{flex-shrink:0;display:flex;align-items:center;margin-right:16px}
.l432a-hdr__navlogo img{width:48px;height:48px;display:block;filter:drop-shadow(0 2px 6px rgba(0,0,0,.45))}
.l432a-hdr__navlist{
  list-style:none;margin:0;padding:0;
  display:flex;flex-wrap:wrap;align-items:center;justify-content:center;
  gap:2px 12px;width:100%;min-width:0;
}
.l432a-hdr__navlink{
  position:relative;display:inline-block;padding:8px 12px;
  border:1px solid transparent;border-radius:10px;
  font-family:var(--f-head);font-weight:600;font-size:16px;color:var(--gold-100);
  transition:color .18s ease-out,border-color .18s ease-out,box-shadow .18s ease-out;
  white-space:nowrap;
}
/* เมาส์ชี้ → ขอบเรืองแสงทอง */
.l432a-hdr__navlink:hover{
  border-color:var(--gold-300);
  box-shadow:0 0 12px rgba(232,196,106,.55),inset 0 0 10px rgba(232,196,106,.14);
}
.l432a-hdr__navlink::after{
  content:"";position:absolute;left:12px;right:12px;bottom:4px;height:2px;border-radius:2px;
  background:var(--gold-300);
  transform:scaleX(0);transform-origin:center;transition:transform .18s ease-out;
}
.l432a-hdr__navlink:hover{color:var(--gold-300)}
.l432a-hdr__navlink:hover::after{transform:scaleX(1)}
.l432a-hdr__navlink.is-active{color:var(--gold-300)}
.l432a-hdr__navlink.is-active::after{transform:scaleX(1)}

/* ============ PANEL 3 — แถบผลหวย (ticker) ============ */
.l432a-hdr__ticker{
  height:48px;border-radius:14px;overflow:hidden;
  background:transparent;
  display:flex;align-items:center;gap:12px;padding-inline:12px;
}
.l432a-hdr__ticker-icon{
  width:28px;height:28px;border-radius:50%;flex-shrink:0;
  display:grid;place-items:center;
  background:rgba(232,196,106,.14);border:1px solid var(--panel-border);
  color:var(--gold-300);
}
.l432a-hdr__ticker-icon svg{width:14px;height:14px}
.l432a-hdr__ticker-view{
  flex:1;overflow:hidden;position:relative;height:100%;display:flex;align-items:center;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 24px,#000 calc(100% - 24px),transparent);
  mask-image:linear-gradient(90deg,transparent,#000 24px,#000 calc(100% - 24px),transparent);
}
.l432a-hdr__ticker-track{
  display:inline-flex;align-items:center;white-space:nowrap;width:max-content;
  animation:l432a-ticker 75s linear infinite;   /* ค่าสำรอง — header.js ตั้งจริงตามความกว้าง (TICKER_SPEED 60 px/วิ) */
  font-family:var(--f-body);font-size:14px;color:var(--text);
}
.l432a-hdr__ticker.is-paused .l432a-hdr__ticker-track,
.l432a-hdr__ticker:hover .l432a-hdr__ticker-track,
.l432a-hdr__ticker:focus-within .l432a-hdr__ticker-track{animation-play-state:paused}
.l432a-hdr__ticker-group{display:inline-flex;align-items:center}
.l432a-hdr__ticker-group > span{padding-right:16px}
.l432a-hdr__ticker-group b{color:var(--gold-300);font-weight:700}   /* เลขผลหวยใน ticker */
.l432a-hdr__ticker-sep{color:var(--gold-300);padding-right:16px;font-weight:600}
@keyframes l432a-ticker{from{transform:translateX(0)}to{transform:translateX(-50%)}}
.l432a-hdr__ticker-btn{
  flex-shrink:0;height:32px;padding-inline:12px;border-radius:8px;
  border:1px solid var(--panel-border);background:transparent;color:var(--text-muted);
  font-family:var(--f-body);font-size:12.5px;font-weight:600;
  transition:border-color .15s,color .15s;
}
.l432a-hdr__ticker-btn:hover{border-color:var(--gold-300);color:var(--gold-300)}

/* ============ mobile sticky top bar (<768px) ============ */
.l432a-hdr__mbar{
  display:none;
  position:fixed;inset:0 0 auto 0;z-index:110;height:56px;
  align-items:center;justify-content:space-between;gap:8px;padding-inline:10px;
  background:rgba(24,5,4,.92);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  border-bottom:1px solid var(--panel-border);
}
.l432a-hdr__burger{
  width:44px;height:44px;border-radius:10px;display:grid;place-items:center;
  color:var(--gold-300);background:transparent;
}
.l432a-hdr__burger svg{width:24px;height:24px}
.l432a-hdr__mbar-brand{display:flex;align-items:center;gap:8px;min-width:0}
.l432a-hdr__mbar-brand img{width:34px;height:34px;display:block;flex-shrink:0;filter:drop-shadow(0 1px 4px rgba(0,0,0,.45))}
.l432a-hdr__mbar-brand strong{
  font-family:'Chonburi',var(--f-head);font-weight:400;font-size:1rem;color:var(--gold-100);
  white-space:nowrap;
}
.l432a-hdr__mbar .l432a-hdr__btn{height:40px;font-size:14px;padding-inline:14px}
.l432a-hdr__mbar-spacer{width:44px;height:44px;flex:0 0 auto}   /* แทนปุ่มขวาเดิม (เอาออก 24 ก.ย. 69) — ให้โลโก้อยู่กลางเท่าเดิม */

/* ============ bottom sheet menu (mobile) ============ */
.l432a-sheet{position:fixed;inset:0;z-index:120;visibility:hidden}
.l432a-sheet.is-open{visibility:visible}
.l432a-sheet__backdrop{
  position:absolute;inset:0;background:rgba(2,10,7,.55);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  opacity:0;transition:opacity .28s ease;border:0;width:100%;
}
.l432a-sheet.is-open .l432a-sheet__backdrop{opacity:1}
/* เมนูกว้างครึ่งจอ ชิดซ้ายใต้ปุ่ม ☰ (24 ก.ย. 69 — ตามเจ้าของเว็บ) · min-width กันข้อความล้นบนจอ 320px */
.l432a-sheet__panel{
  position:absolute;left:0;bottom:0;width:50%;min-width:196px;
  background:#2a0807;border:1px solid var(--panel-border);border-bottom:0;border-left:0;
  border-radius:0 20px 0 0;
  padding:10px 10px calc(14px + env(safe-area-inset-bottom));
  transform:translateY(100%);transition:transform .28s ease;
  max-height:88vh;overflow-y:auto;
}
.l432a-sheet.is-open .l432a-sheet__panel{transform:translateY(0)}
.l432a-sheet__grip{width:44px;height:4px;border-radius:4px;background:rgba(255,255,255,.22);margin:4px auto 12px}
.l432a-sheet__list{list-style:none;margin:0;padding:0;display:grid;gap:5px}
/* แต่ละบรรทัดเป็นปุ่ม + ลูกศร › — 29 ก.ย. 69 เจ้าของสั่ง: ทุกปุ่มทอง gradient (--gold-fill ตัวเดียวกับปุ่มทองทั้งเว็บ) ตัวอักษรแดงเลือดหมู #6b0c14
   (contrast ≥4.81:1 แม้ปลายทองเข้มสุด · เดิม 24 ก.ย.: สลับ #1D0505 / #CC0000 ตัวขาว) */
.l432a-sheet__list a{
  position:relative;display:flex;align-items:center;min-height:44px;padding:0 26px 0 12px;border-radius:12px;
  font-family:var(--f-head);font-weight:600;font-size:16px;color:#6b0c14;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  text-shadow:0 1px 0 rgba(255,245,210,.45);
  background:var(--gold-fill);
  border:1px solid rgba(120,70,10,.55);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 2px 6px rgba(0,0,0,.35);
}
.l432a-sheet__list a::after{
  content:"›";position:absolute;right:10px;top:50%;transform:translateY(-55%);
  font-size:20px;line-height:1;color:#6b0c14;
}
.l432a-sheet__list a:hover,.l432a-sheet__list a:focus-visible{filter:brightness(1.06);border-color:#6b0c14}
.l432a-sheet__list a:active{filter:brightness(.92)}
.l432a-sheet__cta{display:grid;grid-template-columns:1fr;gap:6px;margin-top:10px}
.l432a-sheet__cta .l432a-hdr__btn{width:100%;height:40px}

/* ============ sticky bottom action bar (mobile) ============ */
.l432a-bottombar{
  display:none;
  position:fixed;left:0;right:0;bottom:0;z-index:100;
  height:calc(64px + env(safe-area-inset-bottom));
  padding:8px 10px calc(8px + env(safe-area-inset-bottom));
  background:rgba(24,5,4,.94);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  border-top:1px solid var(--panel-border);
  grid-template-columns:1.2fr;grid-auto-columns:1fr;grid-auto-flow:column;gap:6px;   /* ปุ่มแรกกว้างกว่า · จำนวนปุ่มเปลี่ยนได้ (ปิดข่าว = 3 ปุ่ม) */
  transform:translateY(110%);transition:transform .28s ease;
}
.l432a-bottombar.is-visible{transform:translateY(0)}
.l432a-bottombar a{
  display:flex;align-items:center;justify-content:center;border-radius:12px;
  font-family:var(--f-head);font-weight:600;font-size:14px;min-height:44px;white-space:nowrap;
}
.l432a-bottombar__primary{background:var(--gold-fill);color:#1A1207}
.l432a-bottombar__ghost{border:1px solid var(--panel-border);color:var(--text)}

/* ============ responsive ============ */
@media (max-width:1023.98px){
  .l432a-container{padding-inline:12px}
  /* nav → แถวเลื่อนแนวนอน + snap + ขอบ fade */
  .l432a-hdr__navlist{
    flex-wrap:nowrap;justify-content:flex-start;gap:24px;overflow-x:auto;
    padding-inline:24px;scroll-padding-inline:24px;
    scroll-snap-type:x proximity;scrollbar-width:none;
    -webkit-mask-image:linear-gradient(90deg,transparent,#000 20px,#000 calc(100% - 20px),transparent);
    mask-image:linear-gradient(90deg,transparent,#000 20px,#000 calc(100% - 20px),transparent);
  }
  .l432a-hdr__navlist::-webkit-scrollbar{display:none}
  .l432a-hdr__navlist li{scroll-snap-align:start}
}
@media (max-width:767.98px){
  .l432a-hdr__brandbar,.l432a-hdr__nav{display:none}
  .l432a-hdr__mbar{display:flex}
  .l432a-hdr{padding-top:68px}                 /* เผื่อ mbar fixed 56px */
  .l432a-hdr__ticker{height:40px}
  .l432a-hdr__ticker-track{font-size:13px}
  .l432a-bottombar{display:grid}
  body{padding-bottom:calc(72px + env(safe-area-inset-bottom))}
  html{scroll-padding-top:76px}
}
@media (min-width:768px){
  .l432a-sheet,.l432a-hdr__mbar,.l432a-bottombar{display:none!important}
}

/* ============ แฮชแท็กหมวด (24 ก.ย. 69 หน้าแรกใต้แบนเนอร์ · 29 ก.ย. 69 เจ้าของสั่งให้แสดงทุกหน้า — ย้ายมาจาก hero.css) ============
   หน้าแรก: อยู่ใน index.html ใต้แบนเนอร์ · หน้าอื่น: ก้อน <nav class="l432a-tags l432a-tags--page"> ใน results.html ก่อน <main>
   (หน้า SSR ดึงก้อนนี้ไปด้วยผ่าน siteChrome() ใน ssr.mjs) */
.l432a-tags{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 16px;padding:2px 8px}
.l432a-tags a{
  font-family:var(--f-head);font-weight:600;font-size:15px;line-height:1.5;
  color:var(--gold-100);white-space:nowrap;text-decoration:none;
}
.l432a-tags a:hover,.l432a-tags a:focus-visible{color:var(--gold-300);text-decoration:underline;text-underline-offset:3px}
.l432a-tags--page{max-width:1200px;margin:10px auto 4px}
@media (max-width:767.98px){
  .l432a-tags{gap:4px 12px;padding:0 4px}
  .l432a-tags a{font-size:14px}
  .l432a-tags--page{margin:6px 12px 0}
}

/* ============ โฆษณาข้างจอ 2 ข้าง — LINE @hongtelotto (29 ก.ย. 69 เจ้าของสั่ง · ทุกหน้า) ============
   จอกว้าง ≥1700px: ข้างเนื้อหา (เนื้อหากว้างสุด 1320px + โฆษณา 160px + ช่องว่าง 2 ข้าง → ไม่บังผลหวย)
   มือถือ <768px: ย่อเป็น 56×210 มุมล่าง (ดูกฎท้ายหมวด) · 768–1699px (แท็บเล็ต/โน้ตบุ๊ก) ไม่แสดง และไม่โหลดรูป (display:none + loading="lazy")
   ชิดขอบเนื้อหา: ห่างกลางจอ 660px (ครึ่งของ 1320) + 24px */
.l432a-sidead{display:none}
@media (min-width:1700px){
  .l432a-sidead{display:block;position:fixed;top:50%;transform:translateY(-50%);z-index:40;width:160px}
  .l432a-sidead--left{left:max(12px,calc(50vw - 660px - 184px))}
  .l432a-sidead--right{right:max(12px,calc(50vw - 660px - 184px))}
}
.l432a-sidead[hidden]{display:none!important}
.l432a-sidead a{display:block;border-radius:12px;overflow:hidden;border:1px solid var(--panel-border,rgba(212,175,55,.35));
  box-shadow:0 10px 28px rgba(0,0,0,.55),0 0 0 1px rgba(255,220,140,.08);transition:transform .18s ease,box-shadow .18s ease}
.l432a-sidead a:hover{transform:translateY(-2px);box-shadow:0 14px 34px rgba(0,0,0,.6),0 0 18px rgba(255,200,110,.25)}
.l432a-sidead picture{display:block}
.l432a-sidead img{display:block;width:160px;height:auto;max-height:calc(100vh - 48px);object-fit:cover}
.l432a-sidead__close{position:absolute;top:-10px;right:-10px;width:28px;height:28px;padding:0;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;font-size:18px;line-height:1;color:var(--gold-100,#f7e7a8);
  background:#1a0605;border:1px solid rgba(255,220,140,.45);box-shadow:0 2px 8px rgba(0,0,0,.6)}
.l432a-sidead__close:hover{background:#3a0a0a}
/* มือถือ (<768px · เจ้าของเลือก 29 ก.ย. 69): ย่อ GIF เหลือ 56×210 ลอยมุมล่างซ้าย–ขวา เหนือแถบเมนูล่าง (64px + safe-area)
   z-index 90 = ใต้แถบเมนูล่าง (100) / หัวมือถือ (110) / เมนูสไลด์ (120) · ปุ่ม × อยู่มุมด้านใน (ไม่ล้นขอบจอ) · ทับขอบการ์ดได้จนกว่าจะกดปิด */
@media (max-width:767.98px){
  .l432a-sidead{display:block;position:fixed;bottom:calc(74px + env(safe-area-inset-bottom));z-index:90;width:56px}
  .l432a-sidead--left{left:6px}
  .l432a-sidead--right{right:6px}
  .l432a-sidead a{border-radius:8px;box-shadow:0 6px 16px rgba(0,0,0,.6)}
  .l432a-sidead a:hover{transform:none}
  .l432a-sidead img{width:56px;max-height:none}
  .l432a-sidead__close{width:26px;height:26px;top:-13px;font-size:16px}
  .l432a-sidead--left .l432a-sidead__close{right:-10px}
  .l432a-sidead--right .l432a-sidead__close{right:auto;left:-10px}
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion:reduce){
  .l432a-sidead a{transition:none}
  .l432a-hdr__ticker-track{animation:none}                 /* ticker นิ่ง เห็นข้อความแรก */
  .l432a-sheet__backdrop,.l432a-sheet__panel,.l432a-bottombar{transition:none}
  .l432a-hdr__navlink,.l432a-hdr__navlink::after,.l432a-hdr__btn{transition:none}
}
