/* ==========================================================================
   CSS CUSTOM PROPERTIES & COLOR SYSTEMS
   ========================================================================== */
:root {
  /* Core brand identity colors (Stanford Crimson and warm accents) */
  --stanford-crimson: #8C1515;
  --stanford-crimson-hover: #B12525;
  --stanford-crimson-light: #F4E8E8;
  --stanford-gold: #E3A857;
  --stanford-gold-hover: #F2C27F;
  --stanford-gold-dark: #AF7628;

  /* Typography scale */
  --font-serif: 'Playfair Display', Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;

  /* Spacing system */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-xxl: 4rem;

  /* Border radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Drop Shadows & Blur */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --glass-blur: blur(12px);

  /* Light Theme Color Tokens */
  --bg-page-light: #F8FAFC;
  --bg-surface-light: #FFFFFF;
  --bg-card-light: #FFFFFF;
  --bg-code-light: #F1F5F9;
  --text-primary-light: #0F172A;
  --text-secondary-light: #334155;
  --text-muted-light: #64748B;
  --border-light: #E2E8F0;
  --header-bg-light: rgba(255, 255, 255, 0.75);
  --scrollbar-track-light: #F1F5F9;
  --scrollbar-thumb-light: #CBD5E1;
  --card-hover-border-light: rgba(140, 21, 21, 0.15);

  /* Dark Theme Color Tokens */
  --bg-page-dark: #0B0F19;
  --bg-surface-dark: #121826;
  --bg-card-dark: #1A2234;
  --bg-code-dark: #0F172A;
  --text-primary-dark: #F8FAFC;
  --text-secondary-dark: #CBD5E1;
  --text-muted-dark: #64748B;
  --border-dark: #2E3A52;
  --header-bg-dark: rgba(11, 15, 25, 0.75);
  --scrollbar-track-dark: #0B0F19;
  --scrollbar-thumb-dark: #2E3A52;
  --card-hover-border-dark: rgba(227, 168, 87, 0.25);

  /* Base/Fallback themes for browsers that do not support light-dark() */
  --bg-page: var(--bg-page-light);
  --bg-surface: var(--bg-surface-light);
  --bg-card: var(--bg-card-light);
  --bg-code: var(--bg-code-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --text-muted: var(--text-muted-light);
  --border-color: var(--border-light);
  --header-bg: var(--header-bg-light);
  --scrollbar-track: var(--scrollbar-track-light);
  --scrollbar-thumb: var(--scrollbar-thumb-light);
  --card-hover-border: var(--card-hover-border-light);
  --accent-color: var(--stanford-crimson);
  --accent-hover: var(--stanford-crimson-hover);
  --selection-bg: rgba(140, 21, 21, 0.12);

  /* Set baseline HTML properties */
  color-scheme: light dark;
}

/* System dark theme query for default state fallback */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: var(--bg-page-dark);
    --bg-surface: var(--bg-surface-dark);
    --bg-card: var(--bg-card-dark);
    --bg-code: var(--bg-code-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --text-muted: var(--text-muted-dark);
    --border-color: var(--border-dark);
    --header-bg: var(--header-bg-dark);
    --scrollbar-track: var(--scrollbar-track-dark);
    --scrollbar-thumb: var(--scrollbar-thumb-dark);
    --card-hover-border: var(--card-hover-border-dark);
    --accent-color: var(--stanford-gold);
    --accent-hover: var(--stanford-gold-hover);
    --selection-bg: rgba(227, 168, 87, 0.2);
  }
}

/* Pinned manual light mode override */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-page: var(--bg-page-light);
  --bg-surface: var(--bg-surface-light);
  --bg-card: var(--bg-card-light);
  --bg-code: var(--bg-code-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --text-muted: var(--text-muted-light);
  --border-color: var(--border-light);
  --header-bg: var(--header-bg-light);
  --scrollbar-track: var(--scrollbar-track-light);
  --scrollbar-thumb: var(--scrollbar-thumb-light);
  --card-hover-border: var(--card-hover-border-light);
  --accent-color: var(--stanford-crimson);
  --accent-hover: var(--stanford-crimson-hover);
  --selection-bg: rgba(140, 21, 21, 0.12);
}

