/* OLEThaiPedia Theme Stylesheet — Deep Emerald & Champagne Gold */
:root {
  --otp-bg: #061311;
  --otp-surface: #0c1f1c;
  --otp-surface-2: #091815;
  --otp-border: rgba(52, 211, 153, 0.22);
  --otp-border-gold: rgba(234, 179, 8, 0.35);
  --otp-text: #e6f0ee;
  --otp-muted: #94b0aa;
  --otp-gold: #eab308;
  --otp-gold-bright: #fde047;
  --otp-mint: #34d399;
  --otp-danger: #f87171;
  --otp-radius: 14px;
  --otp-max: 1140px;
}

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

html { scroll-behavior: smooth; }

body.otp-body {
  margin: 0;
  background: var(--otp-bg);
  color: var(--otp-text);
  font-family: "Noto Sans Thai", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--otp-gold); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--otp-gold-bright); text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

.otp-container {
  width: 100%;
  max-width: var(--otp-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Sticky Header */
.otp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 19, 17, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--otp-border);
}

.otp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.otp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--otp-text);
  letter-spacing: -0.02em;
}
.otp-brand:hover { text-decoration: none; color: var(--otp-gold); }
.otp-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--otp-gold), #ca8a04);
  color: #061311;
  font-weight: 900;
  font-size: 0.95rem;
}

.otp-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.otp-nav a {
  color: var(--otp-text);
  font-size: 0.94rem;
  font-weight: 600;
}
.otp-nav a:hover { color: var(--otp-gold); text-decoration: none; }

.otp-lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--otp-border-gold);
  background: var(--otp-surface);
  color: var(--otp-gold);
  font-size: 0.85rem;
  font-weight: 700;
}
.otp-lang-switch:hover {
  background: rgba(234, 179, 8, 0.14);
  text-decoration: none;
}

/* 3-Level Clickable Breadcrumbs */
.otp-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--otp-muted);
  padding: 16px 0 6px;
}
.otp-breadcrumbs a { color: var(--otp-mint); }
.otp-breadcrumbs .otp-sep { opacity: 0.55; }

/* Main Content & Typography */
.otp-main { padding: 20px 0 64px; }

.otp-hero {
  background: radial-gradient(circle at top right, rgba(52, 211, 153, 0.12), transparent 55%), var(--otp-surface);
  border: 1px solid var(--otp-border);
  border-radius: 18px;
  padding: 36px 32px;
  margin-bottom: 32px;
}
.otp-hero--banner {
  padding: 0;
  overflow: hidden;
  background: var(--otp-surface);
}
.otp-hero-banner-fig {
  margin: 0 !important;
}
.otp-hero-banner-fig img {
  width: 100%;
  height: auto;
  display: block;
  border: 0 !important;
  border-radius: 17px !important;
}
.otp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.otp-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.14);
  border: 1px solid var(--otp-border-gold);
  color: var(--otp-gold);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.otp-hero h1, .otp-article h1 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.25;
  color: #f8fafc;
}
.otp-lead {
  color: var(--otp-muted);
  font-size: 1.06rem;
  margin: 0 0 22px;
  max-width: 72ch;
}

.otp-article {
  background: var(--otp-surface);
  border: 1px solid var(--otp-border);
  border-radius: 18px;
  padding: 34px 32px;
}
.otp-article h2 {
  margin: 34px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--otp-border);
  color: var(--otp-gold);
  font-size: 1.45rem;
}
.otp-article h3 {
  margin: 24px 0 10px;
  color: var(--otp-mint);
  font-size: 1.15rem;
}

/* Grid & Pillar Cards */
.otp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.otp-card {
  background: var(--otp-surface-2);
  border: 1px solid var(--otp-border);
  border-radius: var(--otp-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.otp-card:hover { border-color: var(--otp-border-gold); }
.otp-card-thumb {
  display: block;
  margin-bottom: 6px;
}
.otp-card-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--otp-border);
}
.otp-card h3 { margin: 0; font-size: 1.1rem; color: var(--otp-gold); }
.otp-card p { margin: 0; color: var(--otp-muted); font-size: 0.94rem; }

/* Centered Featured Figures, Diagrams & Playing Card Hands */
.otp-featured-fig, .otp-diagram {
  margin: 24px auto;
  text-align: center;
}
.otp-featured-fig img, .otp-featured-fig svg, .otp-diagram svg {
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--otp-border);
}
.otp-featured-fig figcaption {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--otp-muted);
}

.otp-hand {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px auto;
}
.otp-card-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  height: 92px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #091815;
  border: 2px solid var(--otp-border-gold);
  color: #f8fafc;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.otp-card-tile.is-red { color: #f87171; border-color: rgba(248, 113, 113, 0.55); }
.otp-card-tile small { font-size: 1.1rem; line-height: 1; margin-top: 4px; }

/* TL;DR & Safety Callouts */
.otp-tldr {
  background: rgba(52, 211, 153, 0.08);
  border-left: 4px solid var(--otp-mint);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 20px 0;
}
.otp-tldr strong { color: var(--otp-mint); display: block; margin-bottom: 6px; }

