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

/* ==========================================================================
   Font Family
   ========================================================================== */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/playfairdisplay/v37/nuFvD-vYSZviVYUb_rj3ij__anPXJzDwcbmjWBN2PKdFvXDTbtPK-F2qC0usEw.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/ptsans/v17/jizaRExUiTo99u79D0aExcOPIDUg-g.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'PT Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/ptsans/v17/jizYRExUiTo99u79D0e0w8mIAjcQ-woy.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --font-family-sans-serif: 'PT Sans', 'Helvetica Neue', 'Helvetica', 'Arial';
  --font-family-serif: 'Playfair Display', 'Georgia', 'Times New Roman', 'Times';
  --background-color: #fff;
  --font-color: #222;
  --border-color: #d4d4d8;
  --primary-color: #007aff;
  --primary-box-shadow-color: color-mix(in srgb, var(--primary-color) 10%, black);
  --margin: 16px;
}

/* ==========================================================================
   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
 *
 * 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 var(--border-color);
  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
   ========================================================================== */

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

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

/* ==========================================================================
   Custom styles
   ========================================================================== */

body {
  font-family: var(--font-family-sans-serif), sans-serif;
  font-weight: normal;
  font-size: 1rem;
  font-synthesis: none;
  direction: ltr;
  text-align: left;
  text-wrap: balance;
  margin: 0;
  padding: 0;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: var(--margin) auto;

  &.about,
  &.refund,
  &.terms {
    height: calc(100vh - var(--margin) * 5.7);
  }
}

.information {
  max-width: 50%;
  text-align: center;

  .title {
    font-family: var(--font-family-serif), serif;
    font-size: 3rem;
    line-height: 1.2;
    font-weight: 400;
  }

  .description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: color-mix(in srgb, var(--border-color) 50%, black);
  }
}

.tales {
  gap: var(--margin);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  max-width: 1200px;
  overflow: hidden;
  margin: var(--margin) auto;

  .tales__item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
    grid-column: span 4 / span 4;

    &:nth-last-child(2) {
      grid-column: span 5 / span 5;
    }

    &:last-child {
      grid-column: span 7 / span 7;
    }

    &:hover {
      .caption {
        .listen {
          opacity: 1;
        }
      }
    }

    .cover {
      width: calc(var(--margin) * 20);
      height: calc(var(--margin) * 26);
      margin: 0 auto;
      object-fit: contain;
    }

    .caption {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 0 var(--margin);

      .info {
        .duration {
          font-size: 0.875rem;
          line-height: 1.6;
          color: color-mix(in srgb, var(--border-color) 80%, black);
        }

        .title {
          font-size: 1.5rem;
          line-height: 2rem;
          font-weight: normal;
          margin: 0;
        }
      }

      .listen {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        opacity: 0;
        border-radius: 20px;
        cursor: pointer;
        border: 1px solid var(--border-color);
        color: color-mix(in srgb, var(--border-color) 10%, var(--font-color));
        background: color-mix(in srgb, var(--background-color) 98%, var(--font-color));
        box-shadow: 0 5px 20px color-mix(in srgb, var(--border-color) 20%, transparent);
        transition: background 0.3s, box-shadow 0.3s, opacity 0.3s;

        &.playing {
          opacity: 1;
        }

        &:hover {
          background: color-mix(in srgb, var(--background-color) 95%, black);
        }

        &:active {
          box-shadow: none;
          background: color-mix(in srgb, var(--background-color) 90%, black);
        }
      }
    }
  }
}

.price {
  display: flex;
  gap: var(--margin);
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin-top: calc(var(--margin) * 2);

  .buy {
    border: none;
    color: var(--background-color);
    font-size: 1rem;
    line-height: 1.2;
    border-radius: 20px;
    padding: 12px 24px;
    cursor: pointer;
    text-decoration: none;
    background: var(--primary-color);
    box-shadow: 0 5px 20px color-mix(in srgb, var(--primary-box-shadow-color) 20%, transparent);
    transition: background 0.3s, box-shadow 0.3s;

    &:hover {
      background: color-mix(in srgb, var(--primary-color) 90%, white);
    }

    &:active {
      background: color-mix(in srgb, var(--primary-color) 80%, white);
      box-shadow: none;
    }
  }

  .price__description {
    font-size: 0.875rem;
    color: color-mix(in srgb, var(--border-color) 80%, black);
  }
}

.trailer {
    width: 50%;
    height: 480px;
    border: none;
    margin-top: calc(var(--margin) * 2);
}

.benefits {
  margin-top: calc(var(--margin) * 2);
  padding: calc(var(--margin) * 2);
  background: color-mix(in srgb, var(--background-color) 98%, var(--font-color));

  .benefits__title {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 400;
    margin: 0 auto;
  }

  .benefits__list {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: var(--margin);
      margin: var(--margin) auto;
      list-style: none;
      padding: 0 calc(var(--margin) * 4);

      .benefits__item {
          display: flex;
          gap: 12px;
          align-items: center;
          padding: 12px;

        .benefits__image {
          width: 150px;
          height: 150px;
          object-fit: contain;
        }

        .benefits__text {
          font-size: 1.25rem;
          line-height: 1.6;
        }
      }
  }
}

