/* ============================================
   PERFORMANCE OPTIMIZATIONS - Core Web Vitals
   ============================================ */

/* CSS Custom Properties for AutoLifecycle Color Scheme */
:root {
  /* Primary: Charcoal gray - authority, seriousness */
  --color-primary: #2C3E50;
  --color-primary-dark: #1a252f;
  --color-primary-light: #34495e;

  /* Accent: Rust orange - innovation, warmth, distinction */
  --color-accent: #D35400;
  --color-accent-dark: #a04000;
  --color-accent-light: #e67e22;

  /* Background: White/cream - clarity, readability */
  --color-background: #ffffff;
  --color-background-cream: #fefefe;
  --color-background-light: #f8f9fa;

  /* Text: Dark gray - professional, readable */
  --color-text-primary: #333333;
  --color-text-secondary: #666666;
  --color-text-light: #999999;
  --color-text-heading: #000000;

  /* Borders and dividers */
  --color-border: #dee2e6;
  --color-border-light: #e9ecef;

  /* Interactive states */
  --color-hover: #c0392b;
  --color-focus: rgba(211, 84, 0, 0.1);
}

/* Font loading optimization - ensure fonts load quickly */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Optimize image loading - lazy loading via JavaScript fallback */
img {
  max-width: 100%;
  height: auto;
}

/* Optimize animations for 60fps */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reduce paint on scroll */
html {
  scroll-behavior: smooth;
}

/* Optimize rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================
   BASIC AUTOLIFECYCLE STYLES
   ============================================ */

/* Navbar height reduction while keeping logo/title sizes */
.navbar {
  min-height: 90px !important;
  height: 90px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}

.navbar-brand {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Navbar logo sizing */
.navbar-logo {
  max-height: 75px !important;
  height: 75px !important;
  width: auto !important;
}

.navbar-title {
  font-size: 1.8em !important;
  font-weight: 700 !important;
  margin-left: 15px !important;
}

/* ============================================
   THE ECONOMIST TYPOGRAPHY & COLORS
   Based on economist.com design system
   ============================================ */

/* The Economist-style headings - black with serif fonts */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Georgia', 'Times New Roman', serif !important;
  font-weight: 700;
  color: #000000 !important; /* Pure black headings like The Economist */
  line-height: 1.2;
  letter-spacing: -0.02em; /* Slight negative tracking for elegance */
}