.otp-safety-box {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid var(--otp-border-gold);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 22px 0;
  font-size: 0.94rem;
}

.otp-ymyl-warning {
  background: rgba(248, 113, 113, 0.08);
  border-left: 4px solid var(--otp-danger);
  border-top: 1px solid rgba(248, 113, 113, 0.25);
  border-right: 1px solid rgba(248, 113, 113, 0.25);
  border-bottom: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 18px 0 22px;
  font-size: 0.94rem;
}
.otp-ymyl-warning strong { display: block; color: #fca5a5; margin-bottom: 6px; }
.otp-ymyl-warning p { margin: 0; color: var(--otp-text); }

.otp-author-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--otp-surface-2);
  border: 1px solid var(--otp-border);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 28px 0 18px;
}
.otp-author-avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(234, 179, 8, 0.16);
  border: 1px solid var(--otp-border-gold);
  color: var(--otp-gold);
  font-weight: 800;
  font-size: 1rem;
}
.otp-author-name { font-weight: 700; color: var(--otp-text); margin-bottom: 4px; }
.otp-author-name span { font-weight: 500; color: var(--otp-mint); font-size: 0.88rem; }
.otp-author-meta p { margin: 0; color: var(--otp-muted); font-size: 0.9rem; }

/* Responsive Tables */
.otp-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid var(--otp-border);
}
.otp-table-wrap table, .otp-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--otp-surface-2);
  font-size: 0.94rem;
}
.otp-table-wrap th, .otp-table th {
  background: rgba(234, 179, 8, 0.12);
  color: var(--otp-gold);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--otp-border);
  white-space: nowrap;
}
.otp-table-wrap td, .otp-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(52, 211, 153, 0.12);
  color: var(--otp-text);
}

/* Interactive Tools & Strict Dark-Mode Inputs */
.otp-tool-box {
  background: var(--otp-surface);
  border: 1px solid var(--otp-border-gold);
  border-radius: 16px;
  padding: 24px;
  margin: 26px 0;
}
.otp-tool-title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: var(--otp-gold);
}
.otp-tool-sub {
  margin: 0 0 18px;
  color: var(--otp-muted);
  font-size: 0.94rem;
}
.otp-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.otp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
}
.otp-field label {
  font-size: 0.85rem;
  color: var(--otp-muted);
  font-weight: 600;
}

.otp-tool-box input[type="number"],
.otp-tool-box input[type="text"],
.otp-tool-box select {
  background: #091815;
  color: #f1f5f9;
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 72px;
  font-size: 0.95rem;
  line-height: 1.35;
}
.otp-tool-box input:focus,
.otp-tool-box select:focus {
  outline: 2px solid var(--otp-gold);
  outline-offset: 1px;
}

.otp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--otp-border-gold);
  background: var(--otp-gold);
  color: #061311;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
}
.otp-btn:hover { background: var(--otp-gold-bright); }
.otp-btn-ghost {
  background: #091815;
  color: var(--otp-text);
  border: 1px solid var(--otp-border);
}
.otp-btn-ghost:hover { border-color: var(--otp-gold); color: var(--otp-gold); background: #091815; }
.otp-btn-sm { padding: 5px 10px; font-size: 0.82rem; }

.otp-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.otp-tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--otp-border);
  background: #091815;
  color: var(--otp-muted);
  font-weight: 700;
  cursor: pointer;
}
.otp-tab-btn.is-active {
  background: rgba(234, 179, 8, 0.16);
  border-color: var(--otp-gold);
  color: var(--otp-gold);
}

.otp-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.otp-stat-card {
  background: #091815;
  border: 1px solid var(--otp-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.otp-stat-card span { display: block; font-size: 0.8rem; color: var(--otp-muted); }
.otp-stat-card strong { font-size: 1.25rem; color: var(--otp-mint); }

/* FAQ Accordion */
.otp-faq-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.otp-faq-item {
  background: var(--otp-surface-2);
  border: 1px solid var(--otp-border);
  border-radius: 10px;
  padding: 12px 16px;
}
.otp-faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--otp-text);
  list-style: none;
}
.otp-faq-item summary::before { content: "+ "; color: var(--otp-gold); font-weight: 800; }
.otp-faq-item[open] summary::before { content: "− "; }
.otp-faq-item p { margin: 10px 0 0; color: var(--otp-muted); font-size: 0.94rem; }

/* 4-Column E-E-A-T Footer */
.otp-footer {
  border-top: 1px solid var(--otp-border);
  background: #040d0c;
  padding: 44px 0 28px;
  color: var(--otp-muted);
  font-size: 0.9rem;
}
.otp-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 26px;
  margin-bottom: 28px;
}
.otp-footer h4 { margin: 0 0 12px; color: var(--otp-gold); font-size: 1rem; }
.otp-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.otp-footer a { color: var(--otp-muted); }
.otp-footer a:hover { color: var(--otp-gold); }
.otp-footer-bottom {
  border-top: 1px solid rgba(52, 211, 153, 0.14);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
}

@media (max-width: 720px) {
  .otp-hero, .otp-article { padding: 22px 18px; }
  .otp-header-inner { flex-wrap: wrap; padding: 10px 0; }
}
