/* Support Section Shared Styles */

/* Content container responsive styles */
.content-container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .content-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1024px) {
  .content-container {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* Article card styles (used on index and for child articles) */
.article-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Loading shimmer animation */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Child articles section (displayed on article pages for category parents) */
.child-articles-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.child-articles-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.5rem;
}

/* Prose typography styles (article content) */
.prose {
  max-width: none;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  color: #1f2937;
  font-weight: bold;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h1 { font-size: 2.25rem; line-height: 2.5rem; }
.prose h2 { font-size: 1.875rem; line-height: 2.25rem; }
.prose h3 { font-size: 1.5rem; line-height: 2rem; }
.prose h4 { font-size: 1.25rem; line-height: 1.75rem; }

.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
  color: #374151;
}

.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
  color: #374151;
}

.prose a {
  color: #3b82f6;
  text-decoration: underline;
}

.prose a:hover {
  color: #1d4ed8;
}

.prose blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #6b7280;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

.prose pre {
  background-color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose code {
  background-color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.prose th, .prose td {
  border: 1px solid #e5e7eb;
  padding: 0.75rem 1rem;
  text-align: left;
}

.prose th {
  background-color: #f9fafb;
  font-weight: 600;
}

.prose tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Heading anchor links */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  scroll-margin-top: 100px;
  position: relative;
}

.prose .heading-anchor {
  position: absolute;
  left: -1.5rem;
  opacity: 0;
  color: #9ca3af;
  text-decoration: none;
  font-weight: normal;
  transition: opacity 0.2s;
}

.prose h1:hover .heading-anchor,
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor,
.prose h5:hover .heading-anchor,
.prose h6:hover .heading-anchor {
  opacity: 1;
}

.prose .heading-anchor:hover {
  color: #3b82f6;
}

/* Article layout with sidebar */
.article-layout {
  display: flex;
  gap: 3rem;
}

.article-main {
  flex: 1;
  min-width: 0;
}

/* Table of Contents sidebar */
.toc-sidebar {
  display: none;
  width: 280px;
  flex-shrink: 0;
  align-self: start;
  position: sticky;
  top: 100px;
}

@media (min-width: 1280px) {
  .toc-sidebar {
    display: block;
  }
}

/* TOC container - no independent scrolling needed since scroll spy follows page scroll */
.toc-container {
  /* No max-height or overflow - TOC displays fully and page scroll is sufficient */
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid #e5e7eb;
}

.toc-item {
  margin: 0;
}

.toc-link {
  display: block;
  padding: 0.375rem 0 0.375rem 1rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.4;
  transition: all 0.15s ease;
}

.toc-link:hover {
  color: #3b82f6;
  border-left-color: #93c5fd;
}

.toc-link.active {
  color: #3b82f6;
  border-left-color: #3b82f6;
  font-weight: 500;
}

.toc-link[data-level="3"] {
  padding-left: 2rem;
  font-size: 0.8125rem;
}

.toc-link[data-level="4"] {
  padding-left: 3rem;
  font-size: 0.8125rem;
}

/* Mobile TOC (collapsible) */
.toc-mobile {
  display: block;
  margin-bottom: 2rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  overflow: hidden;
}

@media (min-width: 1280px) {
  .toc-mobile {
    display: none;
  }
}

.toc-mobile-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.toc-mobile-toggle:hover {
  background-color: #f3f4f6;
}

.toc-mobile-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.2s;
}

.toc-mobile.open .toc-mobile-toggle svg {
  transform: rotate(180deg);
}

.toc-mobile-content {
  display: none;
  padding: 0 1rem 1rem;
}

.toc-mobile.open .toc-mobile-content {
  display: block;
}

.toc-mobile .toc-list {
  border-left-color: #d1d5db;
}
