/* ===========================================================
   CU THRIVE Leadership Program — Shared Stylesheet
   Clean, healthcare-professional aesthetic.
   Swap brand colors / fonts in :root when you have them.
   =========================================================== */

:root {
  /* CU School of Medicine brand colors
     Source: cuanschutz.edu/offices/communications/brand
     Primary: black + CU Gold; secondary: dark/light grays */
  --color-primary: #000000;        /* CU Black */
  --color-primary-light: #1a1a1a;  /* slightly lifted black for gradients */
  --color-accent: #CFB87C;         /* CU Gold (PMS 4525) */
  --color-accent-dark: #a8924a;    /* darker gold for hover/emphasis */
  --color-accent-bright: #DFC88C;  /* brighter gold for digital interactive use */

  --color-text: #222222;           /* off-black body text */
  --color-text-muted: #565a5c;     /* CU dark gray */
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;         /* very light gray for subtle backgrounds */
  --color-border: #e0e0e0;

  /* Typography — using Google Fonts (loaded in HTML) */
  --font-display: 'Source Serif Pro', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing & sizing */
  --content-max: 880px;
  --wide-max: 1200px;
  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Reset & base ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover {
  color: var(--color-accent-dark);
  text-decoration-color: var(--color-accent-dark);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-primary);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; margin-top: 2.5rem; }
h3 { font-size: 1.25rem; margin-top: 2rem; }

p { margin: 0 0 1.1em; }

/* Header / Nav ----------------------------------------------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Brand block: partner logos + program identifier */
.site-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--color-primary);
  flex-shrink: 0;
}
.site-brand:hover { color: var(--color-primary); }

.site-brand__logos {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.site-brand__logo {
  height: 38px;
  width: auto;
  display: block;
}
.site-brand__logo--som  { height: 40px; }
.site-brand__logo--chwe { height: 28px; } /* CHWE wordmark is wide; trim height for visual balance */

.site-brand__divider {
  width: 1px;
  height: 32px;
  background: var(--color-border);
}

.site-brand__program {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.site-brand__program-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
}
.site-brand__program-sub {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }

.site-nav a {
  font-size: 0.92rem;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  position: relative;
}
.site-nav a:hover { background: var(--color-bg-alt); color: var(--color-primary); }
.site-nav a.is-active {
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--color-accent);
  border-radius: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .site-header__inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
    gap: 0;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
  }
  .site-nav a.is-active {
    box-shadow: inset 4px 0 0 var(--color-accent);
    padding-left: 1rem;
  }
}

@media (max-width: 640px) {
  /* On phones, hide the program name text (logos carry the identity) and
     scale the logos slightly down to fit. */
  .site-brand { gap: 0.75rem; }
  .site-brand__logos { gap: 0.6rem; }
  .site-brand__logo--som { height: 34px; }
  .site-brand__logo--chwe { height: 24px; }
  .site-brand__divider,
  .site-brand__program { display: none; }
}

/* Page hero -------------------------------------------------- */
.page-hero {
  background: var(--color-primary);
  color: #fff;
  padding: 4rem 1.5rem 3.5rem;
  border-bottom: 4px solid var(--color-accent);
  position: relative;
}
.page-hero__inner { max-width: var(--content-max); margin: 0 auto; }
.page-hero__eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.page-hero h1 { color: #fff; margin-bottom: 0.5rem; }
.page-hero__lede {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 640px;
  margin: 0;
}

/* Main content area ------------------------------------------ */
main { min-height: 50vh; }

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.content h2:first-child { margin-top: 0; }

/* Callout / objectives box ----------------------------------- */
.callout {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  padding: 1.5rem 1.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2rem 0;
}
.callout h3 {
  margin-top: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 600;
}
.callout ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.callout li { margin-bottom: 0.5rem; }
.callout li:last-child { margin-bottom: 0; }

/* Resource cards (PDFs, videos) ------------------------------ */
.resources {
  margin: 2.5rem 0;
}
.resources__title {
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
}

.resource-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
/* Single-column vertical flow for lesson pages so resources read in a
   fixed order: reading -> audio podcast -> audio summary -> challenge. */
.resource-grid--stacked {
  grid-template-columns: 1fr;
}
/* The embedded podcast player sits in the stacked flow as a full-width
   tile, matching the card rhythm around it. */
.resource-grid--stacked .audio-player {
  margin: 0;
}

.resource-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.resource-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: var(--color-text);
}

