/* Platform · Together brand palette (per CI_Pattaya_Together-03.png) */
:root {
  --brand: #E42369;
  --accent: #F77BA8;
  --grape: #2F133C;
  --gold: #F0DC7A;
  --sky: #B6E0EB;
  --surface: #FFFFFF;
  --bg-tint: #FFE6F0;
  --bg-cream: #FEFBF3;
  --text-1: #2F133C;
  --text-2: #4A2A5A;
  --text-3: #7E6A8B;
  --text-4: #B8ACC2;
  --rule: #F4C9D9;
  --rule-2: #FCE4EC;
  --shadow: 0 8px 24px rgba(47,19,60,0.06);
  --shadow-hover: 0 18px 40px rgba(47,19,60,0.12);
  --radius: 14px;
  --radius-lg: 20px;
  --font-heading-en: 'Domine', Georgia, serif;
  --font-heading-th: 'Sukhumvit Set', 'Noto Sans Thai', sans-serif;
  --font-body: 'Noto Sans Thai', -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text-1);
  background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-tint) 100%);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Top chrome */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule-2);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 18px;
}
.topbar .brand {
  font-family: var(--font-heading-en);
  font-weight: 700; font-size: 22px;
  color: var(--brand);
  letter-spacing: -0.01em;
}
.topbar .brand .accent { color: var(--accent); }
.topbar .breadcrumb {
  font-size: 13px; color: var(--text-3);
  margin-left: 4px;
}
.topbar .breadcrumb a { color: var(--text-2); text-decoration: none; }
.topbar .breadcrumb a:hover { color: var(--brand); }
.topbar nav { margin-left: auto; display: flex; gap: 8px; }
.topbar nav a {
  font-size: 13px; padding: 7px 12px; border-radius: 999px;
  color: var(--text-2); text-decoration: none;
  border: 1px solid transparent;
}
.topbar nav a:hover {
  color: var(--brand); border-color: var(--rule); background: var(--bg-tint);
}
.topbar nav a.active { color: var(--brand); background: var(--bg-tint); border-color: var(--rule); }

/* Wrap */
.wrap { max-width: 1280px; margin: 0 auto; padding: 32px 24px 80px; }

.head { text-align: center; margin-bottom: 36px; }
.head h1 {
  font-family: var(--font-heading-en);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 56px);
  color: var(--grape);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.head .th-title {
  font-family: var(--font-heading-th);
  font-weight: 600; font-size: 20px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.head .sub {
  font-size: 14px; color: var(--text-3);
  letter-spacing: 0.12em; text-transform: uppercase;
}

/* Grid */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  text-decoration: none;
  color: var(--text-1);
  display: flex; flex-direction: column;
  min-height: 168px;
  transition: all 0.22s;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(247,123,168,0.08), transparent 70%);
  opacity: 0; transition: opacity 0.25s;
}
.card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.card:hover::before { opacity: 1; }
.card-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}
.card-title {
  font-family: var(--font-heading-en);
  font-weight: 700; font-size: 22px;
  color: var(--brand);
  letter-spacing: -0.01em;
}
.card-title-th {
  font-family: var(--font-heading-th);
  font-weight: 600; font-size: 14px;
  color: var(--text-2);
}
.card-desc {
  font-size: 14px; color: var(--text-2);
  line-height: 1.5;
  position: relative; z-index: 1;
}
.card-meta {
  margin-top: auto; padding-top: 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.1em;
  color: var(--text-3); text-transform: uppercase;
  position: relative; z-index: 1;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  background: var(--bg-tint);
  color: var(--brand);
}
.badge.gold { background: rgba(240,220,122,0.18); color: #8B7300; border-color: rgba(240,220,122,0.45); }
.badge.sky { background: rgba(182,224,235,0.18); color: #0F6680; border-color: rgba(182,224,235,0.55); }
.badge.spec { background: var(--grape); color: var(--gold); border-color: var(--grape); }

/* Section heading on hub */
.section-heading {
  font-family: var(--font-heading-en);
  font-size: 24px; color: var(--grape);
  margin: 32px 0 12px;
  letter-spacing: -0.01em;
}
.section-heading-th {
  font-family: var(--font-heading-th); font-size: 14px;
  color: var(--text-3); margin-left: 10px;
}

/* Doc viewer */
.doc-shell {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 44px;
  box-shadow: var(--shadow);
  border: 1px solid var(--rule-2);
}
.doc-shell .doc-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
}
.doc-shell h1, .doc-shell h2, .doc-shell h3, .doc-shell h4 {
  font-family: var(--font-heading-th);
  color: var(--grape);
  margin: 1.4em 0 0.5em;
  line-height: 1.3;
}
.doc-shell h1 { font-size: 28px; color: var(--brand); border-bottom: 2px solid var(--gold); padding-bottom: 8px; }
.doc-shell h2 { font-size: 22px; color: var(--brand); }
.doc-shell h3 { font-size: 18px; color: var(--accent); }
.doc-shell h4 { font-size: 16px; color: var(--grape); }
.doc-shell p { margin: 0.8em 0; }
.doc-shell strong { color: var(--grape); }
.doc-shell a { color: var(--brand); text-decoration: underline; text-decoration-color: var(--rule); }
.doc-shell a:hover { text-decoration-color: var(--brand); }
.doc-shell code {
  background: var(--bg-tint);
  color: var(--brand);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: 'SF Mono', 'Menlo', monospace;
}
.doc-shell pre {
  background: var(--grape);
  color: var(--bg-tint);
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 1em 0;
  font-family: 'SF Mono', 'Menlo', monospace;
}
.doc-shell pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.doc-shell table {
  width: 100%; border-collapse: collapse;
  margin: 1em 0;
  font-size: 14px;
}
.doc-shell th {
  background: var(--bg-tint);
  color: var(--grape);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--rule);
}
.doc-shell td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-2);
  color: var(--text-2);
}
.doc-shell tr:hover td { background: var(--bg-tint); }
.doc-shell ul, .doc-shell ol { margin: 0.6em 0 0.6em 1.5em; }
.doc-shell li { margin: 0.3em 0; }
.doc-shell blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-tint);
  padding: 12px 18px;
  margin: 1em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-2);
}
.doc-shell hr {
  border: none; height: 1px;
  background: linear-gradient(to right, transparent, var(--rule), transparent);
  margin: 2em 0;
}

/* Foot */
.foot {
  margin-top: 40px;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-3);
  text-transform: uppercase;
  text-align: center;
}
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--brand); }

/* Loading + error */
.loading, .error {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
}
.error {
  color: var(--brand);
  background: var(--bg-tint);
  border-radius: var(--radius);
}

/* Mobile */
@media (max-width: 760px) {
  .wrap { padding: 20px 16px 60px; }
  .topbar { padding: 12px 16px; }
  .topbar nav a { padding: 6px 10px; font-size: 12px; }
  .doc-shell { padding: 24px 20px; }
  .doc-shell h1 { font-size: 22px; }
  .doc-shell h2 { font-size: 18px; }
}
