/* Base Styles and Variables */
:root {
  /* Refined color palette */
  --primary-color: #3a56e8;
  --primary-light: #5a9ef5;
  --primary-dark: #3215a0;
  --accent-color: #e83a7c;
  --secondary-color: #38bfe8;
  --text-color: #2b2d42;
  --light-bg: #f8f9fa;
  --dark-bg: #212529;
  
  /* RGB values for opacity manipulations */
  --primary-color-rgb: 58, 86, 232;
  --accent-color-rgb: 232, 58, 124;
  --secondary-color-rgb: 56, 191, 232;
  
  /* New tertiary colors */
  --tertiary-purple: #7209b7;
  --tertiary-teal: #4d908e;
  --tertiary-orange: #f8961e;
  
  /* Gray scale */
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --gray-50: #f9fafb;
  
  /* Semantic colors */
  --success: #2f9e61;
  --info: #4299e1;
  --warning: #f0932b;
  --danger: #d83a3a;
  
  /* Refined UI elements */
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.1);
  --border-radius: 0.5rem;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Improved typography */
  --font-family: 'Montserrat', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --font-family-heading: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Enhanced gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  --gradient-hero: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 70%, var(--secondary-color) 100%);
  --gradient-card: linear-gradient(135deg, #ffffff 0%, var(--gray-100) 100%);
  --gradient-featured: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--tertiary-purple) 100%);
  
  /* Improved shadows */
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --card-hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Header height for scrolling offsets */
  --header-height: 80px;
  --header-height-scrolled: 60px;
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Remove outlines, but keep accessibility-friendly focus states */
*:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

/* Add scroll margin for headings to improve anchor link positioning */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: calc(var(--header-height) + 30px);
  position: relative;
  z-index: 1;
}

/* Chart container with h2 headings need scroll margin */
.chart-container h2[id] {
  scroll-margin-top: calc(var(--header-height) + 40px);
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  padding-top: 10px;
}

/* Additional styles for chart containers with IDs for better anchor targeting */
.chart-container[id] {
  scroll-margin-top: calc(var(--header-height) + 30px);
  position: relative;
  padding-top: 10px;
}

/* Anchor link adjustment */
:target {
  scroll-margin-top: calc(var(--header-height) + 40px);
}

/* Specific selectors to ensure proper targeting */
h2[id="allocation-timing"],
h2[id="cohorts"],
h2[id="allocation-changes"],
h2[id="distribution-of-donations"],
h2[id="user-types"],
h2[id="projects-supported"],
h2[id="donors"],
h2[id="qf-vs-linear-distribution"],
h2[id="correlations"],
h2[id="user-history"],
h2[id="transitions-of-allocators"],
h2[id="transitions-vs-cohorts"],
h2[id="correlations-voters-agenda"],
h2[id="single-project-votes"] {
  scroll-margin-top: calc(var(--header-height) + 50px);
}

body {
  font-family: var(--font-family-body);
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--light-bg);
  padding: 0;
  margin: 0;
  font-size: 1rem;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--dark-bg);
  font-family: var(--font-family-heading);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2rem;
  position: relative;
  padding-bottom: 1rem;
  margin-top: 3rem;
  text-align: center;
}

