@import 'variables';

$block-border-radius: 4px;

.markdown {
    line-height: 1.4;
    margin-left: 12px;

    h1:first-of-type {
        text-transform: capitalize;
        font-weight: 500;
        margin-top: 0;
        font-size: 2.8em;

        @media all and (max-width: $sm-breakpoint){
            font-size: 2em;
        }
    }

    h2 {
        margin-top: 48px;
    }

    h3 {
        margin-top: 36px;
        color: $gray-700;
    }

    h1, h2, h3, h4, h5 {
        font-family: $brand-font-face;
        font-weight: 600;
        line-height: 1.25;

        &[id]:target:before {
            display: block;
            content: " ";
            margin-top: -75px; // Set the Appropriate Height
            height: 75px; // Set the Appropriate Height
            visibility: hidden;
        }
        &[id]:target {
            text-decoration: underline;
        }
    }

    b, optgroup, strong {
        font-weight: 700;
    }

    a {
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }

    li {
        margin-bottom: 6px;
    }

    code:not([data-lang]) {
        font-family: 'Source Code Pro', monospace;
        padding: 0 $padding-4;
        background: $color-code-bg;
        color: $color-code-text;
        border-radius: $block-border-radius;
        border: 1px solid $color-code-border;
    }

    pre:not(.chroma) {
        padding: $padding-16;
        background: $color-code-bg;
        border-radius: $block-border-radius;
        font-size: $font-size-14;
        overflow-x: auto;

        code {
            color: $color-code-text;
            background: none;
            padding: none;
        }
    }

    blockquote {
        margin: 0;
        padding: $padding-16 $padding-16;
        position: relative;
        font-size: 22px;
        color: $gray-700;

        :first-child { margin-top: 0; }
        :last-child { margin-bottom: 0; }

        ::before {
            content: '“';
            position: absolute;
            font-family: Georgia, 'Times New Roman', Times, serif;
            font-size: 48px;
            top: 0px;
            left: -6px;
            color: $gray-500;
        }
    }

    table {
        width: 100%;
        th {
            text-align: left;
        }
        td, th {
            padding: $padding-4;
        }
        tr:nth-child(odd) td {
            background-color: $gray-100;
        }
    }
}
