/* ==========================================================================
   Mukhamad Suhermanto | Academic, Engineering & Creative Portfolio
   Global Modular Design System (Light & Dark Mode)
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Light Palette (Slate / Purdue Gold & Academic Blue Accents) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-primary-soft: #e0f2fe;

  --accent-gold: #b45309;
  --accent-gold-soft: #fef3c7;
  --accent-emerald: #059669;
  --accent-emerald-soft: #d1fae5;
  --accent-indigo: #4f46e5;
  --accent-indigo-soft: #e0e7ff;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 32px -6px rgba(15, 23, 42, 0.12);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --max-width: 1240px;
  --header-height: 70px;
}

[data-theme="dark"] {
  --bg-page: #090d16;
  --bg-surface: #111827;
  --bg-subtle: #1e293b;
  --bg-glass: rgba(17, 24, 39, 0.88);
  --border-color: #1f2937;
  --border-strong: #374151;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent-primary: #38bdf8;
  --accent-primary-hover: #7dd3fc;
  --accent-primary-soft: rgba(56, 189, 248, 0.14);

  --accent-gold: #fbbf24;
  --accent-gold-soft: rgba(251, 191, 36, 0.14);
  --accent-emerald: #34d399;
  --accent-emerald-soft: rgba(52, 211, 153, 0.14);
  --accent-indigo: #818cf8;
  --accent-indigo-soft: rgba(129, 140, 248, 0.14);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 25px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px -6px rgba(0, 0, 0, 0.65);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  scroll-behavior: smooth;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* Typography */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

code, pre {
  font-family: var(--font-mono);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Global Navigation Header & Multi-Level Sub-Menus
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10000;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--text-main);
  text-decoration: none;
}

.brand-logo:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.brand-sub {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  line-height: 1.15;
}

.site-header nav ul,
.site-header nav ol,
.site-header nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav .dropdown-menu {
  padding: 0.45rem;
}

.site-header nav .dropdown-submenu-list {
  padding: 0.45rem;
}

.site-header nav .dropdown-sub-submenu-list {
  padding: 0.4rem;
}

