/* Utility classes */
.hidden {
  display: none !important;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hover-text-blue:hover {
  color: #60a5fa;
}

a {
  text-decoration: none;
}

/* Light mode overrides — must beat inline styles on body */
html.light body,
html:not(.dark) body {
  background-color: #f9fafb !important;
  color: #111827 !important;
}

html.light header,
html:not(.dark) header {
  background-color: #ffffff !important;
  border-bottom-color: #e5e7eb !important;
}

html.light .prose h2,
html:not(.dark) .prose h2 {
  color: #111827 !important;
}

html.light .prose h3,
html:not(.dark) .prose h3 {
  color: #111827 !important;
}

html.light .prose p,
html:not(.dark) .prose p,
html.light .prose li,
html:not(.dark) .prose li {
  color: #374151 !important;
}

html.light .prose strong,
html:not(.dark) .prose strong {
  color: #111827 !important;
}

html.light .prose blockquote,
html:not(.dark) .prose blockquote {
  color: #6b7280 !important;
}

html.light footer,
html:not(.dark) footer {
  border-top-color: #e5e7eb !important;
  color: #6b7280 !important;
}

html.light #search-input {
  background-color: #ffffff !important;
  border-color: #d1d5db !important;
  color: #111827 !important;
}

/* Prose styles for article content */
.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

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

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

.prose li {
  margin-bottom: 0.5rem;
}

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

.prose strong {
  color: white;
  font-weight: 600;
}

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

/* Card/sidebar backgrounds in light mode */
html.light .prose table,
html:not(.dark) .prose table {
  background-color: #ffffff;
}

/* Search input placeholder */
html.light #search-input::placeholder,
html:not(.dark) #search-input::placeholder {
  color: #9ca3af;
}

/* Sidebar cards */
html.light aside > div,
html:not(.dark) aside > div {
  background-color: #ffffff !important;
  border: 1px solid #e5e7eb !important;
}

html.light aside h3,
html:not(.dark) aside h3 {
  color: #111827 !important;
}

html.light aside h4,
html:not(.dark) aside h4 {
  color: #111827 !important;
}

html.light aside p,
html:not(.dark) aside p {
  color: #6b7280 !important;
}

html.light aside a,
html:not(.dark) aside a {
  color: #3b82f6 !important;
}

html.light aside svg,
html:not(.dark) aside svg {
  color: #6b7280 !important;
}

/* Article card text — search page cards */
.search-result h2 {
  color: white !important;
}
.search-result p {
  color: #d1d5db !important;
}
.search-result > div > div > div[style*="color"] {
  color: #9ca3af !important;
}

html.light .search-result h2 {
  color: #111827 !important;
}
html.light .search-result p {
  color: #374151 !important;
}
html.light .search-result > div > div > div[style*="color"] {
  color: #6b7280 !important;
}

html.light .search-result {
  border-bottom-color: #e5e7eb !important;
}

html.light .search-result > div:first-child {
  background-color: #f3f4f6 !important;
}

/* Search input in light mode */
html.light #search-input {
  background-color: #ffffff !important;
  border-color: #d1d5db !important;
  color: #111827 !important;
}

/* Post detail — article borders */
html.light article {
  border-color: #e5e7eb !important;
}
html.light .prose,
html:not(.dark) .prose {
  color: #374151 !important;
}

html.light .prose h2,
html:not(.dark) .prose h2 {
  color: #111827 !important;
}

html.light .prose h3,
html:not(.dark) .prose h3 {
  color: #111827 !important;
}

html.light .prose p,
html:not(.dark) .prose p {
  color: #374151 !important;
}

html.light .prose li,
html:not(.dark) .prose li {
  color: #374151 !important;
}

html.light .prose strong,
html:not(.dark) .prose strong {
  color: #111827 !important;
  font-weight: 600;
}

html.light .prose blockquote,
html:not(.dark) .prose blockquote {
  color: #6b7280 !important;
  border-left-color: #3b82f6;
}

html.light .prose a,
html:not(.dark) .prose a {
  color: #2563eb !important;
}

html.light .prose ul,
html:not(.dark) .prose ul,
html.light .prose ol,
html:not(.dark) .prose ol {
  color: #374151 !important;
}

/* Article page h1 and meta */
html.light article h1,
html:not(.dark) article h1 {
  color: #111827 !important;
}

html.light article > div[style*="9ca3af"],
html:not(.dark) article > div[style*="9ca3af"] {
  color: #6b7280 !important;
}

/* Back link border */
html.light .border-t-1,
html:not(.dark) [style*="border-top: 1px solid #374151"] {
  border-top-color: #e5e7eb !important;
}
