/* --------- Download block (blocks/download) --------- */

/* A row: title and text on the left, the download icon on the right. With a
   file the whole row is the link, through the title's ::after. */
.download {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--wp--preset--spacing--50);
  box-sizing: border-box;
  padding: 18px var(--wp--preset--spacing--60);
  border: 1px solid var(--wp--preset--color--secondary);
  border-radius: 24px;
  background-color: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.download-body {
  flex: 1;
  min-width: 0;
}

.download .download-title {
  margin: 0;
  color: var(--wp--preset--color--primary);
  font-size: var(--wp--preset--font-size--large);
  font-weight: 500;
  line-height: 1.2;
}

.download .download-text {
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.download-icon {
  display: block;
  flex: none;
  width: 16px;
  height: 20px;
  background-color: var(--wp--preset--color--primary);
  mask: url(../../assets/img/download.svg) no-repeat center / contain;
  -webkit-mask: url(../../assets/img/download.svg) no-repeat center / contain;
}

.download-title a {
  color: inherit;
  text-decoration: none;
}

.download-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.download-title a:focus-visible {
  outline: none;
}

.download:has(.download-title a:focus-visible) {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

/* Touch screens have no hover; a tap would leave the colour stuck. */
@media (hover: hover) {
  .download--link:hover {
    background-color: var(--wp--preset--color--secondary);
  }
}
