/* Piryon Education. Hand-written stylesheet (no framework, system fonts only).
   Layout, spacing and colours follow the approved design mockups. */

:root {
  --ivory: #FBF9F3;
  --navy: #003366;
  --burgundy: #7A2E3A;
  --gold: #C9963A;
  --gold-light: #F2D9A0;
  --sand: #F3EEE2;
  --footer: #002147;
  --rule: #E3DED2;
  --text: #2B2B2B;
  --text-2: #3D4250;
  --muted: #5A5F69;
  --field: #8A8478; /* 3.7:1 against white (WCAG 1.4.11 needs 3:1) */
  --white: #FFFFFF;
  --on-navy: #D9DDE6;
  --on-footer: #C9CFDC;
  --teal: #2F6B6B;
  --steel: #5B7FA6;
  --side-rule: #3A4866;
  --max: 1200px;
  --gutter: 32px;
  --font: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}

img { max-width: 100%; }
picture { display: block; }
picture img { display: block; width: 100%; height: auto; }

a { color: var(--navy); }
a:hover { color: var(--burgundy); }

h1, h2, h3 { font-family: var(--font); }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--gold-light); }
.site-footer :focus-visible { outline-color: var(--gold-light); }

.container { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--burgundy);
  font-weight: 700;
}
.eyebrow-gold { color: var(--gold-light); margin-bottom: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  padding: 15px 30px;
  border-radius: 3px;
  border: 0;
}
.btn:hover { color: var(--white); background: var(--burgundy); }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); padding: 13px 28px; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy); }
.btn-button { font-family: var(--font); cursor: pointer; padding: 14px 32px; }
.btn-button[disabled] { opacity: 0.7; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- Header and footer ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--ivory); }
.header-row {
  padding-top: 18px;
  padding-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo { display: block; height: 58px; width: auto; max-width: 100%; }
.nav { display: flex; flex-wrap: wrap; gap: 14px 32px; font-size: 15px; align-items: center; }
.nav a { text-decoration: none; color: var(--navy); padding-bottom: 4px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--burgundy); }
.nav a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--burgundy); }
.nav .nav-cta {
  color: var(--white);
  background: var(--navy);
  padding: 10px 20px;
  border-radius: 3px;
  font-weight: 700;
  border-bottom: 0;
}
.nav .nav-cta:hover { background: var(--burgundy); color: var(--white); }
.nav .nav-cta[aria-current="page"] { background: var(--burgundy); }

.site-footer { background: var(--footer); color: var(--on-footer); }
.footer-row {
  padding-top: 36px;
  padding-bottom: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.site-footer .logo { height: 64px; }
.footer-copy { margin: 0; }
.footer-copy a { color: var(--white); }
.footer-copy a:hover { color: var(--gold-light); }

/* ---------- Home: hero ---------- */
.hero { padding-top: 72px; padding-bottom: 88px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero-copy { flex: 1 1 440px; min-width: 0; }
.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.08;
  color: var(--navy);
}
.accent { color: var(--burgundy); }
.lead { margin: 0 0 36px; font-size: 19px; color: var(--text-2); max-width: 560px; }
.hero-media { flex: 1.3 1 520px; min-width: 0; position: relative; padding: 0 0 22px 22px; }
.hero-block { position: absolute; left: 0; bottom: 0; width: 70%; height: 70%; background: var(--gold); }
.hero-photo { position: relative; box-shadow: 0 18px 40px rgba(0, 51, 102, 0.18); }

/* ---------- Navy bands ---------- */
.band-navy { background: var(--navy); color: var(--white); }
.band-inner { padding-top: 64px; padding-bottom: 72px; }
.band-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin: 0 0 32px; }
.band-head h2 { margin: 0; font-size: 30px; line-height: 1.2; }
.band-link { color: var(--gold-light); font-weight: 700; font-size: 15px; }
.band-link:hover { color: var(--white); }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.subject-card {
  text-decoration: none;
  color: var(--navy);
  background: var(--ivory);
  border-top: 6px solid var(--gold);
  padding: 26px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.subject-card:hover { color: var(--navy); background: var(--white); }
.subject-card h3 { margin: 0; font-size: 19px; line-height: 1.4; }
.subject-text { font-size: 15px; color: var(--text-2); line-height: 1.5; }
.c-gold { border-top-color: var(--gold); }
.c-burgundy { border-top-color: var(--burgundy); }
.c-teal { border-top-color: var(--teal); }
.c-steel { border-top-color: var(--steel); }

/* ---------- Home: approach ---------- */
.approach { padding-top: 96px; padding-bottom: 40px; }
.approach-h { margin: 0 0 48px; font-size: 36px; line-height: 1.2; color: var(--navy); max-width: 720px; }
.approach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 48px; }
.approach-item { border-top: 2px solid var(--navy); padding-top: 24px; }
/* Numerals use burgundy, not gold: gold is not used for text on light backgrounds. */
.approach-num { margin: 0 0 10px; font-size: 44px; font-weight: 700; line-height: 1; color: var(--burgundy); }
.approach-item h3 { margin: 0 0 12px; font-size: 21px; line-height: 1.3; color: var(--navy); }
.approach-item p:last-child { margin: 0; color: var(--text-2); }