.resource-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  color: var(--color-primary);
}
.resource-card__icon svg { width: 22px; height: 22px; }

.resource-card__body { flex: 1; min-width: 0; }
.resource-card__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.resource-card__title {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 1rem;
  line-height: 1.35;
}
.resource-card__meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Video embed ------------------------------------------------ */
.video-block { margin: 2.5rem 0; }
.video-block__caption {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.6rem;
  font-style: italic;
}
.video-frame {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.video-frame video { width: 100%; display: block; }

/* For YouTube/Vimeo iframes (used on other pages) */
.video-frame--embed {
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
}
.video-frame--embed iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: 0;
}

/* Video placeholder (shown until a real YouTube embed is wired in) */
.video-placeholder {
  aspect-ratio: 16 / 9;
  background: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: 1rem;
}
.video-placeholder svg {
  width: 56px;
  height: 56px;
  color: var(--color-accent-dark);
  margin-bottom: 0.25rem;
}
.video-placeholder__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
}
.video-placeholder__sub {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Page footer / contact ------------------------------------- */
.page-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 1.5rem;
  margin-top: 4rem;
}
.page-footer__inner {
  max-width: var(--wide-max);
  margin: 0 auto;
}

.page-footer__partners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  /* White rounded panel so the logos' white backgrounds look intentional
     rather than like white boxes sitting on the grey footer. */
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem 2.5rem;
  width: fit-content;
  margin: 0 auto 1.75rem;
  flex-wrap: wrap;
}
.page-footer__partner {
  display: block;
}
.page-footer__partner img {
  display: block;
  height: 56px;
  width: auto;
}
.page-footer__partner--chwe img { height: 44px; }

.page-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.page-footer a { color: var(--color-primary); }

/* Attribution text — used on Introduction page */
.page-attribution {
  max-width: var(--content-max);
  margin: 3rem auto 0;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  border-top: 1px solid var(--color-border);
  line-height: 1.6;
}
.page-attribution em { font-style: normal; color: var(--color-text); }

@media (max-width: 600px) {
  .page-footer__partners { gap: 1.75rem; }
  .page-footer__partner img { height: 44px; }
  .page-footer__partner--chwe img { height: 34px; }
}

/* Page navigation (prev/next) -------------------------------- */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}
.page-nav a {
  text-decoration: none;
  color: var(--color-text);
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  flex: 1;
  max-width: 48%;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.page-nav a:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-alt);
  color: var(--color-text);
}
.page-nav__dir {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.page-nav__title { font-weight: 600; color: var(--color-primary); }
.page-nav__next { text-align: right; margin-left: auto; }

/* Stats list (used on Empowerment page) --------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 1.75rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
}
.stat-row__item { text-align: center; }
.stat-row__num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  display: inline-block;
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 0.25rem;
}
.stat-row__label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 0.5rem;
}

@media (max-width: 720px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .stat-row { grid-template-columns: 1fr; }
}

/* Empty state ("Coming soon" placeholder for unfinished pages) -- */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  margin: 1rem 0 3rem;
}
.empty-state svg {
  width: 56px;
  height: 56px;
  color: var(--color-accent-dark);
  margin-bottom: 1rem;
}
.empty-state h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}
.empty-state p {
  color: var(--color-text-muted);
  margin: 0;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Placeholder text — visible cue that content still needs to be added */
.placeholder-text {
  background: #fffbe6;
  border-left: 3px solid var(--color-accent);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-text-muted);
}
.placeholder-text em { font-style: normal; }

