/* =====================================================================
   Templates page — template cards.
   Builds on casestudy.css (hero, section headings, cs-card, tags, chips, CTA).
   ===================================================================== */

.tpl-grid-section {
  padding-top: 72px;
}

/* The whole card is one link that opens the live template. */
.tpl-card {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.tpl-card:hover {
  color: inherit;
}

.tpl-card .cs-card-img-wrap img {
  object-position: left top;
}

.tpl-card .cs-tag {
  align-self: flex-start;
  margin-bottom: 14px;
}

.tpl-card:hover .cs-card-link {
  gap: 12px;
  color: #0d2b53;
}

.tpl-card:focus-visible,
.tpl-soon:focus-visible {
  outline: 3px solid rgba(2, 90, 221, 0.45);
  outline-offset: 3px;
}

/* Placeholder card shown beside the live templates. */
.tpl-soon {
  height: 100%;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 28px;
  text-align: center;
  color: inherit;
  text-decoration: none;
  background: #fbfcfe;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.tpl-soon:hover {
  color: inherit;
  background: #fff;
  border-color: rgba(2, 90, 221, 0.45);
}

.tpl-soon__icon {
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #025add;
  background: rgba(2, 90, 221, 0.08);
  border-radius: 14px;
}

.tpl-soon__title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d2b53;
  margin-bottom: 9px;
}

.tpl-soon__text {
  max-width: 300px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #6c757d;
  margin-bottom: 18px;
}

.tpl-soon .cs-card-link {
  margin-top: 0;
}

.tpl-soon:hover .cs-card-link {
  gap: 12px;
  color: #0d2b53;
}

/* ── SEARCH & FILTER ─────────────────────────────────────────────── */
.tpl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 14px;
}

.tpl-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 440px;
}

/* Wrapper span: Font Awesome's JS swaps the <i> for an <svg>. */
.tpl-search__icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  font-size: 0.9rem;
  line-height: 1;
  color: #94a3b8;
  pointer-events: none;
}

.tpl-search input {
  width: 100%;
  height: 50px;
  padding: 0 20px 0 48px;
  font-size: 0.92rem;
  color: #0d2b53;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tpl-search input::placeholder {
  color: #94a3b8;
}

.tpl-search input:focus {
  outline: none;
  border-color: rgba(2, 90, 221, 0.5);
  box-shadow: 0 0 0 4px rgba(2, 90, 221, 0.1);
}

.tpl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 8px 0 18px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.tpl-chip span {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 50px;
  transition: color 0.2s, background 0.2s;
}

.tpl-chip:hover {
  color: #025add;
  border-color: rgba(2, 90, 221, 0.35);
}

.tpl-chip.is-active {
  color: #fff;
  background: #025add;
  border-color: #025add;
}

.tpl-chip.is-active span {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.tpl-chip:focus-visible,
.tpl-reset:focus-visible {
  outline: 3px solid rgba(2, 90, 221, 0.45);
  outline-offset: 2px;
}

.tpl-count {
  margin: 0 0 24px;
  font-size: 0.84rem;
  color: #94a3b8;
}

.tpl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
  padding: 48px 24px;
  text-align: center;
  background: #fbfcfe;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
}

.tpl-empty .tpl-soon__text {
  max-width: 420px;
}

.tpl-empty .tpl-soon__text a {
  color: #025add;
  font-weight: 600;
}

.tpl-reset {
  height: 42px;
  padding: 0 22px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #025add;
  background: rgba(2, 90, 221, 0.08);
  border: 0;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}

.tpl-reset:hover {
  background: rgba(2, 90, 221, 0.14);
}

/* ── FAQS ─────────────────────────────────────────────────────────── */
.tpl-faq {
  padding: 0 0 90px;
}

.tpl-faq__title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  color: #0d2b53;
  letter-spacing: -0.3px;
  margin-bottom: 26px;
}

.tpl-faq__list {
  max-width: 860px;
  display: grid;
  gap: 12px;
}

.tpl-faq__item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tpl-faq__item[open] {
  border-color: rgba(2, 90, 221, 0.25);
  box-shadow: 0 10px 30px -18px rgba(13, 43, 83, 0.35);
}

.tpl-faq__item summary {
  position: relative;
  padding: 18px 56px 18px 22px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #0d2b53;
  list-style: none;
  cursor: pointer;
}

.tpl-faq__item summary::-webkit-details-marker {
  display: none;
}

/* plus that turns into a minus when open */
.tpl-faq__item summary::before,
.tpl-faq__item summary::after {
  content: '';
  position: absolute;
  right: 24px;
  top: 50%;
  width: 14px;
  height: 2px;
  margin-top: -1px;
  background: #025add;
  border-radius: 2px;
  transition: transform 0.25s ease;
}

.tpl-faq__item summary::after {
  transform: rotate(90deg);
}

.tpl-faq__item[open] summary::after {
  transform: rotate(0deg);
}

.tpl-faq__item summary:focus-visible {
  outline: 3px solid rgba(2, 90, 221, 0.45);
  outline-offset: 2px;
  border-radius: 14px;
}

.tpl-faq__item p {
  margin: 0;
  padding: 0 22px 20px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #5b6b80;
}

.tpl-faq__item p a {
  color: #025add;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .tpl-search {
    flex-basis: 100%;
    max-width: none;
  }

  /* Chips scroll sideways instead of wrapping onto several rows. */
  .tpl-filters {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .tpl-filters::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 576px) {
  .tpl-grid-section {
    padding-top: 48px;
  }

  .tpl-soon {
    min-height: 0;
  }
}