/* Pinned manual dark mode override */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: var(--bg-page-dark);
  --bg-surface: var(--bg-surface-dark);
  --bg-card: var(--bg-card-dark);
  --bg-code: var(--bg-code-dark);
  --text-primary: var(--text-primary-dark);
  --text-secondary: var(--text-secondary-dark);
  --text-muted: var(--text-muted-dark);
  --border-color: var(--border-dark);
  --header-bg: var(--header-bg-dark);
  --scrollbar-track: var(--scrollbar-track-dark);
  --scrollbar-thumb: var(--scrollbar-thumb-dark);
  --card-hover-border: var(--card-hover-border-dark);
  --accent-color: var(--stanford-gold);
  --accent-hover: var(--stanford-gold-hover);
  --selection-bg: rgba(227, 168, 87, 0.2);
}

/* Modern light-dark() CSS color scheme overrides */
@supports (color: light-dark(white, black)) {
  :root {
    --bg-page: light-dark(var(--bg-page-light), var(--bg-page-dark));
    --bg-surface: light-dark(var(--bg-surface-light), var(--bg-surface-dark));
    --bg-card: light-dark(var(--bg-card-light), var(--bg-card-dark));
    --bg-code: light-dark(var(--bg-code-light), var(--bg-code-dark));
    --text-primary: light-dark(var(--text-primary-light), var(--text-primary-dark));
    --text-secondary: light-dark(var(--text-secondary-light), var(--text-secondary-dark));
    --text-muted: light-dark(var(--text-muted-light), var(--text-muted-dark));
    --border-color: light-dark(var(--border-light), var(--border-dark));
    --header-bg: light-dark(var(--header-bg-light), var(--header-bg-dark));
    --scrollbar-track: light-dark(var(--scrollbar-track-light), var(--scrollbar-track-dark));
    --scrollbar-thumb: light-dark(var(--scrollbar-thumb-light), var(--scrollbar-thumb-dark));
    --card-hover-border: light-dark(var(--card-hover-border-light), var(--card-hover-border-dark));
    --accent-color: light-dark(var(--stanford-crimson), var(--stanford-gold));
    --accent-hover: light-dark(var(--stanford-crimson-hover), var(--stanford-gold-hover));
    --selection-bg: light-dark(rgba(140, 21, 21, 0.12), rgba(227, 168, 87, 0.2));
  }
  
  :root[data-theme="light"] {
    --bg-page: var(--bg-page-light);
    --bg-surface: var(--bg-surface-light);
    --bg-card: var(--bg-card-light);
    --bg-code: var(--bg-code-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --text-muted: var(--text-muted-light);
    --border-color: var(--border-light);
    --header-bg: var(--header-bg-light);
    --scrollbar-track: var(--scrollbar-track-light);
    --scrollbar-thumb: var(--scrollbar-thumb-light);
    --card-hover-border: var(--card-hover-border-light);
    --accent-color: var(--stanford-crimson);
    --accent-hover: var(--stanford-crimson-hover);
    --selection-bg: rgba(140, 21, 21, 0.12);
  }

  :root[data-theme="dark"] {
    --bg-page: var(--bg-page-dark);
    --bg-surface: var(--bg-surface-dark);
    --bg-card: var(--bg-card-dark);
    --bg-code: var(--bg-code-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --text-muted: var(--text-muted-dark);
    --border-color: var(--border-dark);
    --header-bg: var(--header-bg-dark);
    --scrollbar-track: var(--scrollbar-track-dark);
    --scrollbar-thumb: var(--scrollbar-thumb-dark);
    --card-hover-border: var(--card-hover-border-dark);
    --accent-color: var(--stanford-gold);
    --accent-hover: var(--stanford-gold-hover);
    --selection-bg: rgba(227, 168, 87, 0.2);
  }
}

/* ==========================================================================
   GLOBAL RESET & TYPOGRAPHY STYLE RULES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  accent-color: var(--accent-color);
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

::selection {
  background-color: var(--selection-bg);
  color: inherit;
}

/* ==========================================================================
   ACCESSIBILITY & SCROLLBAR DEFINITIONS
   ========================================================================== */
/* Adaptive Scrollbar styles */
:root {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-xs);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
  }
}

