/* ==========================================================================
   Knightsbridge House International School Japan
   Design tokens taken directly from the kbh.edu.sg stylesheet
   (kbh-infra/app/globals.css) so the two sites read as one school.
   ========================================================================== */

:root {
  /* --- Official KBH palette --- */
  --paper:        #F7F3EA;
  --paper-2:      #EFE8D8;
  --ink:          #0F2742;
  --ink-2:        #1B3658;
  --crest:        #C42A2B;
  --crest-dark:   #A32324;
  --gold:         #B6892D;
  --line:         rgba(15, 39, 66, 0.14);
  --line-strong:  rgba(15, 39, 66, 0.32);
  --muted:        rgba(15, 39, 66, 0.65);

  /* Salmon family — brand surfaces (footer, feature bands) */
  --surface-warm:       #F8C8BC;
  --surface-warm-text:  #5A1F14;
  --surface-warm-muted: #8A3A28;
  --surface-warm-line:  #E59C8A;
  --surface-dark:       #5A1F14;

  --maxw: 1280px;
  --radius: 4px;
  --shadow-md: 0 20px 48px -24px rgba(15,39,66,.34);

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, 'Noto Sans JP', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--crest); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--crest-dark); }

h1, h2, h3 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(40px, 5.5vw, 72px); font-weight: 400; }
h2 { font-size: clamp(28px, 3.6vw, 44px); }
h3 { font-size: 21px; letter-spacing: -0.01em; }
h4 {
  font-family: var(--display);
  font-weight: 500; font-size: 14px;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink); margin: 0 0 1em;
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--crest); font-weight: 400; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.2em; }
li { margin-bottom: .4em; }
strong { font-weight: 600; }

/* --- Layout ------------------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 780px; }
section { padding: 88px 0; }
.section-paper2 { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-warm   { background: var(--surface-warm); color: var(--surface-warm-text); }
.section-warm h2, .section-warm h3 { color: var(--surface-warm-text); }
.section-warm a { color: var(--surface-warm-text); }
.section-dark   { background: var(--surface-dark); color: rgba(247,243,234,.78); }
.section-dark h2, .section-dark h3 { color: var(--paper); }
.center { text-align: center; }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.eyebrow::before { content: ''; width: 32px; height: 1px; background: var(--crest); flex: none; }
.center .eyebrow { justify-content: center; }
.section-dark .eyebrow { color: rgba(247,243,234,.7); }
.section-warm .eyebrow { color: var(--surface-warm-muted); }
.section-warm .eyebrow::before, .section-dark .eyebrow::before { background: currentColor; }

.lede { font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.section-dark .lede { color: rgba(247,243,234,.8); }
.rule { display: none; }

.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-block;
  font-size: 15px; font-weight: 500;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-primary { background: var(--crest); color: var(--paper); border-color: var(--crest); }
.btn-primary:hover { background: var(--crest-dark); border-color: var(--crest-dark); color: var(--paper); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); background: var(--paper-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--paper); border-color: rgba(247,243,234,.45); }
.btn-ghost:hover { background: var(--paper); color: var(--surface-dark); border-color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.center .btn-row { justify-content: center; }

/* --- Header ------------------------------------------------------------ */
.topbar {
  background: var(--surface-dark);
  color: rgba(247,243,234,.8);
  font-size: 12.5px;
  letter-spacing: .02em;
  padding: 8px 0;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar a { color: var(--paper); text-decoration: none; }
.topbar a:hover { color: var(--surface-warm); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 16px; padding-bottom: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 42px; width: auto; }
.brand-crest { height: 52px; width: auto; }
.brand-text { line-height: 1.1; }
.brand-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 9px 11px; cursor: pointer; color: var(--ink);
}
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: currentColor; margin: 4px 0; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--ink); text-decoration: none;
  border-radius: 999px;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.active { color: var(--crest); background: transparent; }
.nav .btn { margin-left: 10px; padding: 9px 20px; font-size: 14px; }
.nav .btn:hover { color: var(--paper); }

/* --- Announcement bar --------------------------------------------------- */
.announce {
  background: var(--crest);
  color: var(--paper);
  text-align: center;
  font-size: 14px; font-weight: 500;
  padding: 11px 28px;
}
.announce a { color: var(--paper); text-underline-offset: 3px; }
.announce a:hover { color: var(--surface-warm); }

/* --- Hero -------------------------------------------------------------- */
.hero { position: relative; background: var(--paper); padding: 88px 0 72px; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 24px; max-width: 14ch; }
.hero .tagline {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 2.6vw, 30px);
  color: var(--crest);
  margin: 0 0 22px;
}
.hero p.lede { max-width: 560px; }
.hero-crest {
  position: absolute; top: 50%; right: 4%; transform: translateY(-50%);
  width: 300px; opacity: .06; z-index: 0; pointer-events: none;
}