/* Section headings */
section h1 {
  font-size: 2.1rem;
  font-weight: 700;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

h2 {
  font-size: 1.2rem;
  margin-top: 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Adjusted spacing for h2 within divs */
div h2 {
  margin-top: 1rem; /* Reduced space before h2 */
  margin-bottom: 1.8rem; /* Slightly increased space after h2 */
}

p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 2rem;
}

.main-content {
  margin-top: 80px;
  width: calc(100% - 280px); /* Subtract TOC width */
  max-width: calc(1300px - 280px); /* Adjust max-width to account for TOC */
  padding: 3rem 2rem 6rem 2rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  flex: 1 0 auto;
  position: relative;
}

/* For extra large screens */
@media (min-width: 1200px) {
  .container {
    max-width: 1300px;
    margin: 0 auto;
  }
  
  .main-content {
    padding: 2rem 2rem 6rem 2rem;
    max-width: calc(1300px - 280px); /* Keep space for TOC */
    width: calc(100% - 280px); /* Keep consistent with base styles */
    margin: 80px auto 0;
  }
}

/* For extremely large screens */
@media (min-width: 2400px) {
  .container {
    max-width: 1300px;
  }
}

/* Mobile Menu Toggle - Simple Hamburger */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Header styles */
.site-header {
  background-color: var(--dark-bg);
  color: white;
  padding: 0.75rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  height: 70px;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-bottom: 3px solid var(--accent-color);
  transition: var(--transition);
}

.site-header.scrolled {
  height: 60px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Remove the hover effect */
.site-header:hover {
  background-color: var(--dark-bg);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  margin: 0 auto;
  max-width: 1300px;
  width: 100%;
  height: 100%;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap; /* Prevent text wrapping */
  letter-spacing: -0.01em;
}

.site-logo:hover {
  text-decoration: none;
  color: white;
  opacity: 0.9;
}

.site-logo img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  display: block;
  filter: brightness(1);
  transition: var(--transition);
}

.site-logo:hover img {
  transform: scale(1.05);
}

.site-nav {
  display: flex;
  align-items: center;
}

.site-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.site-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.site-nav a.active {
  color: white;
  font-weight: 600;
}

.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-color: var(--accent-color);
  border-radius: 1px;
}

.site-nav li a.epoch-7 {
  color: white;
  background-color: rgba(var(--primary-color-rgb, 58, 86, 232), 0.2);
  border-radius: var(--border-radius);
  padding: 0.5rem 0.75rem;
  position: relative;
}

.site-nav li a.epoch-7::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background-color: var(--primary-color);
  z-index: -1;
  transition: height 0.3s ease;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.site-nav li a.epoch-7:hover {
  background-color: rgba(var(--primary-color-rgb, 58, 86, 232), 0.3);
}

.site-nav li a.epoch-7.active {
  background-color: rgba(var(--primary-color-rgb, 58, 86, 232), 0.4);
}

/* Dropdown styles */
.site-nav .dropdown {
  position: relative;
}

.site-nav .dropdown-toggle {
  cursor: pointer;
}

.site-nav .dropdown-toggle i.fa-chevron-down {
  transition: transform 0.3s ease;
  margin-left: 0.25rem;
}

.site-nav .dropdown.open .dropdown-toggle i.fa-chevron-down {
  transform: rotate(180deg);
}

.site-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--dark-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.site-nav .dropdown-menu li {
  list-style: none;
  margin: 0;
}

.site-nav .dropdown-menu a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  display: block;
}

.site-nav .dropdown-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.site-nav .dropdown-menu a.active {
  background-color: rgba(var(--accent-color-rgb, 255, 193, 7), 0.2);
  color: var(--accent-color);
}

/* Mobile dropdown styles */
@media (max-width: 768px) {
  .site-nav .dropdown-menu {
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 0;
    margin-left: 1rem;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .site-nav .dropdown-menu a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    text-align: left;
  }
  
  .site-nav .dropdown-toggle i.fa-chevron-down {
    transform: none;
  }
  
  .site-nav .dropdown:hover .dropdown-toggle i.fa-chevron-down {
    transform: none;
  }
}

