/* ============================================================
   Singapore subject (.sg-subj)
   Exercise book + bar model + number bond + period timetable.
   Tokens match the rest of the site.
   ============================================================ */

.sg-subj,
.sg-cta,
.sg-faq {
  --sg-ink: var(--ink, var(--ink));
  --sg-mute: var(--slate, var(--slate));
  --sg-gold: var(--gold, var(--gold));
  --sg-wash: var(--cream-2, var(--cream-2));
  --sg-line: var(--line, var(--line));
  --sg-margin: var(--gold, var(--gold));
  font-family:var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink, var(--ink));
}

.sg-subj,
.sg-cta {
  background: var(--bg-body);
  overflow-x: clip;
  max-width: 100%;
  overflow-wrap: break-word;
}

.sg-subj *,
.sg-subj *::before,
.sg-subj *::after { box-sizing: border-box; }

.sg-subj img { max-width: 100%; }

.sg-subj h1,
.sg-subj h2,
.sg-subj h3,
.sg-subj h4,
.sg-cta h2 {
  font-family:var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--sg-ink);
  margin: 0;
}

.sg-subj .btn,
.sg-cta .btn {
  font-family:var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 0.5rem;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.sg-subj .wrap,
.sg-cta .wrap {
  width: 100%;
  max-width: var(--maxw, 1280px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

.sg-kicker {
  margin: 0 0 10px;
  font-family:var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-gold);
}

.sg-sec { margin: 0 0 40px; max-width: 38rem; }
.sg-sec h2 { font-size: clamp(30px, 3.4vw, 38px); line-height: 1.12; }
.sg-sec p {
  margin: 14px 0 0;
  color: var(--sg-mute);
  font-size: 1rem;
  line-height: 1.65;
}
.sg-sec--split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px 48px;
  align-items: end;
  max-width: none;
}
.sg-sec-lead {
  margin: 0;
  color: var(--sg-mute);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 28rem;
}

/* ---- Hero: shophouse bay ---- */
.sg-hero {
  position: relative;
  padding: 28px 0 20px;
}

.sg-hero-grid {
  display: grid;
  grid-template-columns: 148px minmax(0, 1.15fr) minmax(280px, 0.95fr);
  min-height: min(580px, 74vh);
  min-width: 0;
  align-items: stretch;
}

.sg-hero-dir {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--sg-wash);
  border-right: 1px solid var(--sg-line);
  min-width: 0;
}
.sg-hero-dir li {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--sg-line);
  min-width: 0;
}
.sg-hero-dir li:last-child { border-bottom: 0; }
.sg-hero-dir em {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--sg-gold);
}
.sg-hero-dir span {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-mute);
}
.sg-hero-dir strong {
  font-family:var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.sg-hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 4vw, 56px) clamp(28px, 4vw, 52px);
}

.sg-brand {
  margin: 0 0 8px;
  font-family:var(--font-heading);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--sg-ink);
}

.sg-hero-copy h1 {
  font-size: clamp(36px, 4.4vw, 48px);
  font-weight: 600;
  max-width: 16ch;
  line-height: 1.12;
  margin: 10px 0 16px;
}

.sg-lead {
  margin: 0 0 28px;
  max-width: 42ch;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--sg-mute);
}

.sg-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
}

.sg-hero-visual {
  position: relative;
  min-width: 0;
  min-height: 320px;
  height: 100%;
  overflow: hidden;
  background: var(--sg-wash);
}

.sg-hero-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}
.sg-hero-photo img,
.sg-hero-photo .ja-img-wrap,
.sg-hero-photo .ja-img-wrap img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ---- Stats: ink stamps ---- */
.sg-stats { padding: 8px 0 56px; }

.sg-stamps {
  list-style: none;
  margin: 0;
  padding: 18px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--sg-line);
  border-bottom: 1px solid var(--sg-line);
}
.sg-stamps li {
  min-width: 0;
  padding: 8px 20px;
  text-align: center;
}
.sg-stamps li + li { box-shadow: inset 1px 0 0 var(--sg-line); }
.sg-stamps strong {
  display: block;
  font-family:var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
}
.sg-stamps span {
  display: block;
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--sg-mute);
}

/* ---- Topics: photo bay + directory ---- */
.sg-topics { padding: 24px 0 80px; }

.sg-work-bay {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr);
  min-height: min(560px, 72vh);
  min-width: 0;
  border: 1px solid var(--sg-line);
  background: var(--bg-body);
  align-items: stretch;
}

.sg-work-visual {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--sg-line);
}

.sg-work-photo {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 240px;
  background: var(--sg-wash);
}
.sg-work-photo img,
.sg-work-photo .ja-img-wrap,
.sg-work-photo .ja-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-work-cap {
  margin: 0;
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--sg-wash);
  border-top: 1px solid var(--sg-line);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-ink);
}

.sg-work {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.sg-work li {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-content: center;
  min-width: 0;
  padding: 12px 24px;
  border-bottom: 1px solid var(--sg-line);
  transition: background 0.2s ease;
}
.sg-work li:last-child { border-bottom: 0; }
.sg-work li:hover { background: var(--sg-wash); }

.sg-work span {
  grid-row: 1 / span 2;
  align-self: center;
  margin: 0;
  font-family:var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--sg-gold);
}

