/**
 * Terrapin Styles
 */

body.hide-embed {
    font-size: 10pt !important;
    line-height: 1.4 !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    margin-top: 0.5rem !important;
    line-height: 1.2em;
}

h4, h5, h6 {
    /* The smaller headers all have the same size */
    font-size: var(--font-size);
}

/** Use hashes to align images eg note.png#left */

img {
    max-width: 100%;
    &[src*='#left'] {
        float: left;
        margin-right: 10px;
    }

    &[src*='#right'] {
        float: right;
        margin-left: 5px;
    }

    &[src*='#center'] {
        display: block;
        margin: auto;
    }
}

pre {
    position: relative;
    background-color: #f8f8f8;
    padding: 5px;
    line-height: 1rem;
    tab-size: 4;
    white-space: pre-wrap;
    &.highlight {
        margin: 0;
    }
}

code {
    color: inherit !important;
    font-size: 0.95em !important;
    font-weight: bold;
}

table {
    border-collapse: collapse;
    td, th {
        padding: 0.4rem 0.75rem;
        vertical-align: top;
        border-top: 1px solid #dee2e6;
    }
    th {
        border-bottom: 2px solid #dee2e6;
    }
    /* Special formatting for MESE and CAPS manuals */
    td .input {
        min-width: 100px;
        display: inline-block;
        border-bottom: 1px solid black;
        margin-bottom: -8px;
        text-align: center;
    }
    /* The "Up^" marker in the Logo Table of Commands */
    .cmdref .table-up {
        float: right;
        padding-left: 20px;
        &:after {
            content: ' ^';
        }
    }
}

div.turtletalk table,
div.turtletalk tbody,
div.turtletalk tr,
div.turtletalk td,
div.turtletalk th {
    border: 0;
    margin: 0;
    padding: 0;
    empty-cells: hide !important;
    max-width: 700px;
    font-size: 0;
}

/* logolib: the "copy code" button */
.btn-copycode {
    position: absolute;
    right: 0;
    font-family: 'Montserrat';
    border-radius: 4px;
}

.highlighter-rouge {
    margin-bottom: 1rem;
}

.highlight {
    padding: 5px;
}

/* Our <span class="example"> settings */

.example {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 87.5% !important;
    display: block;
    white-space: pre;
    padding: 5px;
    background-color: #e8ffe8;
    line-height: 1.3rem;
    strong {
        font-weight: normal;
        font-style: italic;
        color: blue;
    }
    em {
        font-weight: normal;
        font-style: italic;
        color: red;
    }
}

/* Accordions */
.acc-header {
    padding: .25rem 1.25rem !important;
    font-weight: bold;
    &:hover {
        color: var(--link_hover_text) !important;
    }
}

/* Boxes */

.box {
    border: 1px solid #bbb;
    border-radius: 4px;
    padding: 10px;
    margin: 0 20px;
    display: block;

    &.info {
        background-color: var(--infobox-background);
        color: var(--infobox-text);

        &:before {
            font: 3em 'Font Awesome 5 Free';
            content: "\f4ad";
            padding-right: 10px;
            float: left;
        }
    }

    &.warning {
        background-color: var(--warningbox-background);
        color: var(--warningbox-text);

        &:before {
            font: bold 3em 'Font Awesome 5 Free';
            content: "\f071";
            padding-right: 10px;
            color: red;
            float: left;
        }
    }

    &.danger {
        background-color: var(--dangerbox-background);
        color: var(--dangerbox-text);

        &:before {
            font: bold 3em 'Font Awesome 5 Free';
            content: "\f1e2";
            padding-right: 10px;
            float: left;
        }
    }

    &.shadow {
        box-shadow: 2px 3px 15px 4px rgba(0, 0, 0, 0.46);
    }
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 0;
    height: 0;
    overflow: hidden;
    iframe, object, embed {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

.col2,
.col3,
.col4,
.col2-25,
.col2-33,
.col2-50,
.col2-66,
.col2-75 {
    display: grid;
    grid-row-gap: 1rem;
    grid-column-gap: 10px;
    margin-bottom: 1rem;
}

.col2,
.col2-50 {
    grid-template-columns: 50% 50%;
}

.col3 {
    grid-template-columns: 33% 33% 33%;
}

.col4 {
    grid-template-columns: 25% 25% 25% 25%;
}

.col2-25 {
    grid-template-columns: 25% 75%;
}

.col2-33 {
    grid-template-columns: 33% 67%;
}

.col2-66 {
    grid-template-columns: 66% 34%;
}

.col2-75 {
    grid-template-columns: 75% 25%;
}

@media (max-width: 750px) {
    .col4 {
        grid-template-columns: 33% 33% 33%;
    }
}
@media (max-width: 575px) {
    img {
        &[src*='#left'] {
            max-width: 50% !important;
        }

        &[src*='#right'] {
            max-width: 50% !important;
        }
    }
    .col3, .col4 {
        grid-template-columns: 50% 50%;
    }

    .col2,
    .col2-25,
    .col2-33,
    .col2-50,
    .col2-66,
    .col2-75 {
        grid-template-columns: 50%;
    }
}

@media (max-width: 330px) {
    .col3, .col4 {
        grid-template-columns: 100%;
    }
}