/* Mobile header styles */
@media (max-width: 768px) {
  .site-header {
    height: 56px;
    padding: 0.5rem 0;
  }

  .site-header .container {
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .site-logo {
    font-size: 1.1rem;
    gap: 0.5rem;
  }

  .site-logo img {
    height: 28px;
    width: 28px;
  }

  /* Show mobile menu toggle instead of hamburger */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Hide the old hamburger on mobile */
  .hamburger {
    display: none !important;
  }
  
  /* Mobile navigation */
  .site-nav {
    display: block;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--dark-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
  }

  .site-nav.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav ul {
    flex-direction: column;
    margin: 0;
    padding: 0;
  }

  .site-nav li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .site-nav li:last-child {
    border-bottom: none;
  }

  .site-nav a {
    padding: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .site-nav a i {
    width: 24px;
    margin-right: 0.75rem;
  }
}

/* Special rule to ensure hamburger is visible on mobile */
@media screen and (max-width: 850px) {
  .hamburger {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* iPad and tablets specific styles - new section to fix iPad issues */
@media (min-width: 768px) and (max-width: 1024px) {
  .site-header {
    height: 60px;
  }

  .site-logo {
    font-size: 1.1rem;
    gap: 0.5rem;
    max-width: 30%;
  }

  .site-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px; /* Add a bit of padding to show scrollbar */
  }

  .site-nav ul {
    flex-wrap: nowrap;
    gap: 0.75rem;
    padding-right: 10px;
  }

  .site-nav a {
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  /* Only show icon for space efficiency on iPad */
  .site-nav a i {
    margin-right: 0.25rem;
  }
}

/* Special handling for smaller iPads and larger phones in landscape */
@media (min-width: 768px) and (max-width: 850px) {
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Hide the old hamburger */
  .hamburger {
    display: none !important;
  }

  .site-nav {
    display: block;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--dark-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
  }

  .site-nav.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav.is-active ul {
    flex-direction: column;
  }

  .site-nav.is-active li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .site-nav.is-active li:last-child {
    border-bottom: none;
  }

  .site-nav.is-active a {
    padding: 1rem;
    width: 100%;
  }
}

/* Desktop styles */
@media (min-width: 1025px) {
  .mobile-menu-toggle {
    display: none;
  }

  .site-nav {
    display: flex !important;
  }

  .site-nav ul {
    display: flex;
    gap: 1.5rem;
  }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button-large {
  padding: 0.85rem 2rem;
  font-size: 1.05rem;
}

.button-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.button-outline:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Card styles */
.card {
  background: #ffffff;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: var(--transition);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

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

/* Special handling for cards with multiple images */
.card-multi-image {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto 4rem auto;
}

.chart-image-container {
  width: 100%;
  margin-bottom: 1rem;
}

.chart-image-container:last-child {
  margin-bottom: 0;
}

.chart-image-container .chart-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* Card with full-width chart image */
.card-chart {
  text-align: left;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto 1.5rem auto;
  display: block;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: none; /* Ensure no card border */
  overflow: hidden;
}

.card-chart h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 1.2rem;
  text-align: center;
}

.card-chart .table-container {
  box-shadow: none; /* Remove shadow from table container in card-chart */
  margin: 0; /* Remove margin to avoid extra space */
  border: none; /* No border on container */
  border-radius: 0; /* No border radius on container */
  overflow: auto;
}

.card-chart .my-table,
.card-chart .data-table {
  margin: 0; /* Remove margin to avoid extra space */
  box-shadow: none; /* No shadow inside card */
  border-left: none; /* No left border */
  border-right: none; /* No right border */
  border-bottom: none; /* No bottom border */
  border-radius: 0; /* No border radius */
}

.card-chart .chart-image {
  flex: 0 0 70%;
  width: 70%;
  max-width: 70%;
  margin: 1rem 0;
}

/* Chart container - improve layout */
.chart-container {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin: 3rem 0;
  padding: 1.5rem 1.5rem 3rem 1.5rem; /* Increased bottom padding for all chart containers */
  position: relative;
  transition: var(--transition);
  overflow: visible; /* Keep content visible outside container boundaries */
}

.chart-container:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-5px);
}

.chart-container h2 {
  margin-top: 0.5rem; /* Further reduced from 0.75rem */
  margin-bottom: 1.2rem; /* Reduced from 1.8rem */
  font-size: 1.3rem;
  text-align: center;
  color: var(--dark-bg);
  position: relative;
  padding-bottom: 0.5rem; /* Reduced from 0.75rem */
}

.chart-container h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 1.5px;
}

.chart-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Increased from 1rem for better spacing */
  width: 100%;
  min-width: 0;
  overflow: visible;
  margin-bottom: 1.5rem; /* Added bottom margin to all chart content */
}

.chart-image {
  flex: 1;
  display: flex;
  align-items: center; /* Changed from flex-start to center for vertical alignment */
  justify-content: center;
  transition: var(--transition);
  position: relative;
  height: auto;
  min-height: auto; /* Allow natural height */
  overflow: visible;
  padding-bottom: 20px; /* Add padding to all chart images */
}

.chart-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: var(--transition);
  object-fit: contain;
  max-height: none;
  margin-bottom: 10px; /* Additional bottom margin to all chart images */
}