/* Screen readers and visual aids */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   FROSTED GLASS NAVIGATION BAR
   ========================================================================== */
.global-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--header-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area .logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
}

.stanford-shield {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.4rem;
  background-color: #8C1515; /* Always Stanford red for the brand shield */
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .institution {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.logo-text .course-code {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-item {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--accent-color);
  background-color: var(--bg-page);
}

/* Dropdown Session Selector Styling */
.dropdown {
  position: relative;
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.chevron-icon {
  transition: transform 0.2s ease;
}

.dropdown.open .chevron-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 110;
  list-style: none;
  padding: var(--space-sm);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  font-family: var(--font-display);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: normal;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

.dropdown-item:hover {
  background-color: var(--bg-page);
  color: var(--accent-color);
}

.dropdown-item .numeral {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 2px;
}

/* Theme Switcher Button */
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle-btn:hover {
  background-color: var(--bg-page);
  color: var(--accent-color);
}

/* Sun/Moon Visibility */
.sun-icon {
  display: block;
}
.moon-icon {
  display: none;
}

[data-theme="dark"] .sun-icon {
  display: none;
}
[data-theme="dark"] .moon-icon {
  display: block;
}

/* If system default resolves to dark theme, show moon by default */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun-icon {
    display: none;
  }
  :root:not([data-theme="light"]) .moon-icon {
    display: block;
  }
}

/* ==========================================================================
   BREADCRUMBS STYLING
   ========================================================================== */
.breadcrumbs-bar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-sm) 0;
  display: none; /* Hidden by default on home view */
}

.breadcrumbs-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: var(--space-xs);
  font-size: 0.85rem;
  font-family: var(--font-display);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb-item a:hover {
  color: var(--accent-color);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding: 0 var(--space-sm);
  color: var(--text-muted);
}

.breadcrumb-item.active {
  color: var(--text-secondary);
  font-weight: 600;
  pointer-events: none;
}

/* ==========================================================================
   VIEWPORT ENGINE AND ROUTING LOADER
   ========================================================================== */
#app-viewport {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  outline: none; /* Focus shifts programmatically */
}

.viewport-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   HOME LANDING LAYOUT: HERO & LOGISTICS & DYNAMIC SYLLABUS GRID
   ========================================================================== */
/* Hero section layout */
.home-hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-xl) auto;
}

.stanford-badge {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--stanford-crimson);
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  display: inline-block;
}

[data-theme="dark"] .stanford-badge {
  color: var(--stanford-gold);
}

.home-title {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.home-lecturer {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.home-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Logistics Card Layout */
.logistics-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.logistics-title {
  font-size: 1.6rem;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--space-sm);
}

.logistics-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 24px;
  background-color: var(--accent-color);
  border-radius: var(--radius-xs);
}

.logistics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
}

.logistics-item {
  display: flex;
  flex-direction: column;
}

.logistics-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.logistics-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.logistics-value a {
  border-bottom: 1px dashed var(--accent-color);
}

/* 3x6 Interactive Grid Layout */
.sessions-section-title {
  font-size: 2rem;
  margin-bottom: var(--space-lg);
  text-align: center;
}

.syllabus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* Card Styling & premium Micro-animations */
.session-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.session-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--accent-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.session-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--card-hover-border);
  box-shadow: var(--shadow-md);
}

.session-card:hover::after {
  transform: scaleX(1);
}

.session-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.session-numeral {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--accent-color);
  opacity: 0.85;
  line-height: 1;
}

.session-topic {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-xs);
  line-height: 1.35;
}

.session-code {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.session-cases-preview {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-sm);
}

.session-case-title {
  font-weight: 500;
  font-style: italic;
}

.session-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.session-readings-preview {
  font-family: var(--font-display);
  font-weight: 500;
}

