/* Скачивание логотипа: плашка с картинкой, по клику выезжает меню ссылок.
   Работает в паре с /js/download.js.

   <div class="ids__download">
     <div class="ids__download-item">
       <figure>
         <div class="ids__download-plate">
           <img src="…" alt="">
           <span class="ids__download-caption">Скачать</span>
         </div>
         <figcaption>Английский</figcaption>
       </figure>
       <div class="ids__download-menu">
         <p><a href="…">Для экрана<span> ⋅ RGB ⋅ EN ⋅ PNG, SVG</span></a></p>
         <p><a href="…">Для печати<span> ⋅ CMYK ⋅ EN ⋅ EPS, PDF</span></a></p>
       </div>
     </div>
   </div> */

.ids .ids__download {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8em;
  margin: 1.3em -30% 0;

  @media (width < 768px) {
    margin-inline: 0;
  }

  & figure {
    margin-bottom: 0;
  }

  & figcaption {
    text-align: center;
  }
}

.ids .ids__download-item {
  position: relative;
  width: 31%;

  @media (width < 768px) {
    width: 100%;
  }
}

.ids .ids__download-plate {
  position: relative;
  border-radius: 0.5em;
  padding: 2em;
  background-color: var(--ids__surface);
  cursor: pointer;
  transition: transform var(--ids__duration-base) var(--ids__easing-base);

  & img {
    display: block;
    width: 100%;
  }

  &:hover,
  .ids__download-item.active & {
    transform: translateY(-0.2em);
  }
}

.ids .ids__download-caption {
  position: absolute;
  bottom: 0.5em;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.7em;
  opacity: 0;
  transition: opacity var(--ids__duration-base);

  .ids__download-plate:hover & {
    opacity: 0.7;
    transition: 0s;
  }
}

.ids .ids__download-menu {
  position: absolute;
  left: 50%;
  top: calc(100% - 1.5em);
  transform: translateX(-50%);
  z-index: 1;
  width: max-content;
  max-width: 100vw;
  padding: 0.8em 1em;
  border-radius: 0.5em;
  background: var(--ids__background);
  box-shadow: 0 0.5em 1.5em color-mix(in srgb, var(--ids__text) 20%, transparent);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--ids__duration-base),
    top var(--ids__duration-base);

  &.visible {
    top: calc(100% + 0.5em);
    opacity: 1;
    pointer-events: auto;
  }

  & p {
    margin-bottom: 0.4em;
    font-size: 0.8em;
  }

  & a {
    text-decoration: none;
    color: color-mix(in srgb, var(--ids__text) 75%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--shift__brand) 20%, transparent);
    padding-bottom: 0.3em;

    &:hover {
      color: var(--ids__hover);
    }

    & span {
      font-size: 0.85em;
      opacity: 0.5;
      letter-spacing: 0.1em;
    }
  }

  & p:last-child a {
    border-bottom: 0;
  }
}

/* Плашка-ссылка: тот же вид, что у кнопки меню, но ведёт сразу на файл */
.ids a.ids__download-plate {
  display: block;
  color: inherit;
  text-decoration: none;

  &:hover {
    color: inherit;
    text-decoration: none;
  }
}

/* Несколько макетов на одной плашке, клик скачивает архив
   (бывш. .download-group).

   <a class="ids__download-group" href="….zip" download>
     <span class="ids__download-group-items">
       <img src="…" alt="">
       <img class="pill" src="…" alt="">
     </span>
     <span class="ids__download-group-caption">Download</span>
   </a> */
.ids a.ids__download-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 0.8em;
  color: inherit;
  text-decoration: none;

  &:hover {
    transform: translateY(-0.2em);
    color: inherit;
    text-decoration: none;
  }
}

.ids .ids__download-group-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  width: 100%;
  box-sizing: border-box;
  background: var(--shift__aside-background);
  border-radius: 0.9em;
  padding: 1.2em 1.4em;

  & img {
    height: 16em;
    width: auto;
    max-width: 24%;
    object-fit: contain;
  }

  & img.pill {
    height: 7em;
    max-width: none;
  }

  @media (width < 768px) {
    & img,
    & img.pill {
      height: auto;
      max-height: 16em;
      max-width: 70%;
    }
  }
}

.ids .ids__download-group-caption {
  display: block;
  width: 100%;
  margin-top: 0.45em;
  text-align: center;
  color: var(--ids__caption);
  font-size: 0.7em;
  line-height: 1.2;
}
