/* Featured lists: New Arrivals and Staff Favorites on the homepage (store.php), the category pages (page-new.php,
   page-favs.php, page-wine.php, ...) and the week pages (single-tasty_week.php). Kept out of master.css, which CodeKit
   compiles from scss/ (app.scss, 1040.scss, 780.scss and 380.scss hold the card styles this builds on). */

/* Each card is a panel in the On Tap cards' look (css/on-tap.css li.Tap), which sit right above New Arrivals */
#FullColumn .Featured .FeaturedList > span:nth-child(n) {
  background: rgba(255, 252, 243, 0.75);
  border: 1px solid #d9ca93;
  border-top: 3px solid #f15c22;
  box-shadow: 0 1px 0 rgba(96, 77, 42, 0.12);
  box-sizing: border-box;
}
/* Long names (some run to 70 letters) wrap onto even lines with room between them */
#FullColumn .Featured .FeaturedList > span h3 {
  letter-spacing: 0.5px;
  line-height: 1.25;
  margin-bottom: 2px;
  text-wrap: balance;
}
#FullColumn .Featured .FeaturedList > span p.style {
  text-wrap: balance;
}
/* A 4-pack's button and its single's are the same width, so the pair lines up */
#FullColumn .Featured .FeaturedList > span div.add-button h5 {
  min-width: 52px;
  text-align: center;
}

/* master.css floats the cards, so a card with a long name pushed the cards under it down and the rows came out
   staggered. From 481px up they sit in a grid instead: every row starts level, and each card's buy buttons sit at
   its bottom, level with its neighbours'. */
@media all and (min-width: 481px) {
  /* the bottom padding is the 30px the cards' own bottom margins left before the next section */
  #FullColumn .Featured .FeaturedList {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-bottom: 30px;
  }
  /* master.css's clearfix would take a grid cell of its own */
  #FullColumn .Featured .FeaturedList:after {
    display: none;
  }
  /* :nth-child(n) outweighs master.css's every-fourth / every-second card rules */
  #FullColumn .Featured .FeaturedList > span:nth-child(n) {
    clear: none;
    display: flex;
    flex-direction: column;
    float: none;
    margin: 0;
    padding: 8px 8px 14px;
    width: auto;
  }
  #FullColumn .Featured .FeaturedList > span > div.Buy,
  #FullColumn .Featured .FeaturedList > span > div.Buy > span {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
  }
  #FullColumn .Featured .FeaturedList > span div.Label {
    margin-bottom: 10px;
  }
  #FullColumn .Featured .FeaturedList > span p.style {
    margin-bottom: 10px;
  }
  /* The first price button (or the In-Store Only / Out of Stock tag) takes the free space above it */
  #FullColumn .Featured .FeaturedList > span h3 + div.add-button,
  #FullColumn .Featured .FeaturedList > span h3 + h5.oos,
  #FullColumn .Featured .FeaturedList > span p.style + div.add-button,
  #FullColumn .Featured .FeaturedList > span p.style + h5.oos {
    margin-top: auto;
  }
  #FullColumn .Featured .FeaturedList > span div.add-button,
  #FullColumn .Featured .FeaturedList > span h5.oos {
    align-self: center;
  }
  #FullColumn .Featured .FeaturedList > span h4 {
    margin-bottom: 6px;
  }
  #FullColumn .Featured .FeaturedList > span h4:last-child {
    margin-bottom: 0;
  }
  /* See More New Arrivals / See More Wines: centred under the whole grid, 30px below the cards and 40px above
     the next section as before */
  #FullColumn .Featured .FeaturedList > a.see-more {
    grid-column: 1 / -1;
    justify-self: center;
    margin: 14px auto 10px;
  }
}
@media all and (min-width: 481px) and (max-width: 767px) {
  #FullColumn .Featured .FeaturedList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phones keep master.css's one card per row with the label at the left (scss/380.scss); the label's left offset
   makes the panel's left padding look like its right, and the text gets a 10px gap from the label */
@media all and (max-width: 480px) {
  #FullColumn .Featured .FeaturedList > span:nth-child(n) {
    margin-bottom: 14px !important; /* 380.scss sets 10px with !important */
    padding: 10px 10px 12px 4px;
  }
  #FullColumn .Featured .FeaturedList > span > div > span {
    padding-left: 142px;
  }
}
