/* ═══════════════════════════════════════════════════════════════
   HRK Good-Practice Search — Stylesheet
   All classes and custom properties are prefixed hrk- / --hrk-
   Colors follow DESIGN.md (KI-Lila, Nunito Sans)
═══════════════════════════════════════════════════════════════ */

[x-cloak] { display: none !important; }

/* ─── Design tokens ─────────────────────────────────────────── */
.hrk-search-page {
    /* Brand — DESIGN.md */
    --hrk-ki-lila:      #7300FF;
    --hrk-ki-blau:      #4230F2;
    --hrk-gradient-end: #281064;
    --hrk-sunset-pink:  #FF6D7F;
    --hrk-sec-green:    #6DFFB6;

    /* Functional */
    --hrk-accent:       var(--hrk-ki-lila);
    --hrk-accent-light: rgba(115, 0, 255, 0.10);
    --hrk-accent-bg:    rgba(115, 0, 255, 0.05);
    --hrk-gradient:     linear-gradient(135deg, var(--hrk-ki-lila), var(--hrk-gradient-end));
    --hrk-lila-tint:    #EBEAFB;
    --hrk-pink-tint:    #FFE7EA;

    /* Text — match host palette (Blocksy theme on ki-lotse.ai) */
    --hrk-text-primary:   #1E0D36;
    --hrk-text-body:      #201B26;
    --hrk-text-secondary: #555555;
    --hrk-text-tertiary:  #6b6b6b;

    /* Surfaces */
    --hrk-border:     #e0e0e0;
    --hrk-bg-page:    #f7f7f7;
    --hrk-bg-card:    #ffffff;
    --hrk-bg-sidebar: #fafafa;
    --hrk-hover:      #f2f2f2;

    /* Shape — 12px global radius matches host */
    --hrk-radius-card: 12px;
    --hrk-radius-btn:  6px;
    --hrk-radius-chip: 20px;
    --hrk-radius-tag:  4px;
    --hrk-radius-pill: 50px;

    /* Shadows */
    --hrk-shadow-card:  0 10px 20px rgba(41, 51, 61, 0.1);
    --hrk-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);

    font-family: 'Nunito Sans', sans-serif;
    background: var(--hrk-bg-page);
    color: var(--hrk-text-primary);
    min-height: 100vh;
    /* Unbroken tokens (URLs, Testeingaben) müssen überall umbrechen
       dürfen — 'anywhere' zählt anders als 'break-word' auch in die
       min-content-Breite von Grid-/Flex-Zellen hinein. */
    overflow-wrap: anywhere;
}

