/* Canadian High School — Main styles
   Design: DESIGN.md — no Hero, clear hierarchy, responsive */

:root {
  --color-primary: #1a365d;
  --color-primary-hover: #2c5282;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --font-heading: "DM Sans", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
  --max-width: 1200px;
  --section-padding: 80px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
  /* Section background hierarchy (homepage) */
  --section-bg-1: #eef2f7;
  --section-bg-2: #ffffff;
  --section-bg-3: #f5f7fa;
  --section-bg-4: #f0f4f8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  text-decoration: none;
}

.brand:hover {
  color: var(--color-primary-hover);
}

.brand-logo {
  display: block;
  height: 32px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  display: inline-block;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
}

.main-nav a:not(.btn):hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > a::after {
  content: "";
  display: inline-block;
  margin-left: 0.35em;
  vertical-align: 0.2em;
  border: 5px solid transparent;
  border-top-color: currentColor;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  margin: 0;
  margin-top: -4px;
  padding: 12px 0 8px;
  list-style: none;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: none !important;
  z-index: 10;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block !important;
}

.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  display: none;
}

.nav-dropdown:hover::before {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  background: var(--color-bg-alt);
}

.nav-cta-wrap {
  margin-left: 0.5rem;
}

.main-nav .btn-moodle {
  padding: 10px 18px;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(26, 54, 93, 0.25);
  color: #fff !important;
}

.main-nav .btn-moodle:hover {
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(26, 54, 93, 0.35);
}

.main-nav .btn-moodle .btn-icon {
  color: #fff;
  opacity: 0.95;
}

.btn-icon {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.9em;
  opacity: 0.9;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-primary:focus-visible,
.main-nav a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  border-radius: var(--radius);
}

.nav-toggle::before,
.nav-toggle::after,
.nav-toggle span {
  content: "";
  position: absolute;
  left: 12px;
  width: 20px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle::before {
  top: 14px;
}

.nav-toggle span {
  top: 21px;
}

.nav-toggle::after {
  top: 28px;
}

.nav-toggle[aria-expanded="true"]::before {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"]::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* Intro (OSSD Curriculum block) — clear single block */
.intro {
  background: var(--section-bg-1);
  padding: var(--section-padding) 0;
}

.intro-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.75rem;
  background: rgba(26, 54, 93, 0.08);
  border-radius: 4px;
}

.intro-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}

.intro-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
}

.intro-text {
  max-width: 640px;
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-text);
  line-height: 1.65;
}

.intro-cta {
  margin: 1.5rem 0 0;
}

.intro-cta .btn {
  transition: background 0.2s, box-shadow 0.2s;
}

.intro-cta .btn:hover {
  box-shadow: 0 4px 14px rgba(26, 54, 93, 0.35);
}

/* Sections — explicit background hierarchy per block */
.section {
  padding: var(--section-padding) 0;
}