.session-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-color);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.session-card:hover .session-action-btn {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   SESSION SCHOLARLY VIEW LAYOUT
   ========================================================================== */
.session-viewport-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 992px) {
  .session-viewport-layout {
    grid-template-columns: 1fr;
  }
  .session-sidebar {
    position: static !important;
    order: -1;
  }
}

.session-main-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.session-back-nav {
  margin-bottom: var(--space-lg);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
}

.btn-back:hover {
  color: var(--accent-color);
}

.session-scholarly-header {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.session-header-num {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--accent-color);
  margin-bottom: var(--space-xs);
}

.session-header-title {
  font-size: 2.2rem;
  margin-bottom: var(--space-sm);
}

.session-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.85rem;
  font-family: var(--font-display);
  color: var(--text-muted);
}

.session-meta-item strong {
  color: var(--text-secondary);
}

/* Scholarly Markdown Typography Rendering styles */
.markdown-body {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.markdown-body p {
  margin-bottom: var(--space-lg);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.markdown-body h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-xs);
}

.markdown-body h3 {
  font-size: 1.25rem;
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-lg);
}

.markdown-body li {
  margin-bottom: var(--space-xs);
}

/* Scholarly citation blockquotes and legal codes */
.markdown-body blockquote {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  border-left: 4px solid var(--accent-color);
  padding: var(--space-sm) var(--space-lg);
  background-color: var(--bg-page);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-lg) 0;
  color: var(--text-secondary);
}

/* Clean code snippet styles */
.markdown-body pre {
  background-color: var(--bg-code);
  color: var(--text-primary);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-color);
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 2px 5px;
  background-color: var(--bg-code);
  border-radius: var(--radius-xs);
}

.markdown-body pre code {
  padding: 0;
  background-color: transparent;
  border-radius: 0;
}

/* Structured Academic Tables */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
  font-size: 0.95rem;
}

.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-color);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}

.markdown-body th {
  background-color: var(--bg-page);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-secondary);
}

.markdown-body tr:nth-child(even) td {
  background-color: var(--bg-page);
}

/* Session Sidebar Styling */
.session-sidebar {
  position: sticky;
  top: 96px; /* Offset from sticky header */
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-md);
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sidebar-nav-item a {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.sidebar-nav-item a:hover, .sidebar-nav-item.active a {
  background-color: var(--bg-page);
  color: var(--accent-color);
  font-weight: 500;
}

/* ==========================================================================
   ACADEMIC WARNINGS & CRITICAL VENDOR STYLES
   ========================================================================== */
.academic-warning {
  border-bottom: 1px dashed var(--stanford-crimson);
}

.banner-ai-policy {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  border-left: 6px solid var(--stanford-crimson);
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.banner-ai-policy h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--stanford-crimson);
  margin-bottom: var(--space-sm);
  font-size: 1.1rem;
}

.banner-ai-policy p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.banner-ai-policy a {
  font-weight: 600;
}

/* ==========================================================================
   FOOTER STYLING
   ========================================================================== */
.global-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: var(--space-xl) 0;
  margin-top: auto;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer-branding {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sls-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.course-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.footer-link:hover {
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .footer-links {
    justify-content: center;
    gap: var(--space-md);
  }
}

/* ==========================================================================
   VIEW TRANSITIONS & PAGE TRANSITION ANIMATIONS
   ========================================================================== */
/* Smooth same-document fade and slide for browsers that don't support View Transitions */
.view-fade-enter {
  animation: fadeInSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* View Transitions API configuration and dynamic names */
::view-transition-old(root) {
  animation: fadeOutToLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

::view-transition-new(root) {
  animation: fadeInFromRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeOutToLeft {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(-15px); }
}

@keyframes fadeInFromRight {
  from { opacity: 0; transform: translateX(15px); }
  to { opacity: 1; }
}

/* Target specific layout items with aspect ratio preservation */
.session-scholarly-header {
  view-transition-name: scholarly-header;
}

.session-main-content {
  view-transition-name: scholarly-content;
}

::view-transition-old(scholarly-content),
::view-transition-new(scholarly-content) {
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
  
  .view-fade-enter {
    animation: none !important;
  }
}