/* ─── Accessibility ─────────────────────────────────────────── */
.hrk-sr-only {
    position: absolute;
    top: 0; left: 0;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.hrk-skip-link {
    position: absolute;
    top: -40px; left: 0;
    background: var(--hrk-accent);
    color: #fff;
    padding: 8px 16px;
    z-index: 1000;
    border-radius: var(--hrk-radius-btn);
    text-decoration: none;
    font-family: 'Nunito Sans', sans-serif;
    transition: top 0.2s;
}
.hrk-skip-link:focus { top: 8px; }

/* ─── No-script fallback ─────────────────────────────────────── */
/* Rendered outside .hrk-search-page (which is [x-cloak] and hidden without
   JS), so brand colors are hardcoded rather than read from custom properties. */
.hrk-noscript-notice {
    max-width: 900px;
    margin: 24px auto;
    padding: 16px 20px;
    background: #EBEAFB;
    border: 1px solid #7300FF;
    border-radius: 12px;
    color: #1E0D36;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.hrk-noscript-notice a {
    color: #7300FF;
    font-weight: 700;
}

/* ─── Breadcrumb ─────────────────────────────────────────────── */
/* Mirrors the theme's own breadcrumb band, which it renders per page but not
   on this CPT: white text on the KI-Lila gradient (DESIGN.md: gradient on
   banner areas, white text). Same reason as the no-script notice: this sits
   outside .hrk-search-page, so the gradient is hardcoded rather than read from
   --hrk-gradient. Angle and stops match .hrk-topbar on the detail page. */
.hrk-breadcrumb {
    padding: 20px 24px;
    background: linear-gradient(135deg, #7300FF, #281064);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #fff;
    font-weight: 700;
}

/* The current page keeps the nav's own weight (bold), matching the theme,
   where it is a bare text node while only the links are toned down. The theme
   tones its links to 70% white, which lands at 3.96:1 against #7300FF — below
   AA — so they are held at 85% (5.0:1) instead. No hover styling by customer
   request; keyboard focus keeps a visible ring (WCAG 2.4.7). */
.hrk-breadcrumb a,
.hrk-breadcrumb a:hover {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    text-decoration: none;
}

.hrk-breadcrumb a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ─── Page layout ────────────────────────────────────────────── */
.hrk-search-page {
    display: flex;
    position: relative;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.hrk-sidebar {
    width: 300px;
    min-width: 280px;
    flex-shrink: 0;
    background: var(--hrk-bg-sidebar);
    border-right: 1px solid var(--hrk-border);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.hrk-sidebar-search {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--hrk-bg-sidebar);
    border-bottom: 1px solid var(--hrk-border);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
}

.hrk-sidebar-search input[type="search"] {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    color: var(--hrk-text-primary);
    outline: none;
}

.hrk-sidebar-search:focus-within {
    outline: 2px solid var(--hrk-accent);
    outline-offset: 2px;
}

.hrk-sidebar-search input[type="search"]::placeholder {
    color: var(--hrk-text-tertiary);
}

.hrk-search-icon {
    color: var(--hrk-text-tertiary);
    flex-shrink: 0;
}

/* Mobile search bar (main column) — hidden on desktop, shown ≤767px where the
   sidebar (with its own search) is display:none. */
.hrk-mobile-search { display: none; }

.hrk-sidebar-filters {
    padding: 0 0 80px;
    flex: 1;
    overflow-y: auto;
}

/* ─── Filter heading ─────────────────────────────────────────── */
.hrk-filter-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 4px;
}

.hrk-filter-heading-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--hrk-text-primary);
}

.hrk-filter-heading-badge {
    background: var(--hrk-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--hrk-radius-chip);
    line-height: 1.4;
}

/* ─── Filter group ───────────────────────────────────────────── */
.hrk-filter-group {
    padding: 14px 16px;
    border-bottom: 1px solid var(--hrk-border);
}

.hrk-filter-group-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Header label/chevron/count are a toggle button; the reset "x" is a sibling
   button so the two never end up as nested interactive elements. */
.hrk-filter-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 4px 2px;
    margin: -4px 0 -4px -2px;
    cursor: pointer;
    text-align: left;
    font-family: 'Nunito Sans', sans-serif;
    border-radius: var(--hrk-radius-btn);
}

.hrk-filter-group-toggle:focus-visible {
    outline: 2px solid var(--hrk-accent);
    outline-offset: 2px;
}

.hrk-filter-group-chevron {
    color: var(--hrk-text-tertiary);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.hrk-filter-group-chevron--open {
    transform: rotate(180deg);
}

.hrk-filter-group-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--hrk-text-primary);
    flex: 1;
}

.hrk-filter-count {
    font-size: 13px;
    color: var(--hrk-text-tertiary);
}

.hrk-filter-group-reset {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--hrk-text-tertiary);
    border-radius: var(--hrk-radius-btn);
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.hrk-filter-group-reset:hover {
    background: var(--hrk-hover);
    color: var(--hrk-text-primary);
}

.hrk-filter-group-panel {
    margin-top: 10px;
}

/* ─── Checkbox filter ────────────────────────────────────────── */
.hrk-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hrk-checkbox-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 4px;
    font-size: 14px;
    color: var(--hrk-text-secondary);
    cursor: pointer;
    border-radius: var(--hrk-radius-btn);
    transition: background 0.1s;
}

.hrk-checkbox-item:hover {
    background: var(--hrk-hover);
}

