/* Tuition template: "exercise book" look. Change the colours here. */
:root {
  --paper: #ffffff;
  --band: #f2f5fa;      /* light section band */
  --rule: #d6e2f2;      /* exercise-book blue lines */
  --margin: #e07a7a;    /* red margin line */
  --ink: #1f3b9b;       /* ballpoint blue: headings, buttons */
  --ink-dark: #172d78;
  --text: #1a2233;
  --muted: #5a6274;
  --pen: #d12a2a;       /* teacher's red pen: marks only */
  --wa: #25d366;        /* WhatsApp green */
  --font: "Archivo", system-ui, sans-serif;
  --hand: "Kalam", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 64px; /* room for the mobile contact bar */
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Ruled exercise-book paper, used in the hero and results */
.ruled {
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--ink-dark); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* ---------- 1. Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.header-row { display: flex; align-items: center; gap: 12px; height: 64px; }
.header-row .btn { flex-shrink: 0; white-space: nowrap; } /* long names must not squash "Enrol now" */
.brand {
  font-size: 1.3rem;
  font-weight: 800;
  font-stretch: 75%;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav { display: none; gap: 28px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }

/* Mobile contact bar */
.contact-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.contact-bar a {
  padding: 18px;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
}
.contact-call { background: var(--text); }
.contact-wa { background: var(--wa); }

/* ---------- 2. Hero (poster on exercise-book paper) ---------- */
.hero { overflow: hidden; }
.hero-grid { display: grid; gap: 32px; padding-top: 40px; padding-bottom: 40px; }
.hero-text {
  border-left: 2px solid var(--margin); /* the red margin line */
  padding-left: 18px;
  animation: reveal .9s ease-out both;
}
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } }
.hero h1 {
  font-size: clamp(2.9rem, 11vw, 6rem);
  font-weight: 800;
  font-stretch: 70%;
  line-height: .95;
  color: var(--ink);
  margin-bottom: 16px;
}
.hero p { font-size: 1.2rem; max-width: 34ch; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero-phone { font-weight: 700; font-size: 1.1rem; color: var(--ink); text-underline-offset: 4px; }
/* portrait photo; light blue block shows if img/teacher.jpg is missing */
.hero-photo {
  aspect-ratio: 4 / 5;
  max-height: 340px;
  width: 100%;
  border: 1px solid var(--rule);
  background: url("img/teacher.jpg") center top / cover, var(--rule);
}

/* ---------- Sections (shared) ---------- */
.section { padding-top: 56px; padding-bottom: 56px; }
.section h2 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 28px;
}
.section-band { background: var(--band); }

/* ---------- 3. Teacher profile ---------- */
.about-body { display: grid; gap: 24px; }
.about-body p { font-size: 1.15rem; max-width: 60ch; }
.creds { list-style: none; padding: 0; }
.creds li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}
.creds li::before { content: "✓"; font-family: var(--hand); color: var(--pen); font-size: 1.2rem; line-height: 1.3; }

/* ---------- 4. Classes (ruled rows, not cards) ---------- */
.classes { border-top: 2px solid var(--ink); }
.class-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.badge { font-size: .9rem; font-weight: 700; color: var(--muted); }
.class-card h3 { font-size: 1.5rem; font-weight: 800; font-stretch: 80%; line-height: 1.15; }
.class-card p { color: var(--muted); max-width: 55ch; }
.class-card .btn { align-self: flex-start; margin-top: 8px; }
.modes { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.modes li {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 1px 10px;
}

/* ---------- 5. Timetable ---------- */
/* Mobile: each row is a ruled block, data-label shows as the label. Desktop: normal table. */
.timetable { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); }
.timetable thead { display: none; }
.timetable tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.timetable td { display: flex; gap: 12px; padding: 3px 0; }
.timetable td::before {
  content: attr(data-label);
  flex: 0 0 96px;
  font-size: .85rem;
  font-weight: 400;
  color: var(--muted);
}
.timetable td:first-child::before { content: none; }
.timetable td:first-child { display: block; padding-bottom: 6px; }
.timetable small { color: var(--muted); font-size: .85rem; }
.timetable td:last-child { font-weight: 700; color: var(--ink); }
.note { color: var(--muted); font-size: .95rem; margin-top: 14px; }

/* ---------- 6. How it works (a real sequence, so numbered in red pen) ---------- */
.steps { list-style: none; padding: 0; display: grid; gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 2px solid var(--pen);
  border-radius: 50%;
  color: var(--pen);
  font-family: var(--hand);
  font-size: 1.5rem;
  transform: rotate(-6deg);
}
.steps h3 { font-size: 1.2rem; font-weight: 800; line-height: 1.3; align-self: end; }
.steps p { color: var(--muted); }

/* ---------- 7. Results (the marked answer sheet: the page's one bold moment) ---------- */
.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
.result { display: grid; justify-items: start; gap: 6px; }
.result strong {
  font-family: var(--hand);
  font-size: clamp(1.3rem, 5.5vw, 2.4rem);
  white-space: nowrap; /* a pen circle around a split figure looks broken */
  line-height: 1.1;
  color: var(--pen);
  border: 2px solid var(--pen);
  border-radius: 50%;
  padding: .25em .6em .1em;
  transform: rotate(-4deg);
}
.result:nth-child(even) strong { transform: rotate(3deg); }
.result span { font-weight: 600; font-size: .95rem; }

