* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Serif Pro", Georgia, serif;
  color: #222;
  background: #fdfcfb;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 2rem 1.5rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.header-nav {
  text-align: left;
  font-size: 0.8125rem;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
  margin-bottom: 1.5rem;
}

.header-nav a {
  color: #666;
  text-decoration: none;
}

.header-nav a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #222;
}

.subtitle {
  font-size: 1rem;
  color: #666;
  margin: 0;
}

main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  width: 100%;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  background: #fff;
  border: 1px solid #e5e5e5;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  border-color: #222;
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #222;
}

.card p {
  margin: 0;
  color: #666;
  font-size: 0.875rem;
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e5e5e5;
}

.stat {
  text-align: center;
}

.stat .number {
  font-size: 1.5rem;
  font-weight: 600;
  color: #222;
  margin: 0;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
}

.stat .label {
  font-size: 0.6875rem;
  color: #888;
  margin: 0.25rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
}

.info-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e5e5e5;
}

.info-section h2 {
  font-family: "Source Sans Pro", -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 0 0 1rem;
}

.info-section p {
  margin: 0 0 1rem;
  color: #444;
  line-height: 1.7;
  font-size: 0.9375rem;
}

.info-section p:last-child {
  margin-bottom: 0;
}

footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: #888;
  font-size: 0.75rem;
  border-top: 1px solid #e5e5e5;
  margin-top: auto;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
}

footer a {
  color: #666;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Controls */
.controls {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
}

.controls label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8125rem;
  color: #444;
}

.controls input[type="search"],
.controls select {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  background: #fff;
}

.controls input[type="search"] {
  flex: 1 1 200px;
}

.controls input[type="search"]:focus,
.controls select:focus {
  outline: none;
  border-color: #222;
}

.controls select {
  min-width: 140px;
  cursor: pointer;
}

/* Case list */
.case-list {
  margin: 1.5rem 0;
}

.case-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  padding: 1.25rem;
  margin-bottom: 1rem;
  text-decoration: none;
  color: inherit;
  display: block;
}

.case-card:hover {
  border-color: #222;
}

.case-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.case-card-header h3 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.priority-badge {
  background: #222;
  color: #fff;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
}

.case-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.insight-badge {
  background: #f5f5f5;
  color: #444;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
  border: 1px solid #e5e5e5;
}

.case-summary {
  margin-top: 0.5rem;
  color: #666;
  font-size: 0.875rem;
  line-height: 1.5;
}

.case-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.case-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
  font-size: 0.75rem;
  color: #888;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border: 1px solid;
}

.status-icon {
  font-size: 0.7rem;
}

.status-badge.ongoing {
  color: #b45309;
  border-color: #b45309;
}

.status-badge.convicted {
  color: #0b6e4f;
  border-color: #0b6e4f;
}

.status-badge.dismissed {
  color: #b23a48;
  border-color: #b23a48;
}

.status-badge.filed {
  color: #3a0ca3;
  border-color: #3a0ca3;
}

.category-tag {
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #222;
  color: #fff;
}

.empty {
  padding: 3rem;
  text-align: center;
  border: 1px dashed #ddd;
  background: #fff;
  color: #888;
}

/* Case detail page */
.case-header {
  background: #fff;
  border: 1px solid #e5e5e5;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.case-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  text-align: left;
}

.case-header .meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.key-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.fact-box {
  background: #fff;
  padding: 1rem;
  border: 1px solid #e5e5e5;
}

.fact-box .label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.25rem;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
}

.fact-box .value {
  font-size: 1rem;
  font-weight: 600;
  color: #222;
}

.section {
  background: #fff;
  border: 1px solid #e5e5e5;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.section h2 {
  font-family: "Source Sans Pro", -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e5e5;
}

.section p {
  margin: 0 0 1rem;
  line-height: 1.7;
  font-size: 0.9375rem;
}

.section ul {
  margin: 1rem 0;
  padding-left: 1.25rem;
}

.section li {
  margin: 0.5rem 0;
  line-height: 1.5;
  font-size: 0.9375rem;
}

.source-link {
  color: #222;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.875rem;
}

.source-link:hover {
  color: #000;
}

@media (max-width: 640px) {
  header {
    padding: 1.5rem 1.25rem 1rem;
  }

  main {
    padding: 0 1.25rem 3rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .case-header h1 {
    font-size: 1.25rem;
  }

  .case-card {
    padding: 1rem;
  }

  .case-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .case-meta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls input[type="search"],
  .controls select {
    width: 100%;
    min-width: auto;
  }
}

/* Accessibility utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #222;
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-family: "Source Sans Pro", -apple-system, sans-serif;
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
