:root {
  --templates-brown: rgb(80, 34, 11);
  --templates-brown-button: rgb(112, 67, 44);
  --templates-cream: #f8e7cb;
  --templates-font: Alike, serif;
}

/* Header */
.templates-header {
  max-width: 800px;
}

.templates-header__title {
  font-family: var(--templates-font);
  font-weight: 700;
  color: var(--templates-brown);
}

.templates-header__text {
  font-family: var(--templates-font);
  color: #000;
  font-size: 18px;
  line-height: 1.7;
}

/* Filter */
.templates-filter {
  border: 0;
}

.templates-filter__label {
  font-family: var(--templates-font);
  color: var(--templates-brown);
}

.templates-filter__select {
  font-family: var(--templates-font);
}

/* Grid */
.templates-gallery {
  padding-left: 16px;
  padding-right: 16px;
}

/* Card */
.templates-card {
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.templates-card__body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.templates-card__images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  min-height: 280px;
  padding: 0.5rem;
}

.templates-card__image-wrap {
  flex: 0 0 auto;
  width: 260px;
  height: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0.5rem;
}

.templates-card__image {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #f6f6f6;
  display: block;
}

.templates-card__button {
  align-self: center;
  margin-top: 0.5rem;
  font-family: var(--templates-font);
  background: var(--templates-brown-button);
  color: var(--templates-cream);
  border: 0;
  width: auto;
  min-width: 140px;
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
}

.templates-card__button:hover,
.templates-card__button:focus,
.templates-card__button:active {
  background: var(--templates-brown-button);
  color: var(--templates-cream);
}

.templates-card__meta {
  padding-top: 0.75rem;
}

.templates-card__title {
  font-family: var(--templates-font);
  color: var(--templates-brown);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.templates-card__title-label {
  font-weight: 700;
}

.templates-card__tags {
  font-family: var(--templates-font);
  color: #6c757d;
}

.templates-card__badge {
  background: #6c757d;
  color: #fff;
  font-family: var(--templates-font);
  font-weight: 400;
}

/* Responsive */
@media (max-width: 767.98px) {
  .templates-card__images {
    min-height: auto;
  }

  .templates-card__image-wrap {
    width: 100%;
    max-width: 320px;
  }

  .templates-card__image {
    height: 220px;
  }
}

@media (max-width: 575.98px) {
  .templates-header__text {
    font-size: 17px;
  }

  .templates-card__image {
    height: 200px;
  }
}