@import "mixins-and-vars";

body {
    //font-family: "OpenSans", "Helvetica", "Arial", sans-serif;
    font-family: "Helvetica", "Arial", sans-serif;
    line-height: 1.1;
    color: #444;

    // This forces the footer to go to the bottom.
    // Brilliant idea from:
    // https://stackoverflow.com/questions/4575826/how-to-push-a-footer-to-the-bottom-of-page-when-content-is-short-or-missing

    /* @media @tablet-up {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
  } */
}

strong {
    font-weight: bold;
    color: #222;
}

em {
    font-family: "OpenSans", "Helvetica", "Arial", sans-serif;
    font-style: italic;
}

ul {
    list-style: initial;
}

ol {
    list-style: decimal;
}

h1 {
    // font-family: "GraublauWeb", "Arial", "Helvetica", sans-serif;
    font-weight: bold;
    color: #222;
    font-size: (35 / @px);
}

h2 {
    // font-family: "GraublauWeb", "Arial", "Helvetica", sans-serif;
    font-size: (29 / @px);
    border-bottom: solid 1px #999999;
    margin: (29 / @px) 0 0 0;
    color: #222;
}

h3 {
    font-weight: bold;
    padding-top: 20px;
    font-size: (20 / @px);
    border-bottom: double 3px #000;

    .enable__is-dark-mode & {
        border-color: @dark-mode-white;
    }
}

h4 {
    font-weight: 500;
    padding: 20px 0;
    font-size: (20 / @px);
}

a {
    color: @orange;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    scroll-margin-top: 100px;
}

.heading__deeplink {
    color: inherit;
    text-decoration: none;

    &:focus,
    &:hover {
        &::after {
            color: #666;
            content: "#";
            display: inline-block;
            font-size: 0.7em;
            margin-left: 4px;
            text-decoration: none;
            transform: translateY((-4 / @px));
        }
    }
}

ul,
ol {
    padding-left: 1.2rem;
    margin-left: 1.2rem;

    table {
        margin-top: 1.5rem;
    }
}

ul {
    list-style: disc;
}

