/* Reusable Kojable research publication components */
.research-article {
  --research-surface: var(--guide-bg, #ffffff);
  --research-surface-soft: var(--guide-bg-soft, #f7f6f9);
  --research-text: var(--guide-text, #172121);
  --research-text-soft: var(--guide-text-soft, #5a6368);
  --research-border: var(--guide-border, #e5e7eb);
  --research-accent: var(--guide-green, var(--accent-primary));
  --research-accent-soft: var(--guide-green-soft, var(--green-50));
  overflow: clip;
}

.research-article img {
  display: block;
  max-width: 100%;
  height: auto;
}

.research-article h2[id],
.research-article h3[id],
.research-article section[id] {
  scroll-margin-top: 6rem;
}

.research-breadcrumb {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding-top: 1rem;
  color: var(--research-text-soft);
  font-size: 0.875rem;
}

.research-breadcrumb a {
  color: var(--guide-green-support);
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.research-hero {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.research-hero__layout {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.research-hero__copy {
  min-width: 0;
}

.research-hero h1 {
  max-width: 17ch;
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  letter-spacing: -0.04em;
}

.research-hero__subtitle {
  max-width: 62ch;
  margin: 1.25rem 0 0;
  color: var(--research-text-soft);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.research-hero__answer {
  max-width: 62ch;
  margin: 1.25rem 0 0;
  padding: 1rem 1.125rem;
  border-left: 0.35rem solid var(--research-accent);
  border-radius: var(--guide-radius-md);
  background: var(--research-accent-soft);
  color: var(--research-text);
  line-height: 1.6;
}

.research-hero__answer strong {
  font-weight: 800;
}

.research-result-qualification {
  max-width: 66ch;
  margin: 0.85rem 0 0;
  color: var(--research-text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.research-hero__visual {
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-lg);
  background: var(--research-surface);
  box-shadow: 0 24px 60px rgba(23, 33, 33, 0.12);
}

.research-hero__visual img {
  border-radius: calc(var(--guide-radius-lg) - 0.25rem);
}

.research-summary-section {
  padding: 0 0 clamp(3rem, 7vw, 5rem);
}

.research-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.research-summary-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-md);
  background: var(--research-surface);
  box-shadow: 0 8px 24px rgba(23, 33, 33, 0.05);
}

.research-summary-card strong {
  display: block;
  color: var(--research-text);
  font-family: var(--font-family-heading, var(--guide-font));
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.1;
}

.research-summary-card span {
  display: block;
  margin-top: 0.45rem;
  color: var(--research-text-soft);
  font-size: 0.875rem;
  line-height: 1.4;
}

.research-summary-card--qualified {
  border-color: color-mix(in srgb, var(--research-accent) 35%, var(--research-border));
  background: var(--research-accent-soft);
}

.research-summary-qualification {
  margin: 0.85rem 0 0;
  padding: 0.9rem 1rem;
  border-left: 0.25rem solid var(--research-accent);
  color: var(--research-text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.research-layout {
  width: min(1060px, calc(100% - 3rem));
  margin: 0 auto;
  padding-bottom: 5rem;
}

.research-toc {
  margin-bottom: 2rem;
  padding: 1.125rem;
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-md);
  background: var(--research-surface-soft);
}

.research-toc h2 {
  margin: 0;
  font-size: 1rem;
}

.research-toc ol {
  margin: 0.85rem 0 0;
  padding-left: 1.2rem;
}

.research-toc li + li {
  margin-top: 0.45rem;
}

.research-toc a {
  color: var(--research-text-soft);
  font-size: 0.875rem;
  line-height: 1.35;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

.research-toc a:hover {
  color: var(--guide-green-support);
}

.research-content {
  min-width: 0;
}

.research-section {
  padding: clamp(2.5rem, 6vw, 4.25rem) 0;
  border-top: 1px solid var(--research-border);
}

.research-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.research-section h2 {
  max-width: 23ch;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
}

.research-section h3 {
  margin: 2rem 0 0;
  color: var(--research-text);
  font-family: var(--font-family-heading, var(--guide-font));
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.25;
}

.research-section p,
.research-section li {
  color: var(--research-text-soft);
  line-height: 1.75;
}

.research-section p {
  margin: 1rem 0 0;
}

.research-section ul,
.research-section ol {
  margin: 1rem 0 0;
  padding-left: 1.4rem;
}

.research-section li + li {
  margin-top: 0.4rem;
}

.research-section blockquote {
  margin: 1.5rem 0 0;
  padding: 1.1rem 1.25rem;
  border-left: 0.35rem solid var(--research-accent);
  background: var(--research-accent-soft);
}

.research-section blockquote p {
  margin: 0;
  color: var(--research-text);
  font-weight: 700;
}

.research-direct-answer {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--research-accent) 28%, var(--research-border));
  border-radius: var(--guide-radius-lg);
  background: linear-gradient(145deg, var(--research-accent-soft), var(--research-surface));
}

.research-direct-answer h2 {
  max-width: none;
}

.research-direct-answer p:first-of-type {
  color: var(--research-text);
  font-size: 1.1rem;
  font-weight: 800;
}

.research-illustration {
  margin: 2rem 0 0;
  padding: 0.65rem;
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-lg);
  background: var(--research-surface);
}

.research-illustration img {
  border-radius: calc(var(--guide-radius-lg) - 0.25rem);
}
.research-table-wrap {
  margin-top: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-md);
  background: var(--research-surface);
  -webkit-overflow-scrolling: touch;
}

.research-table-wrap:focus-visible {
  outline: 3px solid var(--research-accent);
  outline-offset: 3px;
}

.research-results-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  color: var(--research-text-soft);
  font-size: 0.875rem;
  line-height: 1.5;
}

.research-results-table caption {
  padding: 1rem;
  color: var(--research-text);
  font-weight: 800;
  text-align: left;
}

.research-results-table th,
.research-results-table td {
  padding: 0.8rem;
  border-top: 1px solid var(--research-border);
  vertical-align: top;
  text-align: left;
}

.research-results-table thead th,
.research-results-table tbody th {
  color: var(--research-text);
  font-weight: 800;
}

.research-results-table thead th {
  background: var(--research-surface-soft);
}

.research-platform {
  margin-top: 2.25rem;
  padding-top: 0.25rem;
}

.research-platform + .research-platform {
  padding-top: 2rem;
  border-top: 1px dashed var(--research-border);
}

.research-platform h3 {
  margin-top: 0;
}

.research-inline-qualification {
  padding: 0.9rem 1rem;
  border-left: 0.25rem solid var(--research-accent);
  background: var(--research-surface-soft);
  font-size: 0.925rem;
}

.research-caution {
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 2px solid color-mix(in srgb, var(--research-accent) 45%, var(--research-border));
  border-radius: var(--guide-radius-lg);
  background: var(--research-accent-soft);
}

.research-caution h2 {
  max-width: 26ch;
}

.research-caution p,
.research-caution li {
  color: var(--research-text);
}

.research-figure {
  max-width: 100%;
  margin: 2.25rem 0 0;
}

.research-figure--wide {
  width: 100%;
  max-width: 100%;
}

.research-figure__viewport {
  max-width: 100%;
  overflow: hidden;
  padding: 0.65rem;
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-lg);
  background: var(--research-surface);
  box-shadow: 0 12px 32px rgba(23, 33, 33, 0.06);
}

.research-figure__viewport a {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.research-figure__viewport img {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: calc(var(--guide-radius-lg) - 0.25rem);
}

.research-figure figcaption {
  margin-top: 0.85rem;
  color: var(--research-text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.research-figure__fullsize {
  display: inline-block;
  margin-top: 0.65rem;
  color: var(--guide-green-support);
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.research-recommendations {
  counter-reset: research-recommendation;
  list-style: none;
  padding: 0 !important;
}

.research-recommendations > li {
  counter-increment: research-recommendation;
  position: relative;
  margin-top: 1rem;
  padding: 1.25rem 1.25rem 1.25rem 4rem;
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-md);
  background: var(--research-surface);
}

.research-recommendations > li::before {
  content: counter(research-recommendation, decimal-leading-zero);
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--research-accent);
  color: var(--research-text);
  font-size: 0.75rem;
  font-weight: 900;
}

.research-recommendations h3,
.research-recommendations p {
  margin-top: 0;
}

.research-recommendations h3 {
  font-size: 1.1rem;
}

.research-process-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.research-process-card {
  position: relative;
  padding: 1.15rem;
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-md);
  background: var(--research-surface-soft);
}

.research-process-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.research-process-card p {
  margin-top: 0.5rem;
}

.research-limitations {
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--guide-radius-lg);
  background: var(--research-surface-soft);
}
.research-disclosures h3 {
  margin-top: 2.25rem;
}

.research-author {
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--research-border);
  border-radius: var(--guide-radius-lg);
  background: var(--research-surface-soft);
}

.research-author h2 {
  max-width: none;
}

.research-author a {
  color: var(--guide-green-support);
  font-weight: 800;
  text-underline-offset: 0.2em;
}

.research-faq article {
  padding: 1.25rem 0;
  border-top: 1px solid var(--research-border);
}

.research-faq article:first-of-type {
  margin-top: 1rem;
}

.research-faq h3,
.research-faq article p {
  margin-top: 0;
}

.research-cta {
  margin-top: 1rem;
  padding: clamp(1.5rem, 5vw, 2.75rem);
  border-radius: var(--guide-radius-lg);
  background: var(--research-text);
  color: var(--research-surface);
}

.research-cta h2,
.research-cta p {
  color: inherit;
}

.research-cta .btn {
  margin-top: 1.25rem;
}

@media (min-width: 720px) {
  .research-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .research-process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .research-hero__layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  }

  .research-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 760px);
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: start;
  }

  .research-toc {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    margin: 0;
    overflow-y: auto;
  }
}

@media (max-width: 719px) {
  .research-breadcrumb,
  .research-layout {
    width: min(100% - 2rem, 1120px);
  }

  .research-summary-grid {
    grid-template-columns: 1fr;
  }

  .research-recommendations > li {
    padding: 3.75rem 1rem 1rem;
  }

  .research-recommendations > li::before {
    top: 1rem;
    left: 1rem;
  }
}

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

@media (prefers-color-scheme: dark) {
  .research-hero__visual,
  .research-summary-card,
  .research-illustration,
  .research-figure__viewport,
  .research-recommendations > li {
    box-shadow: none;
  }

  .research-cta {
    background: var(--research-surface-soft);
    color: var(--research-text);
  }
}
