/* =====================================================================
   ZTech Campus — Classic Theme · Component Overrides
   ---------------------------------------------------------------------
   Loaded AFTER the layout's inline component CSS. Every rule is scoped
   under `body.theme-classic` so this file is a no-op for any other
   theme. The goal: take ZTech Campus's existing component patterns and
   re-paint them with classical institutional weight — serif display,
   gradient navy hero, milestone timelines, curved dividers, executive-
   card patterns adapted to the academic surfaces ZTC actually has.

   Surfaces touched:
     - Public marketing pages (homepage hero / stats / programmes / faculties / footer)
     - Admin/lecturer/student shells: chrome only (topbar, sidebar, headings)
       Inner work surfaces (tables, forms, lists) are deliberately untouched
       — operational density matters for grading, rosters, etc.
   ===================================================================== */


/* =====================================================================
   1. GLOBAL TYPOGRAPHY (SCOPED)
   ===================================================================== */

body.theme-classic {
  /* Cream page background flows through */
  background: var(--surface-alt);
  font-family: var(--font-sans);
  color: var(--text);
}

/* Display headlines — h1/h2 across public AND admin shells (chrome only,
   not inside tables/cards which would harm operational clarity).
   We target page titles via specific class hooks the existing layouts use. */
body.theme-classic h1,
body.theme-classic h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--text-strong);
}

/* h3+ stay sans — they're often used inside data cards and need to look
   operational, not ceremonial. */
body.theme-classic h3,
body.theme-classic h4,
body.theme-classic h5,
body.theme-classic h6 {
  font-family: var(--font-sans);
  font-weight: 600;
}

/* Selection: warm gold instead of cool blue */
body.theme-classic ::selection {
  background: rgba(201, 153, 43, 0.30);
  color: var(--text-strong);
}


/* =====================================================================
   2. PUBLIC HEADER (chrome of the public marketing surface)
   ===================================================================== */

body.theme-classic .public-header {
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  /* Slight warm tint when sticky-blurred */
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}

body.theme-classic .brand-mark {
  background: var(--gradient-crest);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #FBF8EF;
  box-shadow: 0 2px 8px rgba(154, 27, 30, 0.25);
}
body.theme-classic .brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

body.theme-classic .public-nav a {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  position: relative;
  transition: color var(--duration) var(--ease-smooth);
}
body.theme-classic .public-nav a:hover {
  color: var(--primary);
}
body.theme-classic .public-nav a.active {
  color: var(--primary);
}
body.theme-classic .public-nav a.active::after {
  content: "";
  position: absolute;
  inset-block-end: -6px;
  inset-inline: 0;
  height: 2px;
  background: var(--primary);
}

body.theme-classic .public-cta {
  background: var(--primary);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.005em;
  box-shadow: 0 3px 10px rgba(154, 27, 30, 0.22);
  transition: all var(--duration) var(--ease-smooth);
}
body.theme-classic .public-cta:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(154, 27, 30, 0.30);
  transform: translateY(-1px);
}


/* =====================================================================
   3. PUBLIC HERO — the centerpiece of the classic look
   ---------------------------------------------------------------------
   The HomeController emits an inline gradient using var(--primary).
   With our token override, --primary is crimson, so the gradient would
   become crimson-on-crimson — too heavy. We override the section's
   background to use --gradient-brand (navy) instead, with a crimson
   accent ribbon below.
   ===================================================================== */

/* The inline hero in HomeController has these tells: a <section> with
   inline gradient on var(--primary) and color:#fff. We can't change
   the inline style, but we CAN over-paint it with a more specific selector
   using ::before. Better approach: target the <section> by direct child
   index + inline style attribute keyword. */

body.theme-classic main.public-main > section:first-of-type {
  background: var(--gradient-brand) !important;
  border-block-end: 4px solid var(--accent-gold);
  position: relative;
}
/* Soft cream-paper texture over the navy */
body.theme-classic main.public-main > section:first-of-type::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0,
      transparent 40px,
      rgba(255, 255, 255, 0.012) 40px,
      rgba(255, 255, 255, 0.012) 41px
    );
  pointer-events: none;
}

/* The h1 inside the hero — promote to serif */
body.theme-classic main.public-main > section:first-of-type h1 {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.02 !important;
  color: #FBF8EF !important;
}

/* Gold underline accent under the h1 */
body.theme-classic main.public-main > section:first-of-type h1::after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  background: var(--accent-gold);
  margin: 1.5rem auto 0;
}

/* Subtitle paragraph — italicized serif for that institutional feel */
body.theme-classic main.public-main > section:first-of-type p {
  font-family: var(--font-display) !important;
  font-style: italic;
  font-weight: 400;
  color: rgba(251, 248, 239, 0.92) !important;
}

/* Primary CTA in hero (white pill) — keep it but warm the radius */
body.theme-classic main.public-main > section:first-of-type a[href="/programmes"] {
  border-radius: var(--radius) !important;
  font-family: var(--font-sans) !important;
  letter-spacing: 0.005em !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25) !important;
}
body.theme-classic main.public-main > section:first-of-type a[href="#faculties"] {
  border-radius: var(--radius) !important;
  font-family: var(--font-sans) !important;
  border: 1.5px solid rgba(251, 248, 239, 0.40) !important;
}


/* =====================================================================
   4. STATS STRIP — promote numbers to serif (the "carved" feel)
   ===================================================================== */

body.theme-classic main.public-main > section:nth-of-type(2) {
  background: var(--surface) !important;
  border-block-end: 1.5px solid var(--border) !important;
  padding-block: clamp(1.5rem, 1rem + 1vw, 2.5rem) !important;
}

/* The stat numbers are styled as font-size:2rem;font-weight:800;color:var(--primary).
   Promote to serif with lighter weight for that engraved feel. */