/* Mobile tweaks --------------------------------------------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.45rem; }
  .page-hero { padding: 3rem 1.25rem 2.5rem; }
  .content { padding: 2rem 1.25rem 3rem; }
  .page-nav { flex-direction: column; }
  .page-nav a { max-width: 100%; }
  .page-nav__next { text-align: left; margin-left: 0; }
}

/* ============================================================
   AUTH GATE — hides site contents until the user is logged in.
   ============================================================ */

/* Hide everything on first paint until JS decides what to show.
   This avoids a flash of protected content before the auth check. */
body { visibility: hidden; }
body.is-locked,
body.is-unlocked { visibility: visible; }

/* Locked state: hide the actual site, show the gate */
body.is-locked .site-header,
body.is-locked main,
body.is-locked .page-footer { display: none; }
body.is-locked .auth-gate { display: flex; }

/* Unlocked state: hide the gate, show the site */
body.is-unlocked .auth-gate { display: none; }

/* The gate itself — full viewport sign-in screen */
.auth-gate {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: var(--color-bg, #fafafa);
}
.auth-gate__inner {
  max-width: 520px;
}
.auth-gate__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.auth-gate__logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}
.auth-gate__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-primary);
}
.auth-gate__subtitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-text);
  margin: 0 0 1.5rem;
}
.auth-gate__lede {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0 0 2rem;
}
.auth-gate__section {
  margin: 0 0 1.75rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-align: left;
}
.auth-gate__section:last-child { margin-bottom: 0; }
.auth-gate__section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-primary);
}
.auth-gate__section p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}
.auth-gate__btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.auth-gate__btn:hover { opacity: 0.85; }
.auth-gate__contact {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.auth-gate__contact a { color: var(--color-primary); }

/* "Log out" button in the header — only visible when logged in (which is
   when site-header is visible at all, so no extra rules needed). */
.auth-logout {
  margin-left: 0.75rem;
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.auth-logout:hover { background: var(--color-bg-alt, #f0f0f0); }

@media (max-width: 720px) {
  .auth-gate__title { font-size: 1.4rem; }
  .auth-gate__subtitle { font-size: 1rem; }
  .auth-gate__logo { height: 44px; }
}

/* ============================================================
   ROLE-BASED ACCESS — facilitator-only pages & nav links.
   ============================================================ */

/* Role-gated nav links are hidden until auth.js confirms the role */
[data-role-link] { display: none; }
[data-role-link].role-visible { display: inline-block; }

/* Forbidden state: logged in but lacking the required role.
   Hide the page content, show the notice. */
body.is-forbidden main,
body.is-forbidden .page-footer { display: none; }
body.is-forbidden .role-notice { display: flex; }

.role-notice {
  display: none;
  min-height: 60vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}
.role-notice__inner { max-width: 480px; }
.role-notice__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.75rem;
}
.role-notice__text {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin: 0 0 1.75rem;
}
.role-notice__text a { color: var(--color-primary); }
.role-notice__btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.role-notice__btn:hover { opacity: 0.85; }

/* ============================================================
   AUDIO PLAYER — embedded podcast/audio players (stream-only).
   ============================================================ */
.audio-player {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.audio-player__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-gold, #CFB87C);
  color: #000;
}
.audio-player__icon svg { width: 22px; height: 22px; }
.audio-player__body {
  flex: 1 1 auto;
  min-width: 0;
}
.audio-player__label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}
.audio-player__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.audio-player audio {
  width: 100%;
  height: 40px;
}

@media (max-width: 560px) {
  .audio-player { flex-direction: column; gap: 0.75rem; }
}

/* ============================================================
   LESSON COMPLETION button + gate privacy notice
   ============================================================ */
.lesson-complete-wrap { margin: 2.5rem 0 0; text-align: center; }
.lesson-complete-btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--color-bg-alt, #f5f5f5);
  color: var(--color-primary);
  border: 2px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lesson-complete-btn:hover { border-color: var(--color-accent); }
.lesson-complete-btn.is-complete {
  background: var(--color-accent);
  color: #000;
  border-color: var(--color-accent);
}
.auth-gate__privacy {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 1rem 0 0;
  max-width: 420px;
}