/* Specific fixes for charts known to have display issues */
.chart-container:has(img[src*="timing.png"]) .chart-image,
.chart-container:has(img[src*="cohorts.png"]) .chart-image,
.chart-container:has(img[src*="allocation_combined.png"]) .chart-image {
  padding-bottom: 30px;
}

.chart-container:has(img[src*="timing.png"]) img,
.chart-container:has(img[src*="cohorts.png"]) img,
.chart-container:has(img[src*="allocation_combined.png"]) img {
}

.chart-image img:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.chart-description {
  flex: 1;
  padding: 0.75rem 1rem 0.75rem 0.75rem !important;
  background-color: transparent;
  border-radius: var(--border-radius);
  box-shadow: none;
  font-size: 0.8rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-right: 0.5rem !important;
  margin-bottom: 20px; /* Add bottom margin to prevent cutoff */
}

.chart-description h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--primary-dark);
}

.chart-description p {
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.chart-description img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: 0.5rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  object-fit: contain;
  width: auto;
}

/* Reports grid */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 4rem;
  margin: 2rem auto;
  max-width: 1300px;
  width: 100%;
}

.reports-grid .card {
  margin: 0; /* Keep this as is since gap handles the spacing in grid */
  height: 100%;
  display: flex;
  flex-direction: column;
}

.reports-grid .card h2 {
  margin-top: 0;
}

.reports-grid .card p {
  flex-grow: 1;
}

.reports-grid .button {
  align-self: center;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .card-multi-image {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  
  .card-multi-image .chart-image {
    width: 70% !important;
    max-width: none;
  }
}

/* Table styles with high specificity to override inline styles */
.table-container {
  width: 100%;
  overflow-x: auto !important;
  margin: 1rem 0;
  border-radius: var(--border-radius);
  box-shadow: none !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  border: none !important;
}

.dataframe.my-table,
.card-chart .dataframe,
.data-table,
table[class*="dataframe"] {
  width: 100% !important;
  min-width: 650px !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
  box-shadow: none !important;
  margin: 0 !important;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--border-radius) !important;
  overflow: hidden !important;
}

/* Reduce table row height */
.dataframe th,
.dataframe td,
.dataframe.my-table th,
.dataframe.my-table td,
.card-chart table th,
.card-chart table td,
table[class*="dataframe"] th,
table[class*="dataframe"] td {
  width: auto !important;
  min-width: 80px !important;
  text-align: center !important;
  padding: 0.4rem 0.5rem !important; /* Reduced padding */
  word-wrap: break-word !important;
  white-space: normal !important;
  border-right: 1px solid var(--gray-300) !important;
  line-height: 1.3 !important; /* Reduced line height */
  font-size: 0.9rem !important; /* Slightly smaller font */
  vertical-align: middle !important;
}

.dataframe th,
.dataframe.my-table th,
.card-chart table th,
table[class*="dataframe"] th {
  background-color: var(--dark-bg) !important;
  color: white !important;
  font-weight: 600 !important;
  padding: 0.5rem !important; /* Slightly larger padding for headers */
}

.dataframe th:last-child,
.dataframe td:last-child,
.dataframe.my-table th:last-child,
.dataframe.my-table td:last-child,
.card-chart table th:last-child,
.card-chart table td:last-child,
table[class*="dataframe"] th:last-child,
table[class*="dataframe"] td:last-child {
  border-right: none !important;
}

/* Further reduce row height for numeric cells */
.dataframe td:not(:first-child),
.dataframe.my-table td:not(:first-child),
table[class*="dataframe"] td:not(:first-child) {
  padding-top: 0.3rem !important;
  padding-bottom: 0.3rem !important;
}

/* Card chart specific styles */
.card-chart {
  border: none !important;
  box-shadow: var(--box-shadow) !important;
  overflow: hidden !important;
}

.card-chart .table-container {
  margin: 0 !important;
  border: none !important;
  overflow-x: auto !important;
}

