/* ============================================================
   components/editorial.css -- editorial annotation blocks
   Usage in .qmd:
     ::: {.editor-update}      -> superseded-but-originally-correct science
     ::: {.editor-correction}  -> corrections to errors in the source text
     ::: {.editor-verified}    -> a number/computation checked by the editor
   Reproducible code sits in a sibling Quarto callout:
     ::: {.callout-note collapse="true" title="Reproduce this (Python)"}
   Wrap citations with [ ... ]{.ref} to recede them.
   ============================================================ */

/* --- Shared layout --- */
.editor-update,
.editor-correction,
.editor-verified {
    padding: 0.9rem 1.15rem;
    margin: 1.5rem 0;
    border-radius: 0 3px 3px 0;
    font-size: 0.95rem;
    line-height: 1.55;
    border-left: 3px solid;
}

/* --- Shared auto-inserted header --- */
.editor-update::before,
.editor-correction::before,
.editor-verified::before {
    display: block;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    font-weight: 600;
    padding-bottom: 0.35rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid;
}

/* --- Shared paragraph tidy --- */
.editor-update>p:first-of-type,
.editor-correction>p:first-of-type,
.editor-verified>p:first-of-type {
    margin-top: 0;
}

.editor-update>p:last-child,
.editor-correction>p:last-child,
.editor-verified>p:last-child {
    margin-bottom: 0;
}

/* --- Shared receding reference line --- */
.editor-update .ref,
.editor-correction .ref,
.editor-verified .ref {
    display: block;
    margin-top: 0.55rem;
    font-size: 0.86rem;
    color: #5a5a5a;
}

/* --- Update since publication: warm bronze --- */
.editor-update {
    border-left-color: #9a7b4f;
    background: #faf8f4;
}

.editor-update::before {
    content: "Update since publication";
    color: #6f5636;
    border-bottom-color: #e3dccf;
}

/* --- Editorial correction: cool slate-blue --- */
.editor-correction {
    border-left-color: #4f6f9a;
    background: #f4f7fa;
}

.editor-correction::before {
    content: "Correction";
    color: #365070;
    border-bottom-color: #d3dde8;
}

/* --- Editor-verified calculation: muted green --- */
.editor-verified {
    border-left-color: #4f8a6b;
    background: #f3f9f5;
}

.editor-verified::before {
    content: "Verified calculation";
    color: #2f6249;
    border-bottom-color: #d3e7db;
}

/* Optional terse verified number for the margin:
   ::: {.column-margin} ::: {.verified-note} ... ::: ::: */
.verified-note::before {
    content: "Verified\00a0\2014\00a0";
    /* "Verified — " */
    font-variant: small-caps;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #2f6249;
}

/* ---
   Dark mode.
   Quarto marks dark mode with the class `quarto-dark` on <body>
   (NOT data-bs-theme). The attribute selector is grouped in only
   as a future-proofing fallback; `.quarto-dark` is what matches.
   --- */
.quarto-dark .editor-update,
[data-bs-theme="dark"] .editor-update {
    border-left-color: #c2a878;
    background: #26221c;
    color: #e6e1d8;
}

.quarto-dark .editor-update::before,
[data-bs-theme="dark"] .editor-update::before {
    color: #d9c39b;
    border-bottom-color: #443c30;
}

.quarto-dark .editor-correction,
[data-bs-theme="dark"] .editor-correction {
    border-left-color: #86a6cf;
    background: #1c2229;
    color: #dce4ee;
}

.quarto-dark .editor-correction::before,
[data-bs-theme="dark"] .editor-correction::before {
    color: #a9c3e2;
    border-bottom-color: #303a44;
}

.quarto-dark .editor-verified,
[data-bs-theme="dark"] .editor-verified {
    border-left-color: #7fbf9c;
    background: #1b241f;
    color: #dce8e1;
}

.quarto-dark .editor-verified::before,
[data-bs-theme="dark"] .editor-verified::before {
    color: #9dd3b4;
    border-bottom-color: #2e3d34;
}

.quarto-dark .verified-note::before,
[data-bs-theme="dark"] .verified-note::before {
    color: #9dd3b4;
}

.quarto-dark .editor-update .ref,
.quarto-dark .editor-correction .ref,
.quarto-dark .editor-verified .ref,
[data-bs-theme="dark"] .editor-update .ref,
[data-bs-theme="dark"] .editor-correction .ref,
[data-bs-theme="dark"] .editor-verified .ref {
    color: #b3ada2;
}