/* Mathify — site styles (no framework, no Webflow) */
:root {
  --navy: #2f3192;
  --navy-dark: #22246e;
  --sun: #fecb70;
  --sun-dark: #f3b545;
  --ink: #1f2a37;
  --muted: #55606e;
  --paper: #ffffff;
  --card-shadow: 0 2px 14px rgba(31, 42, 55, .08);
  --radius: 14px;
  --max: 920px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background-color: #fbfbfd;
  background-image: url("/images/bg.webp");
  background-repeat: repeat;
  background-size: 640px auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--navy); }
a:hover { color: var(--navy-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--sun);
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}
.brand {
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: .04em;
  color: var(--navy);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  padding: 8px;
  color: var(--navy);
  cursor: pointer;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu a,
.nav-menu .dd-btn {
  display: block;
  padding: 10px 14px;
  color: #111;
  text-decoration: none;
  font: inherit;
  font-size: 1rem;
  background: none;
  border: 0;
  cursor: pointer;
  border-radius: 8px;
}
.nav-menu a:hover,
.nav-menu .dd-btn:hover { background: rgba(255,255,255,.45); }
.nav-menu a[aria-current="page"] { color: var(--navy); font-weight: 700; }

.dropdown { position: relative; }
.dd-btn::after { content: " ▾"; font-size: .8em; }
.dd-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 170px;
  background: #fff;
  box-shadow: var(--card-shadow);
  border-radius: 10px;
  list-style: none;
  margin: 4px 0 0;
  padding: 6px;
}
.dropdown.open .dd-list,
.dropdown:focus-within .dd-list { display: block; }
.dd-list a { font-size: .95rem; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 60px;
    flex-direction: column;
    align-items: stretch;
    background: var(--sun);
    padding: 8px 16px 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,.08);
  }
  .site-header.menu-open .nav-menu { display: flex; }
  .dd-list {
    display: block;
    position: static;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 16px;
    margin: 0;
  }
  .dd-btn { pointer-events: none; font-weight: 700; }
  .dd-btn::after { content: ""; }
}

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; }
.page {
  max-width: var(--max);
  margin: 32px auto 48px;
  padding: 0 16px;
}
.card {
  background: rgba(255,255,255,.94);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 28px 32px;
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .card { padding: 20px 18px; }
}
.page-title {
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 20px;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.card h2 {
  color: var(--navy);
  font-size: 1.25rem;
  margin: 28px 0 8px;
}
.card h2:first-child { margin-top: 0; }
.card p { margin: 0 0 14px; text-align: justify; }
.card ul, .card ol { margin: 0 0 14px; padding-left: 1.4em; }
.card li { margin-bottom: 8px; text-align: justify; }

/* ---------- Welcome ---------- */
.hero {
  text-align: center;
  padding: 56px 16px 24px;
}
.hero h1 {
  color: var(--navy);
  font-weight: 900;
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  line-height: 1.25;
  margin: 0 auto;
  max-width: 900px;
  text-shadow: 0 1px 1px rgba(0,0,0,.2);
}
.tiles {
  max-width: 980px;
  margin: 24px auto 56px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tile {
  display: block;
  background: rgba(255,255,255,.94);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px 22px;
  text-decoration: none;
  color: var(--ink);
  border-top: 5px solid var(--sun);
  transition: transform .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(31,42,55,.12); color: var(--ink); }
.tile strong { display: block; color: var(--navy); font-size: 1.15rem; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: .95rem; }

/* ---------- Why Maths gallery ---------- */
.gallery {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.gallery figure {
  flex: 0 0 auto;
  width: min(80%, 320px);
  margin: 0;
  scroll-snap-align: center;
}
.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  background: #eef0f7;
}

/* ---------- Teacher ---------- */
.teacher {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}
.teacher img { border-radius: 50%; width: 240px; height: 240px; object-fit: cover; margin: 0 auto; }
@media (max-width: 680px) {
  .teacher { grid-template-columns: 1fr; }
  .teacher img { width: 200px; height: 200px; }
}

/* ---------- Testimonials ---------- */
.quotes { display: grid; gap: 16px; margin-bottom: 8px; }
.quote {
  background: #fff;
  border-left: 5px solid var(--sun);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 6px rgba(31,42,55,.06);
}
.quote p { margin: 0 0 8px; text-align: left; font-style: italic; }
.quote footer { color: var(--muted); font-size: .95rem; }
.quote footer strong { color: var(--navy); font-style: normal; }

/* ---------- Contact ---------- */
.contact-direct {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #f2f3fb;
  text-decoration: none;
  font-weight: 700;
}
.pill svg { width: 20px; height: 20px; flex: 0 0 auto; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1.5px solid #cfd3e3;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(47,49,146,.15);
}
textarea { min-height: 120px; resize: vertical; }

.send-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 20px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  flex: 1 1 200px;
}
.btn svg { width: 20px; height: 20px; }
.btn-wa { background: #25d366; color: #0b3d1f; }
.btn-wa:hover { background: #1fbd5a; color: #0b3d1f; }
.btn-mail { background: var(--navy); color: #fff; }
.btn-mail:hover { background: var(--navy-dark); color: #fff; }
.form-note { font-size: .9rem; color: var(--muted); margin-top: 12px; text-align: left; }
.form-error { color: #b42318; font-weight: 700; margin-top: 10px; min-height: 1.2em; }

/* ---------- Fees table ---------- */
.table-wrap { overflow-x: auto; margin: 6px 0 18px; }
table.fees { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.fees caption { text-align: left; font-weight: 700; color: var(--navy); padding-bottom: 8px; }
table.fees th, table.fees td { padding: 10px 12px; border-bottom: 1px solid #e3e5ef; text-align: center; }
table.fees thead th { background: var(--sun); color: #111; font-size: .95rem; vertical-align: bottom; }
table.fees thead th span { font-weight: 400; font-size: .82rem; }
table.fees thead th:first-child { border-radius: 10px 0 0 0; }
table.fees thead th:last-child { border-radius: 0 10px 0 0; }
table.fees tbody th { text-align: left; color: var(--navy); }
table.fees td { font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  table.fees { font-size: .88rem; }
  table.fees th, table.fees td { padding: 8px 4px; }
  table.fees thead th span { font-size: .72rem; }
  table.fees caption { font-size: .92rem; }
}

/* ---------- Ratings ---------- */
.stats-note { color: var(--muted); font-size: .95rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 8px;
}
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: #f6f7fd;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.stat b { display: block; font-size: 1.8rem; font-weight: 900; color: var(--navy); line-height: 1.1; }
.stat b small { font-size: .9rem; font-weight: 700; color: var(--muted); }
.stat span { display: block; font-size: .88rem; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.cta { margin-top: 22px; font-weight: 700; text-align: center !important; }
.tiles-inline { margin: 16px 0 0; padding: 0; }

/* ---------- Enquiry form ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 900; color: var(--navy); font-size: 1.05rem; margin-bottom: 10px; padding: 0; }
.form-intro { color: var(--muted); font-size: .95rem; }
.req { color: #b42318; }
.label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.choices label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; cursor: pointer; }
.choices input { width: auto; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #e6e7f5;
  font-size: .9rem;
  padding: 18px 16px;
  text-align: center;
}
.site-footer a { color: var(--sun); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--sun); }

/* Login button in nav (links to the student/admin app) */
.nav-menu a.nav-login { background: var(--navy); color: #fff; font-weight: 700; margin-left: 6px; }
.nav-menu a.nav-login:hover { background: var(--navy-dark); color: #fff; }
@media (max-width: 820px) { .nav-menu a.nav-login { margin: 8px 0 0; text-align: center; } }

/* honeypot field for bots — hidden from people and screen readers */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
