/*! HTML5 Boilerplate v8.0.0 | MIT License | https://html5boilerplate.com/ */

/* main.css 2.1.0 | MIT License | https://github.com/h5bp/main.css#readme */

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

/*
* Remove text-shadow in selection highlight:
* https://twitter.com/miketaylr/status/12228805301
*
* Vendor-prefixed and regular ::selection selectors cannot be combined:
* https://stackoverflow.com/a/16982510/7133471
*
* Customize the background color to match your design.
*/

::-moz-selection {
    text-shadow: none;
}

::selection {
    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;
}

textarea {
    resize: vertical;
}

/* ==========================================================================
   YOUR STYLES GO HERE ...
========================================================================== */

* {
    box-sizing: border-box;
    font-family: Helvetica;
}

html {
    margin: 0;
    padding: 0;
    max-width: 100%;
    font-size: 1em;
    line-height: 1.4;
    background-color: #eee;
}

body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.page {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: #eee;
}

header {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    padding: 3rem 0 3rem 0;
}

h1, h4 {
    margin: 0;
    padding: 0;
}

h1 span {
    background: linear-gradient(to bottom left, rgb(5, 118, 224) 50%, rgb(211, 54, 6) 30%);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mapContainer {
    position: relative;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    width: 95%;
}

/* Tables 1 & 2 */
#countryResults {
    display: flex;
    flex-flow: nowrap column;
    margin: auto;
    width: 100%;
    z-index: 1;
}

#countryResults div {
    width: 100%;
}

#countryResults table {
    width: 100%;
    margin: auto;
}

#countryResults td,
#countryResults th,
#stateResults td,
#stateResults th  {
    padding: 0.5rem;
    width: 50%;
}

th, td {
    text-align: center;
    color: white;
}

.blueCandidate {
    background-color: rgb(5, 118, 224);
}

.redCandidate {
    background-color: rgb(211, 54, 6);
}

#electionWinnerName,
.winner {
    background-color: #888888;
}

#stateResults {
    width: 100%;
    margin: 1rem auto 1rem auto;
}

#stateResults th{
    background-color: #3b3b3b;
}

/* Table 2: Election map */
#mapWrapper {
    width: 100%;
    margin: -4rem auto 1rem auto;
    z-index: 0;
    overflow-x: auto;
}

/* Footer */
footer {
    bottom: 0;
    width: 100%;
}

footer p {
    font-size: 0.75rem;
    text-align: center;
    text-transform: uppercase;
}

footer a {
    text-decoration: none;
    background: linear-gradient(to bottom left, rgb(5, 118, 224) 50%, rgb(211, 54, 6) 30%);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
  
@media only screen and (min-width: 768px) {
    #countryResults,
    #stateResults {
        width: 50%;
    }

    #mapWrapper {
        width: 90%;
        margin: -5rem auto 0.5rem auto;
    }
}

@media only screen and (min-width: 992px) {
    #countryResults {
        flex-direction: row;
        width: 90vw;
        max-width: 56.25rem;
    }

    #mapWrapper {
        display: flex;
        justify-content: center;
        width: 90vw;
        max-width: 56.25rem;
        margin-bottom: 2rem;
    }

    #stateResults {
        position: absolute;
        width: 21.875rem;
        right: 0;
        bottom: 0;
    }

    footer {
        margin-top: 0.5rem;
    }
}


/* ==========================================================================
   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
*/

.sr-only {
    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 .sr-only class to allow the element
* to be focusable when navigated to via the keyboard:
* https://www.drupal.org/node/897638
*/

.sr-only.focusable:active,
.sr-only.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
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
*    `contenteditable` attribute is included anywhere else in the document.
*    Otherwise it causes space to appear at the top and bottom of elements
*    that receive the `clearfix` class.
* 2. 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;
}


/* ==========================================================================
   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;
    }

    /*
    * Printing Tables:
    * https://web.archive.org/web/20180815150934/http://css-discuss.incutio.com/wiki/Printing_Tables
    */
   
    thead {
        display: table-header-group;
    }

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

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

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

