/*
 * "Passar till:" — the food-pairing icons on wine pages.
 *
 * Captured verbatim from the live page's inline <style> blocks, which the
 * chrome extraction drops. Without these rules the block renders as an
 * unstyled bulleted list of full-size images.
 *
 * One rule is deliberately NOT copied: `.taste-characteristics-align-right
 * { opacity: 0 }`. Live pairs it with a scroll-triggered `.tasteAnim0` class
 * added by the tastech script; with the script gone the block would stay
 * invisible forever. It is simply always visible here.
 */
.taste-characteristics-align-right {
  display: inline;
  margin-bottom: 10px;
  max-width: 100%;
  width: 336px;
}

.taste-characteristics-align-right h3:first-child {
  margin-top: 10px;
}

.taste-characteristics-align-right ul.foods {
  list-style: none;
  text-align: center;
  margin: 0 30px 10px 0;
}

.taste-characteristics-align-right ul.foods li {
  width: 25%;
  display: block;
  float: left;
  color: #333;
  text-transform: uppercase;
  position: inherit;
  font-size: 0.5em;
  padding: 0 1em 1.5em 0;
}

.taste-characteristics-align-right ul.foods li img {
  max-width: 100%;
  height: auto;
}

.taste-characteristics-align-right ul.foods li a {
  color: initial;
}

@media screen and (min-width: 769px) {
  .taste-characteristics {
    width: 25%;
  }

  .taste-characteristics-align-right {
    float: right;
    margin-left: 40px;
    display: inline;
    margin-bottom: 10px;
    max-width: 100%;
    width: 336px;
  }

  .taste-characteristics-align-right ul.foods {
    list-style: none;
    text-align: center;
    margin: 0;
  }

  .taste-characteristics-align-right ul.foods li {
    width: 25%;
    display: block;
    float: left;
    color: #333;
    text-transform: uppercase;
    position: inherit;
    font-size: 0.5em;
    padding: 0 1em 1em 0;
  }
}

@media screen and (max-width: 600px) {
  .taste-characteristics-align-right {
    width: 100%;
    display: block;
    margin: 0 auto;
  }

  .taste-characteristics-align-right ul.foods {
    margin: 0 auto 10px;
    display: flex;
    flex-wrap: wrap;
  }

  .taste-characteristics-align-right ul.foods li {
    float: none;
    display: inline-block;
  }
}

/*
 * The tasting bars.
 *
 * The plugin's own stylesheet (meks-flexible-shortcodes/css/style.css) already
 * ships and does the real work; these are only the two things it leaves to the
 * shortcode's inline attributes and to the theme.
 *
 * NOT copied from live: `.mks_progress_level_set { max-width: 0 }`, which pairs
 * with a scroll-triggered `.tasteAnim1` to fill the bar. With the animation
 * script gone that rule would pin every bar at zero width.
 */
.taste-characteristics-align-right .mks_progress_bar {
  margin: 0 0 12px;
}

.taste-characteristics-align-right .mks_progress_label {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  color: #333;
}

.taste-characteristics-align-right .mks_progress_level {
  background: #eee;
}

/*
 * The scroll-in animation, copied from live's own keyframes.
 *
 * These only run once vinjakt-theme.ts adds the classes, which it does when the
 * block scrolls into view. Until then the block is fully visible and the bars
 * are at their real width — the animation is decoration on top of a finished
 * state, never the thing that reveals it. That is the opposite of live, where
 * `opacity: 0` and `max-width: 0` are the resting state and the missing script
 * leaves both stuck there.
 */
@keyframes tasteAnim0 {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes tasteAnim1 {
  0% { max-width: 0; }
  100% { max-width: 100%; }
}

.taste-characteristics-align-right.tasteAnim0 {
  animation-name: tasteAnim0;
  animation-duration: 1.3s;
  animation-delay: 0s;
  animation-fill-mode: both;
}

.taste-characteristics-align-right .mks_progress_level_set.tasteAnim1 {
  animation-name: tasteAnim1;
  animation-duration: 2.3s;
  animation-delay: .2s;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
}

@media (prefers-reduced-motion: reduce) {
  .taste-characteristics-align-right.tasteAnim0,
  .taste-characteristics-align-right .mks_progress_level_set.tasteAnim1 {
    animation: none;
  }
}
