/* ==========================================================================
   d55103.online — design system (เขียนใหม่ทั้งหมด)
   โทน: navy deep + gold accent · ฟอนต์ Sarabun (ไทย) · โมบายล์-first
   ========================================================================== */

:root {
  /* สีหลัก */
  --navy-950: #03070f;
  --navy-900: #060d1a;
  --navy-850: #081326;
  --navy-800: #0b1a30;
  --navy-700: #102542;
  --navy-600: #16314f;
  --navy-500: #1d3e64;
  --gold-600: #8a6412;
  --gold-500: #c8961f;
  --gold-400: #e2b23c;
  --gold-300: #f5d17a;
  --gold-200: #fbe8b8;
  --cream: #f6f1e6;
  --ink: #10151f;
  --muted: #6b7789;
  --line: #22354d;
  --ok: #2fb36a;
  --warn: #e8a13a;

  /* ฟอนต์ */
  --font-th: "Sarabun", "Noto Sans Thai", system-ui, -apple-system, sans-serif;

  /* วง Leben */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* เงา */
  --sh-1: 0 1px 2px rgba(3, 7, 15, .4);
  --sh-2: 0 4px 16px rgba(3, 7, 15, .45);
  --sh-3: 0 12px 36px rgba(3, 7, 15, .5);

  /* layout */
  --maxw: 1140px;
  --h-top: 38px;
  --h-nav: 64px;
  --h-foot: 62px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 0 calc(var(--h-foot) + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-th);
  font-size: 16px;
  line-height: 1.7;
  color: #dbe4f0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(24, 56, 96, .55), transparent 60%),
    radial-gradient(900px 500px at 95% 5%, rgba(138, 100, 18, .18), transparent 60%),
    var(--navy-950);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold-300); text-decoration: none; }
a:hover { color: var(--gold-200); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.3; color: var(--cream); font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 4.2vw, 2.2rem); }
h2 { font-size: clamp(1.25rem, 3.2vw, 1.6rem); }
h3 { font-size: clamp(1.1rem, 2.6vw, 1.3rem); }
p  { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ============================ topbar ============================ */
.topbar {
  background: var(--navy-900);
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
  color: #9fb0c6;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--h-top); gap: 12px;
}
.topbar .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(47, 179, 106, .18);
}
.topbar a { color: #c8d5e6; }

/* ============================ header ============================ */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: rgba(6, 13, 26, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 14px;
  height: var(--h-nav);
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand .logo { height: 38px; width: auto; }
.brand .name {
  font-weight: 700; font-size: 1.15rem; letter-spacing: .5px;
  color: var(--gold-300);
}
.brand .name small { display: block; font-size: .62rem; color: #8fa1b8; font-weight: 500; letter-spacing: 1.5px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 8px 12px; border-radius: var(--r-sm);
  color: #c3d0e2; font-size: .94rem; font-weight: 600;
  white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] {
  background: rgba(226, 178, 60, .12); color: var(--gold-200); text-decoration: none;
}

.nav-toggle {
  margin-left: auto; display: none;
  background: var(--navy-700); border: 1px solid var(--line);
  color: var(--cream); border-radius: var(--r-sm);
  width: 42px; height: 38px; font-size: 1.2rem; cursor: pointer;
}

.head-cta { display: flex; gap: 8px; flex: 0 0 auto; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--h-nav) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy-900); border-bottom: 1px solid var(--line);
    padding: 8px; max-height: 0; overflow: hidden;
    transition: max-height .25s ease;
  }
  .nav.open { max-height: 80vh; overflow-y: auto; }
  .nav a { padding: 12px 14px; border-bottom: 1px solid rgba(34, 53, 77, .5); }
}

/* ============================ buttons ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-th); font-weight: 700; font-size: .98rem;
  padding: 11px 22px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: #2a1e02;
  box-shadow: 0 6px 18px rgba(200, 150, 31, .35);
}
.btn-gold:hover { filter: brightness(1.07); text-decoration: none; }
.btn-outline {
  background: transparent; border-color: var(--gold-500); color: var(--gold-300);
}
.btn-outline:hover { background: rgba(200, 150, 31, .12); text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: .9rem; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ============================ hero ============================ */
.hero { position: relative; overflow: hidden; }
.hero .bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
}
.hero .bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(3, 7, 15, .55), rgba(3, 7, 15, .92));
}
.hero .wrap { position: relative; z-index: 1; padding: 56px 16px 44px; }
.hero h1 { max-width: 20ch; }
.hero p.lead { font-size: clamp(1rem, 2.4vw, 1.15rem); color: #c8d5e6; max-width: 46ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.hero-badges {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px;
  font-size: .9rem; color: #b6c4d8;
}
.hero-badges span::before { content: "✔"; color: var(--ok); margin-right: 6px; }

/* ============================ sections ============================ */
.section { padding: 42px 0; }
.section.alt { background: rgba(11, 26, 48, .55); border-block: 1px solid rgba(34, 53, 77, .45); }
.sec-head { margin-bottom: 22px; }
.sec-head .kicker {
  font-size: .8rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold-400); font-weight: 700;
}
.sec-head p { color: #a9b8cc; margin: 0; }

/* ============================ cards ============================ */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-850));
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--sh-1);
  transition: transform .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--gold-600); }
