/* mobile */
@media only screen and (min-width : 320px) and (max-width : 959px) {
    :root{
        --font-size-px: 17;
        --font-size-smaller-px: 15;
        --font-size-small-px: 13;
       
        --line-height-px: 26;
    }
}

@media only screen and (min-width : 960px) {
    :root{
        --font-size-px: 19;
        --font-size-smaller-px: 17;
        --font-size-small-px: 13;
       
        --line-height-px: 28;
    }
}


:root {
    --font-family: 'PT Serif', serif;
    --font-family-small: 'PT Serif', serif;
    --font-family-header: 'PT Serif', serif;
    --font-family-monospace: 'PT Mono', monospace;
    --font-family-elements: 'PT Sans Caption', sans-serif;
   
    --baseline-offset-small-px: 2;
    --baseline-offset-smaller-px: 2;
   
    --footnote-ref-offset-px: 8;
    
    --font-size: calc(var(--font-size-px) / 16 * 1em);
    --line-height: calc(var(--line-height-px) / var(--font-size-px) * 1em);
    
    --font-size-small: calc(var(--font-size-small-px) / var(--font-size-px) * 1em);
    --font-size-smaller: calc(var(--font-size-smaller-px) / var(--font-size-px) * 1em);
    
    --line-height-small: calc(var(--line-height-px) / var(--font-size-small-px) * 1em);
    --line-height-smaller: calc(var(--line-height-px) / var(--font-size-smaller-px) * 1em);

    --baseline-offset-small: calc(var(--baseline-offset-small-px) / var(--font-size-small-px) * 1em);
    --baseline-offset-smaller: calc(var(--baseline-offset-smaller-px) / var(--font-size-smaller-px) * 1em);    

    --footnote-ref-offset: calc(var(--footnote-ref-offset-px) / var(--font-size-px) * 1em);
}


* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: white;
    color: black;
    font-size: var(--font-size);
    line-height: var(--line-height);
}

    a {text-decoration: none;}
        a:link {color: blue;}
        a:visited {color: purple;}

    ul, ol {
        margin: 0;
        padding: 0;
        padding-left: 2em;
        padding-bottom: var(--line-height);
    }
    p, figure {
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: var(--line-height);
    }

    figure {
        margin: 0;
        padding: 0;
        padding-bottom: var(--line-height);
    }
        figure img {
            display: block;
        }

        figure figcaption {
            background: #f0f0f0;
            clear: left;
        }

            figcaption > p {
                margin: 0;
                padding: 0;
                padding-left: 1ex;
                padding-right: 1ex;
                text-align: justify;
                hyphens: auto;
                font-size: var(--font-size-small);
            }

        figure details {
            display: inline-block;
            vertical-align: bottom;
            margin: 0;
        }
            figure details summary {
                background: #f0f0f0;
                padding: 0 2ex 0 1ex;
                cursor: pointer;
                font-family: var(--font-family-elements);
                font-size: var(--font-size-small);
            }
                figure details summary:focus {
                    outline: none;
                }
                figure details[open] summary {
                    width: 100%;
                    font-weight: bold;
                    color: #333;
                }

    blockquote {
        margin: 0;
        padding: 0;
        padding-left: 3ex;
        padding-right: 5ex;
        text-align: justify;
        hyphens: auto;
        font-size: var(--font-size-smaller);
    }
        blockquote > p, blockquote > ul, blockquote > ol {
            padding-bottom: calc( var(--line-height-smaller) - var(--baseline-offset-smaller) );
            padding-top: var(--baseline-offset-smaller) !important;
        }

    h1 { font-size: 200%; }
    h2 { font-size: 150%; }
    h1, h2 {
        font-family: var(--font-family-header);
    }

        strong, h1, h2 {
            opacity: 0.8;
        }

    /* --- */

    p.divider {text-align: center; font-weight: normal; letter-spacing: 1ex;}

    code {
        font-family: var(--font-family-monospace);
        font-weight: bold;
    }

    img {
        max-width: 100%;
    }

/* mobile */
@media only screen and (min-width : 320px) and (max-width : 959px) {


    section.footnotes {
        font-size: var(--font-size-smaller);
    }

    a.footnote-back, hr { display: none; }

    /* footnote display that slides out */
    div.footnote-display {
        position: fixed;
        left: 0;
        bottom: 0;
        background: #00e0e0;
        width: 100vw;
        padding: 0.5em 1ex 0;
    }
        div.footnote-display > p {
            padding-bottom: 0.5em;
        }
            div.footnote-display > p a {
                text-decoration: underline;
            }

    /* footnotes activated */
    a.footnote-ref {
        position: relative;
        bottom: var(--footnote-ref-offset);
    }

        a.footnote-ref > sup {
            background: #e0e0e0;
            color: blue;
            padding: 0px 4px;
            border-radius: 4px;
            transition: 0.3s;
            vertical-align: baseline;
            font-size: var(--font-size-small);
            font-family: var(--font-family-small);
        }
            a.footnote-ref:focus {
                outline: none;
            }

            a.footnote-ref.active > sup {
                background: blue;
                color: white;
            }

}

/* desktop and big tablet */
@media only screen and (min-width : 960px) {

    a:hover {text-decoration: underline;}

    a.footnote-back, hr, section.footnotes h2 { display: none; }

    article {
        width: 900px;
        margin: 0 auto;
        position: relative;
    }

        a.footnote-ref {
            position: relative;
            bottom: var(--footnote-ref-offset);
        }

            a.footnote-ref > sup {
                vertical-align: baseline;
                font-size: var(--font-size-small);
                font-family: var(--font-family-small);
            }

        article.footnotes-processed {
            padding-right: 325px;
            position: relative;
        }

        .footnotes-side {
            position: absolute;
            right: 0;
            top: 0;
            width: 300px;
            font-family: var(--font-family-small);
            font-size: var(--font-size-small);    }
            .footnotes-side li {
                position: absolute;
            }

            .footnotes-side li  {
                padding-top: var(--baseline-offset-small);
                padding-bottom: 0;
                color: #333;
            }
                .footnotes-side li p {
                    padding-bottom: 0;
                }

}