/* Scoped styles for /research/[id] detail pages */

.research-root {
  background: var(--background, #ffffff);
  color: var(--foreground, #0f172a);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Releases the PageStylesheet gate */
  visibility: visible;
  animation: none;
}

.dark .research-root {
  background: var(--background);
  color: var(--foreground);
}

.research-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 28px 96px;
}

/* Back link */
.research-back {
  margin-bottom: 32px;
}

.research-back a {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.research-back a:hover {
  text-decoration: underline;
}

/* H1 */
.research-h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
  color: var(--foreground);
}

/* Note / callout */
.research-note {
  background: var(--muted);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--muted-foreground);
  margin-bottom: 8px;
  line-height: 1.55;
}

/* Sections */
.research-section {
  margin-top: 40px;
  border-top: 1px solid var(--border);
}

.research-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.research-section h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  /* text-transform: uppercase; */
  color: var(--primary);
  margin: 0 0 16px;
  padding: 16px 0 10px;
  border-bottom: 1px solid var(--border);
}

.research-section p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--foreground);
  margin-bottom: 12px;
}

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

.research-section a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.research-section a:hover {
  opacity: 0.8;
}

/* Decision Output DL */
.research-dl {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.research-dl-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.6;
}

.research-dl-row dt {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--foreground);
  padding-top: 2px;
}

.research-dl-row dd {
  color: var(--muted-foreground);
  margin: 0;
}

/* Ordered list */
.research-ol {
  list-style: none;
  counter-reset: method;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.research-ol li {
  counter-increment: method;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--foreground);
}

.research-ol li::before {
  content: counter(method) '.';
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  color: var(--primary);
  padding-top: 3px;
}

/* Unordered list */
.research-ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.research-ul li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--foreground);
}

.research-ul li::before {
  content: '—';
  font-size: 13px;
  color: var(--muted-foreground);
  padding-top: 2px;
}

.research-ul a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Case Study */
.research-case h2 {
  margin-bottom: 0;
}

.research-case-inner {
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.65;
}

.research-case-inner p {
  margin: 0;
  font-size: 14.5px;
}

.research-case-inner strong {
  font-weight: 700;
  color: var(--foreground);
}

/* Last updated */
.research-updated {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

/* Footer */
.research-footer {
  background: var(--background);
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
  padding: 32px 0 27px;
  margin-top: 40px;
}

.research-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
}

/* Responsive */
@media (max-width: 640px) {
  .research-wrap {
    padding: 32px 16px 72px;
  }

  .research-dl-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .research-dl-row dt {
    font-size: 11.5px;
  }
}
