/* ==========================================================================
   Pusat Tuisyen Lembaran — main stylesheet
   Mobile-first. Colour tokens below; contrast checked against WCAG 2.2 AA.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --navy: #1b2a4a;        /* primary */
  --navy-2: #26395f;
  --navy-ink: #e9eef7;    /* text on navy */
  --cream: #faf6ee;       /* page background */
  --cream-2: #f2ebdd;     /* alternate sections */
  --paper: #fffdf8;       /* cards */
  --gold: #c8a04a;        /* decorative accent only (rules, markers) */
  --gold-soft: #e3c27a;   /* accent on navy */
  --gold-text: #7f611a;   /* gold for text on cream: 5.3:1 */
  --ink: #2b2b2b;         /* body text: 13:1 on cream */
  --muted: #5a5650;       /* secondary text: 6.6:1 on cream */
  --line: #e2d8c5;
  --wa: #17703d;          /* WhatsApp action: white text 6.1:1 */
  --wa-hover: #115a30;
  --focus: #1f5fbf;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Sans 3", system-ui, sans-serif;

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 32px);
  --max: 1160px;
  --section: clamp(3.5rem, 8vw, 6.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 0.3vw + 1rem, 1.15rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
body.lang-zh { font-family: var(--cjk); line-height: 1.8; }
img, svg, iframe { max-width: 100%; display: block; }
a { color: var(--navy); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy);
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
.lang-zh h1, .lang-zh h2, .lang-zh h3 { font-family: var(--cjk); font-weight: 700; letter-spacing: 0.01em; line-height: 1.35; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); font-variation-settings: "opsz" 120; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 1.6vw, 1.35rem); font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; max-width: 68ch; }
.lead { font-size: 1.15em; color: var(--muted); }
.muted { color: var(--muted); }
.center { text-align: center; }
.center p { margin-inline: auto; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 780px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--navy); color: #fff; padding: 0.6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.preview-banner {
  background: #fff3cd; color: #4d3b00; font-size: 0.9rem; text-align: center;
  padding: 0.5rem var(--gutter); border-bottom: 1px solid #e8d48a;
}
.badge {
  display: inline-block; vertical-align: middle; margin-left: 0.4rem;
  font: 600 0.72rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase;
  background: #fff3cd; color: #4d3b00; border: 1px dashed #b38f00; border-radius: 999px; padding: 0.3em 0.6em;
}

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.75rem 1.4rem; border-radius: 999px;
  font: 650 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.lang-zh .btn { font-family: var(--cjk); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-hover); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-lg { min-height: 56px; padding-inline: 2rem; font-size: 1.1rem; }
.text-link { font-weight: 650; color: var(--navy); }
.text-link::after { content: " →"; }
.text-link-light { color: var(--gold-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; flex-wrap: wrap; }
.brand { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--navy); }
.brand-mark { width: 40px; height: 40px; flex: none; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font: 600 1.08rem/1.15 var(--serif); }
.brand-sub { font: 500 0.78rem/1.3 var(--cjk); letter-spacing: 0.12em; color: var(--muted); margin-top: 2px; }

.nav-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem;
  background: transparent; border: 1.5px solid var(--navy); border-radius: 999px; color: var(--navy);
  font: 600 0.95rem/1 var(--sans); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
  transition: transform .2s;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav { display: none; width: 100%; padding: 0.5rem 0 1.25rem; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li a {
  display: block; padding: 0.8rem 0.25rem; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.site-nav a[aria-current="page"] { color: var(--navy); box-shadow: inset 3px 0 0 var(--gold); padding-left: 0.75rem; }
.lang-switch {
  display: inline-flex; align-items: center; margin-top: 1rem; min-height: 44px; padding: 0 1rem;
  border: 1.5px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 650; color: var(--navy);
}
.no-js .site-nav { display: block; }
.no-js .nav-toggle { display: none; }

@media (min-width: 1000px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex !important; align-items: center; gap: 1.25rem; width: auto; padding: 0; }
  .site-nav ul { display: flex; gap: 0.25rem; }
  .site-nav li a { border: 0; padding: 0.5rem 0.65rem; font-size: 0.98rem; border-radius: 8px; }
  .site-nav li a:hover { background: var(--cream-2); }
  .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); padding-left: 0.65rem; border-radius: 0; }
  .lang-switch { margin: 0; min-height: 40px; }
}

