/* See https://tess.oconnor.cx/colophon#markup */

@import "variables.css";

.feed-only {
    display: none;
}

[lang=und-fonipa] > a[rel=help] {
    text-decoration: none;
}

a.mention {
    text-decoration: none;
}

a.mention:not(.u-url)::before {
    content: "@";
}

[href*="instagram.com"].mention::before {
    display: none;
}
[href*="instagram.com"].mention {
    background-image: url(/images/instagram.svg);

    display: inline-block;

    text-decoration: none;
    white-space: pre-wrap;

    padding-inline-start: 1.125ic;

    background-position: -0.175ic 50%;
    background-size: 0.8lh;
    background-repeat: no-repeat;
}
@media (prefers-color-scheme: dark) {
    [href*="instagram.com"].mention {
        background-image: url(/images/instagram-dark.svg);
    }
}
[href*="linkedin.com"].mention:not(.u-url)::before {
    content: "in";
    background-color: rgb(10, 102, 194);
    color: white;
    border-radius: 2px;
    font-weight: 900;
    padding: 0 0.25ch;
    margin-inline-end: 0.125ch;
}
[href*="livejournal.com"].mention:not(.u-url)::before {
    display: none;
}
[href*="livejournal.com"].mention {
    display: inline-block;
    white-space: pre-wrap;
    font-weight: bold;
    padding-inline-start: 18px;
    background-image: url(/images/lj.svg);
    background-repeat: no-repeat;
    background-position: left;
    text-decoration: none;
}
[href*="reddit.com"].mention:not(.u-url)::before {
    content: "u/";
}
[href*="watchcrunch.com"].mention {
    position: relative;
}
[href*="watchcrunch.com"].mention:not(.u-url)::before {
    content: "○";
    color: rgb(18, 184, 134);
    font-weight: bold;
    position: relative;
    bottom: -1px;
    left: -1px;
}
[href*="wikipedia.org"].mention:not(.u-url)::before {
    content: "User:";
}

a.stealth {
    color: inherit;
    cursor: default;
    text-decoration: none;
}

abbr.postnominal {
    text-transform: lowercase;
    font-variant: small-caps;
}

aside {
    margin: -0.5rem auto;
    padding: 0.5rem 1ch;
}

aside > p:first-child {
    margin-top: 0;
}

aside > p:last-child {
    margin-bottom: 0;
}

aside > p:first-child::before {
    display: inline;
    font-family: var(--heading-font-stack);
    font-weight: bold;
}

aside > p:first-child::before {
    content: "Aside: ";
}

aside.alert > p:first-child::before {
    content: none;
}

:lang(tok) aside > p:first-child::before {
    content: "lon poka ni: "
}

html {
    counter-reset: example;
    counter-reset: listing;
}

.example { counter-increment: example; }
.listing { counter-increment: listing; }

aside.example > p:first-child::before,
figure.example > figcaption::before {
    content: "Example " counter(example) ": ";
    font-weight: bold;
}

figure.listing > figcaption::before {
    content: "Listing " counter(listing) ": ";
    font-weight: bold;
}

aside.news > p:first-child::before {
    content: "News: ";
}

aside.note > p:first-child::before {
    content: "Note: ";
}

aside.p-summary > p:first-child::before {
    content: "Summary: ";
}

aside.warning > p:first-child::before {
    content: "Warning: ";
}

aside {
    background: var(--aside-bg);
    color: var(--page-contrast);
}

figcaption > aside {
    background: inherit;
    color: inherit;
}

aside > p:first-child::before, aside .halmos {
    color: var(--aside-fg);
}

aside.example > p:first-child::before,
figure.example > figcaption::before,
aside.example .halmos {
    color: var(--example-fg);
}

figure.listing > figcaption::before {
    color: var(--listing-fg);
}

aside.note > p:first-child::before,
aside.note .halmos {
    color: var(--note-fg);
}

aside.warning > p:first-child::before,
aside.warning .halmos {
    color: var(--warning-contrast);
}

.example {
    background: var(--example-bg);
}

.listing {
    background: var(--listing-bg);
}

aside.alert, aside.warning {
    background: var(--warning-color);
    color: var(--warning-contrast);
}