.card .thumb { aspect-ratio: 16 / 10; background: var(--navy-700); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px 16px 18px; }
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { font-size: .92rem; color: #a9b8cc; margin: 0; }
.card .more { margin-top: 10px; font-weight: 700; font-size: .9rem; }

/* ============================ table ============================ */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
table.data {
  width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 520px;
  background: var(--navy-850);
}
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid rgba(34, 53, 77, .6); }
table.data thead th { background: var(--navy-700); color: var(--gold-200); font-weight: 700; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(29, 62, 100, .35); }

/* ============================ notice ============================ */
.notice {
  border-left: 4px solid var(--gold-500);
  background: rgba(138, 100, 18, .14);
  padding: 14px 18px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .95rem; color: #e6dcc4;
}
.notice.ok  { border-color: var(--ok);   background: rgba(47, 179, 106, .12); color: #cdeedb; }
.notice.warn{ border-color: var(--warn); background: rgba(232, 161, 58, .12); color: #f6e2c4; }

/* ============================ faq ============================ */
.faq details {
  background: var(--navy-800); border: 1px solid var(--line);
  border-radius: var(--r-sm); margin-bottom: 10px; padding: 0 16px;
}
.faq summary {
  cursor: pointer; padding: 14px 0; font-weight: 700; color: var(--cream);
  list-style: none; display: flex; justify-content: space-between; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-400); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq .ans { padding: 0 0 14px; color: #b6c4d8; font-size: .95rem; }

/* ============================ prose ============================ */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }
.prose strong { color: var(--gold-200); }
.prose figure { margin: 22px 0; }
.prose figure img { border-radius: var(--r-md); border: 1px solid var(--line); }
.prose figcaption { font-size: .84rem; color: var(--muted); text-align: center; margin-top: 8px; }
.prose blockquote {
  margin: 20px 0; padding: 12px 18px;
  border-left: 3px solid var(--gold-500); background: rgba(11, 26, 48, .6);
  color: #c8d5e6; border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ============================ figure ในหน้า ============================ */
.shot { margin: 22px 0; }
.shot img { border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--sh-2); }
.shot figcaption { font-size: .84rem; color: var(--muted); text-align: center; margin-top: 8px; }

/* ============================ footer ============================ */
.site-foot {
  background: var(--navy-900); border-top: 1px solid var(--line);
  padding: 36px 0 22px; font-size: .9rem; color: #9fb0c6;
}
.site-foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .site-foot .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .site-foot .cols { grid-template-columns: 1fr; } }
.site-foot h4 { color: var(--gold-300); font-size: .95rem; margin-bottom: 12px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 8px; }
.site-foot a { color: #b6c4d8; }
.site-foot .about { max-width: 34ch; }
.site-foot .legal {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
  font-size: .82rem; color: #6f7f95;
}
.site-foot .badges { display: flex; flex-wrap: wrap; gap: 8px; }
.site-foot .badges span {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 4px 10px; font-size: .78rem; color: #b6c4d8;
}

/* ============================ footer bar (mobile sticky) ============================ */
.footbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  height: var(--h-foot); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(180deg, #0b1a30, #060d1a);
  border-top: 1px solid var(--gold-600);
  box-shadow: 0 -6px 22px rgba(3, 7, 15, .55);
  display: flex; align-items: center; gap: 10px;
  padding-inline: 12px;
}
.footbar .brand-mini { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.footbar .brand-mini img { height: 30px; }
.footbar .brand-mini b { color: var(--gold-300); font-size: .95rem; }
.footbar .fb-actions { display: flex; gap: 10px; flex: 1 1 auto; justify-content: flex-end; }
.footbar .btn { flex: 1 1 0; max-width: 220px; }
@media (min-width: 901px) { .footbar { justify-content: center; } .footbar .fb-actions { flex: 0 0 auto; } .footbar .btn { min-width: 200px; } }

/* ============================ misc ============================ */
.breadcrumb { font-size: .84rem; color: #8fa1b8; padding: 14px 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li::after { content: "/"; margin-left: 6px; color: #55637a; }
.breadcrumb li:last-child::after { content: ""; }

.toc {
  background: var(--navy-800); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 18px; margin: 22px 0;
  font-size: .92rem;
}
.toc h4 { font-size: .9rem; color: var(--gold-300); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin-bottom: 4px; }

.pill {
  display: inline-block; padding: 3px 12px; border-radius: var(--r-pill);
  background: rgba(226, 178, 60, .14); color: var(--gold-200);
  border: 1px solid rgba(226, 178, 60, .35); font-size: .8rem; font-weight: 700;
}

.meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: #8fa1b8; margin-bottom: 14px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold-400); color: #241a02; padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* burger icon (ไม่ใช้ emoji/สัญลักษณ์) */
.nav-toggle { display:none; width:42px; height:42px; border:1px solid var(--line); background:var(--panel); border-radius:10px; align-items:center; justify-content:center; cursor:pointer; }
.nav-toggle .burger, .nav-toggle .burger::before, .nav-toggle .burger::after { display:block; width:18px; height:2px; background:var(--gold); border-radius:2px; position:relative; }
.nav-toggle .burger::before, .nav-toggle .burger::after { content:""; position:absolute; left:0; }
.nav-toggle .burger::before { top:-6px; }
.nav-toggle .burger::after { top:6px; }
@media (max-width: 980px){
  .nav-toggle { display:inline-flex; }
  .nav { display:none; }
  .nav.open { display:flex; }
}
