/* Topic page extras — uses custom.css base styles */

/* Match .section + .section-inner width: padding outside, max-width inside */
.topic-hero {
  max-width: none;
  margin: 0;
  padding: 1.25rem 1rem 0;
}

.topic-hero-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.topic-hero h1 {
  font-size: 1.35rem;
  margin-bottom: 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.topic-hero .topic-lead {
  margin: 0 0 0.75rem;
  color: var(--cool-grey);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  max-width: none;
}

.topic-nav-links {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.topic-nav-links a {
  margin-right: 0.15rem;
}

/* Overview + Selected Papers share one flow so papers sit under the paragraph */
.topic-flow {
  margin-top: 0.5rem;
}

.topic-flow::after {
  content: "";
  display: table;
  clear: both;
}

.topic-overview {
  margin: 0 0 0.55rem;
  line-height: 1.6;
}

.topic-flow > h2 {
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
}

/* Smaller images that float in the text */
.figures-flow {
  float: right;
  width: min(38%, 250px);
  margin: 0.15rem 0 0.85rem 1.1rem;
}

.figures-flow .figure-block {
  margin: 0 0 0.65rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--white);
  overflow: hidden;
}

.figures-flow .figure-block:last-child {
  margin-bottom: 0;
}

.figures-flow img {
  width: 100%;
  height: auto;
  max-height: 130px;
  object-fit: cover;
  margin: 0;
  display: block;
}

.figures-flow .figure-caption {
  margin: 0;
  padding: 0.35rem 0.45rem 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.paper-card {
  padding: 0.85rem 0;
  border-top: 1px dotted var(--line);
}

.paper-card:last-of-type {
  border-bottom: 1px dotted var(--line);
}

.paper-card h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.25rem;
}

.paper-meta {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.paper-summary {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  color: var(--ink);
}

.paper-links {
  margin: 0;
  font-size: 0.88rem;
}

.photo-credit {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: var(--cool-grey);
}

.photo-credit a {
  color: var(--cool-grey);
}

@media (max-width: 700px) {
  .figures-flow {
    float: none;
    width: 100%;
    max-width: 320px;
    margin: 0.35rem auto 0.75rem;
  }

  .figures-flow img {
    max-height: 160px;
  }
}