.book-authors {
  width: 50%;
  position: relative;
  margin: calc(var(--margin) * 2) auto;

  .book-authors__item {
    display: flex;
    gap: var(--margin);
    align-items: flex-end;
    flex-direction: column;
    padding: calc(var(--margin) * 2);
    border-radius: var(--margin);
    background: color-mix(in srgb, var(--background-color) 98%, var(--font-color));

    .text {
      font-size: 1.5rem;
      line-height: 1.6;
      font-style: italic;
      margin: 0 auto;
      text-indent: 0;
      hanging-punctuation: first;
    }

    .blockquote-footer {
      font-size: 1rem;
      line-height: 1.6;
    }
  }

  .authors-img {
    width: 60px;
    height: 60px;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
  }
}

.main-footer {
    margin-top: var(--margin);
    padding: var(--margin);
    text-align: center;
    background: color-mix(in srgb, var(--background-color) 98%, var(--font-color));
    border-top: 1px solid var(--border-color);

  .footer-nav {
    display: flex;
    justify-content: center;
    gap: var(--margin);
    margin: 0 auto;

    .footer-link {
        color: var(--font-color);
        text-decoration: none;
        font-size: 1rem;
        line-height: 1.6;
        border-bottom: 1px solid color-mix(in srgb, var(--border-color) 90%, var(--font-color));
        transition: border-bottom 0.3s, color 0.3s;

      &:hover {
        border-bottom: 1px solid var(--primary-color);
        color: var(--primary-color);
      }
    }
  }
}

.thanks {
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin: var(--margin) auto;
  background: color-mix(in srgb, var(--background-color) 98%, var(--font-color));
  border-radius: var(--margin);
  text-align: center;

  .email-link {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    line-height: 1.4;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 90%, var(--font-color));

    &:hover {
      border-bottom: 1px solid var(--primary-color);
    }
  }
}

.social {
  display: flex;
  justify-content: center;
  gap: var(--margin);
  list-style: none;
  width: 100%;
  padding: 0;
  .network {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
    cursor: pointer;
    background: color-mix(in srgb, var(--background-color) 98%, var(--font-color));
    box-shadow: 0 5px 20px color-mix(in srgb, var(--border-color) 20%, transparent);
    transition: background 0.3s, box-shadow 0.3s;

    &:hover {
      background: color-mix(in srgb, var(--background-color) 95%, black);
    }

    .link {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 12px;
      text-decoration: none;
      color: color-mix(in srgb, var(--border-color) 10%, var(--font-color));
      .name {
        font-size: 1.25rem;
        line-height: 1.6;
      }
    }
  }
}

@media screen and (max-width: 1200px) {
  .information {
    max-width: 75%;
  }

  .tales {
    max-width: 100%;
    overflow-x: auto;;
    grid-template-columns: repeat(5, 1fr);

    .tales__item {
      padding: var(--margin);
      grid-column: span 1;

      &:nth-last-child(2), &:last-child {
        grid-column: span 1;
      }

      .caption {
        .listen {
          opacity: 1;
        }
      }
    }
  }

  .trailer {
    width: 100%;
  }

  .thanks {
    width: 95%;
    background: none;
  }

  .benefits {
    .benefits__list {
      padding: 0 var(--margin);
      grid-template-columns: repeat(2, 1fr);

      .benefits__item {
        grid-column: span 1;

        &:last-child {
          grid-column: span 2;

        }
      }
    }
  }

  .book-authors {
    width: 100%;
  }
}

.reviews {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.reviews__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 0;
  list-style: none;
}

.reviews__item {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 5px;
}

.reviews__avatar {
  display: block;
  margin-bottom: 10px;
}

.reviews__author {
  font-weight: bold;
  margin-top: 10px;
}

.star-rating {
  display: inline-block;
}

.star-rating__star {
  color: #ffd700;
  font-size: 20px;
}

@media screen and (max-width: 768px) {
  .information {
    padding: 0 var(--margin);
    max-width: 100%;

    .title {
      font-size: 2.5rem;
    }

    .description {
      font-size: 1rem;
    }
  }

  .tales {
    margin: 0;

    .tales__item {
      .cover {
        width: calc(var(--margin) * 15);
        height: calc(var(--margin) * 20);
      }
    }
  }

  .trailer {
    height: 300px;
  }

  .benefits {
    .benefits__title {
      font-size: 1.5rem;
    }

    .benefits__list {
      padding: 0;
      grid-template-columns: repeat(1, 1fr);

      .benefits__item {
        grid-column: span 2;

        .benefits__image {
          width: 100px;
          height: 100px;
        }

        .benefits__text {
          font-size: 1rem;
        }
      }
    }
  }

  .price {
    margin: 0;
    bottom: 0;
    width: 100%;
    position: fixed;
    z-index: 10;
    gap: var(--margin);
    flex-direction: row-reverse;
    justify-content: space-between;
    padding: var(--margin) 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background: color-mix(in srgb, var(--background-color) 85%, transparent);

    .buy {
      min-width: 120px;
      text-align: center;
      margin-right: var(--margin);
    }

    .price__description {
      margin-left: var(--margin);
    }
  }

  .book-authors {
    .book-authors__item {
      margin: var(--margin);

      .text {
        font-size: 1.2rem;
        line-height: 1.5;
      }
    }

    .authors-img {
      width: 60px;
      height: 60px;
      bottom: -20px;
    }
  }

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

  .main-footer {
    .footer-nav {
      flex-direction: column;
      gap: 0;
      margin-bottom: calc(var(--margin) * 4);

      .footer-link {
        border-bottom: none;
        margin-bottom: var(--margin);

        &:hover {
          border-bottom: none;
        }
      }
    }
  }
}
