/* Last edited: 2026-11-13 12:50 UTC (Claude, website chat) */
/* =========================================================
   "Working with Dynare" pages (EC9D5): teaching/ec9d5/dynare-*.html
   Only what these pages need on top of site.css: the eyebrow,
   contents box, formula boxes, labelled code blocks, data tables,
   worked examples and checklists.
   ========================================================= */

.eyebrow {
  margin-bottom: 0.55rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- "On this page" box ---------------------------------- */

.dynare-contents {
  margin-top: 2rem;
}

.dynare-contents ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 2rem;
  margin-top: 0.7rem;
  padding-left: 1.3rem;
  font-size: 0.92rem;
}

.dynare-contents li::marker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.dynare-contents a {
  color: var(--accent-strong);
  text-decoration: none;
}

.dynare-contents a:hover {
  text-decoration: underline;
}

/* --- Running text inside a section ----------------------- */

.dynare-body .rule-list + .prose,
.dynare-body .step-list + .prose,
.dynare-body .data-table-wrap + .prose,
.dynare-body .prose + .prose,
.dynare-body .prose + .math-block,
.dynare-body .math-block + .prose {
  margin-top: 0.9rem;
}

/* Inline code in text, tables, callouts and lists. */
.dynare-body :not(pre) > code {
  padding: 0.1rem 0.32rem;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

/* --- Equations ------------------------------------------- */

.math-block {
  max-width: 100%;
  margin: 1rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  color: var(--ink);
}

/* A result worth remembering: tinted box with a small label. */
.key-formula {
  margin: 1.25rem 0;
  padding: 0.8rem 1.25rem 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  color: var(--ink);
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-small);
}

.key-formula-label,
.code-label,
.example-label {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Code ------------------------------------------------ */

.code-block {
  margin: 1.1rem 0;
  overflow: hidden;
  background: var(--paper-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.code-label {
  padding: 0.5rem 0.95rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.code-block pre,
.code-block code {
  font-family: var(--mono);
}

.code-block pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
}

/* --- Tables ---------------------------------------------- */

.data-table-wrap {
  width: 100%;
  margin: 1.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--sheet);
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-family: var(--display);
  font-weight: 700;
}

.data-table td {
  color: var(--ink-soft);
}

.data-table tbody tr:nth-child(even) {
  background: var(--paper-soft);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .is-number {
  font-family: var(--mono);
  font-size: 0.84rem;
  text-align: right;
  white-space: nowrap;
}

.data-table th.is-number {
  font-family: var(--display);
  font-size: inherit;
}

.data-table tr.is-highlight td {
  color: var(--accent-strong);
  font-weight: 600;
}

/* --- Worked examples ------------------------------------- */

.example-card {
  margin: 1.25rem 0;
  padding: 1rem 1.3rem;
  background: var(--sheet);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
}

.example-card .example-label {
  margin-bottom: 0.4rem;
}

.example-card p {
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
}

.example-card p + p,
.example-card .math-block + p {
  margin-top: 0.5rem;
}

.example-card .math-block {
  margin: 0.5rem 0;
}

/* Callouts that follow text keep the same rhythm. */
.dynare-body .callout {
  margin: 1.25rem 0;
}

/* --- Checklists ------------------------------------------ */

/* Numbered steps with round markers. */
.step-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  position: relative;
  padding-left: 2.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
  counter-increment: step;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  top: 0.1rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  color: var(--on-accent, #fff);
  background: var(--accent);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.step-list strong,
.rule-list strong {
  color: var(--accent-strong);
  font-weight: 600;
}

/* Ticked rules. */
.rule-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
  padding: 0;
  list-style: none;
}

.rule-list li {
  position: relative;
  padding-left: 1.7rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.65;
  text-align: justify;
  hyphens: auto;
}

.rule-list li::before {
  content: "\f00c";
  position: absolute;
  top: 0.05rem;
  left: 0;
  color: var(--accent);
  font-family: "Font Awesome 6 Free";
  font-size: 0.85rem;
  font-weight: 900;
}

/* --- Phones ---------------------------------------------- */

@media (max-width: 680px) {
  .dynare-contents ol {
    grid-template-columns: 1fr;
  }

  .key-formula {
    padding: 0.7rem 0.9rem 0.4rem;
  }

  .example-card {
    padding: 0.9rem 1rem;
  }

  .code-block pre {
    font-size: 0.8rem;
  }
}
