@import "css/variables";

body {
    font-size: 14px;
    background-color: #fefefe;
    margin: 0;
    padding: 0;
    color: #111;

    @include fontWeight();

    //@media (max-width: $width-container-mobile-lrg) {
    //    font-size: 16px;
    //}

    @media (max-width: $width-container-mobile) {
        font-size: 13px;
    }
}

.ruler {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    height: 900px;
    width: 5px;
    background-color: $color-primary;
}

* {
    box-sizing: border-box;
    font-size: 1em;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

h1 > span {
    //background-color: $color-primary;
    //padding: .5rem;
    //color: #fff;
    line-height: 1.6em;
}


h1 {
    //@include outOfBox;
    color: $color-primary;
    font-size: 3em;

    &.small-title {
        font-size: 2.5em;
    }

    @media (max-width: $width-container-mobile) {
        font-size: 2.2em;
        line-height: 2em;
    }

    line-height: 1.2em;

    @media (max-width: $width-base) {
        margin: .5em 20px;
        padding-left: 0;
    }

    @media (max-width: $width-mobile) {
        margin: .5em 0;
    }
}

h2 {
    font-size: 1.8em;
    font-weight: 400;
    margin-top: 1.3em;
    position: relative;
}

body h3 {
    font-size: 1.5em;
    margin-top: 1.1em;
    color: $color-black;
}

h2, h3 {
    & > small {
        display: inline-block;
        border-radius: 5px;
        background-color: $color-php;
        color: #fff;
        text-transform: lowercase;
        position:relative;
        top:-4px;

        &.breaking {
            background-color: $color-breaking;
        }

        a:visited,
        a {
            color: inherit;
            text-decoration: none;
            padding: 1px 5px 4px 5px;
            display: inline-block;

            @media (max-width: $width-container-mobile-lrg) {
                text-decoration: underline;
            }
        }
    }
}

h2 > small {
    font-size: .5em;
}

h3 > small {
    font-size: .7em;
}

article {
    @include wrapper();
    font-family: $font-body;
    position: relative;
}

p {
    color: $color-body;
    font-size: 1.3em;
    line-height: 1.55em;

    margin-bottom: 1rem;

    & > small {
        font-size: 1rem;
    }
}

li {
    font-size: 1.3em;
    line-height: 1.55em;
    margin: 0 auto .3rem;
    max-width: $width-base;
    padding-right: 50px;

    @media (max-width: $width-base) {
        max-width: 100%;
        padding-right: 20px;
    }
}

li ul li {
    font-size: 1em;
    padding-right: 0;
}

ul {
    font-weight: 300;
    color: $color-body;
    margin-left: 40px;
    padding-left: 1.5em;
    margin-bottom: 2rem;

    @media (max-width: $width-base) {
        margin-left: 20px;
        padding-left: 0;
    }
}

ul ul {
    margin-top: 10px;
    margin-left: 40px;

    @media (max-width: $width-base) {
        margin-left: 20px;
    }
}

p > em {
    font-style: normal;
    line-height: inherit;
}

blockquote {
    background: $color-primary-pastel;
    padding: 1rem;
    border-left: 4px solid $color-primary;
    color: $color-black;
    line-height: 2em;
    position: relative;

    margin: 0 0 1rem 0;

    p {
        color: inherit;
        line-height:inherit;
    }

    @media (max-width: $width-mobile) {
        border: 1px solid $color-primary;
    }

    &:before {
        position: absolute;
        content: '"';
        display: block;
        font-size: 4em;
        font-family: "Times New Roman", serif;
        color: $color-primary;
        font-weight: bold;
        top: -2px;
        left: 0;


        @media (min-width: $width-mobile) {
            -webkit-text-stroke-width: 2px;
            top: -4px;
            left: -3px;
            -webkit-text-stroke-color: $color-primary-pastel;
        }

    }
}

blockquote + em {
    margin-top: -1em;
    margin-bottom: 1.5em;
}

h1 + blockquote {
    margin-bottom: 2rem;
}

p+blockquote {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

blockquote > p:last-child {
    margin-bottom: 0;
}

blockquote code {
    font-size: .7em;
}

code {
    font-size: .8em;
    letter-spacing: 1px;

    padding: .2em .4em;
    margin-right: 2px;

    font-family: $font-code;
    background-color: darken(#fff, 5);
    color: #000;
}

p code, ul code {
    @media (max-width: $width-container-mobile-lrg) {
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

pre {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;

    overflow-x: auto;
    display: block;

    border: 1px solid darken(#fff, 7);
    background-color: darken(#fff, 3);

    @include outOfBox();
}

pre {
    line-height: 1.7em;
    font-size: 1.1em;
    letter-spacing: 0;
    margin-right: 0;

    padding: 1.5em 1.5rem;

    display: block;
    background-color: darken(#fff, 3);

    @media (max-width: $width-base) {
        padding: 1.5em 1rem;
    }
}

video {
    @include outOfBox();
    max-width: 100%;
}

img {
    box-shadow: 1px 2px 15px -2px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
    max-width:100%;

    @include outOfBox();

    &.editor-badge {
        margin-left: auto;
        margin-right: auto;
        display: block;
        box-shadow: none;
    }

    @media (max-width: $width-base) {
        max-width: 100%;
        margin-left: 0;
    }
}

p > img {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

footer {
    font-family: $font-body;
    margin-bottom: 2rem;
    margin-top: 3rem;
    padding-top:1rem;
    padding-bottom:1rem;
}

footer > nav {
    @include wrapper;
    text-align: center;
}

footer > p {
    font-size: 1.2em;
    text-align: center;
    color: #111;
    margin-top: 1em;

    a {
        color: inherit;
    }
}

a:visited,
a {
    color: #000;
    text-decoration: underline;
    text-decoration-skip: edges;
    text-decoration-color: $color-primary;
}

a:hover {
    text-decoration: none;
}

hr {
    position: relative;
    height: 2rem;
    border: none;
    text-align: center;
    margin: 3rem auto;

    &::before {
        display: inline-block;
        border-bottom: solid #999 1px;
        content: ' ';
        width: 30%;
    }

    @media (max-width: $width-container-mobile) {
        margin: 2rem auto;

        &::before {
            width: 90%;
        }
    }
}

iframe {
    margin-top: 1em;
    margin-bottom: 1em;
    width: 100%;

    @media (max-width: $width-container-mobile) {
        height: 250px;
    }
}

abbr {
    font-variant: all-small-caps;
    font-weight: normal;
    font-size: 1.1em;
    line-height: 1em;
    white-space: nowrap;
}

span.number {
    font-size: .9em;
    line-height: 1em;
    white-space: nowrap;
}

.table-container {
    overflow-x: auto;
}

table {
    font-size: 1.3rem;
    width: 100%;
    margin-bottom: 2rem;
    border-spacing: 0;

    @media (max-width: $width-container-mobile) {
        font-size: 1rem;
    }
}

tr.table-head {
    background-color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
}

tr {
    background-color: darken($color-primary-pastel, 3);
}

td.right {
    text-align: right;
}

tr:nth-child(2n) {
    background-color: $color-primary-pastel;
}

tr.highlight-text {
    font-weight: bold;
}

tr > td:first-child {
}

td {
    padding: .5em 1em;
}

form {
    @media(min-width: $width-container-mobile-lrg) {
        display: flex;
        align-items: baseline;
    }

    font-family: $font-body;
}

label {
    font-size: 1.2rem;
}

input {
    font-size: 1.2rem;
    padding: .5em;
    font-family: $font-body;
    font-weight: normal;
    border: 1px solid $color-black;
}

input:focus {
    border: 1px solid $color-primary;
    outline: none;
}
