/* Custom color scheme - black background with light gray text */
:root {
  --background: #000000;  /* Black background */
  --foreground: #d0d0d0;  /* Light gray text */
  --accent: #d0d0d0;      /* Light gray accent for links */
  --hover: #ffffff;       /* White for hover */
  --background-secondary: rgba(208,208,208,0.08);  /* Slight gray tint for cards */
  --color: #d0d0d0;       /* Light gray text */
  --color-secondary: #a0a0a0;  /* Darker gray for secondary text */
}

/* Set Times New Roman for body text, but keep headers in original font */
body {
  font-family: 'Times New Roman', Times, serif !important;
}

/* Set headers to Times New Roman */
h1, h2, h3, h4, h5, h6,
.post-title,
.section-title {
  font-family: 'Times New Roman', Times, serif !important;
}

/* Fix any gray text that would be invisible on gray background */
.post-meta,
.post-date,
.post-author {
  color: var(--color-secondary) !important;
}

/* Improve post preview styling */
.post-preview {
  padding: 1.5rem;
  background: rgba(208,208,208,0.05);
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid rgba(208,208,208,0.2);
  transition: box-shadow 0.3s ease;
}

.post-preview:hover {
  box-shadow: 0 4px 12px rgba(208,208,208,0.3);
  background: rgba(208,208,208,0.1);
}

/* Main page specific styling */
/* Make post titles on main page bold, italic, and larger */
.posts .post-title a,
.on-list .post-title a {
  font-weight: bold !important;
  font-style: italic !important;
  font-size: 1.3em !important;  /* 2 points larger */
}

/* Style the précis (short description) */
.post-precis {
  color: var(--color-secondary);
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0.5rem 0;
}

/* Case metadata styling */
.case-metadata {
  font-size: 0.9em;
  color: var(--color-secondary);
  margin: 0.5rem 0;
}

.case-metadata span {
  margin-right: 1rem;
}

/* Better pagination styling */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 3rem 0;
  gap: 0.5rem;
}

.pagination-item {
  padding: 0.5rem 1rem;
  background: rgba(208,208,208,0.1);
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  text-decoration: none;
  color: var(--foreground);
  transition: all 0.3s ease;
}

.pagination-item:hover {
  background: rgba(208,208,208,0.3);
  color: #ffffff;
  border-color: #ffffff;
}

.pagination-item.active {
  background: rgba(208,208,208,0.2);
  color: #ffffff;
  border-color: #d0d0d0;
}

.pagination-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.pagination-ellipsis {
  padding: 0.5rem;
  color: var(--color-secondary);
}

/* Improve readability of links */
a {
  color: var(--accent);
}

a:hover {
  color: var(--hover);
}

/* Fix Terminal theme menu for gray background */
.menu {
  background: var(--background);
  border-color: var(--accent);
}

.menu__inner {
  background: var(--background);
}

/* Fix code blocks for gray background */
pre {
  background: #2d2d2d !important;
  color: #f8f8f2 !important;
}

