/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */
/* ==========================================================================
   Imports
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Lora:ital,wght@0,400..700;1,400..700&display=swap');

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
    color: #222;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
    background: var(--light-gold);
    color: var(--text-dark);
    text-shadow: none;
}

::selection {
    background: var(--light-gold);
    color: var(--text-dark);
    text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
    vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   My custom styles
   ========================================================================== */

:root {
    --bkg-dark-green: ;
    --main-green: #455d58;
    --main-green-dark: hsl(from var(--main-green) h s calc(l - 10));
    --main-green-light: hsl(from var(--main-green) h s calc(l + 10));
    --main-green-lighter: hsl(from var(--main-green) h s calc(l + 25));
    --text-light: hsl(40, 28%, 85.3%);
    --color-light-emphasised: hsl(var(--text-light), 80%, 95%);
    --color-vibrant-green: #507916;
    --color-dark-subtle: hsl(41.6, 35%, 65%);
    --main-light: #faf7f2;
    --main-light-darker: hsl(from var(--main-light) h s calc(l - 15));
    --light-gold: #f1c45e;
    --dark-gold: #e3ab01;
    --main-red: #bf2424;
    --main-red-light: hsl(from var(--main-red) h s calc(l + 10));
    --main-red-lighter: hsl(from var(--main-red) h s calc(l + 25));
    --main-red-lightest: hsl(from var(--main-red) h s calc(l + 40));
    --main-blue: #246fbf;
    --main-blue-light: hsl(from var(--main-blue) h s calc(l + 10));
    --main-blue-lighter: hsl(from var(--main-blue) h s calc(l + 25));
    --main-blue-lightest: hsl(from var(--main-blue) h s calc(l + 40));
    --text-dark: #2a3025;
    --color-dark-surface: hsl(108, 8.8%, 11.2%);
    --color-dark-surface-2: hsl(108, 7.5%, 13.1%);
}

h1,
h2,
h3,
h4,
h5 {
    font-family: "EB Garamond", serif;
    font-weight: 600;
    font-style: normal;
}

body {
    font-family: "Lora", sans-serif;
    font-style: normal;
    font-size: 16px;
    font-weight: 400;
    line-height: 25.6px;
    background-color: var(--color-dark-surface-2);
    color: var(--text-light);
    display: flex;
    justify-content: center;
}

a {
    color: var(--light-gold);
    text-decoration: none;

    &:visited {
        color: var(--dark-gold);
    }

    &:hover {
        text-decoration: underline;
    }

    &.extern::after {
        content: '\2197';
        /* Code for ↗ */
        display: inline-block;
        margin-left: 5px;
        font-size: 0.9em;
    }
}

div#container {
    min-width: 40%;
    max-width: 1080px;
}

div.item,
div.spell,
div.recipe {
    background: linear-gradient(0deg, var(--color-dark-surface-2) 0%, var(--main-green) 100%);
    padding: 10px 10px 15px 10px;
    margin: 2px;

    h1,
    h2,
    h3 {
        margin: 0px 0px 6px 0px;
    }

    span.type {
        font-weight: 840;
    }

    span.spellInfo,
    span.itemInfo {
        color: var(--color-dark-subtle);
    }
}

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

.hero-title {
    font-size: 5.5rem;
    font-weight: 600;
}

.activedefense,
.maneuvers {
    color: var(--text-dark);
    background-color: var(--main-light);

    border-collapse: collapse;

    td,
    th {
        font-size: 16px;
    }

    th {
        color: var(--main-light);
    }

    em {
        padding-left: 20px;
    }

    .altcolor {
        background-color: var(--main-light-darker);
    }
}

.activedefense {
    th {
        background-color: var(--main-red);
    }

    .accentlight {
        background-color: var(--main-red-light);
        color: var(--main-light);
        border-top: solid var(--text-dark) 10px;
    }

    .accentlighter {
        background-color: var(--main-red-lighter);
    }

    .accentlightest {
        background-color: var(--main-red-lightest);
    }
}

.maneuvers {
    th {
        background-color: var(--main-blue);
    }

    .accentlight {
        background-color: var(--main-blue-light);
        color: var(--main-light);
        border-top: solid var(--text-dark) 10px;
    }

    .accentlighter {
        background-color: var(--main-blue-lighter);
    }

    .accentlightest {
        background-color: var(--main-blue-lightest);
    }
}

.infotable {
    color: var(--text-dark);
    background-color: var(--main-light);

    border-collapse: collapse;

    th {
        color: var(--main-light);
        background-color: var(--main-green-dark);
    }

    tr:nth-child(even) {
        background-color: var(--main-light-darker);
    }

    td,
    th {
        padding: 2px 5px;
    }

    &.altlayout {
        tr {
            background-color: var(--main-light);
        }

        td:nth-child(even) {
            background-color: var(--main-light-darker);
        }
    }
}

.highlight {
    padding: 2px;
    background-color: var(--main-green-lighter);
    color: var(--main-light);
}

sup.reference {
    unicode-bidi: isolate;
    white-space: nowrap;
    font-weight: normal;
    font-style: normal;
}

ul.reference {
    color: var(--color-dark-subtle);
}


/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
    display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
    /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    white-space: inherit;
    width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
    visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
    content: "";
    display: table;
}

.clearfix::after {
    clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
    /* Style adjustments for viewports that meet the condition */
}

@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
    /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {

    *,
    *::before,
    *::after {
        background: #fff !important;
        color: #000 !important;
        /* Black prints faster */
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    abbr[title]::after {
        content: " (" attr(title) ")";
    }

    /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
    a[href^="#"]::after,
    a[href^="javascript:"]::after {
        content: "";
    }

    pre {
        white-space: pre-wrap !important;
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}