/* ---------- 8. Reviews ---------- */
.rating { margin: -14px 0 28px; color: var(--muted); }
.rating strong { color: var(--text); font-size: 1.2rem; }
.stars, .review::before { color: #e8a317; letter-spacing: 2px; }
.reviews { display: grid; gap: 28px; }
.review { border-top: 2px solid var(--ink); padding-top: 16px; }
.review::before { content: "★★★★★"; display: block; margin-bottom: 8px; }
.review blockquote { font-size: 1.1rem; margin-bottom: 12px; }
.review figcaption { color: var(--muted); font-size: .9rem; font-weight: 600; }

/* ---------- 9. Enrolment form (a slip with fill-in lines) ---------- */
.enrol { display: grid; gap: 8px; }
.enrol-intro { font-size: 1.1rem; max-width: 40ch; }
.enrol-form {
  display: grid;
  gap: 22px;
  background: var(--paper);
  border-top: 4px solid var(--ink);
  padding: 24px 20px 28px;
}
.enrol-form label { display: grid; gap: 2px; font-weight: 700; font-size: .95rem; }
.enrol-form small { font-weight: 400; color: var(--muted); }
.enrol-form input:not([type=radio]), .enrol-form select {
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--rule);
  border-radius: 0;
  padding: 8px 0;
  width: 100%;
}
.enrol-form input:focus, .enrol-form select:focus { outline: none; border-bottom-color: var(--ink); }
.enrol-form ::placeholder { color: #9aa3b5; }
.enrol-form fieldset { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.enrol-form legend { font-weight: 700; font-size: .95rem; margin-bottom: 6px; width: 100%; }
.enrol-form .choice { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 1.05rem; }
.enrol-form input[type=radio] { width: 20px; height: 20px; accent-color: var(--ink); }
.enrol-form .btn { justify-self: start; }

/* ---------- 10. Location ---------- */
.location { display: grid; gap: 28px; }
.facts { display: grid; margin-bottom: 24px; border-top: 2px solid var(--ink); }
.facts dt { font-size: .85rem; color: var(--muted); padding-top: 12px; }
.facts dd { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--rule); font-weight: 600; }
.map { width: 100%; height: 300px; border: 1px solid var(--rule); background: var(--band); }

/* ---------- 11. FAQ ---------- */
.faq { max-width: 760px; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 36px 18px 0;
  font-weight: 700;
  font-size: 1.05rem;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 6px; top: 12px;
  font-size: 1.6rem; color: var(--ink);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 18px; max-width: 65ch; }

/* ---------- 12. Footer ---------- */
.footer { background: var(--ink); color: #dfe6fb; padding: 56px 0 24px; }
.footer-grid { display: grid; gap: 28px; }
.footer p + p { margin-top: 4px; }
.footer h3 { font-size: .9rem; font-weight: 600; color: #aebcf0; margin-bottom: 6px; }
.footer a { color: #fff; }
.footer .brand { color: #fff; font-size: 1.6rem; margin-bottom: 4px; white-space: normal; }
.copyright { margin-top: 40px; font-size: .85rem; color: #aebcf0; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav { display: flex; }
  .hero-grid { grid-template-columns: 1.3fr 1fr; align-items: center; padding-top: 64px; padding-bottom: 64px; }
  .hero-text { padding-left: 32px; }
  .hero-photo { max-height: 500px; }
  .about-body { grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
  .class-card {
    display: grid;
    grid-template-columns: 1fr 1.3fr auto;
    grid-template-areas: "badge desc btn" "title desc btn" "title modes btn";
    column-gap: 32px;
    align-items: start;
  }
  .badge { grid-area: badge; }
  .class-card h3 { grid-area: title; }
  .class-card p { grid-area: desc; }
  .modes { grid-area: modes; }
  .class-card .btn { grid-area: btn; align-self: center; margin-top: 0; }
  .timetable thead { display: table-header-group; }
  .timetable th { text-align: left; padding: 12px 16px 12px 0; color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--rule); }
  .timetable tr { display: table-row; padding: 0; }
  .timetable td, .timetable td:first-child { display: table-cell; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); }
  .timetable td::before { content: none; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .steps li { grid-template-columns: 1fr; row-gap: 12px; }
  .steps li::before { grid-row: auto; }
  .results { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; padding: 16px 0 24px; }
  .reviews { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .enrol { grid-template-columns: 1fr 1.3fr; gap: 64px; align-items: start; }
  .enrol-form { grid-template-columns: 1fr 1fr; gap: 26px 32px; padding: 32px 36px 36px; }
  .enrol-form fieldset, .enrol-form .btn { grid-column: 1 / -1; }
  .location { grid-template-columns: 1fr 1.3fr; gap: 64px; align-items: start; }
  .facts { grid-template-columns: max-content 1fr; column-gap: 24px; }
  .facts dt { padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
  .facts dd { padding-top: 12px; }
  .map { height: 380px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; }
  .contact-bar { inset: auto 24px 24px auto; display: block; }
  .contact-call { display: none; }
  .contact-wa { border-radius: 999px; padding: 14px 22px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
}

/* Respect the phone's "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-text { animation: none; }
  .faq summary::after { transition: none; }
}
