/* Palette and type from style-guide.md. */
:root {
  --clr-green-500: hsl(158, 36%, 37%);
  --clr-green-700: hsl(158, 42%, 18%);
  --clr-cream: hsl(30, 38%, 92%);
  --clr-white: hsl(0, 0%, 100%);
  --clr-grey: hsl(228, 12%, 48%);
  --clr-black: hsl(212, 21%, 14%);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;

  background-color: var(--clr-cream);
  color: var(--clr-grey);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
}

.card {
  display: flex;
  width: 100%;
  max-width: 600px;

  background-color: var(--clr-white);
  border-radius: var(--radius);
  overflow: hidden;
}

.card__image,
.card__content {
  flex-basis: 50%;
  flex-shrink: 0;
}

.card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
}

.card__category {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 0.75rem;
}

.card__title {
  margin: 0;
  color: var(--clr-black);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
}

.card__description {
  margin: 0;
}

.card__prices {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
}

.card__price,
.card__was {
  margin: 0;
}

.card__price {
  color: var(--clr-green-500);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.card__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9375rem;

  background-color: var(--clr-green-500);
  color: var(--clr-white);
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;

  transition: background-color 150ms ease;
}

.card__button:hover {
  background-color: var(--clr-green-700);
}

/* Without this a keyboard user cannot tell the button is focused. */
.card__button:focus-visible {
  outline: 2px solid var(--clr-green-700);
  outline-offset: 3px;
}

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

/* Below the design's tablet width the card stacks and the artwork swaps to the
   taller mobile crop (see the <picture> element). */
@media (max-width: 40em) {
  .card {
    flex-direction: column;
    max-width: 24rem;
  }

  .card__image,
  .card__content {
    flex-basis: auto;
    width: 100%;
  }

  .card__image img {
    height: 15rem;
  }

  .card__content {
    padding: 1.5rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
