@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

/* overall */

body {
    line-height: 1.6em;
    font-size: 18px;
    font-family: 'Georgia', serif;
    margin: 0;
}

#title-logo {
    margin: 2em auto;
    width: 100% !important;
}

/* text */

table {
    border-radius: 5px;
}

td {
    padding: 20px;
    background-color: white;
    text-align: left;
    border-bottom: none;
    font-size: 14px;
    color: #555555;
    line-height: 1.5em;
}

tr {
    border: none;
}

th {
    background-color: #800000;
    color: white;
    padding: 20px;
    font-size: 12px;
    text-align: left;
}

.first-column {
    font-size: 16px;
    color: black;
    line-height: 1.2em;
}

.fa {
    text-align: center;
    font-size: 50px;
    color: rgb(225, 225, 225);
    width: 100%;
}

a,
a:hover,
a:active,
a:visited,
a:focus {
    color: #800000;
    display: inline; /* Ensure it doesn't affect layout */
}

h1 {
    font-size: 50px;
    line-height: 1em;
    text-align: center;
    padding-top: 5vh;
    font-weight: 400;
    font-family: 'Playfair Display', serif;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    line-height: 1.2em;
    width: 60%;
}

hr {
    margin: 2em auto;
}

#subtitle {
    font-size: 28;
    text-align: center;
    margin: 0 auto;
}

.cursor-crosshair {
    cursor: pointer !important;
}

/* intro */

#background {
    display: flex;
    flex-direction: row;
}

#intro {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: rgb(77, 0, 0);
    color: white;
}

#background img {
    width: 50%;
    object-fit: cover;
}

.hoverlayer .hoverlabel rect {
    transform: scale(1.05); /* increase by 5% */
    transform-origin: center;
}

#intro h1,
#subtitle {
    margin-left: auto;
    margin-right: auto;
    width: 70%;
}

#intro a {
    color: white;
}

#bylines {
    font-size: 16px;
    text-align: center;
}

.byline a {
    text-decoration: underline;
}

/* chapters */

.non-scroller,
.section-header {
    margin: auto;
    width: max(600px, 50vw);
}

#methodology {
    font-size: 14px;
    line-height: 1.2em;
    margin: 4em auto;
}

#chapters {
    width: 33vw;
    padding: 0 15px;
    margin-left: 62vw;
    margin-top: 70vh;
    position: relative;
    overflow-x: hidden;
}

#content,
#intro-text {
    margin-top: 30vh;
}

.scroller {
    margin-top: 50vh;
    margin-bottom: 50vh;
    padding: 2em;
    box-shadow: 0 0 1em #dedede;
}

.scroller img,
figure {
    border: 1px solid #4d0000;
    background-color: white;
    margin: 1em 0 0 0;
    padding: 1em 0;
}

.scroller img {
    width: 100%;
}

.caption {
    font-size: 12px;
}

figcaption {
    font-family: 'Playfair Display', serif;
    text-align: right;
    line-height: 1.2em;
    margin-top: 5px;
}

figure {
    padding: 1em;
    background-color: #4d0000;
    color: white;
}

figure a,
figure a:hover,
figure a:active,
figure a:visited,
figure a:focus {
    color: white;
}

blockquote {
    font-weight: 400;
    line-height: 1.2em;
    font-size: 26px;
    margin: 0 !important;
    font-family: 'Georgia', serif;
}

#chart-div,
#chart-container {
    height: 100vh;
    width: 60vw;
    top: 0;
    z-index: 1;
    background-color: white;
}

#chart-container {
    position: fixed;
    overflow: clip;
}

#flowchart {
    padding: 2em;
}

figure {
    margin: 0 !important;
}

#further-reading {
    margin-top: 20em;
}

#what-next {
    margin: 4em auto;
    width: max(600px, 50vw);
}

/* disable drag events for sankey specifically */

g.sankey-node-set {
    cursor: none !important;
}

g.sankey {
    pointer-events: none !important;
}

/* mobile */

@media (width < 800px) {
    /* overall */

    body {
        margin: 0;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    #title-logo {
        width: 200px;
        max-width: 200px;
        flex-shrink: 0;
        margin: 20px;
    }

    /* text */

    #bylines .byline {
        font-size: 12px;
        line-height: 16px;
    }

    h1 {
        font-size: 30px;
        padding-top: 0;
        margin-top: 0;
    }

    #subtitle {
        font-size: 16px;
        line-height: 20px;
    }

    hr {
        width: 90% !important;
        max-width: 100vw;
        margin: 20px;
    }

    .non-scroller {
        font-size: 20px;
    }

    /* intro */

    #background {
        flex-direction: column;
    }

    #background img {
        width: 100%;
        height: auto;
    }

    #intro {
        height: 60vh;
    }

    .non-scroller,
    #intro-text {
        margin: 10vh auto;
    }

    #intro h1,
    #subtitle {
        width: 90%;
    }

    /* chapters */

    #chart-div,
    #background,
    #content,
    #chapters {
        margin: 0;
        width: 100vw;
    }

    #chapters {
        padding: 0;
        background: #eeeeee;
        margin-top: 0;
    }

    .scroller {
        width: 80%;
        margin: 25vh auto;
        background: white;
    }

    .scroller img {
        margin: 0 auto;
        margin-top: 1em;
        display: block;
        max-height: 30vh;
        max-width: 100%;
        width: auto !important;
        object-fit: contain;
    }

    .scroller,
    .non-scroller {
        font-size: 14px;
    }

    .non-scroller,
    .section-header {
        width: 90%;
    }

    .section-header {
        margin: 30vh auto;
    }

    h2 {
        margin: 0;
        font-size: 24px;
        width: 100%;
    }

    blockquote {
        font-size: 16px;
    }

    #conclusion {
        width: 90%;
        margin-bottom: 0;
    }

    #methodology {
        font-size: 12px;
        line-height: 1.5em;
    }

    /* chart */

    #chart-div {
        height: 50vh;
        width: auto;
        margin-top: -30px;
    }

    #chart-container {
        width: 100vw;
        height: 45vh;
        overflow-x: scroll;
    }

    .flowchart text {
        font-size: 26px !important;
        transform: translate(-10px, 4px); /* shifts left and down */
    }

    .flowchart text.top-line {
        transform: translate(-10px, -4px); /* shifts left and up */
    }

    .flowchart text.bottom-line {
        transform: translate(-10px, 12px); /* shifts left and down */
    }

    .flowchart text.left-line {
        transform: translateX(-40px); /* shifts left and down */
    }
}
