/* ---------- Tokens ---------- */
:root {
  --navy: #12264d;
  --navy-dark: #0a1730;
  --gray: #4b5563;
  --gray-dark: #33393f;
  --red: #c8102e;
  --white: #ffffff;
  --ink: #1a2233;
  --ink-soft: #4a5468;
  --bg: #f6f7fb;
  --bg-card: #ffffff;
  --border: #e2e5ee;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(18, 38, 77, 0.08);
  --accent: var(--red);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

img { max-width: 100%; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
header.site-header {
  background: var(--gray);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.nav-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-brand-mark {
  height: 34px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255,255,255,0.82);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.08); }

.nav-link.active {
  color: var(--white);
  background: rgba(255,255,255,0.14);
}

.nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  border-radius: 8px;
  color: rgba(255,255,255,0.82);
  flex-shrink: 0;
}

.nav-icon-link:hover { color: var(--white); background: rgba(255,255,255,0.08); }

.nav-icon-link-text { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--gray) 0%, var(--gray-dark) 100%);
  color: var(--white);
  padding: 72px 0 64px;
}

.hero-eyebrow {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero p.lede {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  max-width: 640px;
  margin: 0 0 28px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: #a80d26; }

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* dept hero variant */
.dept-hero {
  background: linear-gradient(135deg, var(--accent, var(--navy)) 0%, var(--navy-dark) 120%);
}

.dept-hero .hero-icon {
  font-size: 0.85em;
  margin-right: 14px;
  display: inline-block;
}

/* ---------- Sections ---------- */
section { padding: 64px 0; }

.section-title {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ink);
}

.section-lede {
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 0 40px;
  font-size: 1.02rem;
}

.section-alt { background: var(--white); }

/* ---------- Department Cards (home) ---------- */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* ---------- Club Cards (fixed 3-column, doesn't stretch with few items) ---------- */
.club-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.dept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 4px solid var(--card-accent, var(--red));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dept-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(18,38,77,0.14);
}

.dept-card-icon { font-size: 1.8rem; }

.dept-card h3 { margin: 0; font-size: 1.2rem; }

.dept-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex-grow: 1;
}

.dept-card-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--card-accent, var(--red));
}

/* ---------- About strip ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.about-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}

.about-stat .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
}

.about-stat .label {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ---------- Department page body ---------- */
.dept-description {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 760px;
}

.teachers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

.teacher-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
  min-width: 220px;
}

.teacher-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.teacher-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.teacher-name { font-weight: 700; }
.teacher-meta { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- Flowchart ---------- */
.flowchart-wrap {
  --accent: var(--red);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.pathway-name {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

.flowchart-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
}

.flowchart-grid {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 40px;
}

.flow-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  flex: 1 1 190px;
  min-width: 190px;
}

.flowchart-lines {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.flowchart-lines path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.45;
}

.flowchart-lines marker path {
  fill: var(--accent);
  opacity: 0.8;
}

.flow-card {
  position: relative;
  z-index: 1;
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(10, 31, 68, 0.08);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.flow-card:hover,
.flow-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(10, 31, 68, 0.14);
}

.flow-card-tag {
  position: absolute;
  top: -11px;
  right: 12px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
}

.flow-card-grades {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.flow-card-title {
  font-weight: 700;
  font-size: 0.98rem;
}

/* ---------- Course details ---------- */
.course-detail-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.course-detail {
  --accent: var(--red);
  scroll-margin-top: 88px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.course-detail h3 {
  margin: 4px 0 10px;
  font-size: 1.15rem;
}

.course-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.course-detail-grades {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.course-detail-tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
}

.course-detail-desc {
  color: var(--ink-soft);
  max-width: 720px;
}

.course-detail-teachers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.course-detail-teachers-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.course-detail-teacher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.teacher-avatar-sm,
.teacher-avatar-img-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
}

.teacher-avatar-sm {
  background: var(--accent);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.teacher-avatar-img-sm {
  object-fit: cover;
}

.course-detail-prereq {
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 4px;
}

.course-detail-video {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--navy-dark);
}

.course-detail-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Other pathways strip ---------- */
.other-pathways {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.other-pathway-pill {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.other-pathway-pill:hover { border-color: var(--red); color: var(--red); }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--gray);
  color: rgba(255,255,255,0.75);
  padding: 48px 0 20px;
  margin-top: 40px;
}

.footer-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  text-align: center;
}

.footer-title {
  color: var(--white);
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-text { font-size: 0.9rem; margin: 0; }

.footer-staff-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 28px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-staff-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.85rem;
}

.footer-staff-name { font-weight: 600; color: var(--white); }
.footer-staff-email { color: rgba(255,255,255,0.75); }
.footer-staff-email:hover { color: var(--white); }

.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.9rem; }
.footer-links a:hover { color: var(--white); }

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ---------- Not found ---------- */
.not-found { text-align: center; padding: 100px 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .club-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .club-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 16px;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 8px; }

  .nav-icon-link {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 8px;
    margin-left: 0;
  }
  .nav-icon-link-text { display: inline; font-size: 0.92rem; font-weight: 500; }

  .flow-card { padding: 14px; }
}
