/* Slide-like layout when the viewport is wide enough */
@media screen and (min-width: 992px) and (min-height: 700px) {
    :root {
        --half-height: 50vh;
        color: black;
    }

    .navbar-expand-md {
        flex-wrap: wrap;
    }

    .nav-link {
        padding-top: 2px;
        padding-bottom: 2px;
    }

    .title-page {
        height: 100vh !important;
        --half-height: 45vh;
    }

    /* Text alignment for layout-a */
    .layout-a, .layout-a-33, .layout-a-50, .layout-a-66 {
        align-content: center;
    }

    .layout-a:not(.title-page .layout-a) {
        height: 100vh;

        figure {
            img {
                max-width: 100%;
                max-height: calc(97vh - 6rem);
            }
        }

        .col-lg {
            max-height: 100vh;
        }
    }

    .layout-a-33:not(.title-page .layout-a-33) {
        height: calc(var(--half-height) * 2 / 3);
        overflow: auto;

        figure {
            img {
                max-width: 100%;
                max-height: calc(var(--half-height) * 2 / 3 - 3vh - 6rem);
            }
        }

        .col-lg {
            max-height: calc(var(--half-height) * 2 / 3);
        }
    }

    .layout-a-50:not(.title-page .layout-a-50) {
        height: var(--half-height);
        overflow: auto;

        figure {
            img {
                max-width: 100%;
                max-height: calc(var(--half-height) - 3vh - 6rem);
            }
        }

        .col-lg {
            max-height: var(--half-height);
        }
    }

    .layout-a-66:not(.title-page .layout-a-66) {
        height: calc(var(--half-height) * 4 / 3);
        overflow: auto;

        figure {
            img {
                max-width: 100%;
                max-height: calc(var(--half-height) * 4 / 3 - 3vh - 6rem);
            }
        }

        .col-lg {
            max-height: calc(var(--half-height) * 4 / 3);
        }
    }

    /* Vertically centre image in left-hand column (for "gamma" layouts). */
    .sheet .layout-a .col-lg:not(.d-flex) figure,
    .sheet .layout-b .col-lg:not(.d-flex) figure,
    .sheet .layout-b2 .col-lg:not(.d-flex) figure {
        margin-top: auto;
        margin-bottom: auto;
        justify-content: end;
    }

    .layout-b:not(.title-page .layout-b) {
        height: 100vh;

        .col-lg {
            height: 100vh;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(97vh - 6rem);
            }
        }
    }

    .layout-b-50:not(.title-page .layout-b-50) {
        height: 50vh;

        .col-lg {
            height: 50vh;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(47vh - 6rem);
            }
        }
    }

    .layout-b-66:not(.title-page .layout-b-66) {
        height: 66.66vh;

        .col-lg {
            height: 66.66vh;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(63.66vh - 6rem);
            }
        }
    }

    .layout-b2:not(.title-page .layout-b2) {
        height: 100vh;

        .col-lg {
            height: 100vh;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(var(--half-height) - 6rem);
            }
        }
    }

    .layout-b2-50:not(.title-page .layout-b2-50) {
        height: 50vh;

        .col-lg {
            height: 50vh;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(var(--half-height) / 2 - 6rem);
            }
        }
    }

    .layout-b2-66:not(.title-page .layout-b2-66) {
        height: 66vh;

        .col-lg {
            height: 66vh;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(var(--half-height) * 2 / 3 - 6rem);
            }
        }
    }

    .layout-b3:not(.title-page .layout-b3) {
        height: 100vh;

        .col-lg {
            height: 100vh;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(var(--half-height) * 2 / 3 - 6rem);
            }
        }
    }

    .layout-c .flex {
        justify-content: center;
    }

    /* Height for layout-c */
    .flex:not(.title-page .flex, .layout-a .flex, .layout-a-33 .flex, .layout-a-50 .flex, .layout-a-66 .flex) {
        height: 100vh;
    }

    /* Height for layout-c-50 */
    .layout-c-50 {
        height: var(--half-height) !important;
    }

    .layout-c-33 {
        height: calc(var(--half-height) * 2 / 3) !important;
    }

    .title-page .layout-a {
        height: 85vh;

        .col-lg {
            align-content: center;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(84vh - 4rem);
            }
        }
    }

    .title-page .layout-a-50 {
        height: 42vh;

        figure {
            img {
                max-width: 100%;
                max-height: calc(39vh - 4rem);
            }
        }
    }

    .title-page .layout-b2 {
        height: 85vh;

        .col-lg {
            align-content: center;
        }

        figure {
            img {
                max-width: 100%;
                max-height: calc(42vh - 4rem);
            }
        }
    }

    .title-page .layout-c {
        height: 85vh;

        figure {
            img {
                max-width: 100%;
                max-height: calc(84vh - 4rem);
            }
        }
    }

    /* Have some margin around text in one-column pages. */
    .one-column-text, .two-column-text {
        padding: 2rem;
    }

    /* In one-column layout, put text in two columns when there's enough of it.
     */
    .one-column-text > p, .one-column-text > blockquote p {
        margin-left: auto;
        margin-right: auto;
        max-width: 40em;
    }

    .two-column-text {
        columns: 2;
    }

    /* Scale images to fit in page.
       See https://codepen.io/epndavis/pen/ExNyBNN
       and https://epndavis.com/blog/contain-an-image-within-fixed-height-flexbox-grow/ */
    .flex {
        display: flex;
        flex-direction: column;
        justify-content: start;
        overflow: auto;
    }

    /* In figure slices, let images grow to fill available space */
    .sheet .flex figure {
        display: flex;
        flex-direction: column;
        overflow: auto;
        align-items: center;
        justify-content: center;

        img {
            /* FIXME: the -4rem is for up to two lines of caption per image */
            max-height: calc(100% - 4rem) !important;
            max-width: 100% !important;
            flex: 1 1 0%;
        }
    }

    .title-page .flex {
        height: 85vh;
    }

    .image-slice-50:not(.one-column .image-slice-50) {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: var(--half-height);
    }

    /* For two images, constrain height to half page height. */
    .two-images figure img {
        max-height: 40vh !important;
    }

    /* For three images, constrain height to one third page height. */
    .three-images figure img {
        max-height: 30vh !important;
    }

    /* Make figure slices as tall as possible. */
    .figure-slice {
        height: 100%;
    }
}

