/* ============ RESET + BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans Thai', 'Prompt', sans-serif;
  color: #e6edf3;
  background: #0d1117;
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #d4af37; text-decoration: none; transition: color 0.2s ease; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 {
  font-family: 'Cormorant Garamond', 'IBM Plex Serif Thai', serif;
  color: #e6edf3;
  line-height: 1.3;
  margin: 1.5em 0 0.6em;
  font-weight: 700;
}
h1 { font-size: 2.4rem; margin-top: 0; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
strong { color: #d4af37; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.4em; }
blockquote { margin: 0; padding: 0; }

/* ============ HEADER + NAV ============ */
.site-header {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e6edf3;
  font-weight: 700;
}
.site-logo:hover { text-decoration: none; }
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #d4af37;
  color: #fff;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'Cormorant Garamond', 'IBM Plex Serif Thai', serif;
}
.logo-text {
  font-family: 'Cormorant Garamond', 'IBM Plex Serif Thai', serif;
  font-size: 1.25rem;
  letter-spacing: 0.2px;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav li { margin: 0; }
.site-nav a {
  display: inline-block;
  padding: 8px 14px;
  color: #e6edf3;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav a:hover {
  background: #0d1117;
  color: #d4af37;
  text-decoration: none;
}
.site-nav .nav-current a {
  color: #d4af37;
  font-weight: 700;
}

/* ============ MAIN LAYOUT ============ */
.page-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}
.article-body > * { margin-bottom: 1.6rem; }
.article-body > *:last-child { margin-bottom: 0; }
.page-title-block { margin-bottom: 2rem; }
.page-title-block h1 { margin-bottom: 0.4em; }
.page-lede {
  font-size: 1.15rem;
  color: #8b949e;
  line-height: 1.6;
  margin-top: 0;
}

/* ============ BREADCRUMBS ============ */
.breadcrumbs {
  font-size: 0.9rem;
  color: #8b949e;
  margin-bottom: 1.5rem;
}
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.breadcrumbs li:not(:last-child)::after {
  content: "\203A";
  margin-left: 8px;
  color: #8b949e;
}
.breadcrumbs a { color: #8b949e; }
.breadcrumbs a:hover { color: #d4af37; }

/* ============ HERO + INLINE FIGURES ============ */
.hero-figure, .inline-figure {
  margin: 2rem 0;
  border-radius: 6px;
  overflow: hidden;
}
.hero-figure img, .inline-figure img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #30363d;
}
.hero-figure figcaption, .inline-figure figcaption {
  font-size: 0.85rem;
  color: #8b949e;
  padding: 8px 4px 0;
  font-style: italic;
}

/* ============ AUTHOR BOX ============ */
.author-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  margin: 1.5rem 0;
}
.author-photo img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #d4af37;
}
.author-info { flex: 1; }
.author-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8b949e;
  margin: 0 0 4px;
}
.author-name-line { margin: 0 0 4px; font-size: 1.05rem; }
.author-role {
  margin: 0;
  font-size: 0.88rem;
  color: #8b949e;
  line-height: 1.5;
}

