/* =========================================================
   AIA Khon Kaen — Design System
   Brand: AIA Red #D31145 | Warm, trustworthy, professional
   ========================================================= */

:root {
  /* Brand colors */
  --aia-red: #D31145;
  --aia-red-dark: #A50D36;
  --aia-red-soft: #FBE9EE;
  --ink: #1A1B1F;
  --ink-soft: #4A4D57;
  --muted: #6E727E;
  --line: #E6E8EC;
  --bg: #FFFFFF;
  --bg-soft: #F7F8FA;
  --bg-warm: #FCF9F6;
  --gold: #C8A24B;
  --success: #1E874B;

  /* Type */
  --font-sans: "IBM Plex Sans Thai Looped", "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif;
  --font-serif: "Noto Serif Thai", Georgia, serif;

  /* Layout */
  --max: 1140px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(20,22,30,.06), 0 1px 2px rgba(20,22,30,.04);
  --shadow: 0 8px 30px rgba(20,22,30,.08);
  --shadow-lg: 0 20px 60px rgba(20,22,30,.14);
  --space: clamp(3rem, 7vw, 6rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  font-size: 1.0625rem;
  letter-spacing: .005em;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--aia-red); text-decoration: none; transition: color .2s; }
a:hover { color: var(--aia-red-dark); }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
p { color: var(--ink-soft); }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: var(--space); }
.section--soft { background: var(--bg-soft); }
.section--warm { background: var(--bg-warm); }
.center { text-align: center; }
.lead { font-size: 1.18rem; color: var(--ink-soft); }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--aia-red); margin-bottom: .75rem;
}
.section-head { max-width: 680px; margin: 0 auto 3rem; }
.section-head.center { text-align: center; }
.text-muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  padding: .85rem 1.6rem; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--aia-red); color: #fff; box-shadow: 0 6px 18px rgba(211,17,69,.28); }
.btn--primary:hover { background: var(--aia-red-dark); color: #fff; box-shadow: 0 10px 26px rgba(211,17,69,.36); }
.btn--ghost { background: #fff; color: var(--aia-red); border-color: var(--aia-red); }
.btn--ghost:hover { background: var(--aia-red-soft); color: var(--aia-red-dark); }
.btn--line { background: #06C755; color: #fff; }
.btn--line:hover { background: #05a948; color: #fff; }
.btn--lg { padding: 1.05rem 2.1rem; font-size: 1.08rem; }
.btn--block { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.brand .logo {
  width: 40px; height: 40px; border-radius: 10px; background: var(--aia-red); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem; letter-spacing: -.02em;
  box-shadow: 0 4px 12px rgba(211,17,69,.3);
}
.brand small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; }
.nav-links a { color: var(--ink-soft); font-weight: 500; font-size: .98rem; padding: .5rem .8rem; border-radius: 8px; }
.nav-links a:hover, .nav-links a.active { color: var(--aia-red); background: var(--aia-red-soft); }
.nav-cta { margin-left: .5rem; }

/* dropdown */
.has-drop { position: relative; }
.drop-menu {
  position: absolute; top: 100%; left: 0; min-width: 250px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: .5rem; list-style: none; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .18s; margin-top: .35rem;
}
.has-drop:hover .drop-menu, .has-drop:focus-within .drop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.drop-menu a { display: block; padding: .6rem .8rem; border-radius: 8px; font-size: .95rem; }
.drop-menu a strong { display: block; color: var(--ink); }
.drop-menu a span { font-size: .82rem; color: var(--muted); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .25s; }

@media (max-width: 940px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch;
    background: #fff; padding: 1rem 1.25rem 2rem; gap: .15rem; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); transform: translateY(-120%); transition: transform .3s; max-height: calc(100vh - 72px); overflow-y: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .8rem 1rem; font-size: 1.05rem; }
  .drop-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; border-left: 2px solid var(--aia-red-soft); border-radius: 0; margin: .2rem 0 .4rem 1rem; padding: 0; }
  .nav-cta { margin: .5rem 0 0; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero { position: relative; background: linear-gradient(160deg, #fff 0%, var(--aia-red-soft) 100%); overflow: hidden; }
.hero::after {
  content: ""; position: absolute; top: -20%; right: -10%; width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(211,17,69,.12), transparent 70%); border-radius: 50%;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; padding-block: clamp(3rem, 7vw, 5.5rem); position: relative; z-index: 1; }
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 .hl { color: var(--aia-red); }
.hero .lead { margin-bottom: 1.75rem; max-width: 540px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .85rem; margin-bottom: 1.75rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.hero-trust div { display: flex; align-items: center; gap: .5rem; font-size: .92rem; color: var(--ink-soft); font-weight: 500; }
.hero-trust .ic { color: var(--success); font-size: 1.1rem; }
.hero-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 1.75rem; border: 1px solid var(--line);
}
.hero-card .avatar {
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--aia-red), var(--gold)); display: grid; place-items: center;
  color: #fff; font-size: 2rem; font-weight: 700;
}
.hero-card h3 { text-align: center; margin-bottom: .15rem; }
.hero-card .role { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.hero-card .stats { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; text-align: center; border-top: 1px solid var(--line); padding-top: 1rem; }
.hero-card .stats b { display: block; color: var(--aia-red); font-size: 1.3rem; }
.hero-card .stats span { font-size: .76rem; color: var(--muted); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-card { max-width: 420px; }
}

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 860px) { .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .ic-box {
  width: 52px; height: 52px; border-radius: 14px; background: var(--aia-red-soft);
  display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 1rem;
}
.card h3 { margin-bottom: .5rem; font-size: 1.2rem; }
.card p { font-size: .98rem; }
.card .link-more { display: inline-flex; align-items: center; gap: .3rem; margin-top: 1rem; font-weight: 600; font-size: .95rem; }

/* feature list */
.checks { list-style: none; display: grid; gap: .75rem; }
.checks li { display: flex; gap: .65rem; align-items: flex-start; color: var(--ink-soft); }
.checks li::before { content: "✓"; color: var(--success); font-weight: 800; flex: none; margin-top: .1rem; }

/* ---------- Case study ---------- */
.case {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.case-head { background: var(--bg-soft); padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.case-head .tag { font-size: .78rem; font-weight: 700; color: var(--aia-red); text-transform: uppercase; letter-spacing: .08em; }
.case-head h3 { margin-top: .25rem; font-size: 1.25rem; }
.case-body { padding: 1.5rem; display: grid; gap: 1rem; }
.case-row { display: grid; grid-template-columns: 110px 1fr; gap: .75rem; align-items: start; }
.case-row .label { font-weight: 700; font-size: .9rem; }
.case-row.problem .label { color: #C53030; }
.case-row.solution .label { color: var(--aia-red); }
.case-row.result .label { color: var(--success); }
@media (max-width: 520px) { .case-row { grid-template-columns: 1fr; gap: .2rem; } }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 1.5rem; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 1.25rem; align-items: start; }
.step .num {
  counter-increment: step; width: 56px; height: 56px; border-radius: 50%; background: var(--aia-red);
  color: #fff; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800;
}
.step .num::before { content: counter(step); }
.step h3 { font-size: 1.15rem; margin-bottom: .25rem; }

/* ---------- FAQ / Accordion ---------- */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .85rem; background: #fff; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: 1.08rem; font-weight: 600; color: var(--ink); padding: 1.15rem 1.35rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-q .chev { color: var(--aia-red); transition: transform .25s; flex: none; font-size: 1.3rem; }
.faq-item.open .chev { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 1.35rem 1.25rem; color: var(--ink-soft); }
.faq-item.open .faq-a { max-height: 600px; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--aia-red), var(--aia-red-dark)); color: #fff; border-radius: var(--radius); padding: clamp(2rem,5vw,3.5rem); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 560px; margin: .75rem auto 1.75rem; }
.cta-band .btn--ghost { background: #fff; border-color: #fff; }

/* ---------- Form ---------- */
.lead-form { display: grid; gap: 1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .92rem; color: var(--ink); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 1rem; padding: .8rem 1rem; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--aia-red); box-shadow: 0 0 0 3px var(--aia-red-soft);
}
.field textarea { resize: vertical; min-height: 90px; }
.form-status { font-size: .95rem; font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: var(--success); }
.form-status.err { color: #C53030; }
.form-note { font-size: .82rem; color: var(--muted); }

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: none;
  background: #fff; border-top: 1px solid var(--line); padding: .6rem .8rem;
  gap: .6rem; box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.sticky-cta .btn { flex: 1; padding: .8rem; font-size: .98rem; }
@media (max-width: 740px) { .sticky-cta { display: flex; } body { padding-bottom: 76px; } }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: .86rem; color: var(--muted); padding-top: 1.25rem; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--aia-red); }

/* ---------- Article ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article h2 { margin: 2.25rem 0 .75rem; }
.article h3 { margin: 1.75rem 0 .5rem; }
.article p, .article li { color: var(--ink-soft); margin-bottom: 1rem; }
.article ul, .article ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.article img { border-radius: var(--radius); margin: 1.5rem 0; }
.article .meta { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.callout { background: var(--aia-red-soft); border-left: 4px solid var(--aia-red); padding: 1.1rem 1.35rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.5rem 0; }
.callout p { color: var(--ink); margin: 0; }

/* blog cards */
.post-card { display: flex; flex-direction: column; }
.post-card .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--aia-red-soft), #fff); display: grid; place-items: center; font-size: 2.5rem; }
.post-card .body { padding: 1.35rem; flex: 1; display: flex; flex-direction: column; }
.post-card .cat { font-size: .78rem; font-weight: 700; color: var(--aia-red); text-transform: uppercase; letter-spacing: .06em; }
.post-card h3 { font-size: 1.15rem; margin: .35rem 0 .5rem; }
.post-card p { font-size: .94rem; flex: 1; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfd2da; padding-block: 3.5rem 2rem; }
.site-footer a { color: #cfd2da; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; margin-bottom: 2.5rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; letter-spacing: .03em; }
.site-footer ul { list-style: none; display: grid; gap: .55rem; font-size: .94rem; }
.footer-brand .brand { color: #fff; margin-bottom: 1rem; }
.footer-brand .brand small { color: #9aa0ad; }
.footer-brand p { color: #9aa0ad; font-size: .92rem; }
.footer-bottom { border-top: 1px solid #2c2e36; padding-top: 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: #8b909c; }
.footer-disclaimer { font-size: .78rem; color: #6b6f7a; margin-top: 1rem; line-height: 1.6; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Utilities ---------- */
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mb-0 { margin-bottom: 0; }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--aia-red); color: #fff; padding: .6rem 1rem; z-index: 200; }
.skip-link:focus { left: 0; color: #fff; }