/* ---------- Home: split sections ---------- */
.split { display: flex; flex-wrap: wrap; gap: 64px; align-items: center; }
.split-copy { flex: 1 1 420px; min-width: 0; }
.split-copy h2 { margin: 0 0 18px; font-size: 32px; line-height: 1.2; color: var(--navy); }
.split-copy p { color: var(--text-2); }
.paper { padding-top: 72px; padding-bottom: 72px; }
.paper .split-media { flex: 1 1 460px; min-width: 0; }
.paper-photo img { border-bottom: 8px solid var(--burgundy); }
.paper .split-copy p:not(.eyebrow) { margin: 0 0 22px; }

.check-list { list-style: none; margin: 0; padding: 0; color: var(--navy); font-weight: 700; }
.check-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.check-list li:last-child { border-bottom: 0; }
.check-list svg { flex: none; }

.band-sand { background: var(--sand); }
.objectives { padding-top: 88px; padding-bottom: 88px; flex-wrap: wrap-reverse; }
.objectives .split-copy { flex: 1 1 460px; }
.objectives .split-copy p:not(.eyebrow) { margin: 0 0 24px; }
.obj-media { flex: 0 1 400px; min-width: 0; position: relative; padding: 22px 22px 0 0; }
.obj-block { position: absolute; right: 0; top: 0; width: 65%; height: 60%; background: var(--navy); }
.obj-photo { position: relative; }

/* ---------- Image panels that fill their box ---------- */
.cta-row { display: flex; flex-wrap: wrap; align-items: stretch; }
.cta-copy { flex: 1 1 460px; min-width: 0; padding: 72px 48px 72px 0; display: flex; flex-direction: column; justify-content: center; }
.cta-copy h2 { margin: 0 0 14px; font-size: 34px; line-height: 1.2; }
.cta-copy p { margin: 0 0 30px; color: var(--on-navy); }
.cover { flex: 1 1 460px; min-width: 0; min-height: 360px; position: relative; }
.cover picture, .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Courses ---------- */
.page-hero .hero-split { display: flex; flex-wrap: wrap; align-items: stretch; }
.hero-split-copy { flex: 1 1 520px; min-width: 0; padding: 72px 48px 72px 0; display: flex; flex-direction: column; justify-content: center; }
.hero-split-copy h1 { margin: 0 0 22px; font-size: clamp(34px, 5vw, 48px); line-height: 1.12; }
.lead-light { margin: 0; font-size: 18px; color: var(--on-navy); }
.cover-hero { flex: 1 1 440px; min-height: 380px; }

.narrow { max-width: 880px; margin: 0 auto; padding: 80px var(--gutter) 96px; line-height: 1.65; }
.narrow p { margin: 0 0 18px; color: var(--text-2); }
.rule-h { margin: 0 0 16px; font-size: 28px; color: var(--navy); border-top: 2px solid var(--navy); padding-top: 28px; }
.narrow .gap-after { margin-bottom: 56px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 24px; margin: 18px 0 64px; }
.card { background: var(--white); border-top: 6px solid var(--gold); padding: 26px 28px 30px; }
/* Same per-subject top borders as the Home page cards (these must follow .card). */
.card.c-gold { border-top-color: var(--gold); }
.card.c-burgundy { border-top-color: var(--burgundy); }
.card.c-teal { border-top-color: var(--teal); }
.card.c-steel { border-top-color: var(--steel); }
.card h3 { margin: 0 0 10px; font-size: 20px; color: var(--navy); }
.card p { margin: 0; }
.struct-box { background: var(--white); border: 1px solid var(--rule); padding: 36px 40px; margin: 0 0 64px; }
.struct-box h2 { margin: 0 0 14px; font-size: 24px; color: var(--navy); }
.struct-box p { margin: 0 0 20px; }
.plain-list { margin: 0; padding-left: 22px; color: var(--text-2); }
.plain-list li { margin-bottom: 8px; }
.plain-list li:last-child { margin-bottom: 0; }
.narrow ul.gap-after { margin-bottom: 56px; }

