/* Interactive carbon removal essays: layout for margin notes plus the reactive numbers.
   Loaded after ../styles.css, so the fonts, colours and nav come from the rest of the site. */

/* Wider page so notes can sit in the right-hand margin next to the text */
body.essay {
    max-width: 1100px;
}

.essay article {
    max-width: 700px;
    position: relative;
}

.essay article section {
    display: block;
}

.essay article h3 {
    font-size: 14px;
    font-weight: 600;
    color: rgb(15, 18, 25);
    margin: 1.5rem 0 0.5rem;
}

.essay article img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.essay article blockquote {
    border-left: 2px solid rgba(15, 18, 25, 0.2);
    padding-left: 1rem;
    margin: 1rem 0;
}

.essay .byline {
    color: #888888;
}

/* Contents list (main essay) */
.essay .contents {
    margin: 0 0 2rem;
    font-size: 13px;
}

.essay .contents summary {
    cursor: pointer;
    color: #888888;
}

main .post .contents ul {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
}

main .post .contents ul ul {
    padding-left: 1rem;
    margin: 0;
}

main .post .contents li {
    margin-bottom: 0.1rem;
}

/* ---- Margin notes ------------------------------------------------------- */
.marginnote,
.marginnote-reactive {
    float: right;
    clear: right;
    width: 300px;
    margin: 0.3rem -340px 0.75rem 0;
    font-size: 12px;
    line-height: 1.55;
    color: #555555;
    position: relative;
}

/* Notes that open when you click a blue number or a bold phrase */
.marginnote-reactive {
    display: none;
    padding-left: 0.75rem;
    border-left: 2px solid #7BBEF7;
}

.marginnote-reactive.open {
    display: block;
}

/* The ⊕ toggles are only needed when there's no room for notes in the margin */
label.margin-toggle,
input.margin-toggle {
    display: none;
}

[onclick^="sidebar"] {
    cursor: pointer;
}

/* Charts are a fixed 700px wide: let them scroll rather than overflow */
r-svg-chart {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

/* Hovering a number highlights the same value wherever it appears */
.linked-hover {
    background-color: #E4FFED;
}

@media (max-width: 1120px) {
    .marginnote,
    .marginnote-reactive {
        display: none;
        float: none;
        width: auto;
        margin: 0.75rem 0;
        padding-left: 0.75rem;
        border-left: 2px solid rgba(15, 18, 25, 0.15);
    }

    .marginnote-reactive {
        border-left-color: #7BBEF7;
    }

    label.margin-toggle {
        display: inline;
        cursor: pointer;
        color: #888888;
    }

    .margin-toggle:checked + .marginnote,
    .marginnote-reactive.open {
        display: block;
    }
}

/* Equations: KaTeX's default size is large next to the site's 14px text */
.essay .katex {
    font-size: 1.05em;
}

.essay article b {
    font-weight: 600;
}