.hrk-checkbox-item--active {
    font-weight: 600;
    color: var(--hrk-text-primary);
}

.hrk-checkbox-box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--hrk-border);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    background: var(--hrk-bg-card);
}

.hrk-checkbox-box--checked {
    background: var(--hrk-accent);
    border-color: var(--hrk-accent);
}

.hrk-checkbox-item input:focus-visible ~ .hrk-checkbox-box,
.hrk-checkbox-item:focus-within .hrk-checkbox-box {
    outline: 2px solid var(--hrk-accent);
    outline-offset: 2px;
}

.hrk-show-more {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--hrk-accent);
    font-size: 13px;
    font-family: 'Nunito Sans', sans-serif;
    padding: 6px 4px;
    margin-top: 4px;
    transition: opacity 0.15s;
}

.hrk-show-more:hover { opacity: 0.75; }

/* ─── Chip filter ────────────────────────────────────────────── */
.hrk-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hrk-filter-chip {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--hrk-radius-chip);
    border: 1.5px solid var(--hrk-border);
    background: var(--hrk-bg-card);
    color: var(--hrk-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    line-height: 1.5;
}

.hrk-filter-chip:hover {
    border-color: var(--hrk-accent);
    color: var(--hrk-accent);
}

.hrk-filter-chip--active {
    background: var(--hrk-accent-light);
    border-color: var(--hrk-accent);
    color: var(--hrk-accent);
    font-weight: 700;
}

/* ─── Main area ──────────────────────────────────────────────── */
.hrk-main {
    flex: 1;
    min-width: 0;
    padding: 0 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ─── Page title ─────────────────────────────────────────────── */
.hrk-page-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--hrk-ki-lila);
    margin: 24px 0 0;
}

/* ─── Results bar ────────────────────────────────────────────── */
.hrk-results-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--hrk-bg-page);
    border-bottom: 1px solid var(--hrk-border);
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.hrk-results-count {
    flex: 1;
    font-size: 14px;
    color: var(--hrk-text-secondary);
    font-weight: 600;
}

.hrk-results-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ─── Per-page select ─────────────────────────────────────────── */
.hrk-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hrk-per-page-label {
    font-size: 13px;
    color: var(--hrk-text-secondary);
    white-space: nowrap;
}

.hrk-per-page-select {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    color: var(--hrk-text-primary);
    background: var(--hrk-bg-card);
    border: 1.5px solid var(--hrk-border);
    border-radius: var(--hrk-radius-btn);
    padding: 6px 10px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.hrk-per-page-select:hover { border-color: var(--hrk-accent); }

.hrk-per-page-select:focus-visible {
    outline: 2px solid var(--hrk-accent);
    outline-offset: 2px;
}

/* ─── Semantic loading indicator ────────────────────────────── */
.hrk-semantic-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--hrk-text-tertiary);
    flex-shrink: 0;
}

.hrk-semantic-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--hrk-accent-light);
    border-top-color: var(--hrk-ki-lila);
    border-radius: 50%;
    flex-shrink: 0;
    animation: hrk-spin 0.75s linear infinite;
}

@keyframes hrk-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .hrk-semantic-spinner {
        animation: none;
    }
}

/* ─── View Transition — card re-rank animation ───────────────── */
/* Only active during our explicit startViewTransition() call.    */
/* prefers-reduced-motion: the JS guard prevents the transition   */
/* from starting at all, so this rule only fires when motion is OK. */
::view-transition-group(*) { animation-duration: 0.25s; }

/* ─── Buttons ────────────────────────────────────────────────── */
.hrk-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--hrk-accent);
    color: #fff;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--hrk-radius-btn);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.hrk-btn-primary:hover { opacity: 0.88; color: #fff; }

.hrk-btn-primary:focus-visible {
    outline: 2px solid var(--hrk-accent);
    outline-offset: 2px;
}

.hrk-btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--hrk-text-secondary);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    padding: 6px 12px;
    border: 1.5px solid var(--hrk-border);
    border-radius: var(--hrk-radius-btn);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.hrk-btn-reset:hover { background: var(--hrk-hover); }

