/**
 * The public style gallery.
 *
 * The same visual language as the Hash Form Template Demos pages - white cards
 * on a light ground, hairline borders and a two-layer lift shadow - so the two
 * galleries read as one site. Everything here is the frame; the forms inside
 * are drawn entirely by the style they show.
 */

.hfsd {
    --hfsd-accent: #4f46e5;
    --hfsd-accent-dark: #4338ca;
    --hfsd-accent-soft: #eef2ff;
    --hfsd-ink: #1d2327;
    --hfsd-muted: #646970;
    --hfsd-faint: #8c9196;
    --hfsd-line: #e3e5e8;
    --hfsd-ground: #f6f7f9;
    --hfsd-lift: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 28px -16px rgba(16, 24, 40, .18);
    --hfsd-lift-hover: 0 1px 2px rgba(16, 24, 40, .06), 0 22px 40px -20px rgba(16, 24, 40, .3);

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

.hfsd *,
.hfsd *::before,
.hfsd *::after {
    box-sizing: border-box;
}

.hfsd [hidden] { display: none !important; }

/* A site can line the gallery up with its own container by setting this. */
.hfsd-wrap {
    margin: 0 auto;
    max-width: var(--hfsd-wrap, 1340px);
    padding: 0 24px;
}

/* ---------- 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(--hfsd-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; }
}

/* ---------- Try-on: the list, the stage, one live form ---------- */

.hfsd-tryon {
    margin-top: 8px;
    align-items: start;
    display: grid;
    gap: 28px;
    grid-template-columns: 250px minmax(0, 1fr);
}

/* Sticky, so the list stays beside a tall form. */
.hfsd-picks {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    position: sticky;
    top: 110px;
}

.hfsd-pick {
    align-items: center;
    border-radius: 10px;
    color: var(--hfsd-muted);
    display: flex;
    font-size: 15px;
    font-weight: 500;
    gap: 12px;
    padding: 9px 12px;
    text-decoration: none;
    transition: background .13s ease, color .13s ease;
}

.hfsd-pick:hover { background: #fff; color: var(--hfsd-ink); }

.hfsd-pick:focus-visible {
    outline: 2px solid var(--hfsd-accent);
    outline-offset: -2px;
}

.hfsd-pick[aria-current] {
    background: var(--hfsd-accent-soft);
    color: var(--hfsd-ink);
    font-weight: 700;
}

.hfsd-pick-chip {
    border-radius: 7px;
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .14);
    flex: 0 0 auto;
    height: 24px;
    width: 24px;
}

.hfsd-tryon-stage {
    background: #f1f2f5;
    border: 1px solid var(--hfsd-line);
    border-radius: 18px;
    color: var(--hfsd-ink);
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 0;
    padding: 36px;
    transition: background .3s ease, color .3s ease;
}

.hfsd-tryon-stage.is-dark {
    border-color: transparent;
    color: #e8e9f1;
}

.hfsd-tryon-info {
    align-items: flex-end;
    display: flex;
    gap: 16px 32px;
    justify-content: space-between;
}

.hfsd-tryon-intro h2 {
    color: inherit;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin: 0 0 8px;
}

.hfsd-tryon-intro p {
    font-size: 15.5px;
    margin: 0 0 14px;
    max-width: 620px;
    opacity: .78;
}

.hfsd-tryon-form {
    margin: 0 auto;
    max-width: 640px;
    width: 100%;
}

.hfsd-tryon-steps {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.hfsd-step {
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(16, 24, 40, .12);
    border-radius: 9px;
    color: var(--hfsd-ink);
    cursor: pointer;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 16px;
    transition: background .13s ease;
}

.hfsd-step:hover { background: #fff; }

.is-dark .hfsd-step {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .18);
    color: #e8e9f1;
}

.is-dark .hfsd-step:hover { background: rgba(255, 255, 255, .16); }
.hfsd-step[data-step="-1"]::before { content: "\2190\00a0"; }
.hfsd-step[data-step="1"]::after { content: "\00a0\2192"; }

.hfsd-step:focus-visible {
    outline: 2px solid var(--hfsd-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .hfsd-tryon-stage,
    .hfsd-pick { transition: none; }
}

.hfsd-foot-note {
    color: var(--hfsd-faint);
    font-size: 13px;
    margin: 28px 0 0;
    text-align: center;
}

/* ---------- Fonts and colours ---------- */

.hfsd-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hfsd-swatches {
    display: inline-flex;
    margin-right: 4px;
}

.hfsd-swatches i {
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(16, 24, 40, .14);
    display: block;
    height: 18px;
    width: 18px;
}

.hfsd-swatches i + i { margin-left: -5px; }

.hfsd-font,
.hfsd-tag {
    background: var(--hfsd-ground);
    border: 1px solid var(--hfsd-line);
    border-radius: 999px;
    color: var(--hfsd-ink);
    font-size: 12.5px;
    line-height: 1.2;
    padding: 4px 10px;
}

.hfsd-tag {
    background: #1d2327;
    border-color: #1d2327;
    color: #fff;
    font-weight: 600;
}

/* ---------- Single head ---------- */

.hfsd-single-head {
    padding: 36px 0 26px;
}

.hfsd-crumbs {
    color: var(--hfsd-faint);
    display: flex;
    flex-wrap: wrap;
    font-size: 13.5px;
    gap: 8px;
    margin-bottom: 16px;
}

.hfsd-crumbs a { color: var(--hfsd-accent); text-decoration: none; }
.hfsd-crumbs a:hover { text-decoration: underline; }

.hfsd-single-top {
    align-items: flex-end;
    display: flex;
    gap: 20px 40px;
    justify-content: space-between;
}

.hfsd-single-intro h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin: 0 0 10px;
}

.hfsd-single-intro p {
    color: var(--hfsd-muted);
    font-size: 16.5px;
    margin: 0 0 14px;
    max-width: 720px;
}

.hfsd-cta {
    background: var(--hfsd-accent);
    border-radius: 10px;
    color: #fff;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 22px;
    text-decoration: none;
    transition: background .15s ease;
}

.hfsd-cta:hover,
.hfsd-cta:focus { background: var(--hfsd-accent-dark); color: #fff; }

/* Every style one click away, so they can be compared on the same form. */
.hfsd-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 26px;
    position: relative; /* so styles.js can scroll the current chip into view */
}

.hfsd-switcher a {
    background: #fff;
    border: 1px solid var(--hfsd-line);
    border-radius: 999px;
    color: var(--hfsd-ink);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 13px;
    text-decoration: none;
    transition: border-color .13s ease, color .13s ease;
}

.hfsd-switcher a:hover { border-color: #c7ccf7; color: var(--hfsd-accent); }

.hfsd-switcher a.is-on {
    background: var(--hfsd-accent);
    border-color: var(--hfsd-accent);
    color: #fff;
}

/* ---------- Toolbar and stage ---------- */

.hfsd-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

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

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

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

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

.hfsd-note {
    color: var(--hfsd-faint);
    font-size: 12.5px;
    margin: 0;
    max-width: 640px;
}

.hfsd-stage {
    display: flex;
    justify-content: center;
}

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

/* The button is disabled because nothing stands behind the form, but here its
   look is the point, so it keeps the style's own colours at full strength. */
.hfsd button[type="submit"][disabled] {
    cursor: not-allowed;
    filter: none;
    opacity: 1;
}

/* ---------- Previous / next ---------- */

.hfsd-pager {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 40px 0 0;
}

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

.hfsd-pager a:hover {
    border-color: #c7ccf7;
    box-shadow: var(--hfsd-lift);
    color: var(--hfsd-ink);
    transform: translateY(-2px);
}

.hfsd-pager .hfsd-pager-next { text-align: right; }

.hfsd-pager small {
    color: var(--hfsd-accent);
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .07em;
    margin-bottom: 3px;
    text-transform: uppercase;
}

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

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

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

/* The wrapper stands in for the body: the ground and spacing stay the
   gallery's own, the frame's type follows the site around it. */
.hfsd-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. */
.hfsd-in-theme { --hfsd-wrap: calc(var(--total-wide-container-width, 1292px) + 48px); }

@media (max-width: 767px) {
    .hfsd-in-theme .hfsd-wrap { padding: 0 20px; }
    .hfsd-in-theme .hfsd-picks,
    .hfsd-in-theme .hfsd-switcher { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1100px) {
    .hfsd-tryon { grid-template-columns: 210px minmax(0, 1fr); }
    .hfsd-tryon-info { align-items: stretch; flex-direction: column; }
    .hfsd-tryon-info .hfsd-cta { align-self: flex-start; }
}

/* The list becomes one row of chips that scrolls sideways. */
@media (max-width: 860px) {
    .hfsd-tryon { gap: 16px; grid-template-columns: minmax(0, 1fr); }

    .hfsd-picks {
        flex-direction: row;
        margin: 0 -24px;
        max-height: none;
        overflow-x: auto;
        padding: 0 24px 4px;
        position: static;
        scrollbar-width: none;
    }

    .hfsd-picks::-webkit-scrollbar { display: none; }

    .hfsd-pick {
        background: #fff;
        border: 1px solid var(--hfsd-line);
        border-radius: 999px;
        flex: 0 0 auto;
        font-size: 13.5px;
        gap: 8px;
        padding: 5px 13px 5px 6px;
        white-space: nowrap;
    }

    .hfsd-pick[aria-current] { border-color: var(--hfsd-accent); }
    .hfsd-pick-chip { border-radius: 50%; height: 20px; width: 20px; }
}

@media (max-width: 782px) {
    .hfsd-single-top { align-items: stretch; display: block; }
    .hfsd-single-intro h1 { font-size: 29px; }
    .hfsd-cta { display: block; margin-top: 16px; text-align: center; }
    .hfsd-tryon-info .hfsd-cta { align-self: stretch; margin-top: 0; }
    .hfsd-tryon-stage { padding: 22px 18px; }
    .hfsd-tryon-intro h2 { font-size: 23px; }

    /* One row that scrolls sideways rather than four lines of chips. */
    .hfsd-switcher {
        flex-wrap: nowrap;
        margin-left: -24px;
        margin-right: -24px;
        overflow-x: auto;
        padding: 0 24px 4px;
        scrollbar-width: none;
    }

    .hfsd-switcher::-webkit-scrollbar { display: none; }
    .hfsd-switcher a { flex: 0 0 auto; }

    .hfsd-canvas { padding: 18px; }
}

@media (max-width: 640px) {
    .hfsd-picks { margin: 0 -16px; padding: 0 16px 4px; }
    .hfsd-wrap { padding: 0 16px; }
    .hfsd-switcher { margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; }
}