@media (max-width: 440px) {
  .brand-name { font-size: 0.98rem; }
  .brand-mark { width: 36px; height: 36px; }
  .nav-toggle { padding: 0; width: 44px; justify-content: center; }
  .nav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section-alt { background: var(--cream-2); }
.section-navy { background: var(--navy); color: var(--navy-ink); }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-head { margin-bottom: 2.5rem; }
.section-head .lead { margin: 0; }
.section-foot { margin: 2.25rem 0 0; }

h2 { position: relative; }
.section h2::before {
  content: ""; display: block; width: 44px; height: 3px; background: var(--gold); margin-bottom: 1rem; border-radius: 2px;
}
.center h2::before { margin-inline: auto; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 8vw, 6rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.eyebrow {
  display: inline-block; margin-bottom: 1.1rem; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold-text);
}
.lang-zh .eyebrow { letter-spacing: 0.08em; font-size: 0.9rem; }
.hero h1 { margin-bottom: 0.5em; }
.hero .lead { font-size: clamp(1.1rem, 1.2vw + 0.8rem, 1.3rem); }
.photo-placeholder {
  margin: 0; aspect-ratio: 4 / 3; border-radius: calc(var(--radius) * 1.5);
  display: grid; place-items: center; text-align: center; padding: 2rem;
  background:
    linear-gradient(135deg, rgb(255 255 255 / .05) 25%, transparent 25%) 0 0 / 28px 28px,
    var(--navy);
  color: var(--gold-soft); font-weight: 600; letter-spacing: 0.02em;
  box-shadow: 18px 18px 0 -2px var(--cream-2), 18px 18px 0 0 var(--gold);
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; }
  .photo-placeholder { aspect-ratio: 4 / 5; }
}

/* Why choose us */
.feature-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0; }
.feature-list li { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.feature-list li:last-child { border-bottom: 1px solid var(--line); }
.feature-list h3 { margin-bottom: 0.35rem; }
.feature-list p { margin: 0; color: var(--muted); }
@media (min-width: 760px) {
  .feature-list { grid-template-columns: repeat(2, 1fr); column-gap: 3rem; }
  .feature-list li:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}
@media (min-width: 1100px) { .feature-list { grid-template-columns: repeat(3, 1fr); } }

/* Programme cards */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
.card {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem 1.5rem 1.4rem; position: relative;
}
.card::before { content: ""; position: absolute; inset: 0 auto auto 1.5rem; width: 36px; height: 3px; background: var(--gold); }
.card-level { margin: 0.4rem 0 0.6rem; font-size: 0.85rem; font-weight: 700; color: var(--gold-text); letter-spacing: 0.04em; }
.card h3 { font-family: var(--serif); font-weight: 560; font-size: 1.45rem; margin-bottom: 0.5rem; }
.lang-zh .card h3 { font-family: var(--cjk); font-weight: 700; }
.card p { color: var(--muted); font-size: 0.98rem; }
.card-link { margin-top: auto; padding-top: 0.75rem; font-weight: 650; color: var(--wa); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

/* Steps */
.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 1.25rem; border-top: 1px solid rgb(255 255 255 / .18); }
.steps li::before {
  content: "0" counter(step); display: block; font: 500 2.4rem/1 var(--serif); color: var(--gold-soft); margin-bottom: 0.9rem;
}
.steps h3 { color: #fff; }
.steps p { color: var(--navy-ink); margin: 0; opacity: .92; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, 1fr); column-gap: 3rem; } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(4, 1fr); } }

/* Quotes */
.quote { margin: 2rem 0 0; padding-left: 1.5rem; border-left: 3px solid var(--gold); }
.quote blockquote { margin: 0; font: 400 1.25rem/1.5 var(--serif); color: var(--navy); }
.quote figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.95rem; }

/* Location */
.loc-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .loc-grid { grid-template-columns: 0.8fr 1.2fr; gap: 4rem; } }
.loc-address { font-style: normal; font-size: 1.1rem; margin-bottom: 1rem; }
.map {
  min-height: 320px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; padding: 1.5rem; text-align: center;
}
.map-note { font-size: 0.88rem; color: var(--muted); margin: 0; }
.map.is-loaded { padding: 0; overflow: hidden; }
.map iframe { width: 100%; height: 380px; border: 0; }

/* Final CTA */
.cta-band { background: var(--cream-2); border-top: 1px solid var(--line); }


