/*
 * Covers on the downloadable documents.
 *
 * Its own file rather than part of app.min.css, which is gulp output: the deploy
 * runs collectstatic but not gulp, so touching the bundle would mean committing a
 * built file. This ships as itself.
 *
 * The card was a block of labelled text with a red PDF badge at the end, which told
 * you the format and nothing else. These are designed booklets, so the cover goes
 * where a document's cover belongs and the badge keeps its place as the thing you
 * press.
 *
 * The bundle lays this card out two ways, switching at 681px, and the breakpoint
 * below is that same number rather than one of this file's choosing. Picking a
 * different one would leave a band of widths where the two disagreed.
 */

.document_download__cover {
  flex: 0 0 auto;
  /* An image is an inline box, so without this the line box underneath it shows as
     a few pixels of card colour below the cover. */
  line-height: 0;
}

.document_download__cover__image {
  display: block;
  width: 4.4rem;
  height: auto;
  /* White behind it, because a cover with a transparent or pale edge would
     otherwise pick up the card's colour and stop looking like paper. */
  background-color: #fff;
  border: 1px solid rgba(21, 23, 26, 0.14);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(21, 23, 26, 0.08),
              0 3px 10px rgba(21, 23, 26, 0.12);
  will-change: box-shadow;
  transition-duration: 0.28s;
  transition-property: box-shadow;
  transition-timing-function: ease-in-out;
}

/* The card already lifts on hover. The cover lifts a little further, so the thing
   being pointed at is the thing that answers. */
.document_download__anchor:active .document_download__cover__image,
.document_download__anchor:focus .document_download__cover__image,
.document_download__anchor:hover .document_download__cover__image {
  box-shadow: 0 2px 4px rgba(21, 23, 26, 0.12),
              0 8px 20px rgba(21, 23, 26, 0.18);
}

/* Narrow. The bundle stacks this card as a reversed column, which is what puts the
   badge above the text on a phone. Reversed means a later order sits higher up, so
   this lifts the cover to the top, where the eye starts, instead of leaving it at
   the bottom where being first in the markup would otherwise put it. */
.document_download__cover {
  order: 1;
  margin-bottom: 0.809rem;
}

@media only screen and (min-width: 681px) {
  .document_download__anchor {
    /* Was flex-end, which hung the cover off the bottom of a shorter block of
       text. Nothing else in the card changes height, so this only affects how the
       cover and the badge sit against the three lines beside them. */
    align-items: center;
  }

  .document_download__cover {
    order: 0;
    margin-right: 1.077588rem;
    margin-bottom: 0;
  }

  .document_download__cover__image {
    width: 5.4rem;
  }
}
