/**
 * The public template demo pages.
 *
 * Built on the same visual language the Super WooCommerce Product Filter admin
 * uses - white cards on a light ground, hairline borders, a 10px radius and a
 * two-layer lift shadow, under a sticky bar - so the demo site reads as part of
 * the same family of plugins. The accent is Hash Form's own, since the admin
 * colour scheme this borrows from is not available on the front end.
 */

.hf-tpl-demo {
    --hf-tpl-accent: #4f46e5;
    --hf-tpl-accent-dark: #4338ca;
    --hf-tpl-accent-soft: #eef2ff;
    --hf-tpl-ink: #1d2327;
    --hf-tpl-muted: #646970;
    --hf-tpl-faint: #8c9196;
    --hf-tpl-line: #e3e5e8;
    --hf-tpl-hairline: #f0f0f1;
    --hf-tpl-ground: #f6f7f9;
    --hf-tpl-radius: 10px;
    --hf-tpl-lift: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 28px -16px rgba(16, 24, 40, .18);
    --hf-tpl-lift-hover: 0 1px 2px rgba(16, 24, 40, .06), 0 18px 36px -18px rgba(16, 24, 40, .28);

    background: var(--hf-tpl-ground);
    color: var(--hf-tpl-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
    margin: 0;
    padding: 0 0 72px;
}

.hf-tpl-demo *,
.hf-tpl-demo *::before,
.hf-tpl-demo *::after {
    box-sizing: border-box;
}

.hf-tpl-wrap {
    margin: 0 auto;
    max-width: 1340px;
    padding: 0 24px;
}

/* ---------- Sticky bar ---------- */

/* Stays with you down a page of eighty forms, so the way back, the search and
   the one link that sells the plugin are never a scroll away. */
.hf-tpl-bar {
    backdrop-filter: saturate(180%) blur(8px);
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid var(--hf-tpl-line);
    position: sticky;
    top: 0;
    z-index: 30;
}

.hf-tpl-bar-inner {
    align-items: center;
    display: flex;
    gap: 18px;
    margin: 0 auto;
    max-width: 1340px;
    min-height: 62px;
    padding: 0 24px;
}

.hf-tpl-brand {
    color: var(--hf-tpl-ink);
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-decoration: none;
}

.hf-tpl-brand span { color: var(--hf-tpl-accent); }

.hf-tpl-bar-spacer { margin-left: auto; }

.hf-tpl-search {
    align-items: center;
    background: var(--hf-tpl-ground);
    border: 1px solid var(--hf-tpl-line);
    border-radius: 9px;
    color: var(--hf-tpl-faint);
    display: flex;
    flex: 1 1 auto;
    gap: 9px;
    max-width: 440px;
    padding: 8px 13px;
}

.hf-tpl-search:focus-within {
    background: #fff;
    border-color: var(--hf-tpl-accent);
    box-shadow: 0 0 0 3px var(--hf-tpl-accent-soft);
}

.hf-tpl-search svg { flex: 0 0 auto; }

.hf-tpl-search input {
    background: none;
    border: 0;
    color: var(--hf-tpl-ink);
    flex: 1 1 auto;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: 0;
    padding: 0;
    width: 100%;
}

.hf-tpl-search input::-webkit-search-cancel-button { cursor: pointer; }

.hf-tpl-cta {
    color: var(--hf-tpl-accent);
    flex: 0 0 auto;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.hf-tpl-cta:hover { text-decoration: underline; }

/* ---------- Index ---------- */

/* ---------- Hero ----------
   The same block on the templates and styles galleries, in the homepage
   hero's language: a faint grid, a soft indigo glow, one phrase in the accent
   colour, and a switch that makes the two galleries one place. */

.hf-gal-hero {
    background:
        radial-gradient(640px 320px at 88% 0%, rgba(124, 108, 255, .18), transparent 70%),
        radial-gradient(520px 260px at 4% 30%, rgba(79, 70, 229, .08), transparent 70%),
        linear-gradient(#fff, var(--hf-tpl-ground));
    overflow: hidden;
    padding: 64px 24px 52px;
    position: relative;
}

.hf-gal-hero::before {
    background-image: linear-gradient(#eceef6 1px, transparent 1px), linear-gradient(90deg, #eceef6 1px, transparent 1px);
    background-position: center top;
    background-size: 48px 48px;
    content: "";
    inset: 0;
    -webkit-mask-image: linear-gradient(#000, transparent 85%);
    mask-image: linear-gradient(#000, transparent 85%);
    pointer-events: none;
    position: absolute;
}

.hf-gal-hero-in {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 880px;
    position: relative;
    text-align: center;
}

.hf-gal-hero h1 {
    color: #14152b;
    font-size: clamp(32px, 4.6vw, 52px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.08;
    margin: 0;
    text-wrap: balance;
}

.hf-gal-hero h1 em {
    color: #4f46e5;
    font-style: normal;
}

.hf-gal-lead {
    color: #51566b;
    font-size: 17px;
    line-height: 1.6;
    margin: 0;
    max-width: 60ch;
}

.hf-gal-switch {
    background: #fff;
    border: 1px solid #e3e4ee;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(20, 21, 43, .04);
    display: inline-flex;
    gap: 4px;
    padding: 4px;
}

.hf-gal-switch a {
    align-items: center;
    border-radius: 9px;
    color: #51566b;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    padding: 8px 18px;
    text-decoration: none;
    transition: background .13s ease, color .13s ease;
}

.hf-gal-switch a:hover { background: #f3f3f9; color: #14152b; }

.hf-gal-switch a[aria-current] {
    background: #14152b;
    color: #fff;
}

.hf-gal-switch a:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* The count sits in a round badge: soft indigo on the idle tab, a light
   wash on the dark current one. */
.hf-gal-switch small {
    align-items: center;
    background: #eef0ff;
    border-radius: 999px;
    color: #4f46e5;
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 700;
    height: 24px;
    justify-content: center;
    line-height: 1;
    min-width: 24px;
    padding: 0 7px;
}

.hf-gal-switch a[aria-current] small {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

@media (max-width: 782px) {
    .hf-gal-hero { padding: 40px 16px 34px; }
    .hf-gal-hero-in { gap: 16px; }
    .hf-gal-lead { font-size: 15.5px; }
}

/* The sidebar and the grid. Two columns down to tablet, where the categories
   turn into a row that scrolls sideways above the cards. */
.hf-tpl-shell {
    align-items: start;
    display: grid;
    gap: 38px;
    grid-template-columns: 216px minmax(0, 1fr);
    padding-bottom: 40px;
}

.hf-tpl-side { position: sticky; top: 86px; }

.hf-tpl-side-title {
    color: var(--hf-tpl-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    margin: 0 0 12px;
    text-transform: uppercase;
}

.hf-tpl-cats { display: flex; flex-direction: column; gap: 1px; }

.hf-tpl-cat {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 8px;
    color: var(--hf-tpl-muted);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 13.5px;
    gap: 9px;
    padding: 8px 11px;
    text-align: left;
    text-decoration: none;
    transition: background .13s ease, color .13s ease;
    width: 100%;
}

.hf-tpl-cat-dot {
    background: hsl(var(--hf-tpl-hue, 210) 62% 58%);
    border-radius: 50%;
    flex: 0 0 auto;
    height: 7px;
    width: 7px;
}

/* No hue of its own, because it stands for all of them. */
.hf-tpl-cat-all { background: var(--hf-tpl-faint); }

.hf-tpl-cat b {
    color: var(--hf-tpl-faint);
    font-size: 11.5px;
    font-weight: 600;
    margin-left: auto;
}

.hf-tpl-cat:hover { background: var(--hf-tpl-hairline); color: var(--hf-tpl-ink); }

.hf-tpl-cat.is-on {
    background: var(--hf-tpl-accent-soft);
    color: var(--hf-tpl-accent);
    font-weight: 600;
}

.hf-tpl-cat.is-on b { color: var(--hf-tpl-accent); opacity: .7; }

.hf-tpl-result {
    color: var(--hf-tpl-muted);
    font-size: 13.5px;
    margin: 0 0 16px;
}

.hf-tpl-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.hf-tpl-card {
    background: #fff;
    border: 1px solid var(--hf-tpl-line);
    border-radius: 13px;
    box-shadow: var(--hf-tpl-lift);
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.hf-tpl-card:hover,
.hf-tpl-card:focus-visible {
    border-color: hsl(var(--hf-tpl-hue, 210) 50% 78%);
    box-shadow: var(--hf-tpl-lift-hover);
    transform: translateY(-3px);
}

/* The template shots are neutral line drawings on white, so on a white card
   they read as a placeholder that failed to load. Sitting them on their
   category's colour, cropped at the top like a screenshot of a page, turns
   each one into a picture of a form instead. */
.hf-tpl-shot {
    background: linear-gradient(165deg, hsl(var(--hf-tpl-hue, 210) 66% 96%), hsl(var(--hf-tpl-hue, 210) 55% 90%));
    border-bottom: 1px solid var(--hf-tpl-hairline);
    display: block;
    height: 168px;
    overflow: hidden;
    padding: 18px 20px 0;
}

.hf-tpl-shot img {
    background: #fff;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 1px 4px rgba(16, 24, 40, .08), 0 10px 22px -10px rgba(16, 24, 40, .16);
    display: block;
    height: auto;
    width: 100%;
}

.hf-tpl-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 14px 16px 15px;
}

.hf-tpl-card-cat {
    color: hsl(var(--hf-tpl-hue, 210) 48% 42%);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.hf-tpl-card-name {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 5px 0 9px;
}

.hf-tpl-card-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 13px;
}

.hf-tpl-card-fields { color: var(--hf-tpl-faint); font-size: 12px; }

/* Two at most, and only where the template actually has the thing. */
.hf-tpl-badge {
    background: hsl(var(--hf-tpl-hue, 210) 60% 95%);
    border-radius: 4px;
    color: hsl(var(--hf-tpl-hue, 210) 46% 34%);
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
}

/* A span, not a button: the whole card is the link, and a button inside an
   anchor is not something a browser can be asked to make sense of. */
.hf-tpl-card-go {
    background: var(--hf-tpl-accent);
    border-radius: 7px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    margin-top: auto;
    padding: 8px 12px;
    text-align: center;
}

.hf-tpl-card:hover .hf-tpl-card-go,
.hf-tpl-card:focus-visible .hf-tpl-card-go { background: var(--hf-tpl-accent-dark); }

.hf-tpl-empty {
    color: var(--hf-tpl-muted);
    padding: 48px 0;
    text-align: center;
}


/* ---------- One template ---------- */

/* Washed with the category's colour, so arriving from a card reads as the same
   place continued rather than a different page. */
.hf-tpl-single-head {
    background: linear-gradient(170deg, hsl(var(--hf-tpl-hue, 210) 66% 96%), hsl(var(--hf-tpl-hue, 210) 60% 93%));
    border-bottom: 1px solid hsl(var(--hf-tpl-hue, 210) 40% 88%);
    margin-bottom: 32px;
    padding: 22px 0 30px;
}

.hf-tpl-crumbs {
    align-items: center;
    color: hsl(var(--hf-tpl-hue, 210) 30% 55%);
    display: flex;
    font-size: 12.5px;
    gap: 8px;
    margin-bottom: 18px;
}

.hf-tpl-crumbs a {
    color: hsl(var(--hf-tpl-hue, 210) 42% 38%);
    font-weight: 500;
    text-decoration: none;
}

.hf-tpl-crumbs a:hover { text-decoration: underline; }

.hf-tpl-single-top {
    align-items: flex-end;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.hf-tpl-single-intro { min-width: 0; }

.hf-tpl-single-head h1 {
    font-size: clamp(25px, 3vw, 33px);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
    margin: 0 0 8px;
}

.hf-tpl-single-head p {
    color: hsl(var(--hf-tpl-hue, 210) 22% 34%);
    margin: 0;
    max-width: 68ch;
}

.hf-tpl-single-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.hf-tpl-single-meta .hf-tpl-card-fields { color: hsl(var(--hf-tpl-hue, 210) 25% 42%); font-size: 13px; }

.hf-tpl-single-meta .hf-tpl-badge {
    background: hsl(var(--hf-tpl-hue, 210) 55% 99%);
    font-size: 11px;
    padding: 3px 9px;
}

/* The one thing a visitor who likes what they see should be able to do next. */
.hf-tpl-single-cta {
    background: var(--hf-tpl-accent);
    border-radius: 9px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 10px 22px -12px var(--hf-tpl-accent);
    color: #fff;
    flex: 0 0 auto;
    font-size: 13.5px;
    font-weight: 600;
    padding: 11px 20px;
    text-decoration: none;
    white-space: nowrap;
}

.hf-tpl-single-cta:hover { background: var(--hf-tpl-accent-dark); color: #fff; }

/* The width buttons and the disclaimer belong to the canvas, so they sit on a
   bar attached to it rather than floating loose above the page. */
.hf-tpl-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.hf-tpl-widths {
    background: #fff;
    border: 1px solid var(--hf-tpl-line);
    border-radius: 8px;
    display: flex;
    overflow: hidden;
    padding: 3px;
}

.hf-tpl-width {
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--hf-tpl-muted);
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 14px;
    transition: background .13s ease, color .13s ease;
}

.hf-tpl-width:hover { color: var(--hf-tpl-ink); }

.hf-tpl-width[aria-pressed="true"] {
    background: var(--hf-tpl-accent);
    color: #fff;
}

.hf-tpl-note {
    color: var(--hf-tpl-faint);
    font-size: 12.5px;
    margin: 0;
}

/* The stage the form sits on. Centred and width-limited, and the width buttons
   set a real pixel width so the form's own media queries respond. */
.hf-tpl-stage {
    display: flex;
    justify-content: center;
}

.hf-tpl-canvas {
    background: #fff;
    border: 1px solid var(--hf-tpl-line);
    border-radius: 13px;
    box-shadow: var(--hf-tpl-lift);
    max-width: 100%;
    padding: 40px;
    transition: width .2s ease;
    width: 100%;
}

/* Prev / next, so the whole library can be walked without going back to the
   index each time. Cards rather than lines of text, because on a page whose
   whole point is the form in the middle, two words of grey are not something
   anyone finds. */
.hf-tpl-pager {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 40px 0 0;
}

.hf-tpl-pager a {
    background: #fff;
    border: 1px solid var(--hf-tpl-line);
    border-radius: 11px;
    color: var(--hf-tpl-ink);
    display: block;
    padding: 14px 18px;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.hf-tpl-pager a:hover {
    border-color: hsl(var(--hf-tpl-hue, 210) 50% 76%);
    box-shadow: var(--hf-tpl-lift);
    transform: translateY(-2px);
}

/* Only ever one of the two, so the next link keeps the right-hand column. */
.hf-tpl-pager .hf-tpl-pager-next {
    grid-column: 2;
    text-align: right;
}

.hf-tpl-pager small {
    color: hsl(var(--hf-tpl-hue, 210) 40% 48%);
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .07em;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.hf-tpl-pager span { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }

.hf-tpl-pager-prev small::before { content: "\2190\00a0"; }
.hf-tpl-pager-next small::after { content: "\00a0\2192"; }

/* A demo, so the disabled submit should read as deliberate. */
.hf-tpl-canvas button[type="submit"][disabled] {
    cursor: not-allowed;
    opacity: .55;
}

/* ---------- Inside the theme ---------- */

/* The wrapper stands in for the body: the ground and the spacing stay the
   demo's own, the type follows the site around it. */
.hf-tpl-in-theme { font-family: inherit; }

/* Lined up with the Total theme's container: its width plus this wrapper's
   own side padding, and the theme's narrower gutter on phones. */
.hf-tpl-in-theme .hf-tpl-wrap { max-width: calc(var(--total-wide-container-width, 1292px) + 48px); }

@media (max-width: 767px) {
    .hf-tpl-in-theme .hf-tpl-wrap { padding-left: 20px; padding-right: 20px; }
}

/* The theme's rules for links, lists and form controls reach these pages too,
   so the few places they would change the demo are pinned back. */
.hf-tpl-demo [hidden] { display: none !important; }

.hf-tpl-demo .hf-tpl-card:hover,
.hf-tpl-demo .hf-tpl-card:focus,
.hf-tpl-demo .hf-tpl-pager a:hover { color: var(--hf-tpl-ink); }

.hf-tpl-demo .hf-tpl-search input[type="search"] {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    height: auto;
    margin: 0;
    min-height: 0;
    padding: 0;
}

/* Inside the hero, the search is the page's main action: larger, and lifted. */
.hf-gal-hero .hf-tpl-search {
    background: #fff;
    border-color: #dcdfe8;
    border-radius: 12px;
    box-shadow: 0 12px 30px -18px rgba(79, 70, 229, .45);
    flex: 0 0 auto;
    gap: 12px;
    max-width: 580px;
    padding: 0 10px 0 18px;
    width: 100%;
}

.hf-gal-hero .hf-tpl-search input,
.hf-tpl-demo .hf-gal-hero .hf-tpl-search input[type="search"] {
    font-size: 16px;
    height: 54px;
}

.hf-tpl-search-key {
    background: var(--hf-tpl-ground);
    border: 1px solid var(--hf-tpl-line);
    border-radius: 6px;
    color: var(--hf-tpl-faint);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 7px;
}

/* Only the hero's search answers to "/", so only it says so. */
.hf-tpl-bar .hf-tpl-search-key { display: none; }

.hf-tpl-shell { margin-top: 8px; }

/* Clear of a sticky theme header rather than of the demo's own bar. */
.hf-tpl-in-theme .hf-tpl-side { top: 100px; }
.admin-bar .hf-tpl-in-theme .hf-tpl-side { top: 132px; }

@media (max-width: 1100px) {
    .hf-tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Below the two-column shell the categories cannot sit beside the grid, so
   they become a row that scrolls sideways and keeps its place at the top. */
@media (max-width: 860px) {
    .hf-tpl-shell { display: block; }

    .hf-tpl-side {
        background: var(--hf-tpl-ground);
        margin-bottom: 22px;
        position: static;
    }

    .hf-tpl-side-title { display: none; }

    .hf-tpl-cats {
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .hf-tpl-cats::-webkit-scrollbar { display: none; }

    .hf-tpl-cat {
        background: #fff;
        border: 1px solid var(--hf-tpl-line);
        border-radius: 999px;
        flex: 0 0 auto;
        width: auto;
    }

    .hf-tpl-cat.is-on { border-color: var(--hf-tpl-accent); }

    .hf-tpl-cat b { margin-left: 3px; }
}

@media (max-width: 782px) {
    .hf-tpl-bar-inner { flex-wrap: wrap; gap: 12px; min-height: 0; padding: 12px 24px; }
    .hf-tpl-bar .hf-tpl-search { max-width: none; order: 3; width: 100%; }
    .hf-tpl-bar-spacer { display: none; }
    .hf-tpl-canvas { padding: 22px; }


    .hf-tpl-single-top { align-items: stretch; display: block; }
    .hf-tpl-single-cta { display: block; margin-top: 18px; text-align: center; }
    .hf-tpl-pager { grid-template-columns: minmax(0, 1fr); }
    .hf-tpl-pager .hf-tpl-pager-next { grid-column: 1; }
}

@media (max-width: 560px) {
    .hf-tpl-grid { grid-template-columns: minmax(0, 1fr); }
}
