/* ============================================================
   goodapp.pro — main.css
   Layout + components หน้าเว็บ (ใช้ตัวแปรจาก theme.css)
   ============================================================ */

  *{box-sizing:border-box; margin:0; padding:0;}
  html{scroll-behavior:smooth;}
  body{
    background:var(--bg);
    color:var(--ink);
    font-family:var(--font-body);
    line-height:1.5;
    -webkit-font-smoothing:antialiased;
    position:relative;
    overflow-x:hidden;
  }
  img{max-width:100%; display:block;}
  a{color:inherit; text-decoration:none;}
  ul{list-style:none;}
  ::selection{background:rgba(34,211,238,.35); color:#fff;}
  ::-webkit-scrollbar{width:8px; height:6px;}
  ::-webkit-scrollbar-thumb{background:rgba(34,211,238,.3); border-radius:8px;}

  .wrap{max-width:1240px; margin:0 auto; padding:0 20px; position:relative; z-index:2;}

  /* ---------- Atmosphere background (fixed, behind everything) ---------- */
  @keyframes grid-travel{0%{background-position:0 0;}100%{background-position:0 50px;}}
  .atmosphere{position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden;}
  .atmosphere .grid{
    position:absolute; inset:0;
    background-size:50px 50px;
    background-image:
      linear-gradient(to right, rgba(var(--grid-rgb),var(--grid-opacity)) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(var(--grid-rgb),var(--grid-opacity)) 1px, transparent 1px);
    animation:grid-travel 16s linear infinite;
    mask-image:radial-gradient(circle at 50% 50%, rgba(0,0,0,1) 20%, rgba(0,0,0,.1) 85%);
    -webkit-mask-image:radial-gradient(circle at 50% 50%, rgba(0,0,0,1) 20%, rgba(0,0,0,.1) 85%);
    opacity:.8;
  }
  .atmosphere .dots{
    position:absolute; inset:0;
    background-size:25px 25px;
    background-image:radial-gradient(rgba(var(--dots-rgb),var(--dots-opacity)) 1px, transparent 1px);
    mask-image:radial-gradient(circle at 50% 50%, rgba(0,0,0,.8) 30%, rgba(0,0,0,0) 75%);
    -webkit-mask-image:radial-gradient(circle at 50% 50%, rgba(0,0,0,.8) 30%, rgba(0,0,0,0) 75%);
    opacity:.6;
  }
  .atmosphere .orb{position:absolute; border-radius:50%; filter:blur(10px);}
  .atmosphere .orb.cyan{width:640px; height:640px; top:-120px; left:-140px; background:radial-gradient(circle, rgba(var(--grid-rgb),.16) 0%, rgba(2,6,23,0) 70%);}
  .atmosphere .orb.purple{width:680px; height:680px; bottom:-160px; right:-160px; background:radial-gradient(circle, rgba(168,85,247,.16) 0%, rgba(2,6,23,0) 70%);}
  #atmosphere-canvas{position:absolute; inset:0; width:100%; height:100%;}
  @media (prefers-reduced-motion:reduce){ .atmosphere .grid{animation:none;} #atmosphere-canvas{display:none;} }

  /* ---------- Placeholder art (no real images) ---------- */
  .art{position:relative; width:100%; overflow:hidden; background:var(--card-solid); border:1px solid var(--line);}
  .art::before{content:""; position:absolute; inset:0; background-size:22px 22px; background-image:radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px); opacity:.5;}
  .art::after{content:attr(data-tag); position:absolute; right:12px; bottom:10px; font-family:var(--font-mono); font-size:10.5px; letter-spacing:.06em; color:rgba(255,255,255,.5); text-transform:uppercase;}
  .art.ratio-16-9{aspect-ratio:16/9;} .art.ratio-4-3{aspect-ratio:4/3;} .art.ratio-1-1{aspect-ratio:1/1;}
  .art.tech{background:radial-gradient(circle at 30% 20%, rgba(34,211,238,.35), transparent 55%), linear-gradient(135deg,#020617,#0B2530);}
  .art.ev{background:radial-gradient(circle at 30% 20%, rgba(52,211,153,.35), transparent 55%), linear-gradient(135deg,#020617,#062B1D);}
  .art.review{background:radial-gradient(circle at 30% 20%, rgba(168,85,247,.35), transparent 55%), linear-gradient(135deg,#020617,#1E1035);}
  .art.game{background:radial-gradient(circle at 30% 20%, rgba(236,72,153,.35), transparent 55%), linear-gradient(135deg,#020617,#2B0A1E);}
  .art.trend{background:radial-gradient(circle at 30% 20%, rgba(251,191,36,.30), transparent 55%), linear-gradient(135deg,#020617,#2A1E05);}
  .art.life{background:radial-gradient(circle at 30% 20%, rgba(45,212,191,.30), transparent 55%), linear-gradient(135deg,#020617,#052A26);}
  .art.hero{background:radial-gradient(circle at 25% 25%, rgba(34,211,238,.4), transparent 50%), radial-gradient(circle at 80% 70%, rgba(168,85,247,.35), transparent 50%), #020617;}

  /* ---------- Topbar ---------- */
  .topbar{background:var(--topbar-bg); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); font-family:var(--font-mono); font-size:12px; position:relative; z-index:3;}
  .topbar .wrap{display:flex; align-items:center; justify-content:space-between; height:34px;}
  .topbar .live{display:flex; align-items:center; gap:8px; letter-spacing:.05em; color:var(--muted);}
  .dot{width:7px; height:7px; border-radius:50%; background:var(--c-tech); box-shadow:0 0 0 0 rgba(34,211,238,.6); animation:pulse 1.8s infinite;}
  @keyframes pulse{0%{box-shadow:0 0 0 0 rgba(34,211,238,.55);} 70%{box-shadow:0 0 0 6px rgba(34,211,238,0);} 100%{box-shadow:0 0 0 0 rgba(34,211,238,0);}}
  .topbar .social{display:flex; gap:14px; color:var(--heading);}
  .topbar .social a{display:flex; color:var(--heading);}
  .topbar .social svg{width:15px; height:15px;}

  /* ---------- Header ---------- */
  header.site{background:var(--header-bg); backdrop-filter:blur(14px); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:50;}
  header.site .wrap{display:flex; align-items:center; justify-content:space-between; height:76px; gap:20px;}
  .logo{display:flex; align-items:center; gap:10px; white-space:nowrap; text-decoration:none; color:inherit;}
  .logo-mark{
    width:38px; height:38px; border-radius:11px;
    background:linear-gradient(135deg, var(--c-tech), #2563EB);
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 0 20px rgba(34,211,238,.25);
    flex-shrink:0;
  }
  .logo-mark svg{width:20px; height:20px; color:#020617;}
  .logo-mark-fallback{color:#fff; font-family:var(--font-display); font-weight:800; font-size:19px;}
  .logo-mark-img{object-fit:cover;}
  .logo-text-wrap{display:flex; flex-direction:column; line-height:1.15;}
  .logo-text{font-family:var(--font-display); font-weight:800; font-size:22px; color:var(--heading); letter-spacing:-.01em;}
  .logo-text .accent{color:var(--c-tech);}
  .logo-tagline{font-size:11px; color:var(--muted); font-weight:500; margin-top:1px;}

  nav.primary{display:flex; align-items:center; gap:4px; font-size:14px; font-weight:500; position:relative;}
  nav.primary > a{padding:9px 13px; border-radius:999px; color:var(--muted); position:relative; z-index:1; transition:color .15s;}
  nav.primary > a.active{
    font-weight:700; background-image:linear-gradient(90deg, var(--active-grad-1), var(--active-grad-2));
    -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;
  }
  .nav-indicator{
    position:absolute; top:0; height:100%; border-radius:999px; z-index:0;
    background:transparent; border:1.5px solid rgba(var(--nav-hover-rgb),.8);
    box-shadow:0 0 14px rgba(var(--nav-hover-rgb),.5), inset 0 0 10px rgba(var(--nav-hover-rgb),.12);
    opacity:0; pointer-events:none;
    transition:left .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1), opacity .15s;
  }
  nav.primary:hover .nav-indicator{opacity:1;}
  nav.primary > a:hover{color:var(--heading);}

  .head-actions{display:flex; align-items:center; gap:12px;}
  .btn-cta{
    background:linear-gradient(135deg, var(--c-tech), #2563EB);
    color:#020617; font-family:var(--font-display); font-weight:700; font-size:13.5px;
    padding:10px 20px; border-radius:999px; box-shadow:0 0 22px rgba(34,211,238,.25);
    transition:filter .15s;
  }
  .btn-cta:hover{filter:brightness(1.08);}
  .burger{display:none; width:38px; height:38px; border:1px solid var(--line); border-radius:10px; background:transparent; cursor:pointer; align-items:center; justify-content:center;}
  .burger span{display:block; width:16px; height:2px; background:var(--heading); position:relative; transition:background .15s;}
  .burger span::before,.burger span::after{content:"";position:absolute;left:0;width:16px;height:2px;background:var(--heading); transition:background .15s;}
  .burger span::before{top:-5px;} .burger span::after{top:5px;}

  /* ---------- Mobile nav dropdown (ซ่อนเป็น default, เปิดผ่าน JS ใส่ class .open) ---------- */
  .mobile-nav{
    display:none; flex-direction:column; background:var(--card); border-bottom:1px solid var(--line);
    padding:8px 20px 14px; position:relative; z-index:5;
  }
  .mobile-nav a{padding:12px 6px; border-bottom:1px solid var(--line); color:var(--ink); font-size:15px; font-weight:500;}
  .mobile-nav a:last-child{border-bottom:none;}
  .mobile-nav.open{display:flex;}

  /* ---------- Section headings ---------- */
  .section{padding:56px 0; position:relative; z-index:2;}
  .section.tight{padding:40px 0;}
  .section-head{display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:24px; border-bottom:1px solid var(--line); padding-bottom:14px;}
  .section-head h2{font-family:var(--font-display); font-size:26px; font-weight:700; color:var(--heading); display:flex; align-items:center; gap:10px;}
  .section-head .see-all{font-family:var(--font-mono); font-size:12px; letter-spacing:.05em; color:var(--muted); border-bottom:1px solid transparent;}
  .section-head .see-all:hover{color:var(--c-tech); border-color:var(--c-tech);}
  .swatch{width:11px;height:11px;border-radius:3px;display:inline-block;}

  /* eyebrow / category chip — glass pill style */
  .chip{display:inline-flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:4px 10px; border-radius:999px;}
  .chip.tech{background:rgba(var(--c-tech-rgb),.12); color:var(--c-tech); border:1px solid rgba(var(--c-tech-rgb),.3);}
  .chip.ev{background:rgba(var(--c-ev-rgb),.12); color:var(--c-ev); border:1px solid rgba(var(--c-ev-rgb),.3);}
  .chip.review{background:rgba(var(--c-review-rgb),.12); color:var(--c-review); border:1px solid rgba(var(--c-review-rgb),.3);}
  .chip.game{background:rgba(var(--c-game-rgb),.12); color:var(--c-game); border:1px solid rgba(var(--c-game-rgb),.3);}
  .chip.trend{background:rgba(var(--c-trend-rgb),.12); color:var(--c-trend); border:1px solid rgba(var(--c-trend-rgb),.3);}
  .chip.life{background:rgba(var(--c-life-rgb),.12); color:var(--c-life); border:1px solid rgba(var(--c-life-rgb),.3);}

  /* ---------- Hero ---------- */
  .hero-grid{display:grid; grid-template-columns:1fr 360px; gap:22px;}
  /* กันปัญหา CSS Grid คลาสสิก: grid item มี min-width:auto เป็นค่าเริ่มต้น
     ทำให้ item ห้ามหดเล็กกว่าที่เนื้อหาข้างในต้องการ ไม่ว่า grid track จะคำนวณให้แคบแค่ไหน
     .hero-main มี .hero-track ซ้อนอยู่ข้างในหลายชั้น ซึ่งมี overflow-x:auto ของตัวเอง
     แต่ overflow นั้นอยู่คนละ element กับ grid item (.hero-main) จึงไม่ช่วยอะไร
     ต้องเติม min-width:0 ตรงนี้ตรงๆ เพื่อบอกว่า .hero-main หดได้ตามที่ grid track กำหนดจริง
     ไม่งั้นเนื้อหา 10 สไลด์ข้างในจะดัน .hero-main ให้กว้างเกิน 1fr จนล้นออกจาก .wrap */
  .hero-main{min-width:0;}
  .hero-main .art{border-radius:22px;}
  .hero-main .cap{padding-top:18px;}
  .hero-main h1{font-family:var(--font-display); font-size:32px; line-height:1.25; font-weight:700; color:var(--heading); margin:12px 0 10px;}
  .hero-main h1 .grad{background:linear-gradient(90deg, var(--c-tech), var(--c-review)); -webkit-background-clip:text; background-clip:text; color:transparent;}
  .hero-main p.dek{color:var(--muted); font-size:15px; max-width:60ch;}
  .meta{font-family:var(--font-mono); font-size:11.5px; color:var(--muted); display:flex; gap:14px; align-items:center; margin-top:12px;}
  .meta .read-more{margin-left:auto; color:var(--accent); font-weight:600; text-decoration:none;}
  .card:hover .meta .read-more{text-decoration:underline;}

  .hero-side{display:flex; flex-direction:column; gap:16px;}
  .hero-side .rank-panel{height:100%;}

  /* ---------- Pulse ticker ---------- */
  .ticker{padding:14px 0; position:relative; z-index:2;}
  .ticker-row{display:flex; align-items:center; height:46px; background:var(--topbar-bg); backdrop-filter:blur(10px); border:1px solid rgba(var(--accent-rgb),.4); border-radius:14px; overflow:hidden;}
  .ticker-label{font-family:var(--font-display); font-weight:700; font-size:13px; background:linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2)); color:#020617; height:100%; display:flex; align-items:center; padding:0 18px; white-space:nowrap; letter-spacing:.03em; z-index:2;}
  .ticker-track-wrap{overflow:hidden; flex:1; position:relative; height:100%;}
  .ticker-track{display:flex; align-items:center; gap:36px; position:absolute; white-space:nowrap; animation:scroll-left 32s linear infinite; height:100%;}
  .ticker-track span.item{font-family:var(--font-mono); font-size:13px; display:inline-flex; align-items:center; gap:10px; color:var(--ink);}
  .ticker-track span.item::before{content:"▸"; color:var(--c-trend);}
  @keyframes scroll-left{0%{transform:translateX(0);} 100%{transform:translateX(-50%);}}
  @media (prefers-reduced-motion:reduce){ .ticker-track{animation:none;} .dot{animation:none;} }

  /* ---------- Article grid cards ---------- */
  .grid-4{display:grid; grid-template-columns:repeat(4,1fr); gap:20px;}
  .grid-3{display:grid; grid-template-columns:repeat(3,1fr); gap:20px;}
  .card{background:var(--card); border:1px solid var(--line); border-radius:22px; overflow:hidden; backdrop-filter:blur(8px); transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease;}
  .card:hover{transform:translateY(-6px); border-color:rgba(34,211,238,.4); box-shadow:0 12px 30px rgba(0,0,0,.35), 0 0 24px rgba(34,211,238,.12);}
  .card .art{border-radius:22px 22px 0 0;}
  .card .body{padding:16px 18px 20px;}
  .card .chip{margin-bottom:12px;}
  .card h3{font-family:var(--font-display); font-size:16px; font-weight:600; line-height:1.35; margin-bottom:10px; min-height:44px; color:var(--heading);}

  /* การ์ดสีขอบ/พื้นหลังแยกตามหมวด (ครอบที่ grid container) */
  .grid-tech .card{border-color:rgba(var(--c-tech-rgb),.28); background:linear-gradient(180deg, rgba(var(--c-tech-rgb),.07), var(--card));}
  .grid-review .card{border-color:rgba(var(--c-review-rgb),.28); background:linear-gradient(180deg, rgba(var(--c-review-rgb),.07), var(--card));}
  .grid-game .card{border-color:rgba(var(--c-game-rgb),.28); background:linear-gradient(180deg, rgba(var(--c-game-rgb),.07), var(--card));}
  .grid-trend .card{border-color:rgba(var(--c-trend-rgb),.28); background:linear-gradient(180deg, rgba(var(--c-trend-rgb),.07), var(--card));}
  .grid-watch .card{border-color:rgba(var(--c-watch-rgb),.28); background:linear-gradient(180deg, rgba(var(--c-watch-rgb),.07), var(--card));}
  .grid-tech .card:hover{border-color:rgba(var(--c-tech-rgb),.5);}
  .grid-review .card:hover{border-color:rgba(var(--c-review-rgb),.5);}
  .grid-game .card:hover{border-color:rgba(var(--c-game-rgb),.5);}
  .grid-trend .card:hover{border-color:rgba(var(--c-trend-rgb),.5);}
  .grid-watch .card:hover{border-color:rgba(var(--c-watch-rgb),.5);}

  /* ---------- Two column layout: category + ranking ---------- */
  .split{display:grid; grid-template-columns:1fr 360px; gap:26px; align-items:start;}
  .rank-panel{background:var(--card); border:1px solid var(--line); border-radius:22px; padding:24px; backdrop-filter:blur(8px);}
  .rank-panel h2{font-family:var(--font-display); font-size:18px; color:var(--heading); margin-bottom:18px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--line); padding-bottom:14px;}
  .rank-item{display:flex; align-items:flex-start; gap:12px; padding:12px 0; border-bottom:1px solid var(--line);}
  .rank-item:last-child{border-bottom:none; padding-bottom:0;}
  .rank-num{font-family:var(--font-mono); font-weight:700; font-size:19px; color:var(--c-trend); min-width:26px;}
  .rank-item h4{font-family:var(--font-display); font-size:14px; font-weight:600; line-height:1.4; color:var(--heading);}
  .rank-item .meta{color:var(--muted); font-size:10.5px; margin-top:6px;}

  /* ---------- Video thumbnail overlay (ใช้ร่วมกับ .card ทุกกริด) ---------- */
  .play-btn{position:absolute; inset:0; display:flex; align-items:center; justify-content:center;}
  .play-btn svg{width:40px; height:40px; filter:drop-shadow(0 2px 10px rgba(0,0,0,.5));}
  .art .dur{position:absolute; left:10px; bottom:10px; background:rgba(2,6,23,.8); color:#fff; font-family:var(--font-mono); font-size:10.5px; padding:2px 7px; border-radius:6px;}
  /* Playlist card (รับชม) — ชื่อเล็กกว่าการ์ดข่าวทั่วไป */
  .card.playlist h3{font-size:13px; min-height:auto; margin-bottom:6px;}
  .card.playlist .body{padding:12px 14px 16px;}

  /* ---------- Newsletter ---------- */
  .newsletter{background:linear-gradient(120deg, var(--accent-grad-1), var(--accent-grad-2)); color:#020617; border-radius:26px; padding:38px 42px; display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap;}
  .newsletter h2{font-family:var(--font-display); font-size:24px; font-weight:800; max-width:420px;}
  .newsletter p{font-size:13px; opacity:.85; margin-top:6px; max-width:420px;}
  .nl-form{display:flex; gap:10px; flex-wrap:wrap;}
  .nl-form input{background:rgba(2,6,23,.15); border:1.5px solid rgba(2,6,23,.3); padding:12px 18px; border-radius:999px; font-family:var(--font-body); font-size:14px; width:240px; color:#020617;}
  .nl-form input::placeholder{color:rgba(2,6,23,.6);}
  .nl-form button{background:#020617; color:#fff; border:none; padding:12px 24px; border-radius:999px; font-family:var(--font-display); font-weight:700; font-size:14px; cursor:pointer;}
  .nl-form button:hover{background:#0B1220;}

  /* ---------- Footer ---------- */
  footer{background:var(--footer-bg); backdrop-filter:blur(10px); border-top:1px solid var(--line); padding:52px 0 24px; margin-top:20px; position:relative; z-index:2;}
  .foot-grid{display:grid; grid-template-columns:1.4fr repeat(4,1fr); gap:28px; padding-bottom:32px; border-bottom:1px solid var(--line);}
  .foot-about{font-size:12.5px; color:var(--muted); margin-top:14px; max-width:32ch;}
  .foot-col h5{font-family:var(--font-mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-bottom:14px;}
  .foot-col ul li{margin-bottom:9px;}
  .foot-col ul li a{font-size:13.5px; color:var(--ink);}
  .foot-col ul li a:hover{color:var(--c-tech);}
  .foot-bottom{display:flex; align-items:center; justify-content:space-between; padding-top:22px; font-size:12px; color:var(--muted); flex-wrap:wrap; gap:12px;}
  .foot-copyright{display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:12px; color:var(--muted);}
  .foot-copyright a{color:var(--muted); transition:color .15s;}
  .foot-copyright a:hover{color:var(--nav-hover);}
  .foot-copyright .sep{color:var(--line);}
  .foot-social{display:flex; gap:12px;}
  .foot-social a{width:32px; height:32px; border:1px solid var(--line); border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--ink);}
  .foot-social a svg{width:15px; height:15px;}
  .foot-social a:hover{border-color:var(--c-tech); color:var(--c-tech);}

  /* ---------- Responsive ---------- */
  @media (max-width:980px){
    .grid-4{grid-template-columns:repeat(2,1fr);}
    .grid-3{grid-template-columns:repeat(2,1fr);}
    .split{grid-template-columns:1fr;}
    .hero-grid{grid-template-columns:1fr;}
    .foot-grid{grid-template-columns:1fr 1fr; row-gap:28px;}
  }
  @media (max-width:720px){
    nav.primary{display:none;}
    .burger{display:flex;}
    /* "อ่านต่อ.." ขึ้นบรรทัดใหม่บนมือถือ แทนที่จะเบียดอยู่ท้ายแถววันที่/views บรรทัดเดียวกัน */
    .meta{flex-wrap:wrap; row-gap:4px;}
    .meta .read-more{flex-basis:100%; margin-left:0;}
    /* การ์ดโพสต์: 2 คอลัมน์บนมือถือ (เดิม 3 คอลัมน์ทำให้แน่นเกินไปบนจอแคบ) */
    .grid-4, .grid-3{grid-template-columns:repeat(2,1fr); gap:12px;}
    .grid-4 > *:nth-child(n+7), .grid-3 > *:nth-child(n+7){display:none;}
    .card .body{padding:10px;}
    .card h3{font-size:13px;}
    .newsletter{flex-direction:column; align-items:flex-start;}
    .foot-grid{grid-template-columns:1fr 1fr; row-gap:24px;}
    .foot-grid > div:first-child{grid-column:1/-1; margin-bottom:4px;}
    .foot-about{max-width:none;}

    /* ลดความรก: ตัดเนื้อหาส่วนเกินบนมือถือ */
    .section{padding:32px 0;}
    .section.tight{padding:24px 0;}
    .hero-side .rank-panel{padding:20px;}
    .rank-item:nth-child(n+7){display:none;}
    /* ชื่อบทความ: แสดงเต็ม ไม่ตัดด้วย line-clamp อีกต่อไป (เดิมจำกัด 2 บรรทัดแล้ว overflow:hidden ตัดทิ้ง) */
    .hero-main p.dek{
      display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
    }
  }
  @media (max-width:520px){
    .hero-main h1{font-size:24px;}
    .logo-text{font-size:19px;}
    .section-head h2{font-size:21px;}
    .foot-grid{grid-template-columns:1fr;}
  }

  /* ==========================================================
     Toggle switch UI (sun/moon) — ใช้ร่วมกันทั้ง 2 โหมด
     เทคนิค: hidden checkbox + :has() ให้ body ปรับ custom properties เอง
     ========================================================== */
  #darkmode-toggle{width:0; height:0; visibility:hidden; display:none;}
  .darkmode-label{
    display:flex; align-items:center; position:relative; cursor:pointer;
    width:52px; height:28px; border-radius:28px; background:var(--line);
    box-shadow:inset 0 1px 3px rgba(0,0,0,.3); transition:.3s; flex-shrink:0;
  }
  .thumb{
    position:absolute; top:2px; left:2px; width:24px; height:24px; border-radius:50%;
    background:linear-gradient(180deg,#E7EAF0,#94A3B8); box-shadow:0 1px 3px rgba(0,0,0,.35);
    display:flex; align-items:center; justify-content:center; transition:transform .3s;
  }
  .thumb .sun,.thumb .moon{
    position:absolute; width:14px; height:14px; display:flex; align-items:center; justify-content:center;
    transition:opacity .2s; pointer-events:none;
  }
  .thumb .moon{opacity:1; color:#475569;}
  .thumb .sun{opacity:0; color:#F59E0B;}
  .thumb svg{width:14px; height:14px;}

  body:has(#darkmode-toggle:checked) .thumb{transform:translateX(24px); background:linear-gradient(180deg,#FDE68A,#F59E0B);}
  body:has(#darkmode-toggle:checked) .thumb .moon{opacity:0;}
  body:has(#darkmode-toggle:checked) .thumb .sun{opacity:1; color:#7C2D12;}

  /* ---------- Nav indicator (วงรีตาม active/hover) ต้องมีขอบขาวเพิ่ม เฉพาะ Light mode เพื่อให้เห็นชัดบนพื้นครีม ---------- */
  body:has(#darkmode-toggle:checked) .nav-indicator{
    background:#fff;
    outline:1.5px solid #fff;
    outline-offset:-1px;
  }

  /* ---------- โลโก้: ไล่สีตาม active-grad ของธีม เฉพาะ Light mode (เดิม fix เป็นฟ้า-น้ำเงินตลอด) ---------- */
  body:has(#darkmode-toggle:checked) .logo-mark-fallback{
    background:linear-gradient(135deg, var(--active-grad-1), var(--active-grad-2));
    box-shadow:0 0 20px rgba(var(--nav-hover-rgb),.35);
  }
  body:has(#darkmode-toggle:checked) .logo-text .accent{
    background-image:linear-gradient(90deg, var(--active-grad-1), var(--active-grad-2));
    -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;
  }

  /* ---------- โลโก้: ไล่สีส้มตาม theme เฉพาะ Light mode (Dark mode ยังเป็น cyan→blue เดิม) ---------- */
  body:has(#darkmode-toggle:checked) .logo-mark:not(.logo-mark-img){
    background:linear-gradient(135deg, var(--active-grad-1), var(--active-grad-2));
    box-shadow:0 0 20px rgba(245,158,11,.25);
  }
  body:has(#darkmode-toggle:checked) .logo-text .accent{
    background-image:linear-gradient(90deg, var(--active-grad-1), var(--active-grad-2));
    -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;
  }

  /* ---------- Social icons: สีแบรนด์จริงเฉพาะ Light mode (Dark mode ยังใช้สีเดียว currentColor เหมือนเดิม) ---------- */
  body:has(#darkmode-toggle:checked) .social-facebook{color:#1877F2;}
  body:has(#darkmode-toggle:checked) .social-instagram{color:#E4405F;}
  body:has(#darkmode-toggle:checked) .social-youtube{color:#FF0000;}
  body:has(#darkmode-toggle:checked) .social-tiktok{color:#000000;}
  body:has(#darkmode-toggle:checked) .social-x{color:#000000;}
  body:has(#darkmode-toggle:checked) .foot-social a.social-facebook:hover{border-color:#1877F2;}
  body:has(#darkmode-toggle:checked) .foot-social a.social-instagram:hover{border-color:#E4405F;}
  body:has(#darkmode-toggle:checked) .foot-social a.social-youtube:hover{border-color:#FF0000;}
  body:has(#darkmode-toggle:checked) .foot-social a.social-tiktok:hover{border-color:#000000;}
  body:has(#darkmode-toggle:checked) .foot-social a.social-x:hover{border-color:#000000;}


  /* ---------- Ad zones (IAB standard sizes) ---------- */
  /* zone รองรับทั้ง custom affiliate banner และ Google AdSense — ใส่โค้ด/รูปแทนกล่องนี้ได้โดยไม่กระทบ layout */
  .ad-zone{
    position:relative; overflow:hidden;
    background:
      radial-gradient(circle at 25% 25%, rgba(34,211,238,.4), transparent 50%),
      radial-gradient(circle at 80% 70%, rgba(168,85,247,.35), transparent 50%),
      #020617;
    border:1px solid var(--line); border-radius:14px; margin:0 auto;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  }
  .ad-zone::before{content:""; position:absolute; inset:0; background-size:22px 22px; background-image:radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px); opacity:.5;}
  .ad-zone .ad-name{position:relative; z-index:1; font-family:var(--font-mono); font-size:11px; font-weight:700; letter-spacing:.05em; color:#fff;}
  .ad-zone .ad-size{position:relative; z-index:1; font-family:var(--font-mono); font-size:10px; color:rgba(255,255,255,.6);}
  .ad-wrap{padding:0 0 8px; display:flex; justify-content:center;}

  .ad-leaderboard{width:728px; max-width:100%; height:90px;}
  .ad-rect-lg{width:336px; max-width:100%; height:280px;}   /* Large Rectangle — sidebar */
  .ad-billboard{width:970px; max-width:100%; height:250px;}
  .ad-infeed{width:100%; aspect-ratio:4/3; border-radius:22px;}     /* แทรกในคอนเทนต์ ใช้สัดส่วนเดียวกับการ์ด ไม่มี body ตามหลัง จึงโค้งเต็ม 4 มุม */

  @media (max-width:760px){
    .ad-leaderboard{width:320px; height:50px;}
    .ad-billboard{width:320px; height:100px;}
  }

  /* ---------- โฆษณา Affiliate: แสดงภาพขนาดจริง ไม่ยืด/บีบให้เต็มกล่อง ----------
     เดิมกล่อง .ad-leaderboard/.ad-rect-lg/.ad-billboard ล็อกทั้งความกว้างและความสูงตายตัว
     ถ้าไฟล์ภาพที่อัปโหลดมาไม่ได้สัดส่วนพอดีเป๊ะกับกล่อง จะดูยืด/บีบผิดรูป

     กฎนี้ทำให้ "เฉพาะโซนที่มีภาพ affiliate" (class .ad-img-natural) สูงอัตโนมัติตามภาพจริง
     ไม่ล็อกที่ 90px หรือค่าใดค่าหนึ่งตายตัวอีกต่อไป

     ความกว้างของโซน leaderboard (728px เดิม) ก็ปรับเป็น 80% ของพื้นที่เนื้อหาเว็บด้วย
       .wrap มี max-width:1240px หัก padding 20px ทั้งสองข้าง = พื้นที่เนื้อหาจริง 1200px
       1200 × 80% = 960px  ← เพดานความกว้างใหม่ของ affiliate ในโซน leaderboard
     ทำให้ภาพที่มีอยู่จริงกว้างกว่า 728px (เช่นแบนเนอร์ 1200×250) มีที่แสดงกว้างขึ้น ใกล้ขนาดจริงมากกว่าเดิม

     ทั้งสองกฎเจาะจงด้วย :has(.ad-img-natural) จึงไม่กระทบ AdSense/HTML ที่ยังใช้กรอบเดิม
     (leaderboard ปกติยังคง 728px ตามเดิมสำหรับ AdSense/HTML)
     ไม่แตะ media query มือถือ — ฝั่งมือถือยังใช้ 320px ของเดิม (ยังไม่มีการหารือเรื่องนี้) */
  .ad-zone:has(.ad-img-natural){height:auto !important;}
  .ad-zone.ad-leaderboard:has(.ad-img-natural){width:960px; max-width:100%;}
  .ad-img-natural{width:auto; height:auto; max-width:100%; max-height:none; display:block; margin:0 auto;}

/* ---------- Post detail page (v2 — sidebar 360px) ---------- */
.post-wrap{max-width:1240px; margin:0 auto; padding:32px 20px 60px;}
.post-layout{display:grid; grid-template-columns:1fr 360px; gap:32px; align-items:start;}
.post-main{max-width:760px;}
.post-crumb{font-size:13px; color:var(--muted); margin-bottom:16px;}
.post-crumb a{color:var(--muted);}
.post-main h1{font-family:var(--font-display); font-size:clamp(24px,4vw,36px); font-weight:800; line-height:1.3; margin:14px 0 10px; color:var(--heading);}
.post-dek{font-size:16px; color:var(--muted); margin-bottom:14px;}
.post-meta{display:flex; gap:8px; align-items:center; font-size:13px; color:var(--muted); margin-bottom:22px; flex-wrap:wrap;}
.post-cover{width:100%; aspect-ratio:16/9; border-radius:16px; margin-bottom:26px; background-size:cover; background-position:center;}
.post-body{font-size:16px; line-height:1.85; color:var(--ink);}
.post-body p{margin-bottom:18px;}
.post-body img{max-width:100%; border-radius:12px; margin:18px 0;}
.post-body figure{margin:24px 0;}
.post-body figcaption{font-size:13px; color:var(--muted); text-align:center; margin-top:8px;}
.post-body h2{font-family:var(--font-display); font-size:22px; color:var(--heading); margin:40px 0 16px; padding-top:8px; border-top:1px solid var(--line);}
.post-body h2:first-child{border-top:none; padding-top:0; margin-top:0;}
.post-body h3{font-family:var(--font-display); font-size:17px; color:var(--heading); margin:24px 0 10px;}

.post-body blockquote{background:linear-gradient(180deg, rgba(var(--accent-rgb),.10), var(--card)); border:0; border-left:3px solid var(--accent); border-radius:12px; padding:16px 20px; margin:20px 0 28px; font-size:15px;}
.post-body blockquote p{margin:0;}

.post-body ul{margin:10px 0 24px; padding-left:22px;}
.post-body ul li{margin-bottom:8px; line-height:1.6;}

.store-links-wrap{margin:36px 0 8px; padding:24px; border-radius:18px; background:var(--card); border:1px solid var(--line);}
.store-links-title{font-family:var(--font-mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-bottom:14px;}
.store-links-row{display:flex; flex-wrap:wrap; gap:12px;}
.store-btn{display:inline-flex; align-items:center; gap:8px; padding:12px 22px; border-radius:999px; font-family:var(--font-display); font-weight:700; font-size:14.5px; transition:filter .15s, transform .15s;}
.store-btn:hover{filter:brightness(1.12); transform:translateY(-1px);}
.store-btn svg{width:15px; height:15px; flex-shrink:0;}
.post-sidebar{display:flex; flex-direction:column; gap:16px;}
.post-latest{margin-top:56px; grid-column:1/-1;}
.post-latest h2{font-family:var(--font-display); font-size:20px; margin-bottom:18px; color:var(--heading);}
.post-404{max-width:600px; margin:80px auto; text-align:center; padding:0 20px;}
.post-404 h1{font-size:28px; margin-bottom:10px; color:var(--heading);}
.post-404 a{color:var(--nav-hover);}
@media (max-width:860px){
  .post-layout{grid-template-columns:1fr;}
  .post-sidebar{position:static;}
}

/* ---------- Category listing page (v1) ---------- */
.cat-head{padding:36px 0 20px;}
.cat-head h1{font-family:var(--font-display); font-size:clamp(24px,4vw,34px); font-weight:800; color:var(--heading);}
.cat-head .count{color:var(--muted); font-size:14px; margin-top:6px;}
.pagination{display:flex; justify-content:center; gap:8px; margin:32px 0 12px; flex-wrap:wrap;}
.pagination a, .pagination span{
  min-width:38px; height:38px; display:flex; align-items:center; justify-content:center;
  border-radius:10px; font-size:13px; font-weight:600; text-decoration:none;
  border:1px solid var(--line); color:var(--ink);
}
.pagination a:hover{border-color:var(--nav-hover);}
.pagination .current{background:var(--nav-hover); color:#020617; border-color:var(--nav-hover);}
.cat-empty{text-align:center; padding:60px 20px; color:var(--muted);}

/* ---------- Cookie preferences page: แถว 1 = Necessary เต็มความกว้าง, แถว 2 = Analytics+Advertising คู่กัน ---------- */
.cookie-prefs{display:flex; flex-direction:column; gap:16px; margin-top:24px;}
.cookie-row-2{display:grid; grid-template-columns:1fr 1fr; gap:16px;}
.cookie-card{background:var(--card); border:1px solid var(--line); border-radius:16px; padding:20px; display:flex; justify-content:space-between; align-items:center; gap:16px;}
.ck-title{font-weight:700; color:var(--heading); margin-bottom:4px;}
.ck-desc{font-size:13px; color:var(--muted);}
.ck-always{font-size:13px; color:var(--muted); flex-shrink:0;}
.ck-check input{width:20px; height:20px; cursor:pointer;}
.ck-save-btn{margin-top:24px; padding:12px 28px; background:linear-gradient(135deg,var(--nav-hover),#F59E0B); color:#020617; border:none; border-radius:12px; font-weight:700; font-size:14px; cursor:pointer;}
@media (max-width:600px){ .cookie-row-2{grid-template-columns:1fr;} }

/* ---------- Sitemap page: 4 กลุ่มลิงก์เมนู เรียง 2 คอลัมน์ ---------- */
.sitemap-groups{display:grid; grid-template-columns:1fr 1fr; gap:32px; margin-top:32px;}
.sitemap-group h3{font-family:var(--font-display); font-size:17px; color:var(--heading); margin-bottom:12px; padding-bottom:8px; border-bottom:1px solid var(--line);}
.sitemap-group ul{list-style:none; display:flex; flex-direction:column; gap:8px;}
.sitemap-group a{color:var(--ink); font-size:14px;}
.sitemap-group a:hover{color:var(--nav-hover);}
@media (max-width:600px){ .sitemap-groups{grid-template-columns:1fr;} }

/* ---------- Sponsor ad card (ad_type='sponsor') ---------- */
.sponsor-card{display:block; border-radius:16px; overflow:hidden; border:1px solid var(--line); text-decoration:none; background:var(--card);}
.sponsor-cover{position:relative; aspect-ratio:16/9; width:100%;}
.sponsor-badge{position:absolute; top:10px; left:10px; background:rgba(249,115,22,.92); color:#1F0A00; font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:.04em; padding:3px 9px; border-radius:6px;}
.sponsor-body{padding:14px 16px;}
.sponsor-body h4{font-family:var(--font-display); font-size:15px; font-weight:600; color:var(--heading); margin-bottom:4px; line-height:1.35;}
.sponsor-body p{font-size:13px; color:var(--muted); line-height:1.5;}

/* ---------- Sponsor Carousel (ad_type='sponsor_carousel') — desktop drag-scroll ---------- */
.sponsor-carousel-wrap{position:relative; display:flex; align-items:center; gap:8px;}
.sponsor-carousel{
  display:flex; gap:16px; overflow-x:auto; scroll-behavior:smooth;
  padding:4px 2px 8px; cursor:grab; user-select:none;
  scrollbar-width:none;
}
.sponsor-carousel::-webkit-scrollbar{display:none;}
.sponsor-carousel.dragging{cursor:grabbing; scroll-behavior:auto;}
.sponsor-carousel .sponsor-card{flex:0 0 260px; scroll-snap-align:start;}
.sponsor-carousel{scroll-snap-type:x proximity;}
.sc-arrow{
  flex-shrink:0; width:36px; height:36px; border-radius:50%; border:1px solid var(--line);
  background:var(--card); color:var(--ink); cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background .15s;
}
.sc-arrow:hover{background:var(--nav-hover); color:#020617;}
.sc-arrow svg{width:16px; height:16px;}
@media (max-width:760px){
  .sc-arrow{display:none;} /* มือถือใช้ swipe แทนปุ่ม — ปรับเพิ่มเติมทีหลัง */
  .sponsor-carousel .sponsor-card{flex-basis:220px;}
}

/* ---------- Ads Preview Mode (?ads_preview=1 จากปุ่มในหน้า admin) ---------- */
.ad-zone.ads-previewing{outline:2px dashed #F59E0B; outline-offset:2px;}
.ad-preview-tag{
  position:absolute; z-index:2; top:6px; left:6px;
  background:rgba(245,158,11,.92); color:#1F1300;
  font-family:var(--font-mono); font-size:10px; font-weight:700;
  padding:3px 8px; border-radius:6px; letter-spacing:.03em;
}
/* ป้ายขนาดจริง — มุมขวาล่าง แยกสีจากป้ายชื่อโซนเพื่อไม่ให้สับสน */
.ad-preview-size{
  position:absolute; z-index:2; right:6px; bottom:6px;
  background:rgba(17,24,39,.88); color:#FDE68A;
  font-family:var(--font-mono); font-size:10px; font-weight:700;
  padding:3px 8px; border-radius:6px; letter-spacing:.03em;
  pointer-events:none; white-space:nowrap; max-width:calc(100% - 12px); overflow:hidden; text-overflow:ellipsis;
}

/* ---------- แถบแจ้งเตือนโหมดพรีวิว ---------- */
.preview-banner{
  position:sticky; top:0; z-index:60;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:10px 18px;
  background:linear-gradient(90deg, #F59E0B, #EA580C);
  color:#1F1300; font-size:13.5px; font-weight:600;
  box-shadow:0 2px 12px rgba(0,0,0,.35);
}
.preview-banner-dot{
  width:9px; height:9px; border-radius:50%; background:#1F1300;
  animation:preview-blink 1.4s ease-in-out infinite;
}
@keyframes preview-blink{ 0%,100%{opacity:1;} 50%{opacity:.25;} }
.preview-banner-note{ margin-left:auto; font-weight:500; opacity:.8; font-size:12px; }
@media (max-width:640px){ .preview-banner-note{ margin-left:0; width:100%; } }

/* ---------- วิดีโอ YouTube ในเนื้อหาโพสต์ (responsive 16:9) ---------- */
.video-embed{ margin:22px 0; }
.video-frame{
  position:relative; width:100%; padding-top:56.25%;   /* 16:9 */
  border-radius:14px; overflow:hidden; background:#000;
  border:1px solid var(--line);
}
.video-frame iframe{
  position:absolute; inset:0; width:100%; height:100%; border:0;
}
.video-embed figcaption{
  margin-top:8px; font-size:13px; color:var(--muted); text-align:center;
}


/* ============================================================
   Article body v82 — บทความอยู่บนการ์ด อ่านง่ายขึ้น
   ใช้ --post-accent-rgb ที่ post.php ตั้งไว้ที่ .post-main ตามสีหมวดของโพสต์นั้น
   วางท้ายไฟล์เพื่อทับสไตล์ .post-body ชุดเดิมโดยไม่ต้องแก้ของเดิม
   ============================================================ */

.post-body{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:30px 34px;
  font-size:16.5px;
  line-height:1.9;
  color:var(--ink);
}

/* ---------- หัวข้อ h2 : แถบสีหมวด + เลขลำดับ ---------- */
.post-body{counter-reset:ph2;}
.post-body h2{
  counter-increment:ph2;
  position:relative;
  display:flex; align-items:center; gap:12px;
  font-family:var(--font-display);
  font-size:21px; font-weight:800; line-height:1.4;
  color:var(--heading);
  margin:38px 0 16px;
  padding:0 0 12px;
  border-top:none;
  border-bottom:1px solid var(--line);
}
.post-body h2::before{
  content:counter(ph2);
  flex:0 0 auto;
  width:28px; height:28px; border-radius:8px;
  display:grid; place-items:center;
  font-family:var(--font-mono); font-size:13px; font-weight:700;
  color:rgb(var(--post-accent-rgb, 34,211,238));
  background:rgba(var(--post-accent-rgb, 34,211,238),.13);
  border:1px solid rgba(var(--post-accent-rgb, 34,211,238),.3);
}
.post-body h2:first-child{margin-top:0;}

/* ---------- หัวข้อย่อย h3 : ขีดสีด้านซ้าย ---------- */
.post-body h3{
  position:relative;
  font-family:var(--font-display);
  font-size:17.5px; font-weight:700;
  color:var(--heading);
  margin:26px 0 10px; padding-left:14px;
}
.post-body h3::before{
  content:''; position:absolute; left:0; top:.22em; bottom:.22em;
  width:3px; border-radius:2px;
  background:rgb(var(--post-accent-rgb, 34,211,238));
}

.post-body p{margin-bottom:17px;}
.post-body p:last-child{margin-bottom:0;}

/* ตัวเลข/ข้อเท็จจริงที่ AI เน้นไว้ ต้องเห็นชัดกว่าตัวหนาเฉยๆ */
.post-body strong{
  color:var(--heading); font-weight:700;
  background:rgba(var(--post-accent-rgb, 34,211,238),.10);
  padding:1px 5px; border-radius:5px;
}

.post-body ul,.post-body ol{margin:12px 0 22px; padding-left:0; list-style:none;}
.post-body ol{counter-reset:pli;}
.post-body ul li,.post-body ol li{position:relative; margin-bottom:10px; padding-left:26px; line-height:1.75;}
.post-body ul li::before{
  content:''; position:absolute; left:8px; top:.65em;
  width:6px; height:6px; border-radius:50%;
  background:rgb(var(--post-accent-rgb, 34,211,238));
}
.post-body ol li{counter-increment:pli;}
.post-body ol li::before{
  content:counter(pli) '.'; position:absolute; left:0; top:0;
  font-family:var(--font-mono); font-size:13.5px; font-weight:700;
  color:rgb(var(--post-accent-rgb, 34,211,238));
}

/* ---------- ข้อดี-ข้อสังเกต : สองรายการแยกหัวข้อ ----------
   เลิกใช้ตาราง 2 คอลัมน์ เพราะข้อความไทยยาว พอบีบครึ่งจอบนมือถือแล้วอ่านยาก
   และจำนวนสองฝั่งมักไม่เท่ากัน ทำให้มีช่องว่างค้าง                        */
.post-body .ce-pros-cons{
  display:grid; grid-template-columns:1fr 1fr; gap:16px;
  margin:14px 0 26px;
}
.post-body .ce-pros,
.post-body .ce-cons{
  background:var(--bg-2);
  border:1px solid var(--line);
  border-radius:12px;
  padding:16px 18px;
}
.post-body .ce-pros{border-top:3px solid #22C55E;}
.post-body .ce-cons{border-top:3px solid #F59E0B;}

.post-body .ce-pros h3,
.post-body .ce-cons h3{
  margin:0 0 10px; padding-left:0;
  font-family:var(--font-display); font-size:15px; font-weight:700;
  display:flex; align-items:center; gap:7px;
}
.post-body .ce-pros h3::before,
.post-body .ce-cons h3::before{
  content:''; position:static;
  width:18px; height:18px; flex:0 0 auto;
  border-radius:50%; background:none;
  display:inline-block;
  background-repeat:no-repeat; background-position:center; background-size:14px 14px;
}
.post-body .ce-pros h3{color:#22C55E;}
.post-body .ce-cons h3{color:#F59E0B;}
.post-body .ce-pros h3::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322C55E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}
.post-body .ce-cons h3::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F59E0B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4M12 17h.01M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3C/svg%3E");
}

.post-body .ce-pros ul,
.post-body .ce-cons ul{margin:0; padding:0; list-style:none;}
.post-body .ce-pros li,
.post-body .ce-cons li{
  position:relative; margin-bottom:9px; padding-left:18px;
  font-size:15px; line-height:1.75; color:var(--muted);
}
.post-body .ce-pros li:last-child,
.post-body .ce-cons li:last-child{margin-bottom:0;}
.post-body .ce-pros li::before,
.post-body .ce-cons li::before{
  content:''; position:absolute; left:2px; top:.68em;
  width:6px; height:6px; border-radius:50%;
}
.post-body .ce-pros li::before{background:#22C55E;}
.post-body .ce-cons li::before{background:#F59E0B;}

/* จอแคบ: เรียงลงมาแทนวางคู่กัน */
@media (max-width:720px){
  .post-body .ce-pros-cons{grid-template-columns:1fr; gap:12px;}
}

/* ---------- FAQ : ข้อความมีป้ายกำกับ ไม่พับ ----------
   ป้าย "คำถาม :" ใช้สีหมวดของโพสต์ · "คำตอบ :" ใช้เขียวคงที่
   ตั้งใจให้คนละสีกับตัวอักษรเนื้อหา เพื่อกวาดตาหาคำตอบได้เร็ว   */
.post-body h2 + .faq-item{margin-top:16px;}
.post-body .faq-item{
  background:var(--bg-2);
  border:1px solid var(--line);
  border-left:3px solid rgb(var(--post-accent-rgb, 34,211,238));
  border-radius:10px;
  padding:14px 16px;
  margin-bottom:10px;
}
.post-body .faq-item p{margin:0;}
.post-body .faq-item p.faq-q{
  font-family:var(--font-display); font-weight:700; font-size:16px; line-height:1.6;
  color:var(--heading); margin-bottom:8px;
}
.post-body .faq-item p.faq-a{
  font-size:15.5px; line-height:1.8; color:var(--muted);
}
.post-body .faq-label{
  display:inline-block; margin-right:7px;
  font-family:var(--font-mono); font-size:11.5px; font-weight:700;
  letter-spacing:.03em; vertical-align:1px;
}
.post-body .faq-label-q{color:rgb(var(--post-accent-rgb, 34,211,238));}
.post-body .faq-label-a{color:#22C55E;}

/* ---------- โฆษณาคั่นกลางบทความ (อยู่ในการ์ดเดียวกับเนื้อหา) ---------- */
.post-body .post-body-ad{
  margin:30px 0;
  padding:18px 0;
  border-top:1px dashed var(--line);
  border-bottom:1px dashed var(--line);
}
.post-body .post-body-ad:empty{display:none;}

/* ---------- ลิงก์สโตร์ เป็นปุ่ม ---------- */
.post-body ul.ce-links{display:flex; flex-wrap:wrap; gap:10px; margin:14px 0 8px; padding:0;}
.post-body ul.ce-links li{margin:0; padding:0;}
.post-body ul.ce-links li::before{display:none;}
.post-body ul.ce-links a{
  display:inline-flex; align-items:center; gap:7px;
  padding:9px 16px; border-radius:10px; font-size:14px; font-weight:600;
  color:rgb(var(--post-accent-rgb, 34,211,238));
  background:rgba(var(--post-accent-rgb, 34,211,238),.10);
  border:1px solid rgba(var(--post-accent-rgb, 34,211,238),.3);
  transition:background .18s ease, transform .18s ease;
}
.post-body ul.ce-links a::after{content:'↗'; font-size:12px; opacity:.75;}
.post-body ul.ce-links a:hover{background:rgba(var(--post-accent-rgb, 34,211,238),.2); transform:translateY(-1px);}

/* ---------- ชุด Prompt ---------- */
.post-body pre.ce-prompt-text{
  background:var(--bg-2); border:1px solid var(--line); border-left:3px solid rgb(var(--post-accent-rgb, 34,211,238));
  border-radius:12px; padding:16px 18px; margin:10px 0 18px; overflow-x:auto;
  font-family:var(--font-mono); font-size:13.5px; line-height:1.75;
  white-space:pre-wrap; word-break:break-word; color:var(--ink);
}
.post-body pre.ce-prompt-text code{background:none; padding:0; font:inherit;}

.post-body blockquote{
  background:rgba(var(--post-accent-rgb, 34,211,238),.07);
  border-left:3px solid rgb(var(--post-accent-rgb, 34,211,238));
  border-radius:0 12px 12px 0; padding:16px 20px; margin:20px 0 26px; font-size:15.5px;
}

.post-body a:not(.ce-links a){
  color:rgb(var(--post-accent-rgb, 34,211,238));
  border-bottom:1px solid rgba(var(--post-accent-rgb, 34,211,238),.35);
}

/* ---------- สารบัญ ---------- */
.post-toc{
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  padding:18px 20px; margin-bottom:20px;
}
.post-toc-title{
  font-family:var(--font-display); font-size:13px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:var(--muted); margin-bottom:12px;
}
.post-toc ol{counter-reset:toc; list-style:none; margin:0; padding:0;}
.post-toc li{counter-increment:toc; margin-bottom:9px;}
.post-toc li:last-child{margin-bottom:0;}
.post-toc a{
  display:flex; gap:10px; font-size:14px; line-height:1.5; color:var(--muted);
  transition:color .16s ease;
}
.post-toc a::before{
  content:counter(toc);
  flex:0 0 20px; font-family:var(--font-mono); font-size:12px; font-weight:700;
  color:rgb(var(--post-accent-rgb, 34,211,238));
}
.post-toc a:hover{color:var(--heading);}

@media (max-width:860px){
  .post-body{padding:22px 18px; border-radius:14px; font-size:16px;}
  .post-body h2{font-size:19px; margin:30px 0 14px;}
  .post-body .ce-pros,.post-body .ce-cons{padding:14px 15px;}
  .post-body .ce-pros li,.post-body .ce-cons li{font-size:14.5px;}
  .post-body ul.ce-links a{flex:1; justify-content:center;}
}


/* ============================================================
   Hero slider — เลื่อนได้ตามจำนวนโพสต์ที่ติ๊ก "เด่นบนสุด"
   ใช้ scroll-snap เป็นหลัก จึงปัดนิ้วบนมือถือได้และทำงานแม้ JS พัง
   JS เพิ่มแค่ปุ่มลูกศร จุดบอกตำแหน่ง และเลื่อนอัตโนมัติ
   ============================================================ */
.hero-slider{position:relative;}

.hero-track{
  display:flex;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  gap:0;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.hero-track::-webkit-scrollbar{display:none;}

.hero-slide{
  flex:0 0 100%;
  min-width:100%;
  scroll-snap-align:start;
}

/* หัวข้อสไลด์ที่ 2 เป็นต้นไปใช้ h2 เพื่อ SEO แต่ต้องดูเท่ากับ h1 */
.hero-main .hero-title{
  font-family:var(--font-display);
  font-size:clamp(22px,3.4vw,34px);
  font-weight:800;
  line-height:1.3;
  letter-spacing:-.01em;
  margin:10px 0 8px;
}
.hero-main .hero-title a{color:var(--heading);}

/* ---------- ปุ่มลูกศร ---------- */
.hero-nav{
  position:absolute; top:38%; transform:translateY(-50%);
  width:40px; height:40px; border-radius:50%;
  display:grid; place-items:center; cursor:pointer; z-index:3;
  background:rgba(10,14,26,.62);
  border:1px solid rgba(255,255,255,.16);
  backdrop-filter:blur(6px);
  opacity:0; transition:opacity .2s ease, background .2s ease;
}
.hero-slider:hover .hero-nav{opacity:1;}
.hero-nav:hover{background:rgba(10,14,26,.85);}
.hero-nav.prev{left:12px;}
.hero-nav.next{right:12px;}
.hero-nav::before{
  content:''; width:9px; height:9px;
  border-top:2px solid #fff; border-right:2px solid #fff;
}
.hero-nav.prev::before{transform:rotate(-135deg); margin-left:3px;}
.hero-nav.next::before{transform:rotate(45deg); margin-right:3px;}
.hero-nav[disabled]{opacity:.25 !important; cursor:default;}

/* ---------- จุดบอกตำแหน่ง ---------- */
.hero-dots{
  display:flex; justify-content:center; gap:8px;
  margin-top:14px;
}
.hero-dot{
  width:26px; height:4px; border-radius:3px; border:none; cursor:pointer; padding:0;
  background:var(--line);
  transition:background .2s ease, width .2s ease;
}
.hero-dot:hover{background:var(--muted);}
.hero-dot.active{
  width:38px;
  background:rgb(var(--accent-rgb, 34,211,238));
}

/* ---------- มือถือ ---------- */
@media (max-width:860px){
  .hero-nav{display:none;}            /* ปัดนิ้วเอา ไม่ต้องมีปุ่ม */
  .hero-dot{width:20px;}
  .hero-dot.active{width:30px;}
}

@media (prefers-reduced-motion:reduce){
  .hero-track{scroll-behavior:auto;}
  .hero-nav,.hero-dot{transition:none;}
}


/* ============================================================
   ป้ายกำกับโฆษณา + Affiliate Disclosure
   ตามนโยบาย Google AdSense เรื่องความโปร่งใส
   ผู้อ่านต้องแยกออกว่าอันไหนคือโฆษณา และรู้ว่าลิงก์มีค่าตอบแทน
   ============================================================ */

/* ---------- ป้ายมุมแบนเนอร์ ---------- */
.ad-zone{position:relative;}

.ad-badge{
  position:absolute; z-index:2;
  padding:2px 8px; border-radius:4px;
  font-family:var(--font-mono);
  font-size:10px; font-weight:600; letter-spacing:.04em; line-height:1.6;
  color:var(--ad-badge-color, #94a3b8);
  background:var(--ad-badge-bg, rgba(10,14,26,.72));
  border:1px solid var(--ad-badge-border, rgba(255,255,255,.14));
  backdrop-filter:blur(4px);
  pointer-events:none;      /* ไม่บังการคลิกแบนเนอร์ */
  user-select:none;
}

.ad-badge-top-left    {top:6px;  left:6px;}
.ad-badge-top-right   {top:6px;  right:6px;}
.ad-badge-bottom-left {bottom:6px; left:6px;}
.ad-badge-bottom-right{bottom:6px; right:6px;}

/* ป้ายยาวอย่าง "ได้รับการสนับสนุน" ต้องย่อลงบนแบนเนอร์แคบ ไม่งั้นกินพื้นที่โฆษณา */
@media (max-width:560px){
  .ad-badge{font-size:9.5px; padding:2px 6px;}
}
.ad-zone.size-300x250 .ad-badge,
.ad-zone.size-336x280 .ad-badge,
.ad-zone.size-300x600 .ad-badge{font-size:9px; padding:2px 6px;}


/* ============================================================
   หน้าเอกสารกฎหมาย — Terms / Privacy / Cookie Policy
   ============================================================ */
.legal-wrap{max-width:820px;margin:0 auto;padding:28px 20px 60px;}

.legal-doc{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:34px 38px;
  line-height:1.9;
  color:var(--ink);
  font-size:15.5px;
}

.legal-doc h1{
  font-family:var(--font-display);
  font-size:clamp(24px,3.6vw,32px);
  font-weight:800;
  color:var(--heading);
  line-height:1.35;
  margin-bottom:6px;
}
.legal-updated{
  font-family:var(--font-mono);
  font-size:12.5px;
  color:var(--muted);
  margin-bottom:24px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}

.legal-doc h2{
  font-family:var(--font-display);
  font-size:19px; font-weight:700;
  color:var(--heading);
  margin:34px 0 12px;
  padding-bottom:9px;
  border-bottom:1px solid var(--line);
}
.legal-doc h3{
  font-family:var(--font-display);
  font-size:16px; font-weight:700;
  color:var(--heading);
  margin:22px 0 8px;
}

.legal-doc p{margin-bottom:15px;}
.legal-doc p:last-child{margin-bottom:0;}
.legal-doc strong{color:var(--heading);font-weight:600;}

.legal-doc ul{margin:12px 0 20px;padding-left:0;list-style:none;}
.legal-doc li{position:relative;margin-bottom:9px;padding-left:20px;line-height:1.8;}
.legal-doc li::before{
  content:'';position:absolute;left:4px;top:.72em;
  width:5px;height:5px;border-radius:50%;
  background:var(--muted);
}

.legal-doc a{
  color:rgb(var(--accent-rgb, 34,211,238));
  border-bottom:1px solid rgba(var(--accent-rgb, 34,211,238),.35);
}
.legal-doc code{
  font-family:var(--font-mono);
  font-size:13px;
  padding:1px 6px;border-radius:5px;
  background:var(--bg-2);
  border:1px solid var(--line);
}

/* กล่องสรุปด้านบน — ช่วยให้ผู้อ่านเห็นใจความก่อนอ่านยาว */
.legal-callout{
  background:var(--bg-2);
  border:1px solid var(--line);
  border-left:3px solid rgb(var(--accent-rgb, 34,211,238));
  border-radius:10px;
  padding:14px 18px;
  margin:22px 0;
  font-size:14.5px;
  color:var(--muted);
}
.legal-callout strong{color:var(--heading);}

/* ตารางรายการคุกกี้ / ข้อมูลที่เก็บ */
.legal-table{
  width:100%;border-collapse:separate;border-spacing:0;
  margin:14px 0 22px;
  border:1px solid var(--line);border-radius:12px;overflow:hidden;
  font-size:14px;
}
.legal-table th{
  text-align:left;padding:11px 14px;
  font-family:var(--font-display);font-size:13px;font-weight:700;
  color:var(--heading);background:var(--bg-2);
  border-bottom:1px solid var(--line);
}
.legal-table td{
  padding:11px 14px;vertical-align:top;line-height:1.7;
  color:var(--muted);border-bottom:1px solid var(--line);
}
.legal-table tr:last-child td{border-bottom:none;}
.legal-table code{font-size:12.5px;}

/* ลิงก์ไปเอกสารฉบับอื่น */
.legal-nav{
  display:flex;flex-wrap:wrap;gap:10px;
  margin-top:34px;padding-top:22px;
  border-top:1px solid var(--line);
}
.legal-nav a{
  padding:9px 16px;border-radius:9px;
  font-size:14px;font-weight:600;border-bottom:none;
  color:rgb(var(--accent-rgb, 34,211,238));
  background:rgba(var(--accent-rgb, 34,211,238),.10);
  border:1px solid rgba(var(--accent-rgb, 34,211,238),.28);
}
.legal-nav a:hover{background:rgba(var(--accent-rgb, 34,211,238),.2);}

@media (max-width:640px){
  .legal-doc{padding:24px 20px;border-radius:14px;font-size:15px;}
  .legal-doc h2{font-size:17.5px;}
  .legal-table{font-size:13px;}
  .legal-table th,.legal-table td{padding:9px 11px;}
  .legal-nav a{flex:1;text-align:center;}
}


/* ============================================================
   บริการของเรา (Our Services) — Section ใต้ Hero
   ใช้รูปแบบเดียวกับ .sponsor-carousel ที่มีอยู่แล้ว (drag-scroll + ปุ่มลูกศร)
   เพื่อให้พฤติกรรมสม่ำเสมอกับ carousel อื่นในเว็บ
   ============================================================ */

.our-services{padding:34px 0 8px;}
.our-services-head{
  display:flex; align-items:center; gap:9px;
  margin-bottom:16px;
}
.our-services-head .dot{
  width:9px; height:9px; border-radius:50%;
  background:rgb(var(--accent-rgb, 34,211,238));
}
.our-services-head h2{
  font-family:var(--font-display); font-size:19px; font-weight:800;
  color:var(--heading);
}
.our-services-head .see-all{
  margin-left:auto; font-size:13px; color:var(--muted);
}
.our-services-head .see-all:hover{color:var(--heading);}

.os-carousel-wrap{position:relative; display:flex; align-items:center; gap:8px;}

.os-carousel{
  display:flex; gap:18px; overflow-x:auto; scroll-behavior:smooth;
  scroll-snap-type:x proximity;
  padding:4px 2px 10px; cursor:grab; user-select:none;
  scrollbar-width:none;
}
.os-carousel::-webkit-scrollbar{display:none;}
.os-carousel.dragging{cursor:grabbing; scroll-behavior:auto;}

/* แสดงสูงสุด 4 การ์ดต่อจอกว้าง — คำนวณจาก gap 18px × 3 ช่อง */
.os-card{
  flex:0 0 calc((100% - 54px) / 4);
  min-width:220px;
  scroll-snap-align:start;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  transition:border-color .18s ease, transform .18s ease;
}
.os-card:hover{
  border-color:rgba(var(--accent-rgb, 34,211,238),.4);
  transform:translateY(-2px);
}
.os-card a{display:block; color:inherit;}
.os-cover{aspect-ratio:16/9; width:100%; overflow:hidden; background:var(--bg-2);}
.os-cover img{width:100%; height:100%; object-fit:cover; display:block;}
.os-caption{
  padding:12px 14px;
  font-size:14px; line-height:1.6; color:var(--ink);
}

/* ปุ่มลูกศร — ใช้โครงเดียวกับ .sc-arrow ของ sponsor carousel */
.os-arrow{
  flex-shrink:0; width:36px; height:36px; border-radius:50%;
  border:1px solid var(--line); background:var(--card); color:var(--ink);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background .15s;
}
.os-arrow:hover{background:var(--nav-hover); color:#020617;}
.os-arrow svg{width:16px; height:16px;}

@media (max-width:900px){
  .os-card{flex-basis:calc((100% - 18px) / 2);}   /* จอกลาง: 2 การ์ด */
}
@media (max-width:760px){
  /* มือถือ: 2 คอลัมน์เต็มจอเหมือนการ์ดโพสต์ ไม่ใช่การ์ดเดียวโผล่ครึ่งใบแบบเดิม
     (แบบเดิมทำให้ดูเอียงซ้าย เพราะการ์ดแรกกว้าง 76% ค้างอยู่ชิดขอบซ้าย) */
  .os-arrow{display:none;}   /* มือถือใช้ปัดนิ้วแทนปุ่ม */
  .os-carousel{gap:10px;}
  .os-card{flex-basis:calc((100% - 10px) / 2); min-width:0;}
}

/* ---------- หน้าแอดมิน: รายการบริการ ---------- */
.os-row{
  display:flex; align-items:center; gap:14px;
  padding:12px; border-bottom:1px solid var(--line);
}
.os-row:last-child{border-bottom:none;}
.os-row-hidden{opacity:.45;}
.os-thumb{
  width:96px; aspect-ratio:16/9; object-fit:cover;
  border-radius:8px; border:1px solid var(--line); flex-shrink:0;
}
.os-row-body{flex:1; min-width:0;}
.os-row-caption{font-size:14px; font-weight:600; margin-bottom:3px;}
.os-row-link{font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.os-row-actions{display:flex; gap:6px; flex-shrink:0;}

.os-btn{
  padding:6px 12px; border-radius:8px; font-size:12.5px; cursor:pointer;
  border:1px solid var(--line); background:transparent; color:var(--ink);
}
.os-btn:hover{background:var(--nav-hover);}
.os-btn:disabled{opacity:.35; cursor:default;}
.os-btn-icon{padding:6px 10px; font-weight:700;}
.os-btn-danger{border-color:rgba(239,68,68,.4); color:#F87171;}
.os-btn-danger:hover{background:rgba(239,68,68,.12);}
