/* market.mrprofessor.dev
   Trimmed from the old emacs.rudra.dev theme to what this page uses. */

@import url("https://cdn.jsdelivr.net/gh/aymanbagabas/iosevka-fonts@v6.1.2/dist/iosevka/iosevka.min.css");

:root {
    --fg: #33333f;
    --accent: #cb4b16;  /* solarized orange */
    --link: #b58900;    /* solarized yellow */
    --toc-bg: #fdf6e3;  /* solarized base3 */
    --toc-width: 16rem;
    --gutter: 280px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Iosevka Web', monospace;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--fg);
}

#content {
    max-width: 75rem;
    margin: auto;
}

/* Headings */

h2 {
    border-bottom: 1px solid var(--accent);
    padding-bottom: 0.5em;
    font-size: 1.75em;
}

h3 {
    margin-top: 2em;
    font-size: 1.5em;
}

/* Links: yellow for in-page, cyan for external */

a {
    color: var(--link);
    text-decoration: none;
}

a:link {
    background: #ff8;
}

a:visited {
    background: #ffc;
}

a:link:hover,
a:visited:hover {
    background: #ff0;
}

a[href^="http"] {
    background: #bff;
}

a[href^="http"]:visited {
    background: #dff;
}

a[href^="http"]:link:hover,
a[href^="http"]:visited:hover {
    background: #0ff;
}

a[href^="http"]::after {
    content: "\21B3";
    background: white;
    padding-left: 0.2em;
}

/* Photos */

img {
    width: 100%;
}

div.figure {
    font-size: 0.85em;
}

/* Table of contents */

#table-of-contents h2 {
    display: none;
}

#table-of-contents ul {
    list-style: none;
    padding-left: 0;
}

#table-of-contents div > ul > li {
    margin-top: 1em;
    font-weight: bold;
}

#table-of-contents div > ul > li > a {
    color: var(--accent);
}

#table-of-contents ul ul {
    font-weight: normal;
}

#table-of-contents a:link,
#table-of-contents a:visited {
    background: transparent;
}

#table-of-contents a:hover {
    background: #ff0;
}

/* Wide screens: fixed sidebar TOC */

@media screen {
    h2 {
        margin-top: 3em;
    }

    #table-of-contents {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--toc-width);
        font-size: 0.8rem;
        background: var(--toc-bg);
        overscroll-behavior-y: contain;
    }

    #text-table-of-contents {
        position: absolute;
        inset: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 2em 0 2em 2em;
    }

    div.outline-2 {
        margin-left: var(--gutter);
        max-width: 960px;
    }
}

/* Narrow screens: no sidebar */

@media screen and (max-width: 1024px) {
    #table-of-contents {
        display: none;
    }

    div.outline-2 {
        margin-left: 5%;
        max-width: 90%;
    }
}

@media print {
    body {
        color: black;
    }

    @page {
        margin: 25mm;
    }

    #table-of-contents {
        display: none;
    }

    h2, h3 {
        page-break-before: always;
        margin-top: 0;
    }
}