.card-chart .dataframe,
.card-chart table[class*="dataframe"] {
  margin: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
}

/* Override alternating row colors */
.dataframe tr:nth-child(even),
.dataframe.my-table tr:nth-child(even),
.card-chart table tr:nth-child(even),
table[class*="dataframe"] tr:nth-child(even) {
  background-color: var(--gray-50) !important;
}

.dataframe tr:hover,
.dataframe.my-table tr:hover,
.card-chart table tr:hover,
table[class*="dataframe"] tr:hover {
  background-color: rgba(var(--primary-color-rgb, 58, 86, 232), 0.05) !important;
}

/* Mobile adjustments */
@media (max-width: 992px) {
  .table-container {
    overflow-x: auto !important;
    max-width: 100% !important;
    margin: 1rem 0 !important;
  }
  
  .dataframe.my-table,
  .data-table,
  table[class*="dataframe"] {
    margin: 0 !important;
  }
  
  section#octant-aggregates .table-container {
    overflow-x: auto !important;
  }
}

/* Sidebar/Outline */
.outline {
  position: fixed;
  top: 70px; /* Exact match to header height */
  bottom: 0; /* Default to bottom 0 when footer is not visible */
  right: 0;
  width: 280px;
  background-color: white; /* Solid white background */
  border-left: 1px solid var(--gray-300);
  padding: 1rem;
  margin: 0;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 100; /* Higher z-index to appear above content */
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

/* When footer is visible, add space at the bottom of the TOC */
.footer-visible .outline {
  bottom: 60px; /* Match to footer height only when footer is visible */
}

/* For scrolled header state */
.site-header.scrolled + .main-content + .outline,
.site-header.scrolled ~ .outline {
  top: 60px; /* Match scrolled header height */
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .main-content {
    width: 100%;
    max-width: 1300px;
    padding: 3rem 1rem 0 1rem;
  }

  .outline {
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .outline.show {
    transform: translateX(0);
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .main-content {
    padding: 2rem 1rem 0 1rem;
  }

  .outline {
    top: 56px; /* Exact mobile header height */
    bottom: 60px; /* Keep bottom spacing on mobile regardless of footer visibility */
    transform: translateX(100%);
    width: 280px;
    background-color: white;
    padding: 1rem;
    margin: 0;
    transition: transform 0.3s ease;
    z-index: 1001; /* Ensure it's above everything */
  }
  
  .outline.show {
    transform: translateX(0);
  }
  
  .menu-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    z-index: 1002; /* Above the TOC */
    cursor: pointer;
    transition: var(--transition);
  }
  
  .menu-toggle:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
  }
  
  .outline li {
    padding: 0.05rem 0;
  }
  
  .outline a {
    padding: 0.1rem 0;
  }
}

.outline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--primary-color);
}

.outline-header h2 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

/* Toggle button styles */
.toc-toggle {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.25rem;
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.toc-toggle:hover {
  color: var(--primary-dark);
}

.outline.collapsed .toc-toggle {
  transform: rotate(180deg);
}

/* TOC collapse animation */
.outline.collapsed {
  width: 50px;
}

.outline.collapsed ul {
  display: none;
}

.outline.collapsed .outline-header h2 {
  display: none;
}

.outline ul {
  list-style-type: none;
  padding: 0;
}

.outline li {
  margin-bottom: 0.1rem;
  padding: 0.02rem 0;
}

.outline a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  display: block;
  padding: 0.05rem 0;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 0.8rem;
}

.outline a:hover {
  color: var(--primary-color);
  background-color: rgba(99, 102, 241, 0.07); /* Slightly lighter hover state based on primary-light */
  text-decoration: none;
}

.outline a.active {
  color: var(--primary-color);
  background-color: rgba(99, 102, 241, 0.12); /* Updated to match palette */
  font-weight: 600;
}

.outline a.h2-link {
  font-size: 0.75rem;
  font-weight: normal;
  margin-left: 1rem;
  opacity: 0.9;
}

.toc-submenu {
  display: block;
  margin-left: 1rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--gray-300);
}

/* Add a semi-transparent overlay for mobile when TOC is open */
.toc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
}