.hrk-btn-label-short { display: none; }

/* ─── Card grid ──────────────────────────────────────────────── */
.hrk-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hrk-card-item {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.hrk-card-item > .hrk-card {
    width: 100%;
}

/* ─── Card ───────────────────────────────────────────────────── */
.hrk-card {
    position: relative;
    background: var(--hrk-bg-card);
    border-radius: var(--hrk-radius-card);
    box-shadow: var(--hrk-shadow-card);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.15s;
    outline: none;
}

.hrk-card:hover,
.hrk-card:focus-visible {
    box-shadow: var(--hrk-shadow-hover);
    transform: translateY(-1px);
}

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

.hrk-card-body {
    padding: 18px 18px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hrk-card-scenario {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hrk-accent);
    background: var(--hrk-accent-light);
    padding: 2px 8px;
    border-radius: var(--hrk-radius-tag);
    align-self: flex-start;
    margin-bottom: 2px;
}

.hrk-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--hrk-text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    /* Reserve two lines so 1- and 2-line titles keep cards the same height. */
    min-height: calc(1.35em * 2);
}

.hrk-card-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--hrk-text-secondary);
    margin: 0;
    /* Two stacked lines (author + Bundesland) at a fixed height. Block, never
       nowrap, so a long author can't widen the card (see overflow-wrap:anywhere). */
    display: block;
    line-height: 1.4;
    min-height: calc(1.4em * 2);
}

/* Author: exactly one clamped line, wraps normally then ellipsis — width-safe. */
.hrk-card-autor {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hrk-card-bundesland {
    display: block;
    color: var(--hrk-text-tertiary);
    font-weight: 400;
}

.hrk-card-desc {
    font-size: 13px;
    color: var(--hrk-text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 4px 0 0;
    flex: 1;
    /* Reserve three lines so short descriptions keep a uniform card height. */
    min-height: calc(1.55em * 3);
}

.hrk-card-divider {
    height: 1px;
    background: var(--hrk-border);
    margin: 0 18px;
}

.hrk-card-footer {
    padding: 10px 18px 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    /* Reserve the tag row so cards without a Zielgruppe tag stay equal height. */
    min-height: 48px;
    box-sizing: border-box;
}

/* ─── Tag ────────────────────────────────────────────────────── */
.hrk-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--hrk-radius-tag);
    background: var(--hrk-hover);
    color: var(--hrk-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* ─── Card badges (Typ + "Neu") ──────────────────────────────── */
.hrk-card-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    align-self: flex-start;
    /* Keep the scenario box clear of the absolutely-positioned "NEU" badge. */
    max-width: calc(100% - 56px);
    margin-bottom: 2px;
    /* Always in flow (x-show removed in template) + reserve the chip row so cards
       without a Typ/"Neu" badge keep the title aligned. */
    min-height: 21px;
}

.hrk-card-badges .hrk-card-scenario {
    margin-bottom: 0;
    align-self: auto;
    max-width: 100%;
}

/* "NEU" always pinned to the card's top-right corner, regardless of how tall
   the scenario/type box grows. */
.hrk-badge-new {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 9px;
    border-radius: var(--hrk-radius-pill);
    background: var(--hrk-ki-lila);
    color: #fff;
}

/* ─── Active-filter sticky bar ───────────────────────────────── */
.hrk-active-filter-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 0;
    margin-bottom: 8px;
    background: var(--hrk-bg-page);
    border-bottom: 1px solid var(--hrk-border);
}

.hrk-active-filter-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--hrk-text-secondary);
}

.hrk-active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hrk-active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 12px;
    border: none;
    border-radius: var(--hrk-radius-pill);
    background: var(--hrk-ki-lila);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease;
}