code {
  background: rgba(0,0,0,0.1);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

/* Fix buttons */
.button,
.btn {
  background: rgba(208,208,208,0.1);
  color: #d0d0d0;
  border: 1px solid #d0d0d0;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.button:hover,
.btn:hover {
  background: rgba(208,208,208,0.2);
  color: #ffffff;
  border-color: #ffffff;
}

/* Read more button styling */
.read-more {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.read-more:hover {
  color: var(--hover);
  text-decoration: underline;
}

/* Change post title divider from dotted to solid line */
.post-title {
  border-bottom: 1px solid var(--accent) !important;
}

/* Fix the hover effect on case cards - prevent gray background drowning out text */
.group:hover > div {
  background-color: transparent !important;
  border-color: #4a9eff !important;
  border-width: 2px !important;
  box-shadow: 0 8px 16px rgba(74, 158, 255, 0.2) !important;
  transform: translateY(-2px);
}

/* Ensure text remains readable on hover */
.group:hover h2,
.group:hover .text-lg {
  color: #4a9eff !important;
}

/* Keep other text visible on hover */
.group:hover .text-gray-700,
.group:hover .dark\:text-gray-300 {
  color: inherit !important;
}

/* Better hover effect for dark mode */
@media (prefers-color-scheme: dark) {
  .group:hover > div {
    border-color: #6bb3ff !important;
    box-shadow: 0 8px 16px rgba(107, 179, 255, 0.3) !important;
  }
  
  .group:hover h2,
  .group:hover .text-lg {
    color: #6bb3ff !important;
  }
}

/* LIGHT THEME - Slate & Steel */
/* Ultra-conservative grayscale with blue links */
html:not(.dark) body {
  background: #FAFAFB !important;
  color: #111827 !important;
  min-height: 100vh;
}

/* Header styling for light mode */
html:not(.dark) .bg-gray-100,
html:not(.dark) header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E5E7EB !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

html:not(.dark) header * {
  color: #111827 !important;
}

/* Navigation items in light mode */
html:not(.dark) nav a {
  color: #111827 !important;
  transition: all 0.3s ease !important;
}

html:not(.dark) nav a:hover {
  color: #1D4ED8 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

/* Card styling for light mode */
html:not(.dark) .bg-white,
html:not(.dark) .dark\:bg-gray-800,
html:not(.dark) article > div {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  box-shadow: none !important;
}

/* Typography for light mode - Headings */
html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4,
html:not(.dark) h5,
html:not(.dark) h6,
html:not(.dark) .text-lg {
  color: #0B1320 !important;
  font-weight: 600 !important;
}

/* Section titles like "Case Documents" - Force dark text */
html:not(.dark) .section-title,
html:not(.dark) .font-bold,
html:not(.dark) .font-semibold,
html:not(.dark) .text-gray-300,
html:not(.dark) .text-gray-400,
html:not(.dark) .text-gray-500,
html:not(.dark) .text-gray-900 {
  color: #0B1320 !important;
}

html:not(.dark) .text-gray-700,
html:not(.dark) .dark\:text-gray-300 {
  color: #111827 !important;
}

html:not(.dark) .text-gray-600,
html:not(.dark) .dark\:text-gray-400 {
  color: #374151 !important;
}

html:not(.dark) .text-gray-500 {
  color: #374151 !important;
}

/* Category tags in light mode - Subtle blue */
html:not(.dark) .bg-blue-100,
html:not(.dark) .dark\:bg-blue-800 {
  background-color: #EFF6FF !important;
  color: #2563EB !important;
  border: 1px solid #DBEAFE !important;
}

/* Light theme hover effect - Minimal */
html:not(.dark) .group:hover > div {
  background: #FFFFFF !important;
  border-color: #2563EB !important;
  border-width: 1px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  transform: none !important;
}

html:not(.dark) .group:hover h2,
html:not(.dark) .group:hover .text-lg {
  color: #2563EB !important;
}

/* Sidebar styling for light mode */
html:not(.dark) aside > div {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  box-shadow: none !important;
}

html:not(.dark) aside h3,
html:not(.dark) aside .text-md {
  color: #0B1320 !important;
  border-bottom: 1px solid #E5E7EB !important;
  padding-bottom: 0.5rem !important;
}

/* Links in light mode */
html:not(.dark) a {
  color: #2563EB !important;
  text-decoration: none !important;
}

html:not(.dark) a:hover {
  color: #1D4ED8 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

/* Search bar in light mode */
html:not(.dark) input {
  background-color: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  color: #111827 !important;
}

html:not(.dark) input:focus {
  outline: none !important;
  border-color: #2563EB !important;
  box-shadow: 0 0 0 2px #93C5FD !important;
}

html:not(.dark) input::placeholder {
  color: #374151 !important;
}

/* Code blocks in light mode */
html:not(.dark) pre {
  background: #F5F7FA !important;
  border: 1px solid #E5E7EB !important;
  color: #374151 !important;
}

html:not(.dark) code {
  background: #F5F7FA !important;
  color: #374151 !important;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

/* Selection color in light mode */
html:not(.dark) ::selection {
  background: #DBEAFE !important;
  color: #111827 !important;
}

html:not(.dark) ::-moz-selection {
  background: #DBEAFE !important;
  color: #111827 !important;
}

/* Buttons in light mode - Minimal blue */
html:not(.dark) .button,
html:not(.dark) .btn {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border: 1px solid #2563EB !important;
}

html:not(.dark) .button:hover,
html:not(.dark) .btn:hover {
  background: #1D4ED8 !important;
  border-color: #1D4ED8 !important;
}

/* Case Briefs button - simple link style, no background */
html:not(.dark) .btn-primary,
html:not(.dark) a.btn {
  color: #2563EB !important;
  background: transparent !important;
  border: 1px solid #2563EB !important;
  text-decoration: none !important;
}

html:not(.dark) .btn-primary:hover,
html:not(.dark) a.btn:hover {
  color: #1D4ED8 !important;
  background: transparent !important;
  border-color: #1D4ED8 !important;
  text-decoration: underline !important;
}

/* Force all text inside blue buttons to be white */
html:not(.dark) .bg-blue-500 *,
html:not(.dark) .bg-blue-600 *,
html:not(.dark) button[class*="blue"] * {
  color: #FFFFFF !important;
}

/* Target Case Brief button by link content - no background */
html:not(.dark) a[href*="brief"] {
  color: #2563EB !important;
  text-decoration: none !important;
}

html:not(.dark) a[href*="brief"]:hover {
  color: #1D4ED8 !important;
  text-decoration: underline !important;
}

/* Fix any gray headings that contain "Case" or "Document" */
html:not(.dark) h1, 
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4 {
  color: #0B1320 !important;
}

/* Force dark text for any element with light gray text classes */
html:not(.dark) [class*="gray-200"],
html:not(.dark) [class*="gray-300"],
html:not(.dark) [class*="gray-400"] {
  color: #374151 !important;
}

/* Focus states in light mode */
html:not(.dark) *:focus-visible {
  outline: 2px solid #93C5FD !important;
  outline-offset: 2px !important;
}

/* Dark theme - restore original black background */
html.dark body,
.dark body {
  background-color: #000000 !important;
  color: #d0d0d0 !important;
}

html.dark .bg-gray-900,
.dark .bg-gray-900 {
  background-color: #000000 !important;
}

html.dark .dark\:bg-gray-800,
.dark .dark\:bg-gray-800 {
  background-color: #1a1a1a !important;
}

html.dark .dark\:text-white,
.dark .dark\:text-white {
  color: #d0d0d0 !important;
}

html.dark .dark\:text-gray-300,
.dark .dark\:text-gray-300 {
  color: #a0a0a0 !important;
}

html.dark .dark\:text-gray-400,
.dark .dark\:text-gray-400 {
  color: #808080 !important;
}