/* Reinforcement learning for uncalibrated decisions · page-local styles, layered on /styles.css */

.post-body {
  max-width: 720px;
  margin: 0 auto;
}

.post-body p {
  font-size: clamp(16px, 1.1vw, 17px);
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 1.6em;
}

.post-body__heading {
  font-size: clamp(20px, 1.4vw, 22px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 2.4em 0 1em;
}

.post-body strong {
  font-weight: 600;
  color: var(--ink);
}

.post-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--brat);
  transition: background var(--t-fast);
}
.post-body a:hover { background: rgba(138, 206, 0, 0.18); }

.post-figure {
  margin: clamp(32px, 4vw, 56px) 0;
}

.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.post-figure figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
}

.post-body > *:last-child {
  margin-bottom: 0;
}

/* Raw questions card — reuses the global .review details box */
.raw {
  margin-top: clamp(40px, 5vw, 64px);
}

.raw__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.raw .review__body p.raw__note {
  margin: 0;
  color: var(--ink-soft);
}

.raw__copy {
  flex: none;
  padding: 8px 14px;
  font-size: 13px;
}

.raw__code {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--paper-soft);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  tab-size: 2;
}

.raw__code code {
  font: inherit;
}

.raw__note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--paper-soft);
}

/* Footnotes. Verbatim copy of the block in mythos-cb2/styles.css — second user,
   so it stays page-local; promote it into the root sheet at a third, the way
   .review was. Must stay after `.post-body a`: `.fn-ref a` ties it at 0,1,1 and
   only wins the border-bottom on source order. */

.fn-ref {
  font-size: 11px;
  line-height: 0;
  vertical-align: super;
}

.fn-ref a {
  color: var(--ink-soft);
  border-bottom: 0;
}
.fn-ref a:hover { color: var(--ink); }

.footnotes {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.footnotes__list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink-soft);
}

.footnotes__list li {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 1em;
}

.footnotes__list li:last-child { margin-bottom: 0; }

.footnotes__back {
  margin-left: 4px;
  border-bottom: 0 !important;
}

/* Footnote hover preview. Desktop-only — the JS is gated on a fine pointer, and
   the media query keeps the styles out of touch builds regardless. */

@media (hover: hover) and (pointer: fine) {
  .fn-pop {
    position: absolute;
    z-index: 60; /* above the sticky nav at 50 */
    top: 0;
    left: 0;
    max-width: 360px;
    padding: 14px 16px;
    background: var(--paper);
    border: 1px solid var(--ink);
    border-top: 2px solid var(--brat);
    box-shadow: 0 6px 24px rgba(10, 10, 10, 0.1);
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ink-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-2px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  }

  .fn-pop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* The ref itself gets a hit area worth aiming at. */
  .fn-ref a {
    padding: 0 2px;
  }
  .fn-ref a:hover {
    background: rgba(138, 206, 0, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fn-pop { transition: none; transform: none; }
  .fn-pop.is-visible { transform: none; }
}
