/* ==========================================================================
   Examples 2 (template gallery) + template page.
   Load after site.css and examples.css (uses its category tones and the .qp-m form sketches).
   ========================================================================== */

.qp-tone-navy { --tone-50: var(--qp-navy-50); --tone-100: var(--qp-navy-100); --tone-300: var(--qp-navy-300); --tone-500: var(--qp-navy-700); --tone-700: var(--qp-navy-950); }

/* ---------- Gallery hero + search ---------- */
.qp-tp-hero { padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.qp-tp-hero h1 { max-width: 14em; }
.qp-tp-hero .qp-lead { max-width: 34em; }
.qp-tp-search { position: relative; max-width: 40rem; margin: 2rem auto 0; }
.qp-tp-search > .bi-search { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); font-size: 1.125rem; color: var(--qp-navy-700); pointer-events: none; }
.qp-tp-search input { width: 100%; height: 3.75rem; padding: 0 3.25rem 0 3.25rem; border-radius: 999px; border: 1.5px solid var(--qp-navy-200); background: #fff; font-size: 1.0625rem; color: var(--qp-navy-950);
  box-shadow: 0 18px 40px -28px rgba(19, 21, 39, .35); transition: border-color .2s, box-shadow .2s; }
.qp-tp-search input::placeholder { color: var(--qp-navy-600); }
.qp-tp-search input:focus { outline: 0; border-color: var(--qp-green-500); box-shadow: 0 0 0 4px rgb(0 154 115 / .15); }
.qp-tp-search input::-webkit-search-cancel-button { display: none; }
.qp-tp-search__clear { position: absolute; right: .625rem; top: 50%; transform: translateY(-50%); width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: var(--qp-navy-100); color: var(--qp-navy-950); display: grid; place-items: center; }
.qp-tp-popular { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; margin-top: 1rem; font-size: .9375rem; color: var(--qp-navy-950); }
.qp-tp-popular > span { font-weight: 600; }
.qp-tp-popular button { border: 1px solid var(--qp-navy-200); background: rgb(255 255 255 / .7); border-radius: 999px; padding: .25rem .875rem; color: var(--qp-navy-950); font-weight: 500; transition: border-color .2s, color .2s; }
.qp-tp-popular button:hover { border-color: var(--qp-green-500); color: var(--qp-green-700); }