aside.alert {
    font-weight: bold;
}

aside.news, aside.note {
    background: var(--note-bg);
}

caption.prominent {
    caption-side: top;
    border-bottom: none;
    font-weight: bold;
}

.cartouche {
    border: 2px solid currentColor;
    border-radius: 8px;
    padding-inline: 4px;
}

ol.chat {
    list-style-type: none;
}

.checklist li::marker {
    color: red;
    content: "✘";
}

.checklist li.complete::marker {
    font-weight: bold;
    color: green;
    content: "✓";
}

.directory-listing > li {
    list-style-type: none;
    margin-block: 1em;
}

p.metadata, dl.metadata {
    font-size: 0.875em;
}

dl.metadata {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    max-width: var(--metadata-width);
    padding: 0.5rem;
}

article.email dl.metadata {
    grid-template-columns: 1fr 5fr;
}

article.email aside {
    max-width: var(--metadata-width);
}

dl.metadata > dt {
    grid-column: 1;
    text-align: right;
}

article.email dl.metadata > dt {
    text-align: left;
    word-break: keep-all;
}

article.email dl.metadata > dd {
    overflow: hidden;
}

img.face-header {
    vertical-align: middle;
}

dl.metadata > dd {
    grid-column: 2;
    text-align: left;
    margin-inline-start: 1rem;
}

.embed-container {
    display: flex;
    justify-content: center;
}

figure:has(.subtitles) {
    position: relative;
    padding-inline: 0;
}

figcaption.subtitles {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-weight: bolder;
    text-shadow: -0.5px 0 0 black,
                 0 -0.5px 0 black,
                 0 0.5px 0 black,
                 0.5px 0 0 black;
}

figcaption.subtitles,
figcaption.subtitles :link, figcaption.subtitles :visited {
    color: yellow;
    text-decoration: none;
}

@media (prefers-color-scheme: dark) {
    figcaption.subtitles,
    figcaption.subtitles :link, figcaption.subtitles :visited {
        color: white;
    }
}

@media (min-width: 840px) {
    figcaption.subtitles {
        font-size: 2em;
    }
}

section.gallery > figure {
    margin: 0;
    line-height: 1;
}

section.gallery > figure > figcaption {
    margin: 0.5rem;
}

@media (min-width: 900px) {
    section.gallery {
        display: grid;
        grid-template-columns: auto auto;
    }
}
@media (min-width: 1500px) {
    section.gallery {
        grid-template-columns: auto auto auto;
    }
}

.halmos {
    line-height: 1;
    font-size: 1.2em;
    text-decoration: none;
    color: inherit;
    vertical-align: -0.1ic;
}

hr.fleuron, hr.dinkus, hr[title] {
    border: 0;
    text-align: center;
    margin-block: 0;
}

hr[title]::after { content: attr(title); }
hr.fleuron::after { content: "❧"; font-size: 8em; line-height: 0.6; }
hr.dinkus::after { content: "✻ ✻ ✻"; }

.latex, .tex, .latex sub, .tex sub {
  font-size: 1em;
}

.latex sub, .tex sub, .latex sup {
  text-transform: uppercase;
}

.latex sub, .tex sub {
  vertical-align: -0.5ex;
  margin-inline-start: -0.1667em;
  margin-inline-end: -0.125em;
}

.latex sup {
  font-size: 0.85em;
  vertical-align: 0.15em;
  margin-inline-start: -0.36em;
  margin-inline-end: -0.15em;
}

.tex:link, .latex:link {
    text-decoration: none;
}

@media (min-width: 400px) {
    .multicol-toc {
        column-count: 2;
    }
}
@media (min-width: 700px) {
    .multicol-toc {
        column-count: 3;
    }
}
@media (min-width: 900px) {
    .multicol-toc {
        column-count: 4;
    }
}

.nobr {
    white-space: nowrap;
}

/* Old markup of mine before the <figure> element was widely supported */
blockquote + p.source {
    text-align: right;
}

.lyrics, .verse {
    font-family: var(--serif-font-stack);
    font-weight: var(--serif-font-weight);
    white-space: pre-line;
    font-style: italic;
}

.upright {
    text-orientation: upright;
}