.toc-overlay.show {
  display: block;
}

/* Medium screens - tablets and small laptops */
@media (min-width: 769px) and (max-width: 1200px) {
  .container {
    width: 100%;
    padding: 0 2rem;
  }
  
  .main-content {
    padding: 2rem;
  }
  
  .outline {
    width: 250px;
  }
}

/* Utility classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 4rem; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.large-bottom-space { margin-bottom: 60px; }

/* For screens where TOC is visible alongside content */
@media (min-width: 1201px) {
  body {
    padding-right: 0;
  }

  .main-content {
    width: calc(100% - 280px); /* Keep space for TOC */
    max-width: calc(1300px - 280px); /* Keep space for TOC */
    margin: 80px auto 0;
    padding: 2rem 2rem 6rem 2rem;
  }

  .site-footer .container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
  }

  .card,
  .chart-container {
    width: 100%;
    max-width: 100%; /* Use parent container constraints */
    margin-left: auto;
    margin-right: auto;
  }

  section h1 {
    width: 100%;
    max-width: 100%; /* Use parent container constraints */
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  
  /* Remove the right margin from TOC */
  .outline {
    right: 0;
    width: 280px; /* Restore full width */
  }
}

/* Mobile adjustments */
@media (max-width: 1200px) {
  body {
    padding-right: 0;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
    padding: 0 2rem;
  }

  .site-footer .container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
  }

  .card,
  .chart-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Image Modal Styles */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.image-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-image {
  max-width: 100%;
  max-height: 90vh;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-radius: var(--border-radius);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.image-modal.show .modal-image {
  transform: scale(1);
}

.close-modal {
  position: absolute;
  top: -50px;
  right: 0;
  color: white;
  font-size: 30px;
  cursor: pointer;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.close-modal:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

@media (min-width: 768px) {
  .chart-content {
    flex-direction: row;
    align-items: center !important; /* Changed from flex-start to center */
    margin-bottom: 1.5rem; /* Add bottom margin */
  }
  
  .chart-image {
    flex: 0 0 65%;
    height: auto;
    overflow: visible;
    padding-bottom: 1rem; /* Add bottom padding */
    display: flex;
    align-items: center; /* Ensure vertical centering */
  }
  
  .chart-description {
    flex: 0 0 35%;
    padding: 1.5rem 2.5rem 1.5rem 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    margin-right: 2rem !important;
    background-color: transparent;
    box-shadow: none;
  }
  
  .chart-description.full-width {
    flex: 1;
  }
}

/* Footer styles */
.site-footer {
  background-color: var(--dark-bg);
  color: white;
  padding: 0.75rem 0; 
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  box-sizing: border-box;
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-top: 3px solid var(--primary-color);
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 0;
  z-index: 10;
  height: 60px;
  display: flex;
  align-items: center;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
}

.footer-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-update, .copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin: 0;
}

@media (max-width: 768px) {
  .site-footer {
    height: auto;
    padding: 0.75rem 0;
  }
  
  .site-footer .container {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
  }
  
  .footer-info {
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    text-align: center;
  }
}

/* Scroll to top button - FINAL FIX */
#scroll-top-button {
  position: fixed !important;
  bottom: 30px !important;
  right: 30px !important;
  width: 60px !important;
  height: 60px !important;
  background-color: #3a56e8 !important;
  color: white !important;
  border-radius: 50% !important;
  border: 3px solid white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.3s ease !important;
  opacity: 0;
  transform: scale(0.9);
  z-index: 9999999 !important; /* Ultra high z-index */
  pointer-events: auto !important;
}

/* Ensure it's visible when needed */
#scroll-top-button.visible {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* Enhanced hover effect */
#scroll-top-button:hover {
  background-color: #3215a0 !important;
  transform: translateY(-5px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Larger icon */
#scroll-top-button i {
  font-size: 1.75rem !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #scroll-top-button {
    bottom: 120px !important; /* Even higher to ensure visibility */
    right: 20px !important;
    width: 55px !important;
    height: 55px !important;
  }
}

