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

/* main.css 2.1.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.
 */

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

html {
  color: #222;
  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.
 */

:root
{
    --main-color: #6F807F;
    --ambient-color: #D0D0D0;
    --accent-color: #3A97B6;
}

::-moz-selection
{
  background: var(--accent-color);
  text-shadow: none;
  color: #FFFFFF;
}

::selection
{
  background: var(--accent-color);
  text-shadow: none;
  color: #FFFFFF;
}

/*
 * 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
   ========================================================================== */
   
/* material icons */
@font-face
{
  font-family: "Material Icons";
  font-style: normal;
  font-weight: 400;
  src: url(https://fonts.gstatic.com/s/materialicons/v81/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
}

@font-face {
  font-family: 'Material Icons Outlined';
  font-style: normal;
  font-weight: 400;
  src: url(https://fonts.gstatic.com/s/materialiconsoutlined/v51/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUce.woff2) format('woff2');
}

.mt-icons
{
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: inherit;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -moz-osx-font-smoothing: grayscale;
  -moz-font-feature-settings: "liga";
  font-feature-settings: "liga";
}

.mt-icons.mt-icons-outlined
{
  font-family: "Material Icons Outlined";
}

/* resets */
html, body, div, section, article, form, header, main, footer
{
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6, ul, li, p
{
    margin-top: 0;
    padding: 0;
}

p:last-child,
li:last-child
{
    margin-bottom: 0 !important;
}

/* custom */
html,
html *
{
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
}

html,
body
{
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #2C2C2C;
}

body
{
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

a
{
    color: var(--accent-color);
}

.flex-row,
.flex-col,
.flex-fill,
.flex-split,
.flex-center
{
    display: flex;
    gap: 1em;
}

.flex-col
{
    flex-direction: column;
}

.flex-split
{
    justify-content: space-between;
}

.flex-center
{
    justify-content: center;
    align-items: center;
}

.flex-fill > *
{
    flex: 1;
}

.grid-2,
.grid-3,
.grid-4
{
    --grid-gap: 2.5em;
    display: grid;
    grid-gap: var(--grid-gap);
}

.grid-2
{
    grid-template-columns: 1fr 1fr;
}

.grid-3
{
    grid-template-columns: 1fr 1fr 1fr;
}

.grid-4
{
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.flex-2,
.flex-3,
.flex-4
{
    --flex-gap: 3em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--flex-gap);
}

.wrap
{
    width: 950px;
    max-width: 100%;
    margin: auto;
    padding: 1rem 1rem;
}

button,
.button,
input[type="button"],
input[type="submit"]
{
    display: inline-flex;
    padding: 0.4em 0.75em;
    background: var(--accent-color);
    border: 0;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
    color: #FFFFFF;
    cursor: pointer;
    -webkit-transition: all ease-in-out 0.15s;
    -moz-transition: all ease-in-out 0.15s;
    -ms-transition: all ease-in-out 0.15s;
    -o-transition: all ease-in-out 0.15s;
    transition: all ease-in-out 0.15s;
    justify-content: center;
    align-items: center;
    gap: 0.35em;
}

button.t2,
.button.t2,
input[type="button"]
{
    background: var(--main-color);
    color: #FFFFFF;
}

button:hover,
.button:hover,
button:focus,
.button:focus,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="button"]:focus,
input[type="submit"]:focus
{
    outline: none;
    -webkit-transform: scale(108%);
    -moz-transform: scale(108%);
    -ms-transform: scale(108%);
    -o-transform: scale(108%);
    transform: scale(108%);
}

button.t2:hover,
.button.t2:hover,
button.t2:focus,
.button.t2:focus,
input[type="button"]:hover,
input[type="button"]:focus
{
    background: var(--main-color);
    border-color: var(--main-color);
}

/* header */
.header
{
    position: relative;
    background: #FFFFFF;
    box-shadow: 0 3px 8px 3px rgba(0, 0, 0, 0.25);
}

.header .logo,
.header .logo img
{
    display: inline-block;    
}

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

.header .logo img
{
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100px;
}

/* main */
.main
{
    background: #FBFBF6;
    flex: 1;
}

.main section
{
    padding-top: 2.5em;
    padding-bottom: 2.5em
}

.intro
{
    background: var(--accent-color);
    font-size: 1.24em;
    line-height: 1.64;
    text-align: center;
    color: #FFFFFF;
}

.main .intro
{
    padding-top: 1em;
    padding-bottom: 2em;
}

/*.intro h1
{
    font-size: 48px;
    line-height: 1.35;
    letter-spacing: 0.02em;
}*/

.intro .wrap
{
    position: relative;
}

.intro h1
{
    font-family: Georgia, 'Times New Roman', Times, serif;
}

.books ul,
.books li
{
    margin: 0;
    padding: 0;
    list-style: none;
}

.books .indent
{
    padding-left: 2em;
}

.categ header
{
    position: relative;
    margin-bottom: 5px;
    /*padding-top: 6em;*/
    background: var(--main-color);
    border-top: 10px solid transparent;
    color: #FFFFFF;
}

.categ header::before
{
    content: "";
    position: absolute;
    background: rgba(0, 0, 0, 0.18);
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.categ header h1
{
    margin-bottom: 0;
    font-weight: normal;
    font-size: 32px;
    line-height: 1.3;
    text-transform: uppercase;
    word-spacing: 0.1em;
}

.categ header p
{
    font-style: italic;
    font-size: 18px;
}

.book
{
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.book.featured
{
    padding: 2em;
    background: rgba(0, 0, 0, 0.028);
    border-radius: 1.5em;
    font-size: 1.32em;
    text-align: center;
    align-items: center;
    grid-column: span 2;
    gap: 1em;
}

.book.featured-2 {
  grid-column: span 1;
}

.flex-2 .book
{
    flex-basis: calc(50% - (var(--flex-gap) / 2));
}

.flex-3 .book
{
    flex-basis: calc(33.33% - (var(--flex-gap) / 3));
}

.flex-4 .book
{
    flex-basis: calc(25% - (var(--flex-gap) / 4));
}

.flex-3 .book.featured,
.flex-4 .book.featured
{
    flex-basis: calc(50% - (var(--flex-gap) / 2));
    flex-grow: 1;
}

.book *:last-child
{
    margin-bottom: 0 !important;
}

.book figure,
.book.overlay figure
{
    display: flex;
    max-width: 100%;
    min-height: 150px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.book figure, 
.book .figure
{
    margin-top: 0.2em
}

.book.featured figure,
.book.featured .figure
{
    min-height: 380px;
    text-align: center;
    align-items: center;
}

.book figure img,
.book .figure img,
.book.overlay figure img
{
    width: auto;
    max-width: 190px;
    height: auto;
    max-height: 280px;
    box-shadow: -5px 5px 0 var(--ambient-color);
}

.book.featured figure img,
.book.featured .figure img
{
    max-width: 100%;
    max-height: 380px;
}

.book h1
{
    margin-bottom: 0.2em;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 20px;
    color: var(--main-color);
}

.book h2
{
    margin-bottom: 0.35em;
    font-size: 16px;
    font-weight: normal;
    color: var(--main-color);
}

.book .story
{
    text-align: left;
}

.book .actions
{
    margin-bottom: 0.76em;
    padding-top: 0.3em;
    gap: 1em;
}

.book.featured .actions
{
    margin-bottom: 1em;
}

.book .actions .button
{
    min-width: 8em;
    font-size: 1.4em;
}

.book.featured .actions .button
{
    min-width: 8.5em;
}

/* single vote link */
.voting .vote
{
    position: fixed;
    right: -0.4em;
    bottom: 1em;
    background: #FFFFFF;
    border-color: #FFFFFF;
    border-radius: 3px 0 0 3px;
    box-shadow: -2px 5px 13px -3px rgba(0,0,0,0.3);
    font-size: 34px;
    font-weight: bold;
    z-index: 11;
    width: auto;
}

.voting .vote:hover,
.voting .vote:focus
{
    background: #C2432D;
    color: #FFFFFF;
    padding:0.35em 20vw;
}

.voting .vote span:first-child
{
    text-transform: uppercase;
    white-space: nowrap;
}

.voting .vote .exp
{
    display: inline-block;
    width: auto;
    max-width: 0;
    white-space: nowrap;
    overflow: hidden;
    -webkit-transition: all 0.5s ease-in-out;
    -moz-transition: all 0.5s ease-in-out;
    -ms-transition: all 0.5s ease-in-out;
    -o-transition: all 0.5s ease-in-out;
    transition: all 0.5s ease-in-out;
}

.voting .vote:hover .exp,
.voting .vote:focus .exp
{
    max-width: 100vw;
    margin-right: 0.4em;
}

/* footer */
.footer
{
    background: var(--main-color);
    border-top: 5px solid var(--accent-color);
    color: #F2F2F3;
}

.footer .wrap
{
    padding: 2em;
}

.footer .wrap > *:last-child
{
    text-align: right;
}

.footer a
{
    font-weight: bold;
    color: #F2F2F3;
}

/* overlay */
.overlay
{
    display: none;
    padding: 2.5em;
    width: 600px;
    max-width: 100%;
}

.book.overlay
{
    width: auto;
    max-width: 100%;
    padding-top: 0;
}

.book.overlay h1,
.book.featured h1
{
    font-size: 1.8em;
}

.book.overlay h2,
.book.featured h2
{
    margin-bottom: 0.5em;
    font-size: 1.2em;
}

.book.featured h2
{
    font-size: 1.32em;
}

.book.overlay h3,
.book.featured h3
{
    margin-bottom: 1.5em;
    font-size: 1em;
    color: #333333;
}

.book.overlay ul
{
    padding-left: 2.5em;
}

.book.overlay figure
{
    /*width: 200px;*/
    max-width: 250px;
    margin: auto;
    margin-bottom: 2em;
}

.book.overlay figure img
{
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: none;
}

.book.overlay > div
{
    display: flex;
    gap: 2em;
}

.book.overlay > div > div:first-child > div
{
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    text-align: center;
}

.book.overlay .button
{
    border-width: 3px;
    font-size: 1.8em;
    font-weight: bold;
}

.book.overlay .share
{
    margin-top: 2em;
    gap: 0.5em;
}

.book.overlay .share svg
{
    width: 30px;
}

.book.overlay .share .em svg
{
    fill: var(--main-color);
}

.book.overlay .share .fb svg
{
    fill: #1B74E4;
}

.book.overlay .share .tw svg
{
    fill: #0F1419;
}

.book.overlay .share .li svg
{
    fill: #0A66C2;
}

.book.overlay .share .pi svg
{
    fill: #E60023;
}

.book.overlay .share .bs svg
{
    fill: #0085FF;
}

.book.overlay .story
{
    font-size: 1.15em;
    line-height: 1.35;
    text-align: left;
    flex: 1;
}

body.has-overlay
{
    overflow: hidden;
}

body.has-overlay *
{
    opacity: 0.8 !important;
}

body.has-overlay .errmsg
{
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    padding: 3em;
    background: var(--accent-color);
    font-size: 21px;
    text-align: center;
    color: #FFFFFF;
    z-index: 99999;
    opacity: 1 !important;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
}

/* fancybox overrides */
.fancybox-close
{
    display: flex;
    top: -4px;
    right: -4px;
    width: auto;
    height: auto;
    background: var(--main-color);
    padding: 0.25em;
    font-size: 2em;
    line-height: 1em;
    text-decoration: none;
    color: #FFFFFF;
}

.fancybox-close:before
{
    content: "close";
    font-family: "Material Icons";
    font-weight: normal;
    font-style: normal;
    font-size: inherit;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -moz-osx-font-smoothing: grayscale;
    -moz-font-feature-settings: "liga";
    font-feature-settings: "liga";
    font-weight: bold;
}

.fancybox-skin,
.fancybox-opened .fancybox-skin
{
    background: #FFFFFF;
    border: 5px solid var(--main-color);
    border-radius: 0;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    -ms-box-shadow: none;
    -o-box-shadow: none;
    box-shadow: none;
}

.fancybox-overlay
{
    background: rgba(235, 235, 235, 0.8);
}

.fancybox-outer
{
    margin-top: 3.5em;
}

@media screen and (max-width: 1248px)
{
    .header
    {
        position: -webkit-sticky;
        position: sticky;
        top: 0px;
        left: 0px;
        right: 0px;
        height: auto;
        z-index: 9;
    }
    
    .header .wrap
    {
        width: 100%;
    }

    .intro .badge
    {
        top: -2em;
    }

    .voting .vote:hover,
    .voting .vote:focus
    {
        padding:0.35em 10vw;
    }
}

@media screen and (max-width: 950px)
{
    .grid-4
    {
        grid-template-columns: 1fr 1fr;
    }

    .flex-3 .book
    {
        flex-basis: calc(50% - var(--flex-gap));
    }

    .voting .vote {
        z-index: 8;
    }
}

@media screen and (max-width: 850px)
{
    /* .flex-3 .book,
    .flex-4 .book
    {
        flex-grow: 1;
    } */

    .grid-2
    {
        grid-template-columns: 1fr;
    }

    .flex-2
    {
        flex-direction: column;
    }

    .flex-2 .book
    {
        flex-basis: auto;
    }

    .flex-3 .book.featured,
    .flex-4 .book.featured
    {
        flex-basis: 100%;
    }
    
    .book figure,
    .book .figure,
    .book.overlay figure
    {
        min-height: 0;
    }

    .book.featured
    {
        flex-direction: column;
        align-items: center;
    }

    .grid-2 .book.featured
    {
        grid-column: span 1;
    }
    
    .book.featured figure,
    .book.featured .figure
    {
        width: auto;
    }
    
    .book.featured figure img,
    .book.featured .figure img
    {
        max-width: 80%;
        max-height: none;
    }
    
    .book.featured .actions
    {
        flex-direction: row;
    }
    
    .book.featured .actions .button
    {
        min-width: 8.5em;
    }
}

@media screen and (max-width: 720px)
{
    .books li
    {
        margin-bottom: 3em;
    }
    
    .voting .vote
    {
        bottom: 2em;
        font-size: 23px;
    }
    
    .book.overlay > div
    {
        flex-direction: column;
    }
    
    .book.overlay > div > div:first-child > div
    {
        position: static;
    }
}

@media screen and (max-width: 640px)
{
    /* .flex-3,
    .flex-4
    {
        gap: 5em;
        --flex-gap: 5em;
    }

    .book
    {
        font-size: 16px;
    } */

    .flex-3 .book
    {
        flex-direction: column;
    }

    .book.featured
    {
        padding: 1em;
        border-radius: 0.5em;
    }

    .book.featured figure,
    .book.featured .figure
    {
        width: 100%;
    }
    
    .book figure img,
    .book .figure img
    {
        /*max-width: 100%;*/
        max-height: none;
    }

    .book h1
    {
        font-size: 1.48em;
    }

    .book h2
    {
        font-size: 1.32em;
    }

    .book .story
    {
        font-size: 1em;
    }
    
    .book .actions
    {
        flex-direction: row;
    }

    .footer .wrap
    {
        flex-direction: column;
        gap: 2em;
    }

    .footer .wrap > *
    {
        text-align: center !important;
    }
}

@media screen and (max-width: 480px)
{
    .flex-3,
    .flex-4
    {
        gap: 5em;
        --flex-gap: 5em;
    }
    
    .flex-3
    {
        flex-direction: column;
    }
    
    .book.overlay
    {
        padding: 0 1.5em 1.5em 1.5em;
    }

    .books .grp
    {
        margin-left: 0;
    }
    
    .books .indent
    {
        padding-left: 1em;
    }
    
    .book,
    .book.featured figure,
    .book.featured .figure
    {
        align-items: normal;
    }
    
    .book
    {
        text-align: center;
        flex-direction: column;
    }
    
    .book figure,
    .book .figure
    {
        width: auto;
    }
    
    .book.featured figure img,
    .book.featured .figure img
    {
        max-width: 100%;
    }
    
    .book .actions
    {
        font-size: 18px;
        flex-direction: column;
        justify-content: center;
        gap: 10px;
    }
    
    .book.featured .actions
    {
        flex-direction: column;
    }

    .voting .vote
    {
        right: -1px;
        bottom: 0.75em;
    }
    
    .voting .vote .exp
    {
        display: none;
    }
}

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

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

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