/* Main title styling */
h1, .title {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* Subtitle/deck styling */
h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: #666666 !important; /* Gray subtitles like The Economist */
  margin-top: 0;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* Section headings */
h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h4, h5, h6 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* ============================================
   TABLE OF CONTENTS (TOC) FIX
   ============================================ */

/* Sidebar Images */
.sidebar img {
  max-width: 100%;
  margin: 1rem auto;
  border-radius: 8px;
}

/* Post Cards - Subtle hover effect */
.quarto-listing-grid .card {
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quarto-listing-grid .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Reading Time Indicator */
.reading-time {
  font-size: 0.9em;
  color: var(--color-text-secondary); /* Dark gray */
  font-style: italic;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ============================================
   DATA-FORWARD TYPOGRAPHY & VISUAL HIERARCHY
   ============================================ */

/* The Economist-style Links */
a {
  color: var(--color-accent) !important; /* Rust orange accent */
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-hover) !important; /* Darker accent on hover */
  text-decoration: underline;
}

/* Stat Cards - Large Impactful Numbers */
.stat-card {
  background: var(--color-background-light); /* Very light gray background for subtle visual grouping */
  border-radius: 2px; /* Minimal rounding */
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  border-top: 3px solid var(--color-accent); /* Rust orange accent */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* Subtle shadow */
}

.stat-number {
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-accent); /* Rust orange for emphasis */
  line-height: 1;
  margin-bottom: 0.5rem;
  font-family: Georgia, serif;
}

.stat-label {
  font-size: 1.1rem;
  color: var(--color-primary); /* Charcoal gray */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-description {
  font-size: 0.95rem;
  color: var(--color-text-secondary); /* Dark gray */
  margin-top: 0.5rem;
}

/* Multi-stat Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card-mini {
  background: #ffffff;
  border-left: 3px solid #D35400; /* The Economist red */
  padding: 1.5rem;
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-card-mini .stat-number {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.stat-card-mini .stat-label {
  font-size: 0.9rem;
}

/* The Economist-style Callouts */
.callout-tip {
  border-left: 3px solid var(--color-primary) !important; /* Charcoal gray for tips */
  background: var(--color-background-light) !important;
  padding: 1.5rem !important;
  margin: 2rem 0 !important;
  border-radius: 0;
}

.callout-tip .callout-header {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: var(--color-text-heading) !important;
  margin-bottom: 1rem !important;
}

.callout-note {
  border-left: 3px solid var(--color-accent) !important; /* Rust orange for notes */
  background: var(--color-background-light) !important;
  border-radius: 0;
}

.callout-warning {
  border-left: 3px solid var(--color-accent) !important; /* Keep accent for warnings */
  background: #fff5f5 !important;
  border-radius: 0;
}

.callout-tip ol {
  counter-reset: item;
  list-style: none;
  padding-left: 0;
}

.callout-tip ol li {
  counter-increment: item;
  margin-bottom: 1rem;
  padding-left: 2.5rem;
  position: relative;
  line-height: 1.7;
}

.callout-tip ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0;
  background: #D35400; /* The Economist red */
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.callout-tip ol li strong {
  color: #D35400; /* The Economist red */
  font-weight: 700;
}

/* Data Points & Technical Numbers */
.data-point {
  font-family: "Roboto Mono", "SF Mono", Monaco, "Courier New", monospace;
  background: #f8f9fa;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.95em;
  color: #2C3E50;
  border: 1px solid #e9ecef;
}

/* Pull Quotes - The Economist style */
.pull-quote {
  font-size: 1.4rem;
  font-weight: 400;
  color: #1a1a1a;
  border-left: 3px solid #D35400; /* The Economist red */
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  line-height: 1.6;
}

/* The Economist-style Content Width */
.quarto-container {
  max-width: 1200px !important;
}

article {
  max-width: 680px; /* The Economist uses narrow columns for readability */
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Paragraphs - generous spacing like The Economist */
p {
  margin-bottom: 1.2rem;
  line-height: 1.7;
}

/* First paragraph drop cap style (optional) */
article > p:first-of-type::first-letter {
  font-size: 3.5em;
  font-weight: 700;
  line-height: 0.8;
  float: left;
  margin: 0.1em 0.1em 0 0;
  color: #D35400;
}

/* Wide Layout for Data Visualizations */
.full-width {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Data Table Styling - The Economist minimal style */
table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead {
  border-bottom: 2px solid #1a1a1a;
}

thead th {
  padding: 0.75rem 1rem;
  font-weight: 700;
  text-align: left;
  color: #1a1a1a;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

tbody tr {
  border-bottom: 1px solid #e5e5e5;
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: #f9f9f9;
}

tbody td {
  padding: 0.75rem 1rem;
  color: #1a1a1a;
}

/* Figure Captions - The Economist style */
figcaption {
  font-size: 0.85rem;
  color: #666666;
  font-style: normal;
  text-align: left;
  margin-top: 0.5rem;
  line-height: 1.5;
  padding-left: 0.5rem;
  border-left: 2px solid #e5e5e5;
}

/* Visualization Spacing */
img, figure {
  margin: 2rem 0;
}

/* Images should be full width within article */
article img {
  width: 100%;
  height: auto;
}

/* Hero section styling - The Economist clean style */
.hero-section {
  text-align: center;
  padding: 3rem 2rem 2rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 3rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #666666;
  margin: 1rem auto;
  max-width: 680px;
  line-height: 1.6;
  font-weight: 400;
}

.hero-stat {
  color: #D35400; /* The Economist red */
  font-weight: 700;
  font-size: 1.3rem;
}

/* ============================================= */
/* POST CARD ENHANCEMENTS FOR BLOG LISTING */
/* ============================================= */

/* ============================================= */
/* MOBILE OPTIMIZATIONS - COMPREHENSIVE */
/* ============================================= */

/* Mobile-first responsive design */
@media (max-width: 768px) {
  /* General mobile typography */
  body {
    font-size: 16px; /* Prevent zoom on iOS */
    line-height: 1.6;
  }

  /* Mobile navbar optimizations */
  .navbar {
    min-height: 60px !important;
    padding: 0.5rem 1rem !important;
  }

  .navbar-brand {
    padding: 0 !important;
  }

  .navbar-logo {
    max-height: 50px !important;
    height: 50px !important;
  }

  .navbar-title {
    font-size: 1.5em !important;
    margin-left: 8px !important;
  }

  /* Mobile sidebar behavior */
  #quarto-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background: white !important;
    z-index: 1050 !important;
    transition: left 0.3s ease !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1) !important;
    overflow-y: auto !important;
  }

  #quarto-sidebar.show {
    left: 0 !important;
  }

  /* Sidebar toggle button for mobile */
  .sidebar-toggle {
    display: block !important;
    position: fixed !important;
    top: 15px !important;
    left: 15px !important;
    z-index: 1060 !important;
    background: #D35400 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  }

  /* Mobile content adjustments */
  main {
    margin-left: 0 !important;
    padding: 1rem !important;
  }

  .content {
    padding: 1rem !important;
  }

  /* Mobile article layout */
  article {
    max-width: 100% !important;
    padding: 1rem !important;
    margin: 0 !important;
  }

  /* Mobile table responsiveness */
  table {
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }

  thead {
    display: none; /* Hide headers on mobile */
  }

  tbody tr {
    display: block;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 1rem;
    padding: 1rem;
  }

  tbody td {
    display: block;
    text-align: left;
    border: none;
    padding: 0.5rem 0;
    position: relative;
    padding-left: 50%;
  }

  tbody td:before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 600;
    color: #666;
  }

  /* Mobile form elements */
  input[type="email"],
  input[type="text"],
  textarea,
  select {
    width: 100% !important;
    padding: 12px !important;
    font-size: 16px !important; /* Prevent zoom on iOS */
    border: 2px solid #ddd !important;
    border-radius: 4px !important;
    margin-bottom: 1rem !important;
  }

  button {
    min-height: 44px !important; /* Touch target size */
    padding: 12px 24px !important;
    font-size: 16px !important;
  }

  /* Mobile callouts and alerts */
  .callout-tip,
  .callout-note,
  .callout-warning {
    padding: 1rem !important;
    margin: 1rem 0 !important;
  }

  /* Mobile stat cards */
  .stat-card {
    padding: 1.5rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .stat-number {
    font-size: 2.5rem !important;
  }

  /* Mobile hero section */
  .hero-section {
    padding: 2rem 1rem !important;
    text-align: center !important;
  }

  .hero-title {
    font-size: 1.8rem !important;
  }

  .hero-subtitle {
    font-size: 1.1rem !important;
  }

  /* Mobile pull quotes */
  .pull-quote {
    font-size: 1.1rem !important;
    padding: 1rem !important;
    margin: 1.5rem 0 !important;
  }

  /* Mobile code blocks */
  pre, code {
    font-size: 0.9rem !important;
    overflow-x: auto !important;
  }

  /* Mobile images */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Mobile figure captions */
  figcaption {
    font-size: 0.8rem !important;
    padding: 0.5rem !important;
  }

  /* Mobile navigation links */
  a {
    padding: 0.5rem 0 !important;
    display: inline-block !important;
  }

  /* Mobile footer */
  .page-footer {
    padding: 2rem 1rem !important;
    text-align: center !important;
  }

  /* Mobile search */
  #quarto-search {
    width: 100% !important;
    margin: 1rem 0 !important;
  }

  /* Mobile TOC */
  #TOC {
    position: static !important;
    margin: 2rem 0 !important;
    padding: 1rem !important;
    background: #f8f9fa !important;
    border-radius: 4px !important;
  }

  /* Mobile series navigation */
  .series-nav {
    padding: 1rem !important;
  }

  .nav-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .nav-item {
    text-align: center !important;
    padding: 1rem !important;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .navbar-title {
    font-size: 1.3em !important;
    display: none; /* Hide title on very small screens to save space */
  }

  .hero-title {
    font-size: 1.5rem !important;
  }

  .stat-number {
    font-size: 2rem !important;
  }

  .callout-tip ol li {
    padding-left: 2rem !important;
  }

  /* Stack everything vertically on very small screens */
  .stats-grid,
  .nav-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .quarto-post:hover {
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
  }

  a:hover {
    text-decoration: none !important;
  }

  /* Larger touch targets */
  button,
  .btn,
  a.nav-link {
    min-height: 44px !important;
    min-width: 44px !important;
  }
}

/* ============================================= */
/* SCROLL-TO-TOP BUTTON - MOBILE FRIENDLY */
/* ============================================= */

#scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--color-accent); /* Rust orange accent */
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#scroll-to-top:hover {
  background: #c00a05;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#scroll-to-top:focus {
  outline: 2px solid #D35400;
  outline-offset: 2px;
}

/* Mobile adjustments for scroll-to-top */
@media (max-width: 768px) {
  #scroll-to-top {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}

/* Base card styling - The Economist minimal style */
.quarto-post {
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-top: 3px solid #D35400; /* The Economist red */
  background: white;
  height: 100%;
}

.quarto-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* All posts use The Economist red for consistency */

/* Enhanced card image with zoom effect */
.quarto-post .listing-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.quarto-post:hover .listing-image {
  transform: scale(1.05);
}

/* Card title styling - The Economist */
.quarto-post .listing-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.quarto-post .listing-title a {
  color: #000000 !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

.quarto-post .listing-title a:hover {
  color: #D35400 !important; /* The Economist red */
}

/* Card description */
.quarto-post .listing-description {
  color: #666;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Category badges */
.quarto-post .listing-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.quarto-post .listing-category {
  background: #e9ecef;
  color: #2C3E50;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.quarto-post .listing-category:hover {
  background: #D35400; /* The Economist red */
  color: white;
}

/* Date styling - The Economist */
.quarto-post .listing-date {
  color: #666666;
  font-size: 0.85rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

/* Card body padding */
.quarto-post .card-body {
  padding: 1.5rem;
}

/* Responsive Typography & Cards */
@media (max-width: 768px) {
  .stat-number {
    font-size: 3rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .pull-quote {
    font-size: 1.2rem;
    padding-left: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  /* Mobile post card adjustments */
  .quarto-post .listing-title {
    font-size: 1.2rem;
  }
  
  .quarto-post .listing-image {
    height: 160px;
  }
  
  .quarto-post .card-body {
    padding: 1rem;
  }
}

/* ============================================= */
/* INTERACTIVE ELEMENTS & POLISH */
/* ============================================= */

/* Scroll-to-Top Button - The Economist style */
#scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: #D35400; /* The Economist red */
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(227, 18, 11, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

#scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#scroll-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(227, 18, 11, 0.4);
}

/* Sidebar Styling - The Economist minimal style */
.sidebar {
  background: #ffffff;
  border-radius: 0;
  padding: 1.5rem;
  border-right: 1px solid #e5e5e5;
}

.sidebar .sidebar-title {
  font-weight: 700;
  color: #000000;
  font-size: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #D35400; /* The Economist red */
  padding-bottom: 0.5rem;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
}

.sidebar nav li {
  margin-bottom: 0.5rem;
  transition: background 0.2s ease;
}

.sidebar nav li:hover {
  background: #f9f9f9;
}

.sidebar nav a {
  color: #1a1a1a !important;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
  display: block;
  padding: 0.5rem;
  border-radius: 0;
}

.sidebar nav a:hover {
  color: #D35400 !important; /* The Economist red */
  background: transparent;
}

/* Category Count Badges - The Economist style */
.sidebar .category-count {
  background: #D35400; /* The Economist red */
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

/* Newsletter Form Enhancement */
.sidebar form {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-top: 2rem;
}

.sidebar form input[type="email"] {
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar form input[type="email"]:focus {
  border-color: #3498DB;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  outline: none;
}

.sidebar form button {
  background: linear-gradient(135deg, #3498DB 0%, #2980b9 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  margin-top: 0.75rem;
}

.sidebar form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Loading Animation for Images */
img {
  transition: opacity 0.3s ease;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Focus Styles for Accessibility */
a:focus, button:focus, input:focus {
  outline: 3px solid #3498DB;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  #scroll-to-top,
  .sidebar,
  .navbar {
    display: none;
  }
  
  .quarto-post {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   SERIES NAVIGATION STYLES
   ============================================ */

.series-navigation {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.series-progress {
  margin-bottom: 1rem;
}

.progress-bar {
  background: #e9ecef;
  border-radius: 10px;
  height: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, #0a4b78 0%, #8b1538 100%);
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: #6c757d;
  font-weight: 500;
}

.coming-soon {
  color: #8b1538;
  font-weight: 600;
  font-size: 1.1rem;
}

.coming-soon small {
  color: #6c757d;
  font-weight: 400;
  font-size: 0.85rem;
}

.teaser {
  color: #495057;
  font-style: italic;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.series-navigation a {
  color: #0a4b78;
  text-decoration: none;
  font-weight: 500;
}

.series-navigation a:hover {
  color: #8b1538;
  text-decoration: underline;
}

/* ============================================
   ADVANCED SERIES PROGRESS BAR STYLES
   ============================================ */

.series-progress-advanced {
  background: #ffffff;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 2.5rem;
  margin: 3rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 1rem;
}

.progress-header h4 {
  margin: 0;
  color: #0a4b78;
  font-size: 1.4rem;
  font-weight: 600;
  font-family: 'Charter', 'Times New Roman', 'Georgia', serif;
  letter-spacing: -0.02em;
}

.progress-count {
  background: #0a4b78;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: 'Charter', 'Times New Roman', 'Georgia', serif;
}

.progress-bar-advanced {
  position: relative;
  background: #f8f9fa;
  border-radius: 20px;
  height: 8px;
  margin-bottom: 2.5rem;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.progress-fill-advanced {
  background: linear-gradient(90deg, #0a4b78 0%, #8b1538 100%);
  height: 100%;
  border-radius: 20px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill-advanced::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 40%);
  border-radius: 20px;
}

.progress-marker {
  position: absolute;
  top: -6px;
  width: 24px;
  height: 24px;
  background: white;
  border: 2px solid #0a4b78;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #0a4b78;
  transform: translateX(-50%);
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Charter', 'Times New Roman', 'Georgia', serif;
}

.progress-marker.active {
  background: #0a4b78;
  color: white;
  border-color: #0a4b78;
  transform: translateX(-50%) scale(1.15);
  box-shadow: 0 2px 6px rgba(10, 75, 120, 0.25);
}

.progress-marker:hover {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 1px 4px rgba(10, 75, 120, 0.2);
}

.progress-navigation-advanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.nav-previous, .nav-next {
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  text-align: center;
  font-family: 'Charter', 'Times New Roman', 'Georgia', serif;
  font-size: 0.9rem;
}

.nav-previous {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.nav-previous:hover:not(.disabled) {
  background: #0a4b78;
  color: white;
  border-color: #0a4b78;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(10, 75, 120, 0.15);
}

.nav-next {
  background: #8b1538;
  color: white;
  border: 1px solid #8b1538;
}

.nav-next:hover:not(.disabled) {
  background: #a62b4c;
  border-color: #a62b4c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(139, 21, 56, 0.25);
}

.nav-previous.disabled, .nav-next.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.nav-overview {
  background: #0a4b78;
  color: white;
  padding: 0.8rem 1.8rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-family: 'Charter', 'Times New Roman', 'Georgia', serif;
  font-size: 0.9rem;
  border: 1px solid #0a4b78;
}

.nav-overview:hover {
  background: #083058;
  border-color: #083058;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(10, 75, 120, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
  .series-progress-advanced {
    padding: 2rem 1.5rem;
    margin: 2rem 0;
  }

  .progress-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
  }

  .progress-header h4 {
    font-size: 1.2rem;
  }

  .progress-navigation-advanced {
    flex-direction: column;
    gap: 1rem;
    padding-top: 0.75rem;
  }

  .nav-previous, .nav-next, .nav-overview {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
  }

  .nav-overview {
    order: -1;
    margin-bottom: 0.5rem;
  }
}
