@media (max-width:1100px){
  .hero{grid-template-columns:1fr}
  .grid{grid-template-columns:1fr}

  /* Hide desktop TOC on tablets */
  .toc{display:none}

  /* Show mobile TOC toggle button */
  .mobile-toc-toggle {
    display: flex !important;
  }
}
@media (max-width:780px){
  .facts{grid-template-columns:1fr 1fr}

  /* Author box responsive */
  .author-box {
    padding: 20px;
  }

  .author-content {
    flex-direction: column;
    text-align: center;
  }

  .author-info {
    width: 100%;
  }

  .share-buttons {
    justify-content: center;
  }

  .share-btn span {
    display: none;
  }

  .share-btn {
    padding: 10px 12px;
  }

  /* Mobile-specific improvements */
  .article {
    font-size: 16px;
    line-height: 1.75;
  }

  .article p {
    font-size: 16px;
  }

  .article h2 {
    font-size: 24px;
    margin-top: 20px;
  }

  .article h3 {
    font-size: 20px;
    margin-top: 18px;
  }

  /* Better touch targets */
  .article a {
    padding: 2px 0;
    text-decoration-thickness: 2px;
  }

  /* Improved table scrolling */
  .article table {
    font-size: 14px;
  }

  /* Hide reading time badge on very small screens */
  .reading-time-badge {
    display: none;
  }

  /* Adjust quick navigation buttons */
  .quick-nav {
    bottom: 20px;
    right: 10px;
  }

  .quick-nav-btn {
    width: 44px;
    height: 44px;
  }
}

/* Mobile TOC Drawer */
.mobile-toc-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--brand);
  color: white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(38, 92, 115, 0.25);
  z-index: 100;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  font-size: 24px;
}

.mobile-toc-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(38, 92, 115, 0.3);
}

.mobile-toc-toggle::before {
  content: '☰';
  font-weight: bold;
}

.mobile-toc-toggle.open::before {
  content: '✕';
}

/* TOC Mobile Drawer */
.toc-mobile-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  z-index: 99;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.toc-mobile-drawer.open {
  transform: translateY(0);
}

/* Drawer Handle */
.toc-drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 12px auto 8px;
}

/* Drawer Header */
.toc-drawer-header {
  padding: 8px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fafbfc);
}

.toc-drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

/* Drawer Content */
.toc-drawer-content {
  padding: 16px 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.toc-mobile-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-mobile-item {
  margin: 0;
}

.toc-mobile-link {
  display: block;
  padding: 12px 16px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 15px;
}

.toc-mobile-link:hover,
.toc-mobile-link.active {
  background: linear-gradient(135deg, rgba(38, 92, 115, 0.08), rgba(200, 217, 7, 0.05));
  color: var(--brand);
  font-weight: 600;
}

/* Backdrop for mobile drawer */
.toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 98;
}

.toc-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Very small devices (max-width: 480px) */
@media (max-width: 480px) {
  .wrap {
    padding: 16px 12px;
  }

  .article > .card.pad,
  .article > .card {
    padding: 0px;
    border-radius: 8px;
  }

  .title {
    font-size: 26px;
  }

  .article blockquote {
    padding: 16px 16px 16px 40px;
    margin: 20px 0;
  }

  .article blockquote::before {
    font-size: 40px;
    left: 10px;
    top: 15px;
  }

  /* Optimize CTA sidebar for mobile */
  .cta-sidebar-widget {
    position: static;
    margin: 20px 0;
    padding: 24px 16px;
  }

  /* Drop cap adjustment for small screens */
  .article > .card.pad > p:first-of-type:first-letter,
  .article > .card > p:first-of-type:first-letter {
    font-size: 56px;
    margin-right: 6px;
  }

  /* Mobile-optimized facts grid */
  .facts {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .fact {
    padding: 12px 0;
  }

  /* Mobile-optimized key takeaways */
  .article .key-takeaways {
    padding: 16px;
    margin: 20px 0;
  }

  .article .key-takeaways h3 {
    font-size: 18px;
  }

  /* Adjust pager for mobile */
  .pager {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Landscape mobile adjustments */
@media (max-width: 780px) and (orientation: landscape) {
  .mobile-toc-toggle {
    bottom: 10px;
    right: 10px;
    width: 48px;
    height: 48px;
  }

  .toc-mobile-drawer {
    max-height: 80vh;
  }

  .quick-nav {
    flex-direction: row;
    bottom: 10px;
    right: 70px;
  }
}