/* Collection theme plates (template-parts/collection/theme-cards.php).
   Borrow the theme page hero: a dark title bar and an indented yellow
   tagline bar, here overlapping the bottom edge of a large photo.
   Square corners and no shadow, unlike the rounded story cards. */

.theme-plates {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--med);
  margin: var(--med) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 800px) {
  .theme-plates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.theme-plate__link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-bottom: none;
}

.theme-plate__link:focus-visible {
  outline: 3px solid hsl(var(--clr-mediumRed));
  outline-offset: 6px;
}

.theme-plate__image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: hsl(var(--clr-darkBlue));
}

.theme-plate__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.theme-plate__link:is(:hover, :focus-visible) .theme-plate__image img {
  transform: scale(1.03);
}

/* Label sits inside the photo, pinned to its bottom-left corner */
.theme-plate__link {
  position: relative;
}

.theme-plate__label {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
}

.theme-plate__title {
  display: inline-block;
  margin: 0;
  padding: 0.45rem 1rem 0.5rem;
  background: hsl(var(--clr-darkBlue));
  color: hsl(var(--clr-white));
  font-family: var(--ff-serif);
  font-size: var(--fs-600);
  font-weight: var(--fw-400);
  letter-spacing: var(--ls-2);
  line-height: 1.2;
  text-wrap: balance;
}

.theme-plate__tagline {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0 1.5rem;
  padding: 0.3rem 0.75rem;
  background: hsl(var(--clr-mediumYellow));
  color: hsl(var(--clr-darkBlue));
  font-family: var(--ff-sans-normal);
  font-size: var(--fs-400);
  letter-spacing: var(--ls-1);
  line-height: 1.35;
}

@media (min-width: 800px) {
  .theme-plate__label {
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
  }

  .theme-plate__tagline {
    margin-left: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-plate__image img {
    transition: none;
  }

  .theme-plate__link:is(:hover, :focus-visible) .theme-plate__image img {
    transform: none;
  }
}
