.tpl-card {
  position: relative;
  display: block;
  border-radius: 5px;
  overflow: hidden;
  aspect-ratio: 3 / 5.5;
  background: #efece9;
  box-shadow: 0 8px 26px rgba(31, 26, 24, .10);
  transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s ease;
}
.tpl-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 28px 52px rgba(125, 62, 50, .24);
}

/* image fills the card */
.tpl-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.22,1,.36,1);
}
.tpl-card:hover img { transform: scale(1.07); }

/* top scrim keeps the title readable on light artwork */
.tpl-card .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
              rgba(28,16,12,.55) 0%,
              rgba(28,16,12,.28) 28%,
              rgba(28,16,12,0) 52%);
  transition: background .45s ease;
}
.tpl-card:hover .scrim {
  background: linear-gradient(180deg,
              rgba(28,16,12,.62) 0%,
              rgba(28,16,12,.38) 32%,
              rgba(28,16,12,.10) 60%);
}

/* category chip, bottom-left so it stays clear of the title */
.tpl-card .chip {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.34);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 30px;
}

/* ---- top content block ---- */
.tpl-card .tpl-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  padding: 26px 20px 0;
  text-align: center;
}

.tpl-card .tpl-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 16px;
  letter-spacing: -.01em;
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tpl-card .tpl-title a { color: inherit; text-decoration: none; }

/* outlined button, like the reference */
.tpl-card .btn-use {
  display: inline-block;
  background: transparent;
  border: 1px solid rgba(255,255,255,.85);
  color: #fff;
  border-radius: 4px;
  padding: 9px 26px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.tpl-card .btn-use:hover {
  background: #fff;
  border-color: #fff;
  color: #7d3e32;
}

/* preview icon, bottom-right */
.tpl-card .btn-prev {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease, background .28s ease, color .28s ease;
}
.tpl-card:hover .btn-prev { opacity: 1; transform: translateY(0); }
.tpl-card .btn-prev:hover { background: #fff; color: #7d3e32; }

/* touch devices have no hover — keep the preview visible */
@media (hover: none) {
  .tpl-card .btn-prev { opacity: 1; transform: translateY(0); }
}