.section.about {
  background: var(--section-bg-2);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-content {
  min-width: 0;
}

.about-figure {
  position: sticky;
  top: 88px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}

.about-figure img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

.section.programs {
  background: var(--section-bg-3);
}

.section.contact {
  background: var(--section-bg-4);
}

/* Subtle separator between sections */
.section + .section {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.intro + .section {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.section-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  color: var(--color-primary);
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 2px;
  margin-top: 0.75rem;
}

/* About — “who we are” block, distinct from curriculum intro */
.section.about .section-title {
  margin-bottom: 0.5rem;
}

.section.about .section-title::after {
  width: 64px;
  margin-top: 0.5rem;
}

.about-tagline {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
}

.about-bsid {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
}

.about-lead {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.about-content .about p {
  margin: 0 0 1rem;
  max-width: 100%;
}

.about p:last-child {
  margin-bottom: 0;
}

/* Stats */
.stats {
  background: linear-gradient(160deg, var(--color-primary) 0%, #0f2744 100%);
  color: #fff;
}

.stats .section-title {
  color: #fff;
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.95rem;
  opacity: 0.92;
  line-height: 1.4;
}

/* Programs section image */
.programs-visual {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.programs-visual img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--color-bg);
  padding: 28px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-icon {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-primary);
  margin: 0 0 0.75rem;
}

.card p {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.6;
}

/* News */
.news-list {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.news-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.2s;
}

.news-list li:hover {
  background: rgba(26, 54, 93, 0.02);
}

.news-list li:last-child {
  border-bottom: none;
}

.news-date {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.news-list h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.news-list h3 a {
  color: var(--color-primary);
  text-decoration: none;
}

.news-list h3 a:hover {
  text-decoration: underline;
}

.news-list p {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

.news-more {
  margin: 0;
}

.news-more a {
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.news-more a:hover {
  text-decoration: underline;
}

/* Dates */
.dates-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 480px;
}

.dates-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 1.05rem;
}

.dates-list li:last-child {
  border-bottom: none;
}

.date-label {
  font-weight: 600;
  color: var(--color-text);
}

.date-value {
  color: var(--color-text-muted);
}

/* Contact */
.contact-intro {
  margin: 0 0 1.5rem;
  max-width: 560px;
  color: var(--color-text);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem 2rem;
}

.contact-item {
  padding: 1rem 0;
}

.contact-item strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.contact-item p {
  margin: 0;
  font-size: 1.05rem;
}

.contact-item a {
  color: var(--color-primary);
  text-decoration: none;
}

.contact-item a:hover {
  text-decoration: underline;
}

/* Admissions page */
.admissions-page {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.admissions-page .container {
  max-width: 720px;
}

.admissions-intro {
  margin-bottom: 2rem;
}

.page-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2rem);
  color: var(--color-primary);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.page-lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.admissions-overview {
  background: var(--color-bg-alt);
  padding: 1.5rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
}

.admissions-overview p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

.admissions-overview p:last-child {
  margin-bottom: 0;
}

.admissions-overview a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.admissions-overview a:hover {
  text-decoration: underline;
}

.admission-steps {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  counter-reset: step;
}

.admission-step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  counter-increment: step;
}

.admission-step:last-of-type {
  border-bottom: none;
}

.step-num {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: var(--color-primary);
  border-radius: 50%;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  display: block;
  font-size: 1.05rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.step-docs {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
}

.step-note {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 0.25rem;
}

.step-cta {
  margin: 0;
}

.step-cta .btn {
  margin-top: 0.25rem;
}

.step-cta-note {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.admission-notice {
  background: rgba(26, 54, 93, 0.06);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 0 0 2rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.admission-timeline {
  background: var(--color-bg-alt);
  padding: 1.5rem 1.5rem;
  border-radius: 12px;
}

.admission-timeline .section-title {
  margin-bottom: 0.5rem;
}

.admission-timeline p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

/* Programs page */
.programs-page {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.programs-page .container {
  max-width: 720px;
}

.programs-select-wrap {
  margin-bottom: 2rem;
}

.programs-select {
  width: 100%;
  max-width: 320px;
  padding: 12px 40px 12px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.programs-select:hover,
.programs-select:focus {
  border-color: var(--color-primary);
  outline: none;
}

.program-block {
  margin-bottom: 2rem;
  display: none;
}

.program-block#high-school {
  display: block;
}

.program-block p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

.program-block p:last-child {
  margin-bottom: 0;
}

.program-block a {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.program-block a:hover {
  text-decoration: underline;
}

.program-subtitle {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-primary);
  margin: 1.5rem 0 0.5rem;
}

.program-subtitle:first-of-type {
  margin-top: 1rem;
}

.program-lead {
  margin-bottom: 1rem;
}

.ossd-courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.ossd-courses-group h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}

.ossd-courses-group ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

.ossd-courses-group li {
  margin-bottom: 0.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .admission-step {
    gap: 1rem;
    padding: 1rem 0;
  }

  .step-num {
    width: 2rem;
    height: 2rem;
    font-size: 0.9rem;
  }

  .admissions-overview,
  .admission-timeline {
    padding: 1.25rem;
  }
}

/* Footer */
.site-footer {
  background: linear-gradient(160deg, var(--color-primary) 0%, #0f2744 100%);
  color: #fff;
  padding: 0;
}

.footer-inner {
  padding: 56px 24px 32px;
}

.footer-top {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.footer-logo {
  display: block;
  width: 40px;
  height: auto;
  object-fit: contain;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.footer-moodle-block {
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.footer-moodle-desc {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.5;
}

.footer-moodle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-primary);
  background: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.footer-moodle-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.footer-moodle-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.footer-back {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-back:hover {
  color: #fff;
}

.footer-copy {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Responsive: show hamburger, collapse nav */
@media (max-width: 1024px) {
  .main-nav ul {
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-figure {
    position: static;
    order: -1;
  }

  .programs-visual {
    margin-bottom: 1.5rem;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px 24px;
    display: none;
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .main-nav li:last-child {
    border-bottom: none;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .main-nav a {
    display: block;
    padding: 12px 0;
  }

  .nav-cta-wrap .btn-moodle {
    display: block;
    text-align: center;
    width: 100%;
  }

  .nav-dropdown .nav-dropdown-menu {
    display: none !important;
    position: static;
    min-width: 0;
    padding: 8px 0 8px 1rem;
    box-shadow: none;
    border: none;
    background: transparent;
  }

  .nav-dropdown.is-open .nav-dropdown-menu {
    display: block !important;
  }

  .nav-dropdown-menu a {
    padding: 8px 0;
  }

  .section {
    padding: 60px 0;
  }

  .intro {
    padding: 60px 0;
  }

  body {
    font-size: 16px;
  }
}
