/* Curated collections: the cards the empty cart offers, and the whole list at
   /collections. Loaded by both pages, with collections.js to split
   each card's logos into even rows. */

.collections {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid #eee;
  text-align: center;
}

#content .collections-sub {
  margin: 0 0 2px;
  color: #777;
  font-variation-settings: "wght" 450, "ital" 1;
}

/* #content h2:not(:first-child) adds 60px above any h2 in the page, and that
   :not() counts toward specificity, so the element has to be named here to
   beat it */
#content h2.collections-title {
  margin: 10px 0 24px;
  font-size: 26px;
}

#content .collection-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

@media (max-width: 700px) {
  #content .collection-list {
    grid-template-columns: 1fr;
  }
}

/* A card takes after the ones on /plugins: the collection's interfaces
   stacked across a tinted stage, and the rest underneath */
#content .collection {
  display: flex;
  flex-direction: column;
  /* a grid column will not shrink below what is inside it, so without this the
     collections holding more logos grow wider than the rest of the row */
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

#content .collection:hover {
  border-color: #d6d6d6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* the stage: a wash from the first plugin's colour to the last's */
.collection-stage {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, var(--tint-from), var(--tint-to));
}

/* placed by the server (store/curated.py, cascade), so they keep their
   sizes relative to one another */
.collection-shot {
  position: absolute;
  display: block;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.14));
  transition: transform 0.35s ease-out;
}

/* on hover the stack spreads a little, each window further than the one
   behind it */
#content .collection:hover .collection-shot {
  transform: translate(calc(var(--i) * 3px), calc(var(--i) * 2px));
}

@media (prefers-reduced-motion: reduce) {
  #content .collection,
  .collection-shot {
    transition: none;
  }
}

/* everything under the stage */
.collection-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 16px 18px 18px;
  border-top: 1px solid #f0f0f0;
}

.collection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#content .collection-name {
  margin: 0;
  font-size: 1.2em;
  line-height: 1.15;
  font-variation-settings: "wght" 780, "opsz" 24;
}


/* the green + that puts a collection in the cart: a button on the cart page, a
   link into it everywhere else */
#content .collection-add {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid seagreen;
  border-radius: 100%;
  background: seagreen;
  color: white;
  font-family: var(--text-font);
  font-size: 20px;
  font-variation-settings: "wght" 750, "ital" 0;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

#content .collection-add:hover {
  filter: brightness(1.15);
}

#content .collection-add:disabled {
  opacity: 0.5;
  cursor: default;
}

#content .collection-about {
  margin: 0;
  font-size: 14px;
  line-height: 145%;
  color: #555;
}

#content .collection-about a {
  color: royalblue;
  text-decoration: underline;
  text-decoration-color: rgba(46, 139, 87, 0.35);
  text-underline-offset: 2px;
}

#content .collection-about a:hover {
  text-decoration-color: seagreen;
}

/* small, since the stage already shows the plugins; the columns are set by
   collections.js, which splits them into rows as even as it can */
#content .collection-plugins {
  display: grid;
  grid-template-columns: repeat(auto-fit, 32px);
  gap: 6px;
  margin: 2px 0 12px;
  padding: 0;
  list-style: none;
}

#content .collection-plugins li {
  width: 32px;
  margin: 0;
  padding: 0;
  background: none;
}

.collection-plugins img {
  display: block;
  width: 100%;
  height: auto;
}

/* under the handful the cart offers, the way to the rest */
#content .collections-more {
  margin: 22px 0 0;
  text-align: center;
  font-size: 15px;
}

#content .collections-more a {
  color: seagreen;
  font-variation-settings: "wght" 650, "ital" 0;
}

#content .collections-more a:hover {
  color: #1e6b41;
}

/* -------------------------------------------------------- /collections */

.curated-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 20px 90px;
}

/* the page's own heading, where the cart has a section heading */
.curated-page .collections {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#content h1.collections-title {
  margin: 10px 0 28px;
}

/* the cards' names are h2 here, under the page's h1; the site adds space
   above every h2 after the first, which the cards do not want */
#content h2.collection-name {
  margin: 0;
}

#content .collections-none {
  grid-column: 1 / -1;
  padding: 24px;
  color: #666;
  text-align: center;
}

/* what the collection saves as a bundle: at the foot of the card, so the lines
   line up across a row whatever length the blurbs above them run to */
#content .collection-saving {
  margin: auto 0 0;
  padding-top: 12px;
  color: seagreen;
  font-size: 15px;
  font-variation-settings: "wght" 500, "ital" 1;
}

/* weight comes from the variation axis here; font-weight alone is overridden */
#content .collection-saving strong {
  font-variation-settings: "wght" 750, "ital" 1;
}

/* more room between the cards when they have the page to themselves */
.curated-page .collection-list {
  gap: 28px;
}

.collections-view {
  margin: -8px 0 28px;
}

/* dark screenshots want a dark stage, still shaded with the plugins' colours */
.curated-page.is-dark .collection-stage {
  background: linear-gradient(135deg, var(--tint-from), var(--tint-to)), #1c1c1e;
}

/* a screenshot that would not load (see collections.js) */
.collection-shot.missing {
  display: none;
}