.hrk-active-filter-chip:hover,
.hrk-active-filter-chip:focus-visible {
    background: var(--hrk-ki-blau, #4230F2);
}

.hrk-active-filter-chip svg {
    flex: 0 0 auto;
    opacity: 0.85;
}

.hrk-active-filter-clear {
    margin-left: auto;
    background: none;
    border: none;
    padding: 0;
    color: var(--hrk-ki-lila);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* ─── Empty state ────────────────────────────────────────────── */
.hrk-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 24px;
    text-align: center;
    color: var(--hrk-text-tertiary);
}

.hrk-empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ─── Pagination ─────────────────────────────────────────────── */
.hrk-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--hrk-border);
}

.hrk-pagination-range {
    font-size: 13px;
    color: var(--hrk-text-tertiary);
    margin: 0;
}

.hrk-pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.hrk-page-cell {
    display: contents;
}

.hrk-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px; height: 36px;
    padding: 0 10px;
    border: 1.5px solid var(--hrk-border);
    background: var(--hrk-bg-card);
    border-radius: var(--hrk-radius-btn);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    color: var(--hrk-text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.hrk-page-btn:hover:not(:disabled) {
    border-color: var(--hrk-accent);
    color: var(--hrk-accent);
}

.hrk-page-btn--active {
    background: var(--hrk-accent);
    border-color: var(--hrk-accent);
    color: #fff;
    font-weight: 700;
}

.hrk-page-btn--active:hover { opacity: 0.9; color: #fff; }

.hrk-page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.hrk-page-btn:focus-visible {
    outline: 2px solid var(--hrk-accent);
    outline-offset: 2px;
}

.hrk-page-ellipsis {
    display: flex; align-items: center;
    padding: 0 4px;
    font-size: 14px;
    color: var(--hrk-text-tertiary);
}

/* ─── Filter badge ───────────────────────────────────────────── */
.hrk-filter-badge {
    background: var(--hrk-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: var(--hrk-radius-chip);
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
}

/* ─── Mobile filter button ───────────────────────────────────── */
.hrk-mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--hrk-accent);
    color: #fff;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 28px;
    border: none;
    border-radius: var(--hrk-radius-chip);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(115, 0, 255, 0.35);
    align-items: center;
    gap: 8px;
    transition: opacity 0.15s;
}

.hrk-mobile-filter-btn:hover { opacity: 0.88; }

/* ─── Bottom sheet backdrop ──────────────────────────────────── */
.hrk-bottom-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
}

/* ─── Bottom sheet ───────────────────────────────────────────── */
.hrk-bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 88vh;
    background: var(--hrk-bg-card);
    border-radius: 16px 16px 0 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hrk-bottom-sheet-handle {
    width: 40px; height: 4px;
    background: var(--hrk-border);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
}

.hrk-bottom-sheet-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 12px;
    border-bottom: 1px solid var(--hrk-border);
    flex-shrink: 0;
}

.hrk-bottom-sheet-header .hrk-filter-heading-label {
    font-size: 17px;
    font-weight: 700;
    flex: 1;
}

.hrk-bottom-sheet-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: var(--hrk-hover);
    border-radius: 50%;
    cursor: pointer;
    color: var(--hrk-text-secondary);
    transition: background 0.15s;
}

.hrk-bottom-sheet-close:hover { background: var(--hrk-border); }

.hrk-bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
}

.hrk-bottom-sheet-footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--hrk-border);
    flex-shrink: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.hrk-bottom-sheet-footer .hrk-btn-primary {
    flex: 1;
    justify-content: center;
}

/* Alpine transition classes */
.hrk-fade-enter { transition: opacity 0.25s ease; }
.hrk-fade-start { opacity: 0; }
.hrk-fade-end   { opacity: 1; }