.site-header nav .dropdown-divider {
  margin: 0.35rem 0.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item-dropdown {
  position: relative;
  margin: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-item-dropdown.open > .nav-link {
  color: var(--accent-primary);
  background: var(--bg-subtle);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.caret-icon {
  font-size: 0.68rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.nav-item-dropdown.open > .nav-link .caret-icon {
  transform: rotate(180deg);
}

/* Level 1 Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 225px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.45rem;
  list-style: none;
  margin: 0;
  z-index: 10010;
}

/* Keep the STEM 3-level cascade comfortably shifted left so Sub-Menu + right-side Weeks stay in view */
@media (min-width: 1100px) {
  .nav-item-stem > .dropdown-menu {
    left: -175px;
  }
}

/* Right-align last menu dropdown so it never overflows screen edge */
.nav-item-dropdown:last-child > .dropdown-menu {
  left: auto;
  right: 0;
}

.nav-item-dropdown.open > .dropdown-menu {
  display: block;
}

@media (min-width: 861px) {
  .nav-item-dropdown:hover > .dropdown-menu {
    display: block;
  }

  .nav-item-dropdown:hover::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
    z-index: 10005;
  }
}

.dropdown-item,
.dropdown-sub-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover,
.dropdown-sub-trigger:hover,
.dropdown-submenu.open > .dropdown-sub-trigger {
  background: var(--bg-subtle);
  color: var(--accent-primary);
  text-decoration: none;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.35rem 0.25rem;
}

/* Level 2 Sub-Sub-Menu (Flyout) */
.dropdown-submenu,
.dropdown-sub-submenu {
  position: relative;
  margin: 0;
  overflow: visible;
}

.dropdown-submenu-list {
  display: none;
  position: absolute;
  top: -0.45rem;
  left: calc(100% + 4px);
  min-width: 290px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.45rem;
  list-style: none;
  margin: 0;
  z-index: 10020;
}

.dropdown-submenu.open > .dropdown-submenu-list {
  display: block;
}

/* Course row inside Level 2 with hoverable Level 3 right-side Weeks flyout */
.dropdown-sub-row {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-sub-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.4rem 0.5rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  transition: color 0.15s ease;
}

.dropdown-sub-caret-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.52rem 0.7rem 0.52rem 0.35rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: color 0.15s ease;
}

.dropdown-sub-row:hover,
.dropdown-sub-submenu:hover > .dropdown-sub-row,
.dropdown-sub-submenu.open > .dropdown-sub-row {
  background: var(--bg-subtle);
  color: var(--accent-primary);
}

.dropdown-sub-row:hover .dropdown-sub-link,
.dropdown-sub-submenu:hover > .dropdown-sub-row .dropdown-sub-link,
.dropdown-sub-submenu.open > .dropdown-sub-row .dropdown-sub-link,
.dropdown-sub-row:hover .dropdown-sub-caret-btn,
.dropdown-sub-submenu:hover > .dropdown-sub-row .dropdown-sub-caret-btn,
.dropdown-sub-submenu.open > .dropdown-sub-row .dropdown-sub-caret-btn {
  color: var(--accent-primary);
  text-decoration: none;
}

/* Level 3 Sub-Sub-Menu (Course Weeks Flyout) */
.dropdown-sub-submenu-list {
  display: none;
  position: absolute;
  top: -0.45rem;
  left: calc(100% + 4px);
  min-width: 285px;
  max-height: min(76vh, 600px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  list-style: none;
  margin: 0;
  z-index: 10030;
}

.dropdown-sub-submenu.flip-left > .dropdown-sub-submenu-list {
  left: auto;
  right: calc(100% + 4px);
}

.dropdown-sub-submenu.open > .dropdown-sub-submenu-list {
  display: block;
}

.dropdown-week-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.34rem 0.65rem;
  font-size: 0.84rem;
}

.dropdown-week-label {
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.dropdown-week-topic {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  max-width: 185px;
}

.dropdown-week-item:hover .dropdown-week-topic {
  color: var(--accent-primary);
}

@media (min-width: 861px) {
  .dropdown-submenu:hover > .dropdown-submenu-list,
  .dropdown-sub-submenu:hover > .dropdown-sub-submenu-list {
    display: block;
  }

  /* Invisible hover bridges so moving the cursor across the 4px gap stays open */
  .dropdown-submenu:hover::after,
  .dropdown-sub-submenu:hover::after {
    content: "";
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: 100%;
    width: 12px;
    z-index: 10025;
  }

  .dropdown-sub-submenu.flip-left:hover::after {
    left: auto;
    right: 100%;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.mobile-menu-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem;
    gap: 0.35rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.7rem 0.85rem;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--accent-primary);
    border-radius: 0;
    padding: 0.25rem 0 0.25rem 0.75rem;
    margin: 0.25rem 0 0.25rem 0.5rem;
    display: none;
  }

  .nav-item-dropdown.open > .dropdown-menu {
    display: block;
  }

  .dropdown-submenu-list,
  .dropdown-sub-submenu-list {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border-strong);
    border-radius: 0;
    padding: 0.2rem 0 0.2rem 0.75rem;
    margin: 0.2rem 0 0.2rem 0.5rem;
    max-height: none;
    overflow-y: visible;
    min-width: 0;
    display: none;
  }

  .dropdown-submenu.open > .dropdown-submenu-list,
  .dropdown-sub-submenu.open > .dropdown-sub-submenu-list {
    display: block;
  }

  .dropdown-sub-submenu.open > .dropdown-sub-row .caret-icon {
    display: inline-block;
    transform: rotate(90deg);
  }
}

@media (max-width: 520px) {
  .nav-container {
    padding: 0 0.9rem;
    gap: 0.5rem;
  }

  .brand-logo {
    min-width: 0;
    gap: 0.55rem;
    font-size: 0.96rem;
  }

  .brand-sub {
    font-size: 0.68rem;
  }

  .nav-actions {
    flex-shrink: 0;
    gap: 0.35rem;
  }

  .theme-toggle {
    padding: 0.38rem 0.55rem;
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-active {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}

.badge-coming-soon {
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
}

.badge-primary {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
}

.badge-indigo {
  background: var(--accent-indigo-soft);
  color: var(--accent-indigo);
}

/* ==========================================================================
   Hero & Section Layout
   ========================================================================== */
.hero-section {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border-color);
  background: radial-gradient(circle at top right, var(--accent-primary-soft), transparent 45%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

.hero-title {
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 800;
  margin: 0.6rem 0 1rem;
}

.hero-subtitle {
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: 1.5rem;
}

.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.profile-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-top: 0.3rem;
}

/* ==========================================================================
   Cards & Grids
   ========================================================================== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 500px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   CV Interactive Tabs & Viewer
   ========================================================================== */
.cv-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}

.cv-tab-btn {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cv-tab-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.cv-pane {
  display: none;
}

.cv-pane.active {
  display: block;
}

.cv-timeline-item {
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--accent-primary);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.cv-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.cv-timeline-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-main);
}

.cv-timeline-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-primary-soft);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.cv-timeline-sub {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pdf-embed-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pdf-embed-frame {
  width: 100%;
  height: 760px;
  border: none;
  display: block;
}

/* ==========================================================================
   Breadcrumbs & Course Portals
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

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

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

.formula-showcase {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.4rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.syllabus-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.syllabus-table th,
.syllabus-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.syllabus-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-main);
}

.syllabus-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Photography Masonry & Lightbox Modal
   ========================================================================== */
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.photo-grid {
  columns: 3 320px;
  column-gap: 1.25rem;
}

.photo-card {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  cursor: zoom-in;
  box-shadow: var(--shadow-xs);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
}

.photo-card:hover img {
  transform: scale(1.03);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 13, 22, 0.82) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem 1.15rem;
  color: #ffffff;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.photo-meta {
  font-size: 0.76rem;
  color: #cbd5e1;
  font-family: var(--font-mono);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 2rem;
}