/* --- Page head ---------------------------------------------------------- */
.page-head { background: var(--paper); padding: 64px 0 28px; }
.page-head p { font-size: 17px; color: var(--ink-2); max-width: 620px; margin: 0; }
.breadcrumb {
  font-size: 12px; text-transform: uppercase; letter-spacing: .16em;
  color: var(--muted); margin-bottom: 24px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .here { color: var(--crest); }

/* --- Cards ------------------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.card:hover { background: var(--paper-2); transform: translateY(-2px); }
.section-paper2 .card { background: var(--paper); }
.section-paper2 .card:hover { border-color: var(--line-strong); }
.card h3 { margin-bottom: .45em; }
.card p { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.card p:last-child { margin-bottom: 0; }
.card .num {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-bottom: 20px;
  border-radius: var(--radius);
  background: var(--surface-dark); color: var(--paper);
  font-family: var(--display); font-weight: 700; font-size: 17px;
  box-shadow: 0 0 0 1px var(--gold) inset;
}
.card-link {
  display: inline-block; margin-top: 16px;
  font-size: 14px; font-weight: 500; color: var(--crest); text-decoration: none;
}
.card-link::after { content: ' \2192'; }
.card-link:hover { color: var(--crest-dark); text-decoration: underline; }

.card-plain { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }

/* --- Stats ------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { text-align: center; padding: 20px 14px; }
.stat .figure {
  display: block;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(38px, 5vw, 60px); line-height: 1;
  letter-spacing: -0.03em;
  color: var(--paper);
  margin-bottom: 10px;
}
.stat .label {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(247,243,234,.62);
}

/* --- Programme blocks ---------------------------------------------------- */
.prog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 36px 30px;
  margin-bottom: 24px;
}
.prog:hover { border-color: var(--line-strong); }
.prog-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.prog-head h3 { font-size: 28px; margin-bottom: .3em; }
.tag {
  display: inline-block;
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  background: var(--paper-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px;
}
.meta-list { list-style: none; padding: 0; margin: 22px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.meta-list li { margin: 0; padding: 16px 18px; background: var(--paper); font-size: 15px; }
.meta-list .k { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.subjects { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 26px; }
.subjects li { margin: 0; padding-left: 16px; position: relative; font-size: 15px; color: var(--ink-2); }
.subjects li::before { content: ''; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--crest); }

/* --- Tables ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption {
  text-align: left; padding: 22px 24px 4px;
  font-family: var(--display); font-weight: 500; font-size: 20px; color: var(--ink);
}
th, td { padding: 16px 24px; text-align: left; border-bottom: 1px solid var(--line); }
thead th {
  background: var(--paper-2);
  font-family: var(--sans);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
tbody th { font-weight: 500; color: var(--ink); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--ink); }
th.amount { text-align: right; }

/* --- Steps -------------------------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: 28px; }
.step { position: relative; padding-left: 64px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background: var(--surface-dark); color: var(--paper);
  font-family: var(--display); font-size: 17px; font-weight: 700;
  box-shadow: 0 0 0 1px var(--gold) inset;
}
.step h3 { margin-bottom: .35em; }
.step p, .step li { color: var(--ink-2); }

/* --- Quote -------------------------------------------------------------- */
.quote {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.32; letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 1em;
}
.section-warm .quote { color: var(--surface-warm-text); }

/* --- Info lists / forms --------------------------------------------------- */
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); margin: 0; }
.info-list li:last-child { border-bottom: 0; }
.info-list .k { flex: 0 0 128px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.info-list .v { flex: 1; color: var(--ink); font-size: 15px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--crest); outline-offset: 1px; border-color: var(--crest);
}
.form-note { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* --- CTA band ------------------------------------------------------------ */
.cta { background: var(--surface-dark); color: rgba(247,243,234,.8); text-align: center; padding: 88px 0; }
.cta h2 { color: var(--paper); }
.cta h2 em { color: var(--surface-warm); }
.cta p { max-width: 560px; margin: 0 auto 30px; }

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  background: var(--surface-warm);
  color: var(--surface-warm-text);
  padding: 72px 0 32px;
  font-size: 14px;
}
.site-footer h4 { color: var(--surface-warm-text); }
.site-footer a { color: var(--surface-warm-muted); text-decoration: none; }
.site-footer a:hover { color: var(--surface-warm-text); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 48px; margin-bottom: 48px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .5em; }
.footer-brand p { color: var(--surface-warm-muted); max-width: 320px; line-height: 1.6; }
.footer-brand .brand-crest { margin-bottom: 16px; }
.footer-bottom {
  border-top: 1px solid var(--surface-warm-line);
  padding: 26px 0 0;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--surface-warm-muted);
}
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--surface-warm-line); border-radius: 999px;
  color: var(--surface-warm-text);
}
.social a:hover { background: var(--surface-warm-text); border-color: var(--surface-warm-text); color: var(--surface-warm); }
.social svg { width: 15px; height: 15px; fill: currentColor; }
.info-list .social { margin-top: 0; }
.info-list .social a { border-color: var(--line-strong); color: var(--ink); }
.info-list .social a:hover { background: var(--crest); border-color: var(--crest); color: var(--paper); }

/* --- Utilities ------------------------------------------------------------ */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--crest); color: var(--paper); padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.map-embed { border: 1px solid var(--line); width: 100%; height: 340px; border-radius: var(--radius); filter: saturate(.85); }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .subjects { grid-template-columns: repeat(2, 1fr); }
  .meta-list { grid-template-columns: 1fr; }
  .hero-crest { display: none; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 8px 20px 20px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 6px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav .btn { margin: 16px 0 0; text-align: center; border-radius: 999px; }
  .site-header .wrap { position: relative; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  section { padding: 60px 0; }
  .hero { padding: 60px 0 56px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .subjects { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .info-list li { flex-direction: column; gap: 6px; }
  .info-list .k { flex: none; }
  .prog { padding: 26px 22px; }
  .brand-logo { height: 34px; }
  .topbar .wrap { justify-content: center; text-align: center; }
}

@media print {
  .site-header, .topbar, .announce, .cta, .nav-toggle, .site-footer { display: none; }
  body { font-size: 12pt; color: #000; background: #fff; }
}