.sg-work h3 {
  grid-column: 2;
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.25;
}

.sg-work p {
  grid-column: 2;
  margin: 4px 0 0;
  color: var(--sg-mute);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ---- Why: number bond ---- */
.sg-why {
  padding: 24px 0 88px;
  background:
    linear-gradient(var(--bg-body), var(--bg-body)) padding-box,
    linear-gradient(var(--sg-line), var(--sg-line)) border-box;
}

.sg-why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
  gap: 48px 40px;
  align-items: center;
}

.sg-why-copy .sg-sec { margin-bottom: 28px; }

.sg-why-photo {
  overflow: hidden;
  background: var(--sg-wash);
  aspect-ratio: 16 / 10;
  max-width: 520px;
}
.sg-why-photo img,
.sg-why-photo .ja-img-wrap,
.sg-why-photo .ja-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-bond {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 0;
}
.sg-bond-lines { display: none; }

.sg-bond li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 14px;
  min-width: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--sg-line);
  background: transparent;
  transition: background 0.28s ease;
}
.sg-bond li:last-child { border-bottom: 0; }
.sg-bond li:hover { background: var(--sg-wash); }

.sg-bond li span {
  grid-row: 1 / span 2;
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-gold);
}
.sg-bond li h3 {
  font-size: 1.05rem;
  line-height: 1.3;
}
.sg-bond li p {
  margin: 6px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--sg-mute);
}

/* ---- Method: CPA legend + period list ---- */
.sg-method { padding: 8px 0 88px; }

.sg-term {
  min-width: 0;
}

.sg-cpa {
  list-style: none;
  margin: 0 0 36px;
  padding: 0 0 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 32px;
  border-bottom: 1px solid var(--sg-line);
}
.sg-cpa li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  min-width: 0;
  position: relative;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.28s ease;
}
.sg-cpa li:hover { background: var(--sg-wash); }
.sg-cpa li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -20px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--sg-gold);
  border-right: 2px solid var(--sg-gold);
  transform: translateY(-50%) rotate(45deg);
}
.sg-cpa span {
  grid-row: 1 / span 2;
  font-family:var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  color: var(--sg-gold);
}
.sg-cpa strong {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sg-cpa em {
  font-style: normal;
  font-size: 14.5px;
  color: var(--sg-mute);
  line-height: 1.4;
}

.sg-timetable {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sg-timetable li {
  display: grid;
  grid-template-columns: 72px minmax(120px, 0.38fr) minmax(0, 1.2fr);
  gap: 0 28px;
  align-items: center;
  min-width: 0;
  padding: 28px 12px 28px 16px;
  margin: 0 -12px 0 -16px;
  border-bottom: 1px solid var(--sg-line);
  cursor: default;
  transition: background 0.28s ease, box-shadow 0.28s ease;
}
.sg-timetable li:hover {
  background: var(--sg-wash);
  box-shadow: inset 3px 0 0 var(--sg-gold);
}

.sg-period {
  display: block;
  margin: 0;
  font-family:var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sg-gold);
}
.sg-timetable h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}
.sg-timetable p {
  margin: 0;
  color: var(--sg-mute);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ---- Voice: window + fascia sign ---- */
.sg-voice { padding: 0 0 88px; }

.sg-copybook {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: 0 32px;
  align-items: stretch;
  min-width: 0;
  min-height: 340px;
}

.sg-copybook-photo {
  position: relative;
  overflow: hidden;
  background: var(--sg-wash);
  min-height: 280px;
  height: 100%;
}
.sg-copybook-photo img,
.sg-copybook-photo .ja-img-wrap,
.sg-copybook-photo .ja-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

.sg-copybook-page {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 36px 36px 28px;
  background: var(--sg-wash);
}

.sg-copybook-page blockquote { margin: 0; }
.sg-copybook-page blockquote p {
  margin: 0;
  font-family:var(--font-heading);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  line-height: 1.4;
  max-width: 28ch;
  color: var(--sg-ink);
}
.sg-copybook-page figcaption {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--sg-line);
}
.sg-copybook-page figcaption em {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--sg-gold);
  flex-shrink: 0;
}
.sg-copybook-page figcaption div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sg-copybook-page cite {
  font-style: normal;
  font-family:var(--font-heading);
  font-size: 16.5px;
  font-weight: 600;
}
.sg-copybook-page figcaption span {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-mute);
}

/* ---- CTA: perforated enrolment slip ---- */
.sg-cta {
  padding: 0 0 72px;
  overflow-x: clip;
  max-width: 100%;
}

