/**
 * Template list cards (diy-template).
 * Everything is scoped under .tpl-card so the shared `.team .member` rules
 * used by other pages are untouched.
 */

.team .member.tpl-card {
  /* `.team .member` (0,2,0) centres text and adds padding; both fight a long SEO
     title, and a bare `.tpl-card` (0,1,0) loses to it — hence the longer selector. */
  text-align: left;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .07);
  transition: transform .25s ease, box-shadow .25s ease;
}
.tpl-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}

/* ── Thumbnail ── */
.tpl-card .tpl-thumb {
  display: block;
  line-height: 0;
}
.tpl-card .tpl-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
}

/* ── Badges over the image ── */
.tpl-card .tier-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  z-index: 2;
}
.tpl-card .tier-badge.tier-entry { background-color: #64748B; }
.tpl-card .tier-badge.tier-core  { background-color: #E8552A; }
.tpl-card .tier-badge.tier-flag  { background-color: #6D28D9; }

.tpl-card .quality-badge {
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  background-color: rgba(17, 24, 39, .82);
  box-shadow: none;
}

/* ── Body ── */
.tpl-card .tpl-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 14px 16px 16px;
}

/* Short theme name, e.g. 小暑 — a label, not the headline. */
.tpl-card .tpl-name {
  font-size: 12px;
  font-weight: 700;
  color: #E8552A;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.tpl-card .tpl-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  margin: 0 0 14px;
}
.tpl-card .tpl-title a {
  color: #1F2937;
  transition: color .2s ease;
}
.tpl-card .tpl-title a:hover { color: #E8552A; }
.tpl-card .tpl-summary {
  min-height: 2.9em;
  margin: 0 0 .9rem;
  color: #68707a;
  font-size: .86rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Price block ──
   margin-top:auto pins it to the bottom, so price lines stay aligned
   across cards whose titles wrap to a different number of lines. */
.tpl-card .tpl-price {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: #FEF0EB;
  border: 1px solid #FDDDD2;
}
.tpl-card .tpl-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
}
.tpl-card .tpl-price-tag {
  align-self: center;
  padding: 2px 7px;
  border-radius: 6px;
  background: #E8552A;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  margin-right: 8px;
}
.tpl-card .tpl-price-num {
  font-size: 26px;
  font-weight: 800;
  color: #E8552A;
  line-height: 1.1;
}
.tpl-card .tpl-price-unit {
  margin-left: 1px;
  font-size: 13px;
  font-weight: 600;
  color: #E8552A;
}
.tpl-card .tpl-price-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #6B7280;
  line-height: 1.6;
}
/* The DIY tier is the secondary option: same block, visually demoted. */
.tpl-card .tpl-price-diy {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #EBCDC3;
  font-size: 12.5px;
  color: #6B7280;
}
.tpl-card .tpl-price-diy-num {
  font-size: 15px;
  font-weight: 700;
  color: #4B5563;
  white-space: nowrap;
}

/* ── CTA ── */
.tpl-card .tpl-cta {
  display: block;
  margin-top: 10px;
  padding: 8px 0;
  border: 1px solid #E8552A;
  border-radius: 8px;
  color: #E8552A;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: background .2s ease, color .2s ease;
}
/* The global `a:hover` in style.css outranks a single class, so restate colour. */
.tpl-card .tpl-cta:hover {
  background: #E8552A;
  color: #fff;
}

/* DIY listing intro and non-link filters. */
.diy-intro {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #f1d9d2;
  border-radius: 12px;
  background: #fffaf8;
}
.diy-intro h2,
.diy-filter-heading h2 {
  margin: 0 0 .45rem;
  color: #20242b;
  font-size: 1.25rem;
  font-weight: 750;
}
.diy-intro p,
.diy-filter-heading p {
  margin: 0;
  color: #68707a;
  line-height: 1.65;
}
.diy-intro-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.5rem;
  margin-top: .85rem;
  color: #505862;
  font-size: .9rem;
}
.diy-intro-choices strong { color: #d94e31; }
.diy-filters {
  margin-bottom: 1.5rem;
  padding: 1.2rem 1.35rem;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(17,24,39,.04);
}
.diy-filter-heading,
.diy-filter-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.diy-filter-heading { margin-bottom: 1rem; }
.diy-filter-heading > span { color: #78808a; font-size: .9rem; white-space: nowrap; }
.diy-filter-controls { justify-content: flex-start; flex-wrap: wrap; }
.diy-filter-controls label {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #3f4650;
  font-size: .9rem;
  font-weight: 650;
}
.diy-filter-controls select {
  min-width: 190px;
  max-width: min(360px, 68vw);
  padding: .62rem .85rem;
  border: 1px solid #d9dde2;
  border-radius: 8px;
  background: #fff;
  color: #343a40;
  font-weight: 400;
}
.diy-filter-reset {
  padding: .58rem .9rem;
  border: 1px solid #e8552a;
  border-radius: 8px;
  background: #fff;
  color: #d94e31;
  font-weight: 650;
}
.diy-filter-reset:hover { background: #fff2ed; }
.diy-empty-state {
  margin: 2rem auto;
  padding: 2rem 1rem;
  color: #68707a;
  text-align: center;
  background: #fff;
  border: 1px dashed #d9dde2;
  border-radius: 12px;
}

/* DIY listing pagination: match the coral theme instead of Bootstrap blue. */
#team .pagination {
  gap: .4rem;
  margin-top: 2rem;
}
#team .pagination > .page-item { margin-left: 0; }
#team .pagination .page-link {
  min-width: 2.75rem;
  padding: .55rem .9rem;
  border: 1px solid #f1d9d2;
  border-radius: 8px;
  background: #fff;
  color: #d94e31;
  text-align: center;
  box-shadow: none;
}
#team .pagination .page-link:hover,
#team .pagination .page-link:focus {
  border-color: #e8552a;
  background: #fff2ed;
  color: #c94326;
}
#team .pagination .page-item.active .page-link,
#team .pagination .page-item.active .page-link:hover {
  border-color: #e8552a;
  background: #e8552a;
  color: #fff;
}
#team .pagination .page-item.disabled .page-link {
  border-color: #ece7e5;
  background: #f8f7f6;
  color: #a9a6a4;
}

@media (max-width: 575.98px) {
  .tpl-card .tpl-price-num { font-size: 23px; }
  .tpl-card .tpl-body { padding: 12px 14px 14px; }
  .diy-intro { padding: 1rem; }
  .diy-filter-heading,
  .diy-filter-controls,
  .diy-filter-controls label { align-items: stretch; flex-direction: column; }
  .diy-filter-heading { gap: .35rem; }
  .diy-filter-controls select { min-width: 0; max-width: none; width: 100%; }
}