.lightbox-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  object-fit: contain;
}

.lightbox-caption-bar {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  color: #f8fafc;
  width: 100%;
  max-width: 680px;
  font-size: 0.92rem;
}

.lightbox-btn {
  position: fixed;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.06);
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
}

.lightbox-prev {
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* ==========================================================================
   Global Code Block Copy Button & Page Notebook (.ipynb) Export
   ========================================================================== */
pre, div.sourceCode {
  position: relative;
}

.global-copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.global-copy-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.global-copy-btn.copied {
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.footer-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}


/* ==========================================================================
   Global "Cite this page (APA 7th)" box + automatic "Last updated" date
   Injected by assets/js/main.js -> injectCitationFooter() on every page
   ========================================================================== */
.page-citation-footer {
  width: 100%;
  margin: 2.5rem 0 0;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border-color);
  font-family: var(--font-sans, 'Inter', sans-serif);
}

body > .page-citation-footer .citation-inner {
  max-width: var(--max-width, 1200px);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-citation-footer .citation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.page-citation-footer .citation-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.page-citation-footer .citation-box {
  font-family: var(--font-mono, 'Fira Code', Consolas, monospace);
  font-size: 0.84rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0.95rem 1.1rem 0.95rem 2.6rem;
  text-indent: -1.5rem; /* APA hanging indent */
  background: var(--bg-code, var(--bg-subtle, #f1f5f9));
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-primary, var(--primary, #0284c7));
  border-radius: 8px;
  user-select: all;
  margin: 0;
}

.page-citation-footer .citation-copy-btn {
  flex-shrink: 0;
  padding: 0.32rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.page-citation-footer .citation-copy-btn:hover {
  border-color: var(--accent-primary, var(--primary, #0284c7));
  color: var(--accent-primary, var(--primary, #0284c7));
}

.page-citation-footer .citation-copy-btn.copied {
  border-color: #10b981;
  color: #10b981;
}

.page-citation-footer .citation-note,
.page-citation-footer .page-updated {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.page-citation-footer .page-updated {
  font-weight: 600;
}

/* ==========================================================================
   Site-Wide Expandable Practice Problem Solutions (<details>)
   Matches Pre-Calculus & Calculus I standard across all course pages
   ========================================================================== */
details {
  margin: 0.85rem 0 1.35rem 0;
  padding: 0.75rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary, var(--accent-primary, #0284c7));
  border-radius: 8px;
}

details summary {
  cursor: pointer;
  color: var(--primary, var(--accent-primary, #0284c7));
  font-size: 0.95rem;
  user-select: none;
}

details[open] summary {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

details ol,
details ul {
  margin: 0.5rem 0 0.25rem 1.35rem;
}

details p {
  margin: 0.45rem 0;
}
