/* FetalMind academic-page extensions. Global colors and surfaces stay in the original theme. */

.academic-skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: var(--surface);
  background: var(--text-main);
  transform: translateY(-180%);
}

.academic-skip-link:focus {
  transform: translateY(0);
}

.academic-hero .hero-body {
  padding-bottom: 1.8rem;
}

.academic-hero .publication-title {
  max-width: 980px;
}

.academic-hero .publication-title img {
  width: 70px;
  height: 70px;
}

.fetalmind-name {
  color: #4c7a93;
  font-weight: 740;
}

.academic-venue {
  width: fit-content;
  margin: 0 auto 1.15rem;
  color: #2980b9;
  font-size: 1.75rem;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.academic-affiliations {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.94rem !important;
  line-height: 1.55;
}

.academic-hero .publication-links {
  margin-top: 1.25rem;
}

.academic-teaser {
  padding: 0 1rem 1.35rem;
  background: transparent;
}

.academic-teaser .container.is-max-desktop {
  width: 100%;
}

.academic-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.academic-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0 !important;
}

.academic-figure figcaption {
  padding: 0.72rem 0.9rem;
  border-top: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}

.academic-figure--overview {
  border-radius: var(--radius-lg);
}

.academic-figure--method figcaption {
  padding: 1rem 1.1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: left;
}

.method-summary {
  max-width: 780px;
  margin: 0 auto 1.5rem;
  color: var(--text-body);
  font-size: 0.98rem;
  line-height: 1.65;
}

.method-summary p + p {
  margin-top: 0.7rem;
}

.method-summary strong {
  color: var(--text-main);
}

.academic-section-heading {
  margin-bottom: 1.25rem;
  text-align: center;
}

.academic-section-heading .title {
  margin-bottom: 0 !important;
}

.academic-section-heading p {
  max-width: 600px;
  margin: 0.55rem auto 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.academic-overview-section .container.is-max-desktop {
  position: relative;
  overflow: hidden;
  padding: 0;
  border-color: rgba(41, 128, 185, 0.24);
  box-shadow: inset 0 4px 0 #2980b9;
}

.overview-header {
  max-width: 650px;
  padding: 2.25rem 2.25rem 1.45rem;
}

.overview-header .title {
  margin-bottom: 0 !important;
  font-size: clamp(1.8rem, 3.5vw, 2.35rem);
}

.overview-header p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.overview-argument {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}

.overview-block {
  padding: 1.6rem 2.25rem 1.7rem;
}

.overview-block--problem {
  background: rgba(41, 128, 185, 0.045);
}

.overview-block--response {
  border-left: 1px solid var(--surface-border);
}

.overview-label {
  margin: 0 0 0.22rem;
  color: #2980b9;
  font-size: 0.76rem;
  font-weight: 720;
}

.overview-block > h3 {
  margin: 0 0 1rem;
  color: var(--text-main);
  font-size: 1.17rem;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.overview-points,
.method-list {
  display: grid;
}

.overview-points article {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--surface-border);
}

.overview-points article:first-child {
  padding-top: 0.2rem;
}

.overview-points article:last-child,
.method-list article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.overview-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-top: 0.06rem;
  border: 1px solid rgba(41, 128, 185, 0.2);
  border-radius: var(--radius-sm);
  color: #2980b9;
  background: rgba(41, 128, 185, 0.07);
  font-size: 0.76rem;
}

.overview-points h4,
.method-list h4 {
  margin: 0;
  color: var(--text-main);
  font-size: 0.96rem;
  font-weight: 690;
}

.overview-points p,
.method-list p {
  margin: 0.25rem 0 0;
  color: var(--text-body);
  font-size: 0.84rem;
  line-height: 1.52;
}

.method-list article {
  position: relative;
  padding: 0.82rem 0 0.82rem 1rem;
  border-bottom: 1px solid var(--surface-border);
}

.method-list article:first-child {
  padding-top: 0.2rem;
}

.method-list article::before {
  position: absolute;
  top: 1.05rem;
  left: 0;
  width: 3px;
  height: 1.55rem;
  border-radius: 3px;
  background: #2980b9;
  content: "";
}

.method-list article:first-child::before {
  top: 0.43rem;
}

.overview-premise {
  display: grid;
  grid-template-columns: minmax(110px, 0.22fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: baseline;
  padding: 1rem 2.25rem 1.1rem;
  background: rgba(41, 128, 185, 0.07);
}

.overview-premise strong {
  color: #2980b9;
  font-size: 0.84rem;
}

.overview-premise p {
  margin: 0;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 610;
}

.academic-stats,
.result-metrics {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--surface-border);
}