/* Main content adjustments */
.main-content {
  position: relative;
  z-index: 5;
  flex: 1 0 auto;
  padding-bottom: 0;
  margin-bottom: 0;
}

.site-footer {
  flex-shrink: 0;
  margin-top: 0;
  z-index: 10;
}

/* Hero Section */
.hero-section {
  background: var(--gradient-hero);
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="1"/></svg>') repeat,
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="30" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>') repeat;
  opacity: 0.25;
  animation: rotate 30s linear infinite, rotate-reverse 20s linear infinite;
}

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

@keyframes rotate-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 1.5s ease-out;
}

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

.hero-title {
  font-size: 3rem !important;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: white;
  animation: fadeIn 1s ease-out forwards;
}

.hero-subtitle {
  font-size: 1.1rem;
  margin-bottom: 0;
  opacity: 0.9;
  animation: fadeInUp 1s ease-out 0.4s backwards;
  color: rgba(255, 255, 255, 0.9);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 3rem;
  animation: fadeInUp 1s ease-out 0.6s backwards;
}

.stat-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  min-width: 180px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.2);
}

.stat-card i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Epoch Cards */
.epoch-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  justify-content: center;
}

.epoch-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--gray-200);
  width: 100%; /* Ensure cards use full width of their grid cell */
  max-width: 350px; /* Set a maximum width for consistency */
  margin: 0 auto; /* Center the card within its grid cell */
}

.epoch-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
}

.epoch-card.featured {
  background: var(--gradient-featured);
  color: white;
  border-top: 4px solid var(--accent-color);
}

.epoch-card.featured h2,
.epoch-card.featured .card-icon i,
.epoch-card.featured p {
  color: white;
}

.epoch-card.featured:hover {
  transform: translateY(-5px) scale(1.02);
}

.card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.epoch-card.featured .card-icon {
  color: var(--accent-color);
}

.epoch-card h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--dark-bg);
}

.epoch-card p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateX(5px);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .stat-card {
    width: 100%;
  }
  
  .epoch-cards {
    grid-template-columns: 1fr;
    margin-top: -2rem;
    justify-content: center; /* Maintain center alignment on mobile */
  }
}

/*!
 * Hamburgers
 * @description Tasty CSS-animated hamburgers
 * @author Jonathan Suh @jonsuh
 * @site https://jonsuh.com/hamburgers
 * @link https://github.com/jonsuh/hamburgers
 */
.hamburger {
  padding: 15px 15px;
  display: none; /* Base state is hidden for desktop */
  cursor: pointer;
  transition-property: opacity, filter;
  transition-duration: 0.15s;
  transition-timing-function: linear;
  font: inherit;
  color: inherit;
  text-transform: none;
  background-color: transparent;
  border: 0;
  margin: 0;
  overflow: visible;
  z-index: 1001; /* Ensure it's above other elements */
}

.hamburger:hover {
  opacity: 0.7;
}

.hamburger.is-active:hover {
  opacity: 0.7;
}

.hamburger.is-active .hamburger-inner,
.hamburger.is-active .hamburger-inner::before,
.hamburger.is-active .hamburger-inner::after {
  background-color: white;
}

.hamburger-box {
  width: 30px;
  height: 24px;
  display: inline-block;
  position: relative;
}

.hamburger-inner {
  display: block;
  top: 50%;
  margin-top: -2px;
}

.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
  width: 30px;
  height: 3px;
  background-color: white;
  border-radius: 4px;
  position: absolute;
  transition-property: transform;
  transition-duration: 0.15s;
  transition-timing-function: ease;
}

.hamburger-inner::before, .hamburger-inner::after {
  content: "";
  display: block;
}

.hamburger-inner::before {
  top: -10px;
}

.hamburger-inner::after {
  bottom: -10px;
}

/* Slider animation */
.hamburger--slider .hamburger-inner {
  top: 2px;
}

.hamburger--slider .hamburger-inner::before {
  top: 10px;
  transition-property: transform, opacity;
  transition-timing-function: ease;
  transition-duration: 0.15s;
}

.hamburger--slider .hamburger-inner::after {
  top: 20px;
}

.hamburger--slider.is-active .hamburger-inner {
  transform: translate3d(0, 10px, 0) rotate(45deg);
}