/* ---------- Inner pages ---------- */
.page-hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.page-hero .lead { margin-bottom: 0; }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.h3-like { font-size: clamp(1.35rem, 2vw, 1.6rem); }
.h3-like::before { display: none !important; }
.pull { font: 400 clamp(1.2rem, 1.6vw, 1.4rem)/1.55 var(--serif); color: var(--navy); }
.lang-zh .pull { font-family: var(--cjk); }
.two-col { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.panel p { margin: 0; color: var(--muted); }
.card-grid-3 { }
@media (min-width: 1040px) { .card-grid-3 { grid-template-columns: repeat(3, 1fr); } }

.team { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .team { grid-template-columns: 1fr 1fr; } }
.person { display: flex; gap: 1.25rem; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.avatar { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--navy); color: var(--gold-soft); font: 600 1.2rem/1 var(--serif); }
.person h3 { margin-bottom: 0.15rem; }
.person-role { margin: 0 0 0.5rem; font-weight: 650; color: var(--gold-text); font-size: 0.95rem; }
.person p:last-child { margin: 0; color: var(--muted); }

.approach-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.approach-list li { counter-increment: step; display: grid; grid-template-columns: 3.5rem 1fr; column-gap: 1rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.approach-list li:first-child { border-top: 0; padding-top: 0; }
.approach-list li::before { content: "0" counter(step); grid-row: span 2; font: 500 2.2rem/1 var(--serif); color: var(--gold); }
.approach-list h2 { margin-bottom: 0.4rem; }
.approach-list p { margin: 0; }
.tick-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.tick-list li { position: relative; padding-left: 2rem; }
.tick-list li::before { content: ""; position: absolute; left: 0.2rem; top: 0.45em; width: 0.9rem; height: 0.5rem; border-left: 2.5px solid var(--gold-text); border-bottom: 2.5px solid var(--gold-text); transform: rotate(-45deg); }

.notice { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 1.25rem 1.5rem; }

/* Contact */
.contact-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 0.85fr 1.15fr; gap: 4rem; } }
.dl { margin: 1rem 0 2rem; display: grid; gap: 1.1rem; }
.dl dt { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-text); }
.lang-zh .dl dt { letter-spacing: 0.04em; }
.dl dd { margin: 0.2rem 0 0; font-size: 1.1rem; }
.dl address { font-style: normal; }
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.25); padding: clamp(1.5rem, 4vw, 2.5rem); }
.no-js .js-only { display: none; }
.field { margin: 0 0 1.25rem; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 650; margin-bottom: 0.4rem; padding: 0; }
.req { font-weight: 400; color: var(--muted); font-size: 0.9em; }
.field input[type=text], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.85rem; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid #b9ad97; border-radius: 10px;
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--navy); }
.field [aria-invalid="true"] { border-color: #b3261e; }
.field-error { margin: 0.4rem 0 0; color: #b3261e; font-weight: 600; font-size: 0.95rem; }
.hint { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.field .check { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.4rem 0.9rem; border: 1.5px solid #b9ad97; border-radius: 999px; background: #fff; cursor: pointer; font-weight: 500 !important; margin: 0 !important; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--navy); }
.check:has(input:checked) { border-color: var(--navy); background: #eef1f7; }
.form-privacy { font-size: 0.92rem; color: var(--muted); }
.map-wide { min-height: 380px; margin-top: 1.5rem; }
.map-wide iframe { height: 450px; }

/* Privacy / prose */
.prose h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-top: 2.25rem; }
.prose h2::before { display: none; }
.prose h2:first-child { margin-top: 0; }
.lang-links a { margin-left: 0.4rem; font-weight: 600; }
.link-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.6rem; font-size: 1.1rem; }
.zh-inline { font-family: var(--cjk); font-size: 0.7em; color: var(--muted); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--navy-ink); padding-top: 3.5rem; font-size: 0.98rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2.5rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; } }
.footer-brand { display: flex; align-items: center; gap: 0.8rem; font: 600 1.25rem/1.2 var(--serif); color: #fff; }
.footer-brand img { flex: none; }
.footer-brand-zh { display: block; margin-top: 0.3rem; font: 500 0.9rem/1.3 var(--cjk); letter-spacing: 0.12em; color: var(--gold-soft); }
.footer-heading { font: 700 0.8rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 1rem; }
.footer-heading::before { display: none; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.site-footer address { font-style: normal; margin-bottom: 0.75rem; }
.footer-base { border-top: 1px solid rgb(255 255 255 / .14); padding-block: 1.25rem 6rem; font-size: 0.88rem; opacity: .85; }
.footer-base p { margin: 0; }

/* ---------- WhatsApp floating button ---------- */
.wa-float {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--wa); color: #fff; box-shadow: 0 8px 24px rgb(27 42 74 / .28);
}
.wa-float:hover { background: var(--wa-hover); }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .wa-float, .map, .preview-banner { display: none; }
  body { background: #fff; }
}