.hrk-sheet-enter { transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.hrk-sheet-start { transform: translateY(100%); }
.hrk-sheet-end   { transform: translateY(0); }

/* ─── Reduced motion ─────────────────────────────────────────── */
/* Neutralizes all remaining transitions/animations inside the search page.
   The .hrk-semantic-spinner rule above already stops its own animation;
   this is a broader net over hover/focus transitions, chevrons, sheets, etc. */
@media (prefers-reduced-motion: reduce) {
    .hrk-search-page *,
    .hrk-search-page *::before,
    .hrk-search-page *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1199px) {
    /* Break out of theme content wrapper to span full viewport width */
    .hrk-search-page {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        overflow-x: clip;
    }

    .hrk-sidebar { display: none; }

    .hrk-mobile-filter-btn { display: flex; }
    .hrk-bottom-sheet-backdrop { display: block; }
    .hrk-bottom-sheet { display: flex; }

    .hrk-main { padding: 0 16px 80px; }

    /* Sticky active-filter bar goes edge-to-edge (cancels .hrk-main padding)
       with its own generous padding once the sidebar is hidden. */
    .hrk-active-filter-bar {
        margin-left: -16px;
        margin-right: -16px;
        padding: 16px;
        gap: 10px;
    }

    .hrk-btn-label-long  { display: none; }
    .hrk-btn-label-short { display: inline; }
}

@media (max-width: 767px) {
    /* Sidebar (and its search field) is hidden here — surface search in the
       main column. */
    .hrk-mobile-search {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 12px 0;
        padding: 10px 14px;
        background: var(--hrk-bg-card);
        border: 1px solid var(--hrk-border);
        border-radius: var(--hrk-radius-card);
    }
    .hrk-mobile-search:focus-within {
        outline: 2px solid var(--hrk-accent);
        outline-offset: 2px;
    }
    .hrk-mobile-search input[type="search"] {
        flex: 1;
        min-width: 0;
        border: none;
        background: transparent;
        font-family: 'Nunito Sans', sans-serif;
        font-size: 14px;
        color: var(--hrk-text-primary);
        outline: none;
    }
    .hrk-mobile-search input[type="search"]::placeholder { color: var(--hrk-text-tertiary); }

    .hrk-results-bar { flex-wrap: wrap; }
    /* Count on its own full line; actions wrap so the submit button never
       overflows when the reset button appears. */
    .hrk-results-count { flex: 1 1 100%; }
    .hrk-results-bar-actions { flex-wrap: wrap; }

    .hrk-card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .hrk-card-title { font-size: 15px; }

    /* Footer wraps so the tag doesn't push the card past viewport width */
    .hrk-card-footer {
        flex-wrap: wrap;
        gap: 8px 12px;
        padding: 10px 16px 14px;
    }
    .hrk-card-body { padding: 16px 16px 10px; }
    .hrk-card-divider { margin: 0 16px; }

    .hrk-tag { max-width: 140px; }

    .hrk-empty-state { padding: 56px 16px; }

    .hrk-bottom-sheet-header { padding: 12px 16px; }
    .hrk-bottom-sheet-footer { padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
    .hrk-main { padding: 0 12px 80px; }

    /* Match the tighter .hrk-main padding so the bar stays flush to the edges. */
    .hrk-active-filter-bar {
        margin-left: -12px;
        margin-right: -12px;
        padding: 14px 12px;
    }

    .hrk-card-body { padding: 14px 14px 10px; }
    .hrk-card-divider { margin: 0 14px; }
    .hrk-card-footer { padding: 10px 14px 12px; gap: 6px; flex-wrap: wrap; }

    .hrk-tag { max-width: 120px; font-size: 11px; }

    .hrk-results-bar { gap: 8px; padding: 8px 0; }
    .hrk-results-count { font-size: 13px; flex: 1 1 100%; }
    .hrk-results-bar-actions { gap: 6px; flex-wrap: wrap; }

    .hrk-pagination-controls { gap: 2px; }
    .hrk-page-btn { min-width: 32px; height: 32px; padding: 0 6px; font-size: 13px; }

    .hrk-mobile-filter-btn {
        padding: 11px 22px;
        font-size: 14px;
        bottom: 16px;
    }

    .hrk-bottom-sheet-footer { gap: 6px; }
}

@media (min-width: 1200px) {
    .hrk-bottom-sheet,
    .hrk-bottom-sheet-backdrop,
    .hrk-mobile-filter-btn { display: none !important; }
}
