/*! HTML5 Boilerplate v6.1.0 | MIT License | https://html5boilerplate.com/ */

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

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

    html {
        color: #000;
        font-size: 1em;
        line-height: 1.4;
    }

    /*
     * 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 {
        background: #b3d4fc;
        text-shadow: none;
    }

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

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* Typography */

@font-face {
    font-family: 'Encode';
    src: url('../fonts/encodesanscondensedsemibold-webfont.woff2') format('woff2'),
         url('../fonts/encodesanscondensedsemibold-webfont.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Encode';
    src: url('../fonts/encodesans-regular-webfont.woff2') format('woff2'),
         url('../fonts/encodesans-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Encode', Helvetica, Arial, sans-serif;
}

h1 {
    color: #FEC501;
    flex-grow: 1;

}

h2, h3, p, ul {
    /*max-width: 45rem;*/
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5em;
}
/* Layout */

header, footer {
    background: #000;
    padding: 0 2em;
}

.nav {
    align-items: center;
    display: flex;
    list-style-type: none;
    justify-content: center;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    height: 100%;
    flex-direction: column;
}

.nav__link {
    color: #fff;
    margin: 0 0 0 1em;
}

.cta {
    border-radius: 0.3em;
    background-color: #bf1010;
    color: #fff;
    display: inline-block;
    font-weight: bold;
    padding: 0.5em 1em;
    text-decoration: none;
    white-space: nowrap;
}

@media screen and (min-width: 440px) {

    .nav {
        flex-direction: row;
    }
    
}

@media screen and (min-width: 500px) {

    .nav {
        justify-content: flex-end;
    }
    
}

.container {
    margin: 0 auto;
    max-width: 50rem;
}

.container--masthead {
    display: grid;
    grid-gap: 2em;
    grid-template-columns: 1fr auto;
    max-width: 800px;
}

.hero {
    background-color: #FEC501;
    font-family: 'Encode', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 2em;
}

.hero__container {
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: auto 1fr;
    grid-gap: 2em;
    margin: 0 auto;
    max-width: 800px;
}

.hero__heading {
    font-size: 2em;
    margin: 0;
}

.hero__img {
  border: 1px solid #000;
  height: auto;
  margin: 0 auto;
  max-width: 300px;
  width: 100%;
}

.hero__action {
    margin: 0;
    text-align: center;
}

.cta--hero {
    display: inline-block;
    font-size: 1.25em;
    margin: 0 auto;
    max-width: calc(300px - 2em);
    text-align: center;
    width: calc(100% - 2em);
}

.blurb {
    padding: 1em 2em;
}

.blurb__heading {
    border-bottom: 4px #FEC501 solid;
    color: #000000;
    display: inline-block;
    line-height: 25px;
    margin-bottom: 0;
    text-shadow:  -3px 2px white, 0 2px white, 2px 2px white;
}

.signup {
    background-color: #FEC501;
    margin: 0;
    padding: 1em 2em 2em;
}

.formcontainer {
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 100%;
    grid-template-rows:  1fr 1fr 1fr auto;
    grid-gap: 1em;
    margin: 0 auto;
    max-width: 800px;
}

input[type=text],
input[type=email] {
    border: none;
    border-radius: 0.3em;
    padding: 0.5em 1em;
}

.cta--signup {
    background: #000;
    border: 0;
}

footer {
    color: #fff;
    padding: 1em 2em;
}

.footer__content {
    margin: 0 auto;
    max-width: 800px;

}

@media screen and (min-width: 500px) {

    .nav {
        justify-content: flex-end;
    }
}

@media screen and (min-width: 600px) {


    .hero__container {
        grid-template-columns: auto 1fr;
        grid-template-rows: 1fr auto 1fr 1fr;
    }

    .hero__heading {
        grid-column: 1;
        grid-row: 2;
    }

    .hero__action {
        grid-column: 1;
        grid-row: 3;
        text-align: left;
    }

    .hero__img {
        align-self: center;
        grid-column: 2;
        grid-row: 1 / span 4;
        width: 200px;
    } 

    .cta--hero {
        max-width: calc(200px - 2em);
    }
}


@media screen and (min-width: 700px) {

    .hero__heading {
        font-size: 2.5em;
    }
    .hero__img {
        width: 250px;
    } 

}

@media screen and (min-width: 800px) {

    .hero__container {
        grid-template-rows: 1fr auto 1fr 1fr;
    }

    .hero__heading {
        grid-row: 2;
    }

    .hero__img {
        grid-row: 1 / span 4;
        width: 300px;
    } 

    .hero__action {
        grid-row: 3;
    }
}


.chapter {
  background: white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  display: grid;
  grid-gap: 1em;
  grid-template-columns:  20% auto;
  grid-template-rows:  auto auto;
  margin: 3em auto;
  padding: 1em;
  justify-content: space-evenly;
  /*padding: 1em 2em;*/
}

h2 + .chapter {
  margin-top: 2em;
}

.chapter__meta {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 7em;
  line-height: 1;
  margin: 0 auto;
}

.chapter__heading {
  grid-column: 2;
  grid-row: 1;
  /*text-align: left;*/
  margin: 1em 0 0;
}

.chapter__content {
  grid-column: 2;
  grid-row: 2;
}

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

    /*
     * Hide visually and from screen readers
     */

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

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

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

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

    /*
     * 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: " "; /* 1 */
        display: table; /* 2 */
    }

    .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: transparent !important;
            color: #000 !important; /* Black prints faster */
            -webkit-box-shadow: none !important;
            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:
         * 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;
        }
    }