body.theme-classic main.public-main > section:nth-of-type(2) > div > div > div:first-child {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  font-size: clamp(2rem, 1.5rem + 1.4vw, 2.8rem) !important;
  letter-spacing: -0.02em !important;
  color: var(--primary) !important;
  font-variant-numeric: lining-nums !important;
}

/* Stat labels: smaller, more spaced caps */
body.theme-classic main.public-main > section:nth-of-type(2) > div > div > div:last-child {
  font-size: 0.72rem !important;
  letter-spacing: 0.14em !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}


/* =====================================================================
   5. PUBLIC SECTION HEADINGS (h2 inside public-container sections)
   ===================================================================== */

body.theme-classic .public-container h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text-strong);
}
body.theme-classic .public-container h2 + p {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-muted);
}


/* =====================================================================
   6. FEATURED CARDS (.pub-card)
   ===================================================================== */

body.theme-classic .pub-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration) var(--ease-smooth),
              box-shadow var(--duration) var(--ease-smooth),
              border-color var(--duration);
}
body.theme-classic .pub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* The programme code chip (the small mono badge on each card) */
body.theme-classic .pub-card span[style*="primary-soft"] {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(154, 27, 30, 0.15);
  border-radius: var(--radius-xs) !important;
  font-family: var(--font-mono) !important;
  font-weight: 600 !important;
}


/* =====================================================================
   7. PUBLIC FOOTER
   ===================================================================== */

body.theme-classic .public-footer {
  background: var(--text-strong);  /* Deep navy */
  color: rgba(251, 248, 239, 0.75);
  border-block-start: 4px solid var(--accent-gold);
  margin-block-start: 0;  /* Reset the 4rem the inline style adds */
  padding-block-start: clamp(3rem, 2rem + 3vw, 5rem) !important;
}
body.theme-classic .public-footer * {
  /* Ensure all text is readable on the dark footer */
  color: inherit;
}
body.theme-classic .public-footer h4,
body.theme-classic .public-footer strong {
  color: #FBF8EF;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
body.theme-classic .public-footer a {
  color: rgba(251, 248, 239, 0.65);
  transition: color var(--duration);
}
body.theme-classic .public-footer a:hover {
  color: var(--accent-gold);
}


/* =====================================================================
   8. ADMIN SHELL — chrome only (sidebar, topbar, page headings)
   ---------------------------------------------------------------------
   We restyle the operational frame but DELIBERATELY leave inner data
   surfaces (tables, forms, dense lists) on the default tokens-driven
   styling. Score-entry pages and rosters need their clarity untouched.
   ===================================================================== */

/* Sidebar — warm cream surface with crimson active state */
body.theme-classic .sidebar {
  background: var(--surface);
  border-inline-end: 1.5px solid var(--border);
}
body.theme-classic .sidebar-header {
  background: var(--gradient-brand);
  color: #FBF8EF;
  border-block-end: 3px solid var(--accent-gold);
}
body.theme-classic .sidebar-header * {
  color: inherit;
}
body.theme-classic .sidebar-footer {
  background: var(--surface-muted);
  border-block-start: 1px solid var(--border);
}

/* Topbar — match the navy/cream contrast */
body.theme-classic .topbar {
  background: var(--surface);
  border-block-end: 1.5px solid var(--border);
}

/* Admin page headings — serif treatment for the page title only */
body.theme-classic .page-title,
body.theme-classic main h1,
body.theme-classic main h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
}

/* But INSIDE data cards/tables, h3/h4 stay sans (operational) */
body.theme-classic .card h3,
body.theme-classic table h3 {
  font-family: var(--font-sans);
  font-weight: 600;
}


/* =====================================================================
   9. LECTURER / STUDENT SHELLS
   ===================================================================== */

/* These layouts are simpler — header strip + content. We just paint the
   header strip with the cream/navy treatment and leave content alone. */
body.theme-classic.lecturer-body header,
body.theme-classic.student-body header,
body.theme-classic header.lecturer-header,
body.theme-classic header.student-header {
  background: var(--surface);
  border-block-end: 1.5px solid var(--border);
}


/* =====================================================================
   10. LOGIN PAGE — institutional treatment
   ===================================================================== */

/* The login layout is full-page; its existing inline style does the heavy
   lifting. We paint the body bg to cream so it harmonizes. */
body.theme-classic.login-page,
body.theme-classic .login-page,
body.theme-classic .auth-page {
  background: var(--surface-alt);
}

/* Login card — slightly more substantial */
body.theme-classic .login-card,
body.theme-classic .auth-card {
  border: 1.5px solid var(--border);
  border-block-start: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}


/* =====================================================================
   11. BUTTONS — gentler radii + shadow palette site-wide
   ===================================================================== */

body.theme-classic button,
body.theme-classic .btn,
body.theme-classic [class*="btn-"] {
  font-family: var(--font-sans);
  letter-spacing: 0.005em;
  transition: all var(--duration) var(--ease-smooth);
}


/* =====================================================================
   12. CURVED SECTION DIVIDERS — opt-in via .has-classic-curve
   ---------------------------------------------------------------------
   Available for the public homepage if HomeController later wants to
   apply a class. Backward-compatible: doesn't activate without the
   class hook.
   ===================================================================== */

body.theme-classic .has-classic-curve { position: relative; }
body.theme-classic .has-classic-curve::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto 0;
  height: 60px;
  background: var(--surface-alt);
  clip-path: ellipse(75% 100% at 50% 0%);
  z-index: 1;
}


/* =====================================================================
   13. ACCESSIBILITY — respect reduced-motion + keep focus visible
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {
  body.theme-classic *,
  body.theme-classic *::before,
  body.theme-classic *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body.theme-classic :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