.sg-slip {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 0 32px;
  align-items: center;
  background: var(--sg-wash);
  border: 1px solid var(--sg-line);
  position: relative;
  overflow: hidden;
}
.sg-slip-stub {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-ink);
  background: var(--bg-body);
  border-right: 2px dashed rgba(26, 26, 26, 0.18);
}
.sg-slip-copy { padding: 36px 0; min-width: 0; }
.sg-slip-copy h2 {
  font-size: clamp(26px, 2.8vw, 34px);
  margin: 0 0 6px;
}
.sg-slip-copy p {
  margin: 0;
  max-width: 46ch;
  color: var(--sg-mute);
  font-size: 1rem;
  line-height: 1.65;
}
.sg-slip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 28px 32px 28px 0;
}

/* ---- FAQ ---- */
.sg-faq {
  overflow-x: clip;
  max-width: 100%;
}
.sg-faq-visual {
  align-self: start;
  overflow: hidden;
  background: var(--cream);
  min-height: 420px;
  min-width: 0;
}
.sg-faq-visual img,
.sg-faq-visual .ja-img-wrap,
.sg-faq-visual .ja-img-wrap img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  display: block;
}

.sg-subj .sg-hero-photo .ja-img-wrap,
.sg-subj .sg-why-photo .ja-img-wrap,
.sg-subj .sg-work-photo .ja-img-wrap,
.sg-subj .sg-copybook-photo .ja-img-wrap {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .sg-subj .wrap,
  .sg-cta .wrap { padding-left: 28px; padding-right: 28px; }
  .sg-hero-grid { grid-template-columns: 128px minmax(0, 1fr) minmax(240px, 0.85fr); }
  .sg-hero-copy h1 { max-width: none; }
  .sg-why-grid { grid-template-columns: 1fr; }
  .sg-faq-visual { display: none; }
  .sg-faq .faq-main {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sg-slip {
    grid-template-columns: 56px minmax(0, 1fr);
  }
  .sg-slip-actions {
    grid-column: 2;
    padding: 0 28px 28px 0;
  }
}

@media (max-width: 900px) {
  .sg-work-bay {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .sg-work-visual { border-right: 0; border-bottom: 1px solid var(--sg-line); }
  .sg-work-photo {
    min-height: 220px;
    aspect-ratio: 16 / 9;
    flex: none;
  }
  .sg-work li { padding: 14px 18px; }
  .sg-hero { padding-top: 20px; }
  .sg-hero-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .sg-hero-dir {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--sg-line);
  }
  .sg-hero-dir li {
    flex: 1 1 50%;
    border-bottom: 1px solid var(--sg-line);
    border-right: 1px solid var(--sg-line);
    padding: 14px 16px;
  }
  .sg-hero-dir li:nth-child(2n) { border-right: 0; }
  .sg-hero-visual {
    order: -1;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 9;
    overflow: hidden;
  }
  .sg-hero-photo {
    position: absolute;
    inset: 0;
  }
  .sg-hero-copy {
    padding: 28px 4px 8px;
  }
  .sg-hero-copy h1,
  .sg-lead { max-width: none; }
  .sg-sec--split { grid-template-columns: 1fr; }
  .sg-stamps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-stamps li:nth-child(n + 3) { box-shadow: inset 0 1px 0 var(--sg-line); }
  .sg-stamps li:nth-child(2n) { box-shadow: inset 1px 0 0 var(--sg-line); }
  .sg-stamps li:nth-child(3) { box-shadow: inset 0 1px 0 var(--sg-line); }
  .sg-copybook {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 0;
  }
  .sg-copybook-photo {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 9;
  }
  .sg-copybook-page {
    padding: 28px 24px 24px;
  }
  .sg-copybook-page blockquote p { max-width: none; }
  .sg-cpa { gap: 0 20px; }
  .sg-cpa li:not(:last-child)::after { right: -14px; }
  .sg-timetable li {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 4px 16px;
  }
  .sg-timetable .sg-period { grid-row: 1 / span 2; align-self: start; }
  .sg-timetable h3,
  .sg-timetable p { grid-column: 2; }
}

@media (max-width: 767px) {
  .sg-cpa { grid-template-columns: 1fr; gap: 16px; padding-bottom: 20px; }
  .sg-cpa li:not(:last-child)::after { display: none; }
  .sg-timetable h3 { font-size: 20px; }
  .sg-timetable p { grid-column: 2; }
  .sg-work h3 { font-size: 1.05rem; }
  .sg-work p { font-size: 14.5px; }
  .sg-copybook-page { padding: 24px 20px 20px; }
}

@media (max-width: 640px) {
  .sg-subj .wrap,
  .sg-cta .wrap { padding-left: 20px; padding-right: 20px; }
  .sg-stamps { grid-template-columns: 1fr 1fr; }
  .sg-slip {
    grid-template-columns: 1fr;
  }
  .sg-slip-stub {
    writing-mode: horizontal-tb;
    transform: none;
    border-right: 0;
    border-bottom: 2px dashed rgba(26, 26, 26, 0.18);
    padding: 10px 16px;
    letter-spacing: 0.18em;
  }
  .sg-slip-copy { padding: 24px 20px 8px; }
  .sg-slip-actions {
    grid-column: 1;
    padding: 8px 20px 24px;
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .sg-hero-cta { flex-direction: column; align-items: stretch; }
}

