/* Inspiration filter (#18371). Separate file: assets/css/main.css is minified
   build output. Follows the look of the mockups and the .projects styles. */

.projects__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

/* Same look as the first item of the header menu: Canela, and a chevron that
   turns over when the panel opens */
.projects__filter {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  font-family: Canela, Georgia, serif;
  font-size: 16px;
  line-height: 2.5;
  color: #000;
  cursor: pointer;
}

.projects__filter::after,
.filter__expand::after {
  content: "";
  display: block;
  background: url(/assets/svg/arrow-bottom.svg) no-repeat 50% / contain;
  transition: transform .2s cubic-bezier(.455, .03, .515, .955);
}

.projects__filter::after {
  width: 12px;
  height: 5px;
  margin-left: 10px;
}

.projects__filter[aria-expanded="true"]::after,
.filter__expand[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* .projects__list and .filter are display:flex, which beats the browser style
   for [hidden]: hide the swapped lists explicitly */
.projects__list[hidden],
.projects__item[hidden],
.projects__empty[hidden],
.filter[hidden] {
  display: none;
}

/* The panel unfolds on a click: .filter clips the height while .filter__inner
   keeps its borders and padding at full size (JS animates max-height and the
   bottom margin) */
.filter {
  overflow: hidden;
  margin-bottom: 50px;
}

.filter__inner {
  padding: 30px 0;
  border-top: 1px solid #e0ded9;
  border-bottom: 1px solid #e0ded9;
}

.filter__list {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.filter__group {
  flex: 0 0 25%;
  margin-bottom: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.filter__item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  cursor: pointer;
}

.filter__item--child {
  padding-left: 25px;
}

.filter__head {
  display: flex;
  align-items: flex-start;
}

.filter__expand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 18px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.filter__expand::after {
  width: 8px;
  height: 5px;
}

/* Subcategories unfold like the panel. Rows animate from 0fr to 1fr, so no
   height has to be measured; visibility keeps the folded checkboxes out of the
   tab order, and only switches once the closing animation is over. */
.filter__children {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows .35s ease, visibility 0s linear .35s;
}

.filter__group.is-expanded .filter__children {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows .35s ease, visibility 0s;
}

.filter__children-inner {
  min-height: 0;
  overflow: hidden;
}

.filter__checkbox {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin: 2px 12px 0 0;
  accent-color: #000;
}

.filter__label {
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 1px;
  color: #000;
}

.filter__item--child .filter__label {
  color: #8a8a8a;
}

/* Inspiration types (#18944): their own block under the categories, with a
   subtitle in the serif of the "Filtrer" link */
.filter__section {
  margin-top: 10px;
}

.filter__title {
  margin: 0 0 20px;
  font-family: Canela, Georgia, serif;
  font-size: 16px;
  line-height: 1.4;
  color: #000;
}

.filter__actions {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.filter__apply {
  padding: 15px 30px;
  border: 0;
  background: #1a1a1a;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
}

.filter__clear {
  margin-left: 30px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 15px;
  color: #8a8a8a;
  cursor: pointer;
}

/* Filtered results: a masonry of columns, so every photo keeps its own
   proportions and no gap is left between rows, unlike the fixed-width cards of
   the project grid */
.projects__list--photos {
  display: block;
  column-count: 3;
  column-gap: 30px;
}

.projects__item--photo {
  width: 100%;
  margin: 0 0 30px;
  -webkit-column-break-inside: avoid;
  break-inside: avoid;
}

.projects__item--photo a,
.projects__item--photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Same appearance as the site's reveal-block: fade + 20px rise, one after the
   other. The leaving list fades out first, so the two never overlap. */
.projects__item--photo {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s cubic-bezier(.39, .575, .565, 1),
              transform .5s cubic-bezier(.39, .575, .565, 1);
}

.projects__list--photos.is-revealed .projects__item--photo {
  opacity: 1;
  transform: none;
}

.projects__list.is-leaving,
.projects__empty.is-leaving {
  opacity: 0;
  transition: opacity .25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .projects__filter::after,
  .filter__expand::after,
  .filter__children,
  .filter__group.is-expanded .filter__children {
    transition: none;
  }

  .projects__item--photo,
  .projects__list.is-leaving,
  .projects__empty.is-leaving {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.projects__empty {
  margin: 0 0 50px;
  font-size: 15px;
  color: #8a8a8a;
}

@media screen and (max-width: 900px) {
  .projects__list--photos {
    column-count: 2;
    column-gap: 20px;
  }

  .projects__item--photo {
    margin-bottom: 20px;
  }

  .projects__header {
    display: block;
    text-align: center;
  }

  .projects__filter {
    margin-bottom: 30px;
  }

  .filter__group {
    flex: 0 0 50%;
  }

  .filter__actions {
    justify-content: center;
  }
}

@media screen and (max-width: 420px) {
  .projects__list--photos {
    column-count: 1;
  }

  .filter__group {
    flex: 0 0 100%;
  }
}