@media screen and ((max-width: 991px) or (max-height: 700px)) {
    img {
        max-width: 100%;
        max-height: 80vh;
    }

    /* Suppress vertical height setting from fullpage.css when we're not using it. */
    .fp-scrollable.fp-responsive .fp-is-overflow.fp-section:not(.fp-auto-height):not([data-percentage]) {
        min-height: initial;
    }
}

/* Main text column on non-lecture pages */
.main-text {
    max-width: 40rem;
}

/* Suppress bullets */
ul li {
    list-style-type: none;
}

/* Italicise figure captions. */
figcaption {
    font-style: italic;
    em {
        font-style: normal;
    }
}

/* Centre figures. */
figure {
    text-align: center;
}

/* Inline lists */
.inline-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Block quotes. Bootstrap uses a class .blockquote instead. */
blockquote {
    margin-left: 2rem;
    margin-bottom: 0rem;
}

/* Text font. */
.main-text, .lecture-text {
    font-family: 'Palatino', 'Sabon', 'Garamond', 'Georgia', sans-serif !important;
}

/* Small caps (class output by Pandoc) */
.smallcaps {
    font-variant: small-caps;
}

/* Override where otherwise we'd have bold */
.normal-weight {
    font-weight: normal !important;
}

/* Notes */
.note {
    margin-left: 3rem;
    font-size: small;
}

/* Centre tables, and unset column widths set by Pandoc */
table {
    margin: auto;
    width: unset !important;
    colgroup > col {
        width: unset !important;
    }
    p {
        margin-bottom: 0;
    }
}

/* Dinkus */
hr {
    margin-top: 0px; /* Compensate for margin after <p> */
    border: none;
    text-align: center;
    color: black;
    opacity: 1;
}

hr::after {
  content: "* * *";
}

/* Hyperlinks */
a {
    color: black;
    text-decoration-color: #ccc;
}

a:hover {
    background: #d0eeff;
}
