/* ============================================
   Walkable Genotypes — additions to the
   Model Medicine series base style.
   ============================================ */


/* --- Hero with background image --- */
.hero-with-image {
  position: relative;
}

.hero-with-image .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-with-image .hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  /* Push the image's brightness down so overlaid text reads. */
  filter: brightness(0.55) saturate(1.05);
}

.hero-with-image .hero-bg::after {
  /* Vertical fade: full image legible at top-mid, fading to body bg at bottom
     so the hero blends into the next section without a hard seam. */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 8, 13, 0.45) 0%,
    rgba(8, 8, 13, 0.55) 40%,
    rgba(8, 8, 13, 0.85) 80%,
    var(--bg-primary) 100%
  );
}

.hero-with-image .container {
  position: relative;
  z-index: 1;
}

/* The radial accent glow from the base hero competes with the image; mute it. */
.hero-with-image::before {
  display: none;
}


/* --- Section image (decorative section-break visual) ---
   Image and the prose block beneath it share the same centered axis
   (both have `margin: 0 auto` and matching max-widths), so the page
   reads as a single column rather than left-anchored prose floating
   beneath a centered image. */
.section-image {
  margin: 1.5rem auto 2.5rem;
  max-width: 88%;
  text-align: center;
}

.section-image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  /* Pull palette toward the dark site theme without losing the painterly mood. */
  filter: brightness(0.95) saturate(0.9) contrast(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.section-image-small {
  max-width: 72%;
}

@media (max-width: 720px) {
  .section-image,
  .section-image-small {
    max-width: 100%;
  }
}


/* --- Figures --- */
.figure {
  margin: 1.5rem 0 1rem;
  text-align: center;
}

.figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  padding: 0.5rem;
  border: 1px solid var(--border-light);
}

.figure-caption {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 760px;
  margin: 1rem auto 0;
  text-align: left;
}


/* --- Code block --- */
.codeblock {
  background: #050509;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.codeblock pre {
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #c8c8d8;
}

.codeblock code {
  font-family: inherit;
}


/* --- Prose paragraphs (long-form sections) ---
   Centered as blocks (margin: 0 auto) so they share a vertical axis
   with section images. Text within stays left-aligned for readability. */
.prose,
.prose-lead {
  color: var(--text-secondary);
  line-height: 1.85;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.prose {
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.prose-lead {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.subsection-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.005em;
}

.footnote {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 1rem;
  max-width: 720px;
}


/* --- Resources grid --- */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.resource-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transition: background 0.2s, border-color 0.2s;
}

.resource-label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 0.6rem;
}

.resource-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.resource-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex: 1;
}

.resource-desc code {
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--accent-cyan);
  background: rgba(92, 224, 216, 0.08);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}


/* --- Footer additions --- */
.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer-text a {
  color: var(--text-secondary);
}

.footer-text a:hover {
  color: var(--accent);
}