/* ============ INTRO + TOC ============ */
.intro-block { font-size: 1.05rem; }
.intro-block p:first-of-type::first-letter {
  font-family: 'Cormorant Garamond', 'IBM Plex Serif Thai', serif;
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  padding-right: 8px;
  padding-top: 6px;
  color: #d4af37;
  font-weight: 700;
}
.toc {
  background: #161b22;
  border-left: 4px solid #d4af37;
  padding: 20px 24px;
  border-radius: 4px;
  margin: 2rem 0;
}
.toc h2 { margin-top: 0; font-size: 1.1rem; }
.toc ol { margin: 0; padding-left: 1.4em; column-count: 2; column-gap: 24px; }
.toc li { margin-bottom: 0.35em; font-size: 0.94rem; break-inside: avoid; }
.toc a { color: #e6edf3; }
.toc a:hover { color: #d4af37; }

/* ============ CONTENT SECTIONS ============ */
.content-section { margin-bottom: 1.8rem; }
.content-section h2 { scroll-margin-top: 80px; }
.head-anchor-para {
  padding: 12px 16px;
  background: #161b22;
  border-radius: 4px;
  font-size: 0.95rem;
  border-left: 3px solid #d4af37;
}

/* ============ FAQ ============ */
.faq-block {
  background: #161b22;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #30363d;
  margin: 2rem 0;
}
.faq-block h2 { margin-top: 0; }
.faq-block details {
  border-bottom: 1px solid #30363d;
  padding: 12px 0;
}
.faq-block details:last-of-type { border-bottom: none; }
.faq-block summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
  color: #e6edf3;
  list-style: none;
  position: relative;
  padding-left: 24px;
}
.faq-block summary::-webkit-details-marker { display: none; }
.faq-block summary::before {
  content: "+";
  position: absolute;
  left: 0;
  top: 4px;
  color: #d4af37;
  font-weight: 700;
  font-size: 1.2rem;
}
.faq-block details[open] summary::before { content: "\2212"; }
.faq-answer {
  padding: 8px 0 4px 24px;
  color: #8b949e;
  font-size: 0.96rem;
}

/* ============ RELATED ============ */
.related-pages { margin: 2.5rem 0; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 1rem;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #e6edf3;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.related-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: #d4af37;
}
.related-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #d4af37;
  font-weight: 700;
}
.related-title {
  font-family: 'Cormorant Garamond', 'IBM Plex Serif Thai', serif;
  font-size: 1rem;
  line-height: 1.4;
}
.related-card-home { background: #d4af37; color: #fff; border-color: #d4af37; }
.related-card-home .related-label { color: rgba(255,255,255,0.85); }
.related-card-home .related-title { color: #fff; }

/* ============ DISCLAIMER ============ */
.disclaimer {
  background: #161b22;
  border: 1px solid #30363d;
  border-left: 5px solid #d4af37;
  padding: 20px 24px;
  border-radius: 4px;
  margin: 2rem 0;
  font-size: 0.93rem;
  color: #8b949e;
}
.disclaimer h3 { margin-top: 0; color: #e6edf3; font-size: 1.1rem; }
.disclaimer a { font-weight: 600; }
.disclaimer-note { font-size: 0.85rem; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #30363d; }

/* ============ FOOTER ============ */
.site-footer {
  background: #161b22;
  border-top: 1px solid #30363d;
  margin-top: 60px;
  padding: 40px 0 20px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}
.footer-col { font-size: 0.9rem; color: #8b949e; }
.footer-brand { font-family: 'Cormorant Garamond', 'IBM Plex Serif Thai', serif; font-size: 1.15rem; color: #e6edf3; margin: 0 0 6px; }
.footer-tag { margin: 0; }
.footer-heading { font-weight: 700; color: #e6edf3; margin: 0 0 10px; font-size: 0.95rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: #8b949e; }
.footer-col a:hover { color: #d4af37; }
.footer-bottom {
  max-width: 1180px;
  margin: 30px auto 0;
  padding: 20px 24px 0;
  border-top: 1px solid #30363d;
  font-size: 0.82rem;
  color: #8b949e;
  text-align: center;
}
.footer-bottom p { margin: 0; }

/* ============ CONTACT FORM ============ */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  margin-top: 1.2rem;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  color: #e6edf3;
  font-size: 0.92rem;
}
.contact-form input, .contact-form textarea {
  border: 1px solid #30363d;
  background: #161b22;
  color: #e6edf3;
  padding: 10px 12px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 2px #d4af3722;
}
.contact-form button {
  align-self: flex-start;
  background: #d4af37;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}
.contact-form button:hover { opacity: 0.88; }
.form-note {
  font-size: 0.82rem;
  color: #8b949e;
  margin: 0;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.4rem; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-nav ul { gap: 2px; }
  .site-nav a { padding: 6px 10px; font-size: 0.9rem; }
  .page-main { padding: 24px 18px 40px; }
  .toc ol { column-count: 1; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .related-grid { grid-template-columns: 1fr; }
}

/* ============ PRINT ============ */
@media print {
  .site-nav, .site-footer, .contact-form, .related-pages { display: none; }
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
}


/* ==== LUXURY DARK ==== */
body {
  background: linear-gradient(180deg, #0d1117 0%, #050810 100%);
  min-height: 100vh;
}
.page-title-block h1 {
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #d4af37 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.faq-block, .disclaimer, .toc, .author-box, .related-card, .site-header, .site-footer {
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.spec-callout {
  background: linear-gradient(135deg, #161b22 0%, #1c2230 100%);
  border: 1px solid #d4af3744;
  border-left: 4px solid #d4af37;
  padding: 20px 24px;
  border-radius: 4px;
  margin: 2rem 0;
}
.spec-callout h4 {
  color: #d4af37;
  margin: 0 0 12px;
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.spec-callout ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.spec-callout li {
  padding: 6px 0;
  border-bottom: 1px dashed #30363d;
  color: #e6edf3;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}
.spec-callout li:last-child { border-bottom: none; }
.related-card-home {
  background: linear-gradient(135deg, #d4af37 0%, #7c3aed 100%);
}