.academic-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.academic-stats div,
.result-metrics div {
  padding: 1.1rem 0.75rem;
  border-right: 1px solid var(--surface-border);
  text-align: center;
}

.academic-stats div:last-child,
.result-metrics div:last-child {
  border-right: 0;
}

.academic-stats dt,
.result-metrics dt {
  color: #2980b9;
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.academic-stats dd,
.result-metrics dd {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.result-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.1rem;
}

.ablation-note {
  margin: 1rem 0 0;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid #2980b9;
  color: var(--text-body);
  background: rgba(41, 128, 185, 0.055);
  font-size: 0.85rem;
  line-height: 1.5;
}

.case-study-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, 0.55fr);
  gap: 1.5rem;
  align-items: center;
}

.academic-figure--case {
  width: min(100%, 680px);
  justify-self: center;
}

.case-verdict {
  margin: 0;
  border-top: 1px solid var(--surface-border);
}

.case-verdict div {
  padding: 0.85rem 0.2rem;
  border-bottom: 1px solid var(--surface-border);
}

.case-verdict dt {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.case-verdict dd {
  margin: 0.15rem 0 0;
  color: var(--text-main);
  font-size: 0.96rem;
  font-weight: 650;
}

.case-verdict .is-correct {
  color: #2980b9;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.55fr);
  gap: clamp(1.5rem, 6vw, 4rem);
  align-items: center;
}

.report-layout .title {
  margin-bottom: 0.75rem !important;
}

.report-summary {
  max-width: 480px;
  margin: 0;
  color: var(--text-body);
  font-size: 0.95rem;
}

.academic-figure--report {
  width: min(100%, 350px);
  justify-self: center;
}

html[data-theme="dark"] .academic-figure,
html[data-theme="dark"] .ablation-note {
  border-color: rgba(236, 243, 249, 0.2) !important;
  background: #080b10 !important;
}

html[data-theme="dark"] .academic-venue,
html[data-theme="dark"] .academic-stats dt,
html[data-theme="dark"] .result-metrics dt,
html[data-theme="dark"] .case-verdict .is-correct {
  color: #8cc7f2 !important;
}

html[data-theme="dark"] .ablation-note {
  border-left-color: #8cc7f2 !important;
}

html[data-theme="dark"] .academic-overview-section .container.is-max-desktop {
  border-color: rgba(140, 199, 242, 0.36) !important;
  box-shadow: inset 0 4px 0 #8cc7f2 !important;
}

html[data-theme="dark"] .overview-block--problem,
html[data-theme="dark"] .overview-premise {
  background: rgba(140, 199, 242, 0.075) !important;
}

html[data-theme="dark"] .overview-label,
html[data-theme="dark"] .overview-marker,
html[data-theme="dark"] .overview-premise strong {
  color: #8cc7f2 !important;
}

html[data-theme="dark"] .overview-marker {
  border-color: rgba(140, 199, 242, 0.28) !important;
  background: rgba(140, 199, 242, 0.1) !important;
}

html[data-theme="dark"] .method-list article::before {
  background: #8cc7f2 !important;
}

@media screen and (max-width: 768px) {
  .academic-hero .publication-title img {
    width: 56px;
    height: 56px;
  }

  .academic-venue {
    font-size: 1.35rem;
  }

  .academic-teaser {
    padding: 0 0.5rem 0.9rem;
  }

  .overview-argument,
  .case-study-layout,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .overview-header {
    padding: 1.8rem 1.4rem 1.1rem;
  }

  .overview-block {
    padding: 1.35rem 1.4rem 1.45rem;
  }

  .overview-block--response {
    border-top: 1px solid var(--surface-border);
    border-left: 0;
  }

  .overview-premise {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 1rem 1.4rem 1.1rem;
  }

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

  .academic-stats div:nth-child(2n) {
    border-right: 0;
  }

  .academic-stats div:nth-child(n + 3) {
    border-top: 1px solid var(--surface-border);
  }

  .academic-stats div:last-child {
    grid-column: 1 / -1;
  }

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

  .result-metrics div:nth-child(2n) {
    border-right: 0;
  }

  .result-metrics div:nth-child(n + 3) {
    border-top: 1px solid var(--surface-border);
  }

  .case-verdict {
    width: min(100%, 520px);
    margin: 0 auto;
  }

  .report-layout {
    text-align: center;
  }

  .report-summary {
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .academic-skip-link {
    transition: none;
  }
}
