/*
    Site search's own styles (tarka-web-design/site-search): the instant
    search box and its drop-down, the box that opens over the page, the
    plain box, and the results page with its filters. Served by the
    package beside search.js, with no build step.

    Colours, corners and type come from the site: a Tailwind v4 site puts
    its @theme tokens on :root as --color-brand, --radius-card and so on,
    and everything here reads those first and falls back to plain
    defaults. A site can go further by setting the --ss-* values itself.
    Everything is scoped under .ss-* so the site's own styles are left alone.

    Every rule but the last few is in the "components" layer, with the
    layers declared in Tailwind v4's own order, so a site's utilities
    (class="mb-8" on a component) win over these, and Tailwind's base layer
    never comes after them, whichever stylesheet loads first. Each
    component's outer element carries not-prose, so Tailwind's typography
    plugin leaves it alone inside a "prose" column.
*/
@layer properties, theme, base, components, utilities;

@layer components {
    .ss-box, .ss-overlay, .ss-catalogue, .ss-plain, .ss-page, .ss-catalogue-block {
        --ss-brand: var(--color-brand, #1d4ed8);
        --ss-brand-dark: var(--color-brand-dark, color-mix(in srgb, var(--ss-brand) 82%, black));
        --ss-brand-soft: var(--color-brand-soft, color-mix(in srgb, var(--ss-brand) 12%, white));
        --ss-on-brand: var(--color-on-brand, #ffffff);
        --ss-ink: var(--color-ink, #0f172a);
        --ss-muted: var(--color-ink-soft, #475569);
        --ss-surface: var(--color-surface, #ffffff);
        --ss-surface-alt: var(--color-surface-alt, #f1f5f9);
        --ss-line: var(--color-line, #e2e8f0);
        --ss-radius: var(--radius-card, 1rem);
        --ss-radius-sm: var(--radius-button, 0.5rem);
        --ss-radius-image: var(--radius-image, 0.75rem);
        --ss-font-display: var(--font-display, inherit);
        --ss-heading-weight: var(--font-weight-heading, 700);
        --ss-mark: color-mix(in srgb, var(--ss-brand) 16%, transparent);
        --ss-shadow: 0 24px 48px -16px rgba(15, 23, 42, .28), 0 2px 6px rgba(15, 23, 42, .08);
        --ss-focus: 0 0 0 3px color-mix(in srgb, var(--ss-brand) 30%, transparent);
        color: var(--ss-ink);
    }
    .ss-box *, .ss-overlay *, .ss-catalogue *, .ss-plain *, .ss-box *::before, .ss-overlay *::before, .ss-catalogue *::before { box-sizing: border-box; }
    .ss-box button, .ss-overlay button, .ss-catalogue button, .ss-plain button, .ss-box input, .ss-overlay input, .ss-catalogue input, .ss-catalogue select, .ss-plain input { font: inherit; color: inherit; }
    .ss-box button:not(:disabled), .ss-overlay button:not(:disabled), .ss-catalogue button:not(:disabled), .ss-plain button, .ss-catalogue label, .ss-catalogue select { cursor: pointer; }
    /* Resets with no weight of their own (:where), so every rule below wins over them. */
    :where(.ss-box, .ss-overlay, .ss-catalogue) :where(p, h2, h3, ul, ol, fieldset) { margin: 0; }
    :where(.ss-catalogue) :where(ul, ol) { padding: 0; list-style: none; }
    :where(.ss-catalogue) fieldset { border: 0; padding: 0; min-width: 0; }

    .ss-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    .ss-icon { width: 1.25rem; height: 1.25rem; flex: none; }
    .ss-box mark, .ss-overlay mark, .ss-catalogue mark { background: var(--ss-mark); color: inherit; border-radius: 2px; padding: 0 .05em; }

    .ss-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .6rem 1.25rem; border: 0; border-radius: var(--ss-radius-sm); background: var(--ss-brand); color: var(--ss-on-brand) !important; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background-color .15s ease; }
    .ss-button:hover { background: var(--ss-brand-dark); }
    .ss-button:focus-visible { outline: none; box-shadow: var(--ss-focus); }
    .ss-button-quiet { background: var(--ss-surface-alt); color: var(--ss-ink) !important; }
    .ss-button-quiet:hover { background: var(--ss-line); }
    .ss-link { color: var(--ss-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
    .ss-link:hover { color: var(--ss-brand-dark); }

    /* ------------------------------------------------------------------ */
    /* The instant box (<x-site-search />).                               */
    /* ------------------------------------------------------------------ */
    .ss-box { position: relative; display: block; font-size: 1rem; line-height: 1.4; }
    .ss-design-bar { width: 100%; max-width: 26rem; }
    .ss-form { position: relative; margin: 0; }
    .ss-field { position: relative; display: flex; align-items: center; gap: .25rem; min-height: 2.75rem; padding: 0 .35rem 0 .85rem; border: 1px solid var(--ss-line); border-radius: var(--ss-radius-sm); background: var(--ss-surface); transition: border-color .15s ease, box-shadow .15s ease; }
    .ss-field:focus-within { border-color: var(--ss-brand); box-shadow: var(--ss-focus); }
    .ss-field-icon { color: var(--ss-muted); width: 1.15rem; height: 1.15rem; }
    .ss-input { flex: 1; min-width: 0; height: 2.6rem; margin: 0; padding: 0 .4rem; border: 0; outline: 0; background: transparent; font-size: 1rem; }
    .ss-input::placeholder { color: var(--ss-muted); opacity: .85; }
    .ss-input::-webkit-search-cancel-button, .ss-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
    .ss-clear, .ss-cancel { display: grid; place-items: center; height: 2.25rem; min-width: 2.25rem; padding: 0 .4rem; border: 0; border-radius: var(--ss-radius-sm); background: transparent; color: var(--ss-muted); }
    .ss-clear:hover, .ss-cancel:hover { background: var(--ss-surface-alt); color: var(--ss-ink); }
    .ss-clear[hidden] { display: none; }
    .ss-clear .ss-icon { width: 1rem; height: 1rem; }
    .ss-cancel { font-weight: 600; color: var(--ss-brand); }
    .ss-spinner { display: none; width: 1rem; height: 1rem; margin-right: .25rem; border: 2px solid var(--ss-line); border-top-color: var(--ss-brand); border-radius: 50%; animation: ss-spin .7s linear infinite; }
    .ss-loading .ss-spinner { display: block; }
    @keyframes ss-spin { to { transform: rotate(360deg); } }

    .ss-open { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: 999px; background: transparent; color: inherit; }
    .ss-open:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
    .ss-open:focus-visible { outline: none; box-shadow: var(--ss-focus); }

    /* The drop-down. */
    .ss-panel { position: absolute; z-index: 90; top: calc(100% + .5rem); left: 0; width: min(36rem, calc(100vw - 2rem)); max-height: min(72vh, 44rem); overflow-y: auto; overscroll-behavior: contain; padding: .5rem; border: 1px solid var(--ss-line); border-radius: var(--ss-radius); background: var(--ss-surface); box-shadow: var(--ss-shadow); color: var(--ss-ink); text-align: left; }
    .ss-panel[hidden] { display: none; }
    .ss-group + .ss-group { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--ss-line); }
    .ss-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .45rem .65rem .25rem; color: var(--ss-muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
    .ss-group-head span:last-child { letter-spacing: 0; text-transform: none; font-weight: 500; }
    .ss-option { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .45rem .65rem; border-radius: var(--ss-radius-sm); color: var(--ss-ink); text-decoration: none; scroll-margin: .5rem; }
    .ss-option[aria-selected="true"] { background: var(--ss-surface-alt); box-shadow: inset 3px 0 0 var(--ss-brand); }
    .ss-option-icon { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: var(--ss-radius-sm); background: var(--ss-surface-alt); color: var(--ss-muted); }
    .ss-option-icon .ss-icon { width: 1rem; height: 1rem; }
    .ss-option-text { flex: 1; min-width: 0; }
    .ss-option-label { margin-left: auto; padding-left: .5rem; color: var(--ss-muted); font-size: .8125rem; white-space: nowrap; }
    .ss-suggestion mark { background: none; font-weight: 700; }
    .ss-thumb { position: relative; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; flex: none; overflow: hidden; border-radius: var(--ss-radius-image); background: var(--ss-surface-alt); color: var(--ss-brand-dark); font-weight: 700; font-size: .875rem; }
    .ss-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .ss-hit-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
    .ss-hit-title { font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .ss-hit-sub, .ss-hit-snippet { color: var(--ss-muted); font-size: .875rem; line-height: 1.35; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .ss-hit-price { display: flex; flex-direction: column; align-items: flex-end; flex: none; padding-left: .5rem; font-weight: 700; white-space: nowrap; text-align: right; }
    .ss-hit-price small { color: var(--ss-muted); font-weight: 500; font-size: .75rem; }
    .ss-hit-price s { color: var(--ss-muted); font-weight: 500; font-size: .8125rem; }
    .ss-see-group { color: var(--ss-brand); font-weight: 600; font-size: .9375rem; min-height: 2.5rem; }
    .ss-see-all { margin-top: .35rem; justify-content: space-between; border-top: 1px solid var(--ss-line); border-radius: 0 0 var(--ss-radius-sm) var(--ss-radius-sm); color: var(--ss-brand); font-weight: 600; }
    .ss-see-all .ss-icon { width: 1.1rem; height: 1.1rem; }
    .ss-panel-note { padding: .5rem .65rem; color: var(--ss-muted); font-size: .875rem; }
    .ss-panel-empty { padding: .75rem .65rem .35rem; }
    .ss-panel-empty strong { display: block; font-weight: 700; }
    .ss-panel-empty span { color: var(--ss-muted); font-size: .9375rem; }
    .ss-panel .ss-chips { padding: .35rem .65rem .5rem; }
    .ss-panel .ss-chip[aria-selected="true"] { border-color: var(--ss-brand); background: var(--ss-brand-soft); }

    /* The box over the page (design="icon"): a panel at the top on a computer, the whole screen on a phone. */
    .ss-overlay { position: fixed; inset: 0; z-index: 2147483000; display: block; font-size: 1rem; line-height: 1.4; }
    .ss-overlay[hidden] { display: none; }
    .ss-overlay-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); opacity: 0; transition: opacity .18s ease; }
    .ss-overlay-panel { position: relative; width: min(40rem, calc(100% - 2rem)); margin: 9vh auto 0; padding: .75rem; border-radius: var(--ss-radius); background: var(--ss-surface); box-shadow: var(--ss-shadow); opacity: 0; transform: translateY(-8px); transition: opacity .18s ease, transform .18s ease; }
    .ss-overlay-open .ss-overlay-backdrop { opacity: 1; }
    .ss-overlay-open .ss-overlay-panel { opacity: 1; transform: none; }
    .ss-overlay .ss-field { min-height: 3.25rem; font-size: 1.0625rem; }
    .ss-overlay .ss-panel { position: static; width: auto; max-height: min(64vh, 40rem); margin-top: .5rem; padding: 0; border: 0; box-shadow: none; }
    html.ss-no-scroll, html.ss-no-scroll body { overflow: hidden; }
    @media (prefers-reduced-motion: reduce) { .ss-overlay-backdrop, .ss-overlay-panel { transition: none; } }

    @media (max-width: 640px) {
        .ss-overlay-panel { width: 100%; height: 100%; margin: 0; padding: .75rem 1rem 0; border-radius: 0; display: flex; flex-direction: column; }
        .ss-overlay .ss-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
        .ss-overlay .ss-panel { flex: 1; max-height: none; padding-bottom: 1.5rem; }
        .ss-overlay .ss-input { font-size: 16px; }
        .ss-input { font-size: 16px; }
        .ss-thumb { width: 3rem; height: 3rem; }
    }

    /* ------------------------------------------------------------------ */
    /* The plain box (<x-site-search-form />).                            */
    /* ------------------------------------------------------------------ */
    .ss-plain { margin: 0; max-width: 36rem; }
    .ss-plain-label { display: block; margin-bottom: .4rem; font-weight: 600; }
    .ss-plain-row { display: flex; gap: .5rem; }
    .ss-plain-field { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
    .ss-plain-icon { position: absolute; left: .85rem; color: var(--ss-muted); width: 1.15rem; height: 1.15rem; pointer-events: none; }
    .ss-plain-input { width: 100%; min-height: 2.75rem; padding: .55rem .9rem .55rem 2.6rem; border: 1px solid var(--ss-line); border-radius: var(--ss-radius-sm); background: var(--ss-surface); font-size: 1rem; outline: 0; }
    .ss-plain-input:focus { border-color: var(--ss-brand); box-shadow: var(--ss-focus); }

    /* ------------------------------------------------------------------ */
    /* The results page and <x-site-search-catalogue />.                  */
    /* ------------------------------------------------------------------ */
    .ss-page { padding: clamp(2rem, 6vw, 4rem) 0; }
    .ss-page-inner { width: 100%; max-width: var(--container-site, 72rem); margin: 0 auto; padding: 0 1.25rem; }
    @media (min-width: 640px) { .ss-page-inner { padding: 0 2rem; } }
    .ss-page-head { max-width: 48rem; margin-bottom: 1.5rem; }
    .ss-page-heading, .ss-catalogue-heading { margin: 0; font-family: var(--ss-font-display); font-weight: var(--ss-heading-weight); font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.15; letter-spacing: var(--tracking-heading, -0.02em); color: var(--ss-ink); }
    .ss-catalogue-heading { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1rem; }
    .ss-page-intro { margin: .75rem 0 0; color: var(--ss-muted); font-size: 1.125rem; }

    .ss-catalogue { font-size: 1rem; line-height: 1.5; }
    .ss-catalogue-form { margin: 0; }
    .ss-searchbar { display: flex; gap: .5rem; max-width: 40rem; }
    .ss-searchbar-field { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
    .ss-searchbar-icon { position: absolute; left: .9rem; color: var(--ss-muted); pointer-events: none; }
    .ss-searchbar-input { width: 100%; min-height: 3rem; padding: .6rem 1rem .6rem 2.75rem; border: 1px solid var(--ss-line); border-radius: var(--ss-radius-sm); background: var(--ss-surface); font-size: 1.0625rem; outline: 0; }
    .ss-searchbar-input:focus { border-color: var(--ss-brand); box-shadow: var(--ss-focus); }
    .ss-searchbar .ss-button { min-height: 3rem; }

    .ss-results { margin-top: 1.5rem; transition: opacity .15s ease; }
    .ss-busy .ss-results { opacity: .55; }
    .ss-tabs { display: flex; gap: .5rem; margin: 0 0 1.25rem; padding-bottom: .25rem; overflow-x: auto; scrollbar-width: thin; }
    .ss-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border: 1px solid var(--ss-line); border-radius: 999px; color: var(--ss-ink); font-size: .9375rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
    .ss-tab:hover { border-color: var(--ss-brand); }
    .ss-tab[aria-current="page"] { border-color: var(--ss-brand); background: var(--ss-brand); color: var(--ss-on-brand); }
    .ss-tab-count { padding: 0 .45rem; border-radius: 999px; background: color-mix(in srgb, currentColor 12%, transparent); font-size: .8125rem; font-weight: 600; }

    .ss-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1.5rem; }
    .ss-chips-label { color: var(--ss-muted); font-size: .9375rem; font-weight: 600; }
    .ss-chip { display: inline-flex; align-items: center; padding: .35rem .85rem; border: 1px solid var(--ss-line); border-radius: 999px; background: var(--ss-surface); color: var(--ss-ink); font-size: .9375rem; text-decoration: none; }
    .ss-chip:hover { border-color: var(--ss-brand); color: var(--ss-brand); }
    .ss-chip mark { background: none; font-weight: 700; }

    .ss-layout { display: block; }
    .ss-layout-filters { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
    .ss-main { min-width: 0; }
    .ss-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
    .ss-count { color: var(--ss-muted); font-weight: 500; }
    .ss-toolbar-actions { display: flex; align-items: center; gap: .5rem; }
    .ss-sort { display: inline-flex; align-items: center; gap: .5rem; }
    .ss-sort-label { color: var(--ss-muted); font-size: .9375rem; }
    .ss-select { min-height: 2.5rem; padding: .4rem 2.2rem .4rem .75rem; border: 1px solid var(--ss-line); border-radius: var(--ss-radius-sm); background: var(--ss-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E") no-repeat right .6rem center / 1rem; -webkit-appearance: none; appearance: none; font-size: .9375rem; }
    .ss-select:focus { outline: none; border-color: var(--ss-brand); box-shadow: var(--ss-focus); }
    .ss-filter-button { display: none; align-items: center; gap: .45rem; min-height: 2.5rem; padding: .4rem .9rem; border: 1px solid var(--ss-line); border-radius: var(--ss-radius-sm); background: var(--ss-surface); font-weight: 600; }
    .ss-filter-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ss-brand); }
    .ss-js .ss-no-js { display: none; }

    .ss-note { margin-bottom: 1.25rem; padding: .75rem 1rem; border-radius: var(--ss-radius-sm); background: var(--ss-brand-soft); color: var(--ss-ink); font-weight: 500; }

    /* Filters. */
    .ss-filters { position: sticky; top: 6rem; display: flex; flex-direction: column; gap: 1.5rem; }
    .ss-filters-head { display: none; align-items: center; justify-content: space-between; }
    .ss-filters-title { font-family: var(--ss-font-display); font-weight: var(--ss-heading-weight); font-size: 1.25rem; }
    .ss-filters-close { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: transparent; }
    .ss-filters-close:hover { background: var(--ss-surface-alt); }
    .ss-filter-title { margin-bottom: .5rem; padding: 0; font-weight: 700; font-size: .9375rem; }
    .ss-check { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; font-size: .9375rem; line-height: 1.3; }
    .ss-check input { width: 1.1rem; height: 1.1rem; margin: 0; flex: none; accent-color: var(--ss-brand); }
    .ss-check-count { margin-left: auto; padding-left: .5rem; color: var(--ss-muted); font-size: .8125rem; }
    .ss-js .ss-check-more { display: none; }
    .ss-js .ss-show-more .ss-check-more { display: flex; }
    .ss-more { margin-top: .35rem; padding: 0; border: 0; background: none; color: var(--ss-brand); font-weight: 600; font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; }
    .ss-more[hidden] { display: none; }
    .ss-range { display: flex; align-items: center; gap: .5rem; }
    .ss-range-field { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
    .ss-range-unit { position: absolute; left: .65rem; color: var(--ss-muted); font-size: .9375rem; pointer-events: none; }
    .ss-range-field input { width: 100%; min-height: 2.5rem; padding: .4rem .5rem .4rem 1.5rem; border: 1px solid var(--ss-line); border-radius: var(--ss-radius-sm); background: var(--ss-surface); font-size: .9375rem; -moz-appearance: textfield; }
    .ss-range-field input::-webkit-outer-spin-button, .ss-range-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .ss-range-field input:focus { outline: none; border-color: var(--ss-brand); box-shadow: var(--ss-focus); }
    .ss-range-to { color: var(--ss-muted); font-size: .875rem; }
    .ss-filters-foot { display: flex; align-items: center; gap: 1rem; }
    .ss-js .ss-filters-apply { display: none; }

    /* Results: cards for products, lines for pages and posts. */
    .ss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 2.25rem 1.5rem; }
    .ss-grid-wide { grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); }
    .ss-cell { min-width: 0; }
    .ss-card { display: flex; flex-direction: column; color: var(--ss-ink); text-decoration: none; }
    .ss-card-media { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: var(--ss-radius-image); background: var(--ss-surface-alt); }
    .ss-card-image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
    .ss-card:hover .ss-card-image { transform: scale(1.04); }
    .ss-card-initials { font-family: var(--ss-font-display); font-weight: var(--ss-heading-weight); font-size: 2.25rem; color: var(--ss-brand-dark); opacity: .7; }
    .ss-badge { position: absolute; left: .75rem; top: .75rem; padding: .2rem .6rem; border-radius: var(--ss-radius-sm); background: var(--ss-ink); color: var(--ss-surface); font-size: .75rem; font-weight: 600; }
    .ss-badge-sale { background: var(--ss-brand); color: var(--ss-on-brand); }
    .ss-card-title { margin-top: .8rem; font-family: var(--ss-font-display); font-weight: var(--ss-heading-weight); line-height: 1.3; }
    .ss-card:hover .ss-card-title { text-decoration: underline; text-underline-offset: 3px; }
    .ss-card-sub { margin-top: .2rem; color: var(--ss-muted); font-size: .875rem; }
    .ss-price { margin-top: .45rem; font-weight: 600; }
    .ss-price-from { color: var(--ss-muted); font-weight: 400; }
    .ss-price-was { margin-left: .35rem; color: var(--ss-muted); font-weight: 400; font-size: .875rem; }

    .ss-list { display: flex; flex-direction: column; gap: 1.5rem; max-width: 48rem; }
    .ss-text-hit { padding-bottom: 1.5rem; border-bottom: 1px solid var(--ss-line); }
    .ss-text-hit:last-child { border-bottom: 0; }
    .ss-text-title { font-family: var(--ss-font-display); font-weight: var(--ss-heading-weight); font-size: 1.1875rem; line-height: 1.3; }
    .ss-text-title a { color: var(--ss-ink); text-decoration: none; }
    .ss-text-title a:hover { color: var(--ss-brand); text-decoration: underline; text-underline-offset: 3px; }
    .ss-text-meta { margin-top: .2rem; color: var(--ss-muted); font-size: .875rem; }
    .ss-text-snippet { margin-top: .4rem; color: var(--ss-muted); }

    .ss-section + .ss-section { margin-top: 3rem; }
    .ss-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
    .ss-section-heading { font-family: var(--ss-font-display); font-weight: var(--ss-heading-weight); font-size: 1.375rem; }
    .ss-section-count { margin-left: .35rem; color: var(--ss-muted); font-family: inherit; font-size: 1rem; font-weight: 500; }

    .ss-empty { max-width: 40rem; padding: 2rem 0; }
    .ss-empty-title { font-family: var(--ss-font-display); font-weight: var(--ss-heading-weight); font-size: 1.375rem; line-height: 1.3; }
    .ss-empty-text { margin-top: .5rem; color: var(--ss-muted); }
    .ss-empty > p + p { margin-top: .5rem; }
    .ss-popular { margin-top: 1.5rem; }
    .ss-popular-intro { margin-bottom: .75rem; font-weight: 600; }

    .ss-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem; margin-top: 3rem; }
    .ss-page-link { display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .75rem; border: 1px solid var(--ss-line); border-radius: var(--ss-radius-sm); color: var(--ss-ink); font-weight: 600; text-decoration: none; }
    a.ss-page-link:hover { border-color: var(--ss-brand); color: var(--ss-brand); }
    .ss-page-link[aria-current="page"] { border-color: var(--ss-brand); background: var(--ss-brand); color: var(--ss-on-brand); }
    .ss-page-gap { color: var(--ss-muted); padding: 0 .25rem; }

    /* A phone: the filters fold behind the "Filter" button, as a sheet over the page. */
    @media (max-width: 899px) {
        .ss-layout-filters { display: block; }
        .ss-filters { position: static; margin-bottom: 2rem; }
        .ss-js .ss-filter-button { display: inline-flex; }
        .ss-js .ss-filters { display: none; }
        .ss-js.ss-filters-open .ss-filters { position: fixed; inset: 0; z-index: 2147483000; display: flex; margin: 0; padding: 1rem 1.25rem 1.25rem; overflow-y: auto; background: var(--ss-surface); }
        .ss-js.ss-filters-open .ss-filters-head { display: flex; }
        .ss-js.ss-filters-open .ss-filters-foot { position: sticky; bottom: 0; margin-top: auto; padding-top: 1rem; background: var(--ss-surface); }
        .ss-js.ss-filters-open .ss-filters-apply { display: inline-flex; flex: 1; }
        .ss-grid, .ss-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1rem; }
        .ss-sort-label { display: none; }
    }
    @media (max-width: 380px) {
        .ss-searchbar .ss-button { padding: .6rem .9rem; }
    }
}

/*
    Outside the layers on purpose. A site's own CSS outside a layer beats
    anything inside one, and the site template styles the TipTap writing in
    .rich-text that way: links underlined in the brand colour, lists
    indented with bullets, list items spaced apart, rounded pictures, its
    own heading sizes. Should a build put a search box inside writing, those
    would restyle it. revert-layer hands each of those properties back to
    the layers (these components, or a utility class on the element), and
    only inside .rich-text; the spacing .rich-text puts between its own
    blocks is left as it is.
*/
:is(.rich-text, .rich-text-inverted) :is(.ss-box, .ss-overlay, .ss-catalogue-block, .ss-catalogue, .ss-plain, .ss-page) :is(a, ul, ol, li, strong, em, img, h1, h2, h3, h4, h5, h6, code, table, th, td) {
    color: revert-layer;
    text-decoration: revert-layer;
    text-underline-offset: revert-layer;
    padding: revert-layer;
    margin-top: revert-layer;
    list-style: revert-layer;
    font-family: revert-layer;
    font-size: revert-layer;
    font-style: revert-layer;
    font-weight: revert-layer;
    line-height: revert-layer;
    letter-spacing: revert-layer;
    max-width: revert-layer;
    width: revert-layer;
    height: revert-layer;
    border: revert-layer;
    border-radius: revert-layer;
    border-collapse: revert-layer;
    background: revert-layer;
    text-align: revert-layer;
}