.hamburger--slider.is-active .hamburger-inner::before {
  transform: rotate(-45deg) translate3d(-5.71429px, -6px, 0);
  opacity: 0;
}

.hamburger--slider.is-active .hamburger-inner::after {
  transform: translate3d(0, -20px, 0) rotate(-90deg);
}

/* Standalone card for images without descriptions */
.standalone-card {
  text-align: center;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  margin-bottom: 1.5rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  overflow: visible;
  width: 100%;
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
}

.standalone-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  color: var(--dark-bg);
}

.standalone-card .chart-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
  padding-bottom: 20px; /* Add some bottom padding to prevent cutoff */
  overflow: visible;
}

/* Compact TOC styles */
.outline li {
  margin-bottom: 0.1rem;
  padding: 0.02rem 0;
}

.outline a {
  padding: 0.05rem 0;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  display: block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 0.8rem; /* Decreased font size further */
}

/* Remove extra bottom spacing from the last elements in each section */
section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.card-chart .table-container {
  box-shadow: none; /* Remove shadow from table container in card-chart */
  margin: 0; /* Remove margin to avoid extra space */
}

.card-chart .my-table,
.card-chart .data-table {
  margin: 0; /* Remove margin to avoid extra space */
  box-shadow: none; /* No shadow inside card */
}

/* E7-specific overrides */
section#octant-aggregates .table-container {
  overflow-x: auto !important; /* Force scrolling for these tables */
}

section#octant-aggregates .my-table {
  table-layout: auto !important; /* Override fixed layout in e7 tables */
}

section#octant-aggregates th, 
section#octant-aggregates td {
  width: auto !important; /* Override the 1% width */
  white-space: nowrap !important; /* Keep table headers on one line */
}

/* Data tables specific styles (for e7 and similar tables) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

.data-table th, 
.data-table td {
  text-align: center;
  padding: 8px;
  word-wrap: break-word;
  white-space: normal;
}

.data-table th {
  background-color: var(--dark-bg);
  color: white;
  font-weight: 600;
}

.data-table td {
  color: var(--gray-700);
}

/* Equal width columns for data tables */
.data-table-equal-cols th,
.data-table-equal-cols td {
  width: calc(100% / 7); /* For 7 columns, adjust as needed */
}

/* Column size for data tables */
.data-table-col {
  min-width: 80px; /* Minimum width */
}

/* Fix for specific chart images */
.chart-image img[src*="timing.png"],
.chart-image img[src*="cohorts.png"],
.chart-image img[src*="allocation_combined.png"] {
  max-height: none !important;
  margin-bottom: 20px !important;
}

/* Add extra space for chart containers with these specific images */
.chart-container h2 + .chart-content .chart-image img[src*="timing.png"],
.chart-container h2 + .chart-content .chart-image img[src*="cohorts.png"],
.chart-container h2 + .chart-content .chart-image img[src*="allocation_combined.png"] {
  margin-bottom: 30px !important;
}

/* Special handling for specific chart images */
.chart-image img[src*="timing.png"],
.chart-image img[src*="cohorts.png"],
.chart-image img[src*="donations_distribution.png"],
.chart-image img[src*="allocation_combined.png"],
.chart-image img[src*="user_types.png"],
.chart-image img[src*="transitions.png"] {
  max-height: none !important;
  margin-bottom: 20px !important;
  height: auto !important;
}

/* Ensure parent containers have adequate space */
.chart-container:nth-of-type(n+3):nth-of-type(-n+5) {
  padding-bottom: 3.5rem; /* Extra padding for charts 3-5 which have display issues */
}

/* Nested List Styles */
.nested-list {
  margin-left: 30px;
  list-style-type: circle;
}

/* Summary Section Styles */
.summary-section {
  background-color: rgba(var(--primary-color-rgb), 0.05);
  border-radius: var(--border-radius);
  padding: 2rem 2.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary-color);
}

.summary-section h1 {
  color: var(--primary-dark);
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.summary-section ul {
  padding-left: 1.5rem;
}

.summary-section li {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.summary-section .nested-list {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .summary-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
}