.course-list { list-style: none; margin: 0 0 56px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.course-card { background: var(--white); border: 1px solid var(--rule); border-top: 6px solid var(--navy); padding: 24px 28px 28px; }
.course-card h3 { margin: 0 0 6px; font-size: 20px; color: var(--navy); }
.course-card p { margin: 0 0 10px; }
.course-card p:last-child { margin-bottom: 0; }
.course-card .course-grade { font-size: 14px; font-weight: 700; color: var(--muted); }

.narrow .tuition { margin: 0; border-top: 1px solid var(--rule); padding-top: 28px; }

/* ---------- Contact ---------- */
.contact-wrap { padding-top: 80px; padding-bottom: 96px; max-width: 1120px; }
.page-h1 { margin: 0 0 16px; font-size: clamp(34px, 5vw, 44px); line-height: 1.15; color: var(--navy); }
.contact-intro { margin: 0 0 48px; max-width: 700px; }
.contact-grid { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }

.contact-form {
  box-sizing: border-box;
  flex: 999 1 520px;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-weight: 700; color: var(--navy); font-size: 15px; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  color: var(--text);
  padding: 12px 14px;
  border: 1px solid var(--field);
  border-radius: 3px;
  background: var(--white);
}
.field textarea { resize: vertical; min-height: 9em; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
.field [aria-invalid="true"] { border-color: var(--burgundy); border-width: 2px; padding: 11px 13px; }
.field-hint { margin: 0; font-size: 14px; color: var(--muted); }
.field-error { margin: 0; font-size: 14px; font-weight: 700; color: var(--burgundy); }
.field-error[hidden] { display: none; }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.status { font-size: 15px; }
.status:empty { display: none; }
.status { padding: 16px 20px; border: 1px solid; }
.status.is-success { background: #EEF3EC; border-color: #B8CBB3; color: #24452A; }
.status.is-error { background: #F8ECEE; border-color: #D9B3BA; color: #5A1F2A; }
.status:focus-visible { outline-offset: 2px; }

.contact-side { flex: 1 1 340px; min-width: 0; background: var(--navy); color: var(--white); }
.side-body { padding: 32px 32px 36px; }
.contact-side h2 { margin: 0 0 10px; font-size: 20px; color: var(--gold-light); }
.contact-side h2.side-rule { border-top: 1px solid var(--side-rule); padding-top: 24px; }
.side-line { margin: 0 0 28px; line-height: 1.55; }
.side-link { font-weight: 700; color: var(--white); }
.side-link:hover { color: var(--gold-light); }
.side-charter { margin: 0; color: var(--on-navy); }

/* ---------- 404 ---------- */
.narrow-404 { padding-top: 80px; padding-bottom: 120px; }
.links-404 { display: flex; flex-wrap: wrap; gap: 12px 32px; font-weight: 700; margin: 0; }

/* ---------- Plain result page from the Worker (no-JavaScript form posts) ---------- */
.result-wrap { max-width: 720px; margin: 0 auto; padding: 64px var(--gutter) 96px; }
.result-wrap .logo-link { margin-bottom: 40px; }
.result-wrap ul { margin: 12px 0 0; padding-left: 22px; }
.result-back { margin: 28px 0 0; font-weight: 700; }

/* ---------- Narrow screens ---------- */
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .hero { padding-top: 40px; padding-bottom: 56px; gap: 40px; }
  .hero-media { padding-left: 14px; padding-bottom: 14px; }
  .band-inner { padding-top: 48px; padding-bottom: 56px; }
  .approach { padding-top: 64px; }
  .approach-h { font-size: 28px; }
  .paper, .objectives { padding-top: 56px; padding-bottom: 56px; }
  .split { gap: 40px; }
  .split-copy h2 { font-size: 27px; }
  .cta-copy { padding: 48px 0; }
  .cta-copy h2 { font-size: 28px; }
  .cover { min-height: 260px; }
  .cover-hero { min-height: 240px; }
  .hero-split-copy { padding: 48px 0; }
  .narrow { padding-top: 56px; padding-bottom: 64px; }
  .rule-h { font-size: 24px; }
  .struct-box { padding: 26px 22px; }
  .contact-wrap { padding-top: 48px; padding-bottom: 64px; }
  .contact-form { padding: 24px 20px; }
  .contact-grid { gap: 40px; }
  .side-body { padding: 26px 22px 30px; }
  .nav { gap: 12px 24px; }
}