/* ---------- Layout: filters left, results right ---------- */
.qp-tp-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.5rem); padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: clamp(3rem, 7vw, 5rem); }
.qp-tp-side { position: sticky; top: 1.5rem; align-self: start; display: flex; flex-direction: column; gap: 2rem; }
.qp-tp-side__title { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--qp-navy-950); margin: 0 0 .75rem; }
.qp-tp-cats { display: flex; flex-direction: column; gap: .25rem; margin: 0; }
.qp-tp-cat { width: 100%; display: flex; align-items: center; gap: .75rem; padding: .5rem .625rem; border: 0; border-radius: .875rem; background: transparent; color: var(--qp-navy-950); font-weight: 500; text-align: left; white-space: nowrap; transition: background .2s; }
.qp-tp-cat__icon { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: .625rem; display: grid; place-items: center; background: var(--tone-100); color: var(--tone-700); font-size: .9375rem; transition: background .2s, color .2s; }
.qp-tp-cat__n { margin-left: auto; font-size: .8125rem; font-weight: 600; color: var(--qp-navy-700); font-variant-numeric: tabular-nums; }
.qp-tp-cat:hover { background: var(--qp-navy-100); }
.qp-tp-cat.is-active { background: var(--tone-100); font-weight: 600; }
.qp-tp-cat.is-active .qp-tp-cat__icon { background: var(--tone-500); color: #fff; }
.qp-tp-cat.is-active .qp-tp-cat__n { color: var(--qp-navy-950); }
.qp-tp-types { display: flex; flex-wrap: wrap; gap: .375rem; }
.qp-tp-types button { border: 1.5px solid var(--qp-navy-200); background: #fff; border-radius: 999px; padding: .375rem .875rem; font-size: .9375rem; font-weight: 500; color: var(--qp-navy-950); transition: border-color .2s, background .2s, color .2s; }
.qp-tp-types button:hover { border-color: var(--qp-navy-400); }
.qp-tp-types button.is-active { background: var(--qp-navy-950); border-color: var(--qp-navy-950); color: #fff; }

@media (max-width: 991.98px) {
  .qp-tp-layout { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .qp-tp-side { position: static; gap: 1rem; }
  .qp-tp-side__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .qp-tp-cats { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: .5rem; margin-inline: -1rem; padding-inline: 1rem; }
  .qp-tp-cats::-webkit-scrollbar { display: none; }
  .qp-tp-cat { width: auto; padding: .375rem .875rem .375rem .375rem; border: 1.5px solid var(--qp-navy-200); border-radius: 999px; background: #fff; }
  .qp-tp-cat.is-active { border-color: var(--tone-300); }
  .qp-tp-cat__icon { width: 1.75rem; height: 1.75rem; border-radius: 50%; font-size: .8125rem; }
  .qp-tp-cat__n { margin-left: .25rem; }
}

/* ---------- Results ---------- */
.qp-tp-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.25rem; margin-bottom: 1.5rem; color: var(--qp-navy-950); }
.qp-tp-reset { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: .375rem; font-weight: 600; color: var(--qp-navy-950); text-decoration: underline; text-underline-offset: 3px; }
.qp-tp-group { scroll-margin-top: 1.5rem; }
.qp-tp-group + .qp-tp-group { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.qp-tp-group__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.qp-tp-group__icon { flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: .875rem; display: grid; place-items: center; background: var(--tone-500); color: #fff; font-size: 1.25rem; }
.qp-tp-group__titles { min-width: 0; }
.qp-tp-group__title { margin: 0; font-size: clamp(1.375rem, 1.1rem + .8vw, 1.75rem); font-weight: 700; letter-spacing: -.02em; color: var(--qp-navy-950); line-height: 1.15; }
.qp-tp-group__intro { margin: .25rem 0 0; color: var(--qp-navy-950); }
.qp-tp-viewall { margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--qp-navy-950); background: transparent; color: var(--qp-navy-950); font-weight: 600; font-size: .9375rem; text-decoration: none; transition: background .2s, color .2s; }
.qp-tp-viewall:hover { background: var(--qp-navy-950); color: #fff; }
.qp-tp-viewall .bi { transition: transform .25s var(--qp-ease); }
.qp-tp-viewall:hover .bi { transform: translateX(3px); }
@media (max-width: 575.98px) {
  .qp-tp-group__head { flex-wrap: wrap; }
  .qp-tp-group__titles { flex: 1 1 calc(100% - 4rem); }
  .qp-tp-viewall { margin-left: 4rem; }
}

/* Grid: 3 / 2 / 1 per row. In the "all templates" view each category shows one row (--rows-limit). */
.qp-tp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); margin: 0; }
@media (max-width: 1199.98px) { .qp-tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px)  { .qp-tp-grid { grid-template-columns: minmax(0, 1fr); } }
.qp-tp-browse .qp-tp-item:nth-child(n+4) { display: none; }
@media (max-width: 1199.98px) { .qp-tp-browse .qp-tp-item:nth-child(n+3) { display: none; } }
.qp-tp-item[hidden], .qp-tp-group[hidden] { display: none !important; }
.qp-tp-filtered .qp-tp-viewall { display: none; }

/* Template card: tinted picture of the form on top, details below; the whole card opens the template page */
.qp-tp-card { height: 100%; display: flex; flex-direction: column; border-radius: var(--qp-radius-card, 1.5rem); background: #fff; border: 1px solid var(--qp-navy-200); color: inherit; text-decoration: none; overflow: hidden;
  transition: border-color .25s, transform .3s var(--qp-ease), box-shadow .3s; }
.qp-tp-card:focus-visible { outline: 3px solid var(--tone-300); outline-offset: 3px; }
.qp-tp-card__thumb { position: relative; aspect-ratio: 16 / 10; display: flex; justify-content: center; align-items: flex-start; padding-top: 1.75rem; overflow: hidden; background: var(--tone-100); }
.qp-tp-card__thumb .qp-m { width: 62%; transform: translateY(0) rotate(-2deg); }
.qp-tp-card__type { position: absolute; left: .875rem; top: .875rem; padding: .1875rem .625rem; border-radius: 999px; background: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tone-700); }

.qp-tp-card__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: .5rem; padding: 1.125rem 1.25rem 1.25rem; }
.qp-tp-card__name { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; color: var(--qp-navy-950); }
.qp-tp-card__desc { flex: 1 1 auto; color: var(--qp-navy-950); font-size: .9375rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qp-tp-card__foot { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; padding-top: .875rem; border-top: 1px solid var(--qp-navy-100); font-size: .875rem; font-weight: 500; color: var(--qp-navy-950); }
.qp-tp-card__foot > span:not(.qp-tp-card__go) { display: inline-flex; align-items: center; gap: .375rem; }
.qp-tp-card__foot .bi { color: var(--tone-700); }
.qp-tp-card__go { margin-left: auto; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--tone-100); transition: background .25s; }
.qp-tp-card__go .bi { color: var(--tone-700); transition: transform .25s var(--qp-ease), color .25s; }
@media (hover: hover) {
  .qp-tp-card:hover { border-color: var(--tone-300); transform: translateY(-4px); box-shadow: 0 28px 48px -32px rgba(19, 21, 39, .45); color: inherit; }
  .qp-tp-card:hover .qp-m { transform: translateY(-4px) rotate(0deg); }
  .qp-tp-card:hover .qp-tp-card__go { background: var(--tone-500); }
  .qp-tp-card:hover .qp-tp-card__go .bi { color: #fff; transform: translateX(2px); }
}

/* Empty state */
.qp-tp-empty { text-align: center; padding: clamp(2.5rem, 6vw, 4rem) 1rem; border-radius: var(--qp-radius-card, 1.5rem); border: 2px dashed var(--qp-navy-200); color: var(--qp-navy-950); }
.qp-tp-empty__icon { width: 3.5rem; height: 3.5rem; border-radius: 50%; display: inline-grid; place-items: center; background: var(--qp-navy-100); font-size: 1.375rem; }
.qp-tp-empty__title { font-size: 1.375rem; font-weight: 700; margin: 1rem 0 .5rem; color: var(--qp-navy-950); }

/* AI box (primary green, like the Tour page / homepage boxes) */
.qp-tp-ai { margin-top: clamp(3rem, 6vw, 4.5rem); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.75rem, 4vw, 3rem); border-radius: var(--qp-radius-panel, 2rem); color: #fff; background: radial-gradient(70% 70% at 100% 0%, rgb(117 206 170 / .45), transparent 70%), var(--qp-green-500); }
.qp-tp-ai__tag { display: inline-flex; align-items: center; gap: .5rem; padding: .375rem .75rem; border-radius: 999px; font-size: .8125rem; font-weight: 700; background: var(--qp-green-700); }
.qp-tp-ai__title { margin: 1.25rem 0 .75rem; font-size: clamp(1.625rem, 1.2rem + 1.3vw, 2.25rem); line-height: 1.1; font-weight: 700; letter-spacing: -.03em; color: #fff; }
.qp-tp-ai p { font-size: 1.0625rem; line-height: 1.6; max-width: 28em; }
.qp-tp-ai__demo { display: flex; flex-direction: column; gap: .625rem; padding: clamp(1rem, 2.5vw, 1.5rem); border-radius: 1.25rem; background: rgb(255 255 255 / .16); color: var(--qp-navy-950); }
.qp-tp-ai__prompt, .qp-tp-ai__q { display: flex; align-items: center; gap: .625rem; padding: .75rem .875rem; border-radius: .875rem; background: #fff; font-size: .875rem; font-weight: 500; }
.qp-tp-ai__prompt > .bi { color: var(--qp-green-600); }
.qp-tp-ai__prompt b { margin-left: auto; padding: .25rem .75rem; border-radius: .5rem; background: var(--qp-green-500); color: #fff; font-size: .8125rem; font-weight: 600; }
.qp-tp-ai__q b { width: 1.5rem; height: 1.5rem; border-radius: .4375rem; display: grid; place-items: center; background: var(--qp-green-100); color: var(--qp-green-800); font-size: .75rem; }
@media (max-width: 767.98px) { .qp-tp-ai { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Template page
   ========================================================================== */
.qp-tpd-hero { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(3rem, 6vw, 4.5rem); }
.qp-tpd-crumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); font-size: .9375rem; color: var(--qp-navy-950); }
.qp-tpd-crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--qp-navy-400); }
.qp-tpd-crumbs a { color: var(--qp-navy-950); text-decoration: none; }
.qp-tpd-crumbs a:hover { text-decoration: underline; }
.qp-tpd-tag { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .75rem .25rem .25rem; border-radius: 999px; background: var(--tone-100); color: var(--tone-700); font-size: .875rem; font-weight: 600; }
.qp-tpd-tag i { width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--tone-500); color: #fff; font-size: .8125rem; }
.qp-tpd-title { margin: 1.25rem 0 0; font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.75rem); line-height: 1.04; font-weight: 700; letter-spacing: -.04em; color: var(--qp-navy-950); }
.qp-tpd-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1.5rem 0 0; font-weight: 500; color: var(--qp-navy-950); }
.qp-tpd-facts li { display: inline-flex; align-items: center; gap: .5rem; }
.qp-tpd-facts .bi { color: var(--tone-700); font-size: 1.0625rem; }

/* Preview window */
.qp-tpd-preview { border-radius: 1.5rem; background: #fff; border: 1px solid var(--qp-navy-200); overflow: hidden; box-shadow: 0 40px 80px -48px rgba(19, 21, 39, .45); }
.qp-tpd-preview__bar { display: flex; align-items: center; gap: .75rem; padding: .625rem .75rem .625rem 1rem; border-bottom: 1px solid var(--qp-navy-100); }
.qp-tpd-preview__dots { display: flex; gap: .375rem; } .qp-tpd-preview__dots i { width: .625rem; height: .625rem; border-radius: 50%; background: var(--qp-navy-200); }
.qp-tpd-preview__label { font-size: .875rem; font-weight: 600; color: var(--qp-navy-950); }
.qp-tpd-device { margin-left: auto; display: flex; padding: .1875rem; border-radius: 999px; background: var(--qp-navy-100); }
.qp-tpd-device button { width: 2.25rem; height: 2rem; border: 0; border-radius: 999px; background: transparent; color: var(--qp-navy-700); display: grid; place-items: center; transition: background .2s, color .2s; }
.qp-tpd-device button.is-active { background: #fff; color: var(--qp-navy-950); box-shadow: 0 1px 3px rgba(19, 21, 39, .15); }
.qp-tpd-preview__stage { position: relative; height: clamp(26rem, 60vh, 36rem); display: flex; justify-content: center; background: var(--tone-100); transition: padding .35s var(--qp-ease); }
.qp-tpd-preview__stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; transition: width .35s var(--qp-ease), border-radius .35s; }
.qp-tpd-preview.is-phone .qp-tpd-preview__stage { padding-block: 1.25rem; }
.qp-tpd-preview.is-phone iframe { width: min(23.5rem, 100%); border-radius: 1.75rem; box-shadow: 0 0 0 .5rem var(--qp-navy-950); }
/* No live version yet: a large sketch of the form */
.qp-tpd-sketch { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; padding: 2rem; }
.qp-tpd-sketch .qp-m { width: min(22rem, 80%); transform: rotate(-2deg); }
.qp-tpd-preview.is-phone .qp-tpd-sketch .qp-m { width: min(15rem, 70%); }
.qp-tpd-sketch__note { display: inline-flex; align-items: center; gap: .5rem; padding: .375rem .875rem; border-radius: 999px; background: #fff; font-size: .875rem; font-weight: 600; color: var(--qp-navy-950); }

/* Sections */
.qp-tpd-section { padding-block: clamp(3rem, 6vw, 4.5rem); }
.qp-tpd-section--inside { background: var(--qp-navy-50); border-radius: var(--qp-radius-panel, 2rem); margin-inline: clamp(0rem, 1.5vw, 1.5rem); }
.qp-tpd-h2 { margin: 0; font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem); line-height: 1.1; font-weight: 700; letter-spacing: -.03em; color: var(--qp-navy-950); }
.qp-tpd-text { margin: 1rem 0 0; font-size: 1.0625rem; color: var(--qp-navy-950); }

.qp-tpd-qs { display: flex; flex-direction: column; gap: .625rem; margin: 0; counter-reset: q; }
.qp-tpd-qs li { display: flex; align-items: center; gap: 1rem; padding: .875rem 1.125rem; border-radius: 1rem; background: #fff; border: 1px solid var(--qp-navy-200); color: var(--qp-navy-950); }
.qp-tpd-qs__n { flex: 0 0 auto; width: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--qp-navy-700); }
.qp-tpd-qs__q { flex: 1 1 auto; font-weight: 500; }
.qp-tpd-qs__type { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .625rem; border-radius: 999px; background: var(--tone-100); color: var(--tone-700); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.qp-tpd-qs li.qp-tpd-qs__more { justify-content: center; border-style: dashed; background: transparent; font-weight: 600; }
@media (max-width: 575.98px) {
  .qp-tpd-qs li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: start; gap: .5rem .75rem; }
  .qp-tpd-qs__type { grid-column: 2; justify-self: start; }
  .qp-tpd-qs li.qp-tpd-qs__more { display: flex; }
  .qp-tpd-preview__stage { height: 24rem; }
}

.qp-tpd-related { padding-top: 0; }
.qp-tpd-related__head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }

@media (prefers-reduced-motion: reduce) {
  .qp-tp-card, .qp-tp-card .qp-m, .qp-tp-card__go .bi, .qp-tpd-preview__stage iframe { transition: none !important; transform: none !important; }
}

/* "When to use" boxes = the homepage "Get your insights" cards (same rule as home.css) */
.qp-team-card { padding: 1.625rem; display: flex; flex-direction: column; gap: .75rem; text-decoration: none; color: var(--qp-navy-950); height: 100%; }
/* steps removed: give the related section its top spacing back */
.qp-tpd-section--inside + .qp-tpd-related, .qp-tpd-related { padding-top: clamp(3rem, 6vw, 4.5rem); }

/* "What's inside" shows 4 questions; the dashed button opens the rest */
.qp-tpd-qs li[hidden] { display: none; }
.qp-tpd-qs__more { width: 100%; margin-top: .625rem; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .875rem 1.125rem; border-radius: 1rem; border: 1.5px dashed var(--qp-navy-300); background: transparent; color: var(--qp-navy-950); font-weight: 600; transition: border-color .2s, background .2s; }
.qp-tpd-qs__more:hover { border-color: var(--tone-500); background: #fff; }
.qp-tpd-qs__more:focus-visible { outline: 3px solid var(--tone-300); outline-offset: 2px; }

/* phone preview sits on the category colour (green, sky, amber, violet, pink) */
.qp-tpd-preview.is-phone .qp-tpd-preview__stage { background: var(--tone-500); }
.qp-tpd-preview.is-phone iframe { box-shadow: 0 0 0 .5rem var(--qp-navy-950), 0 30px 60px -30px rgba(19, 21, 39, .6); }

/* Interim gallery over the CMS examples (Views/Examples/Index.cshtml): the category's CMS text as the intro, the old
   page's closing call to action under the AI box */
.qp-tp-group__intro.qp-cms-text a { font-weight: 600; }
.qp-tp-own { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
/* the CMS intros are a few lines long: the icon stays by the title */
.qp-tp-group__head { align-items: flex-start; }
