/* Post-specific base styles extracted from llms_information_economics.html */

.post-wrap { max-width: 750px; margin: 2rem auto 4rem; padding: 0 1rem; }
.post-wrap p { line-height: 1.9; margin: 0.75rem 0; }
.post-wrap h2 { margin-top: 1.5rem; font-size: 1.35rem; font-weight: bold; }
.post-wrap h3 { margin-top: 1.5rem; font-size: 1.1rem; font-weight: bold;}
.post-wrap h2, .post-wrap h3 { scroll-margin-top: 80px; }
pre { background: #f8f9fa; padding: .75rem 1rem; border-radius: 6px; overflow: auto; }
code { font-family: Inconsolata, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; }

/* Hyphenation for long words */
.post-wrap p,
.post-wrap li,
.post-wrap blockquote {
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  overflow-wrap: anywhere;
}
.post-wrap pre,
.post-wrap code { hyphens: none; overflow-wrap: normal; word-break: normal; }

/* Citation links */
a.cite {
  color: #0d6efd;
  text-decoration: none;
  cursor: pointer;
  hyphens: none;
  overflow-wrap: normal;
  word-break: keep-all;
}
a.cite:hover { text-decoration: underline; }

/* Floating Table of Contents (base) */
.toc-nav {
  position: fixed;
  top: 190px; /* JS may align to first H2 unless locked via data-lock-top */
  width: clamp(240px, 22vw, 340px); /* wider, but flexible */
  max-width: 340px; /* increased max width */
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding-right: 16px; /* space before separator */
  font-size: 1.1rem;
  color: var(--muted);
  z-index: 10;
  border-right: 1px solid #e9ecef; /* vertical separator */
  box-sizing: border-box;
  left: 16px; /* will be updated via JS for responsive positioning */
  background: transparent;
  /* Wrap long entries nicely */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.toc-title { font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0; padding: 0; }
.toc-list li.toc-h3 { margin-left: 1rem; font-size: 0.92em; }
.toc-nav a { color: inherit; text-decoration: none; display: block; padding: 2px 0; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.toc-nav a:hover { color: var(--link); }
.toc-list li.active > a { color: var(--link); font-weight: 600; }

/* Inline/mobile ToC placement: below the <hr>, inside content flow */
.toc-nav.toc-inline {
  position: static;
  width: 100%;
  max-width: none;
  max-height: none;
  border-right: 0;
  padding-right: 0;
  margin: 0.75rem 0 1rem;
}
.toc-nav.toc-inline .toc-title { margin-bottom: 0.25rem; }
.toc-nav.toc-inline .toc-list { padding-left: 0; }

/* Right margin citation note */
.citation-note {
  position: absolute; /* positioned via JS relative to page */
  max-width: 320px;
  background: #fff;
  color: var(--text);
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
  padding: .75rem .875rem;
  z-index: 1000;
}
.citation-note .note-close { position: absolute; top: 6px; right: 8px; background: transparent; border: 0; font-size: 18px; line-height: 1; color: #666; cursor: pointer; }
.citation-note .note-close:hover { color: #000; }
.citation-note .note-item { margin: .25rem 0; font-size: .95rem; }
.citation-note .note-item a { color: #dc3545; text-decoration: none; }
.citation-note .note-item a:hover { text-decoration: underline; }

/* Hide notes on narrow screens */
@media (max-width: 1200px) { .citation-note { display: none !important; } }

/* Flavor widget styles */
.flavor-widget { border: 1px solid #e9ecef; border-radius: 10px; padding: .75rem .9rem; margin: 1rem 0 1.5rem; background: #fafbfc; }
.flavor-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.flavor-btn { appearance: none; border: 1px solid #ced4da; background: #fff; color: #333; padding: .35rem .6rem; border-radius: 8px; font-size: .95rem; cursor: pointer; }
.flavor-btn:hover { border-color: #adb5bd; }
.flavor-btn.active { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.flavor-math { padding: .25rem 0 .1rem; min-height: 2.2rem; }
.flavor-text { padding: .25rem 0 .25rem; color: #212529; font-style: normal; }
.flavor-text .question-prompt { margin-bottom: .25rem; line-height: 2; }
.flavor-text .options { list-style: none; padding: 0; margin: .25rem 0 0; }
.flavor-text .options li { line-height: 2; margin: 0; }
.flavor-text .options li.correct .option-text { color: #198754; font-weight: 600; }
.flavor-text .option-label { font-weight: 600; margin-right: .25rem; color: #495057; }

/* Results chart */
.results-chart { position: relative; border: none solid #e9ecef; border-radius: 10px; padding: .5rem .5rem; margin: .75rem 0 1.5rem; background: #fff; }
.results-chart .chart-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.results-chart .legend { display: flex; gap: .5rem; flex-wrap: wrap; }
.results-chart .legend .legend-item { appearance: none; border: 1px solid #ced4da; background: #fff; color: #333; padding: .25rem .5rem; border-radius: 8px; font-size: 0.9rem; cursor: pointer; }
/* Active legend buttons match bar colors */
.results-chart .legend .legend-item.active[data-flavor="det"] { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.results-chart .legend .legend-item.active[data-flavor="unc"] { background: #f1b6da; border-color: #f1b6da; color: #fff; }
.results-chart .legend .legend-item.active[data-flavor="cost"] { background: #dc3545; border-color: #dc3545; color: #fff; }
.results-chart .chart-host { width: 100%; height: 280px; position: relative; }
.results-chart .chart-tooltip { position: absolute; pointer-events: none; display: none; background: rgba(33,37,41,.96); color: #fff; padding: .25rem .4rem; border-radius: 4px; font-size: 12px; white-space: nowrap; z-index: 5; }

/* Right-align numbers in results table */
.table-figure table th:nth-child(2),
.table-figure table th:nth-child(3),
.table-figure table td:nth-child(2),
.table-figure table td:nth-child(3) {
  text-align: right;
}

/* remove the top line from the table */
.table-figure table thead th {
    border-top: none;
}
