/* ==========================================================================
   หมาน168 (mhan168) — PROTOTYPE-FAITHFUL THAI TEMPLE FAIR & PHA KHAO MA SYSTEM
   Exact match to approved Prototype 01, Prototype 02 & Prototype 03
   ========================================================================== */

:root {
  --bg-indigo: #170F35;
  --bg-plum: #24174A;
  --bg-plum-deep: #120B2B;

  --surface-cream: #FCF8EB;
  --surface-paper: #FDF1D6;
  --surface-white: #FFFFFF;

  --pha-red: #E82722;
  --pha-gold: #F7B11A;
  --pha-gold-bright: #FFD23F;
  --pha-lime: #7CD61D;
  --pha-cyan: #00B5CC;
  --pha-magenta: #D81CE0;
  --pha-ochre: #C98A1A;

  --text-on-light: #1A1238;
  --text-muted-light: #564D72;
  --text-on-dark: #FFFDF7;
  --text-muted-dark: #DAD3EE;

  --border-light: #ECE0C6;
  --border-light-strong: #DECBA8;

  --grad-cta-fest: linear-gradient(90deg, #E82722 0%, #F57C1F 55%, #F7B11A 100%);
  --shadow-fest-card: 0 10px 26px rgba(23, 15, 53, 0.07);
  --shadow-night-dock: 0 18px 40px rgba(10, 6, 28, 0.44);
  --shadow-cta-glow: 0 8px 22px rgba(232, 39, 34, 0.34);

  --font-heading: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --max-w: 1200px;
  --gutter: 28px;
  --radius-btn: 999px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--surface-cream);
  color: var(--text-on-light);
}

body {
  font-family: var(--font-body);
  background-color: var(--surface-cream);
  color: var(--text-on-light);
  line-height: 1.72;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: #D4221D;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

a:hover {
  color: #9A0A9E;
}

.section-night a,
.cover-hero a,
.site-footer a {
  color: var(--pha-gold);
}

.section-night a:hover,
.cover-hero a:hover,
.site-footer a:hover {
  color: #FFFFFF;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2.5px solid var(--pha-gold);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.22;
}

h1 {
  font-size: clamp(2rem, 3.8vw, 3.15rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.08rem, 1.5vw, 1.26rem);
  font-weight: 700;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-cream {
  background-color: var(--surface-cream);
  color: var(--text-on-light);
  padding: clamp(46px, 5.5vw, 72px) 0;
}

.section-cream p {
  color: var(--text-muted-light);
}

.section-paper {
  background-color: var(--surface-paper);
  color: var(--text-on-light);
  border-top: 1px solid var(--border-light-strong);
  border-bottom: 1px solid var(--border-light-strong);
  padding: clamp(46px, 5.5vw, 72px) 0;
}

.section-paper p {
  color: var(--text-muted-light);
}

.section-night {
  background: radial-gradient(circle at 86% 14%, rgba(216, 28, 224, 0.14), transparent 42%),
              radial-gradient(circle at 12% 85%, rgba(0, 181, 204, 0.12), transparent 38%),
              var(--bg-indigo);
  color: var(--text-on-dark);
  padding: clamp(48px, 5.8vw, 76px) 0;
}

.section-night h1,
.section-night h2,
.section-night h3 {
  color: var(--text-on-dark);
}

.section-night p {
  color: var(--text-muted-dark);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