ul,
ol,
p {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

table {
    li {
        margin-bottom: 1.5rem;
    }
}

.enable-quote {
    background: #f9f9f9;
    border-left: 10px solid #ccc;
    margin: 1.5em 10px;
    padding: 0.5em 10px;
    quotes: "\201C" "\201D" "\2018" "\2019";
}

.centered-block {
    margin: 0 auto;
    display: block;
}

.example {
    h1 {
        text-align: center;
    }

    main {
        max-width: 1024px;
        margin: 0 auto;
    }

    .example-nav {
        text-align: center;

        ul {
            li {
                display: inline-block;
                list-style: none;
            }
        }
    }

    .notes {
        border: dashed #9c6f39 3px;
        padding: 1em;
        background-color: #ffffee;
        margin: 2em auto;
        max-width: calc(1024px - 2em);

        h2 {
            margin: 0;
            border-bottom: none;
        }
    }
}

input,
select {
    font-size: 1em;
}

.enable-example {
    padding: 1em;
    border: solid 1px black;
    margin: 3em 0;
    border-left: solid 5px black;
    font-family: "Helvetica", "Arial", sans-serif;

    .enable__is-dark-mode & {
        border-color: #aaa;
    }

    &--no-border {
        border: none;
    }

    &:has(video),
    &:has(iframe) {
        padding: 0;
        border: none;
        /* margin: 0 -@mobile-page-padding;

        @media @desktop {
            margin: 0 -@page-padding;
        } */
    }
}

.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

.mobile {
    display: none !important;

    @media @mobile {
        display: inherit !important;
    }
}

.tablet {
    display: none !important;

    @media @tablet {
        display: inherit !important;
    }
}

.desktop {
    display: none !important;

    @media @desktop {
        display: inherit !important;
    }
}

.mobile-and-tablet {
    display: none !important;

    @media @mobile-and-tablet {
        display: inherit !important;
    }
}

.bookmarklet {
    border: solid 1px black;
    border-radius: 14px;
    padding: 7px;
    margin: 1em auto;
    color: white;
    font-weight: bold;
    max-width: 15em;
    width: 50%;
    background-color: #4c6874;
    display: block;
    text-align: center;
    text-decoration: none;
    text-shadow: 2px 2px 2px black;
}

.list {
    &--no-decoration,
    &--inline {
        list-style: none;
        margin-left: 0;
    }

    // Inline turns list items into inline-block
    &--inline {
        margin-left: -5px;

        > li {
            display: inline-block;
            padding-right: 5px;
            padding-left: 5px;
        }
    }
}

.break {
    &--with-space {
        content: "A" !important;
        display: block !important;
        margin-bottom: 0.5rem !important;
    }
}

/* z-index overrides */
.enable-flyout {
    z-index: (@able-player-max-z-index + 1) !important;

    &__overlay-screen {
        z-index: (@able-player-max-z-index) !important;
    }

    &__open-menu-button {
        z-index: (@able-player-max-z-index + 2) !important;
    }
}

.play-pause-anim {
    &__checkbox-container {
        z-index: (@able-player-max-z-index - 1) !important;

        @media @desktop {
            z-index: (@able-player-max-z-index + 2) !important;
            // Safari needs some help here
            transform: translateZ(2px);
        }

        .enable-flyout__body--is-open & {
            z-index: 0 !important;
        }
    }
}

code {
    font-family: "ModeSeven", "Consolas", monospace;
    background-color: #eee;
    border-radius: 3px;
    padding: 3px;
    word-wrap: break-word;

    a & {
        background-color: #f6f6f6;
    }

    .enable__is-dark-mode & {
        color: #0a0;
        background-color: #000;
    }
}

.center {
    text-align: center;
}

.margin-bottom {
    margin-bottom: 40px;
}

.compliance-table {
    width: 450px;
    max-width: 100%;

    .has-multi-tables & {
        vertical-align: top;

        @media @desktop {
            display: inline-block;
            &:not(:last-child) {
                margin-right: 20px;
            }
        }
    }
}

.compliance-table,
.comparison-table {
    margin: 1em auto 3em auto;

    th,
    td {
        text-align: center;
        vertical-align: middle;
    }

    th {
        a {
            color: @table-header-link-color;

            .enable__is-dark-mode & {
                color: @table-header-link-color--dark-mode;
            }
        }
    }

    tr {
        background: none !important;
    }

    td {
        border: solid 1px @table-cell-border-color;

        .enable__is-dark-mode & {
            border: solid 1px @table-cell-border-color--dark-mode
        }
    }

    &__icon {
        width: 20px;
    }
}

.has-multi-tables {
    text-align: center;
    &::after {
        content: "";
        clear: both;
        display: table;
    }
}

.meter-demo-container {
    // Container for example meters (not needed for meter)
    align-items: center;
    column-gap: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    justify-content: space-between;
    text-wrap: nowrap;
    width: fit-content;
}

.screen-reader-table {
    tr {
        @first-col-width: 125px;
        td {
            width: calc(~"(100% - @{first-col-width}) / 5");
        }

        td:first-child {
            width: @first-col-width;
        }
    }
}

iframe {
    .enable-focus({
    outline: solid 2px @focus-color !important;
    outline-offset: -2px;
  }, {
    outline: none !important;
  });
}


.enable__is-dark-mode {
    main {
        color: @dark-mode-white;
    }
    
    body {
        background: #333;
        //color: rgb(201, 209, 217);
        color: @dark-mode-white;
    }
    

    strong {
        color: @dark-mode-white;
    }

    h1 {
        color: @dark-mode-white;
    }

    h2 {
        color: @dark-mode-white;
    }

    p {
        color: @dark-mode-white;
    }

    a {
        color: @light-orange;
    }

    .enable-quote {
        background: #222;
        border-left: 10px solid #555;
    }

    input,
    textarea,
    select {
        background: @dark-mode-black;
        color: @dark-mode-white;
        border-color: @dark-mode-white;
    }

    input[type="submit"] {
        background: @dark-mode-darkgrey;
        color: @dark-mode-white;
    }
}

img, svg {
    max-width: 100%;
}
