/**
 * Sky Orphan Sponsorship — orphans listing (archive) page.
 *
 * Implements `orphan-design/project/orphans-listing.html` from the
 * Claude Design handoff. All design tokens come from
 * `assets/css/orphan-page.css` (--bg, --card, --ink, --brand, etc.)
 * which is enqueued before this file.
 *
 * Markup is rendered by `templates/archive-orphan.php`. The
 * outer wrapper is `<div class="skd-orphan-page skd-orphan-archive">`
 * — the inner `.skd-orphan-page` provides the design-token scope,
 * the inner `.skd-orphan-archive` provides the listing-specific
 * components below.
 */

/* Hide Woodmart's / theme's page-title banner above our hero so the
   cream background doesn't render twice (banner + our hero gradient). */
body.post-type-archive-sky_orphan .wd-page-title,
body.post-type-archive-sky_orphan .page-title,
body.post-type-archive-sky_orphan .wd-title-banner,
body.post-type-archive-sky_orphan .wd-page-title-section,
body.tax-skd_country .wd-page-title,
body.tax-skd_country .page-title,
body.tax-skd_country .wd-title-banner,
body.tax-skd_country .wd-page-title-section {
    display: none !important;
}

.skd-orphan-archive {
    background: var(--bg);
    color: var(--ink);
}
.skd-orphan-archive * { box-sizing: border-box; }
.skd-orphan-archive h1,
.skd-orphan-archive h2,
.skd-orphan-archive h3,
.skd-orphan-archive h4 {
    font-family: var(--wd-entities-title-font, inherit);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}
.skd-orphan-archive a { color: inherit; text-decoration: none; }

/* ───────── Hero ───────── */
.skd-orphan-archive .hero {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.skd-orphan-archive .hero-inner {
    /* Width + horizontal centring handled by the theme container. */
    padding: 48px 0 36px;
}
.skd-orphan-archive .hero-copy { max-width: 720px; }
.skd-orphan-archive .crumbs {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}
.skd-orphan-archive .crumbs span { color: var(--ink); }
.skd-orphan-archive h1.title {
    font-size: 48px !important;
    line-height: 1.05 !important;
    max-width: 14ch;
    color: var(--ink) !important;
    margin: 0 !important;
    padding: 0 !important;
}
.skd-orphan-archive h1.title em {
    color: var(--brand);
    font-style: normal;
}
.skd-orphan-archive .lede {
    color: var(--ink-soft);
    font-size: 17px;
    margin-top: 18px;
    max-width: 50ch;
}
/* Hero stats card removed in 1.0.97 per request. */

/* ───────── Wrap ───────── */
.skd-orphan-archive .wrap {
    /* Width, max-width and horizontal centring intentionally handled
       by the theme container. We only set the grid + vertical rhythm. */
    padding: 32px 0 48px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

/* ───────── Sidebar filters ───────── */
.skd-orphan-archive aside.filters {
    position: sticky;
    top: 24px;
    align-self: start;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}
.skd-orphan-archive aside.filters h3 {
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted) !important;
    font-weight: 600 !important;
    margin-bottom: 12px !important;
    font-family: inherit !important;
}
.skd-orphan-archive .filter-group {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}
.skd-orphan-archive .filter-group:first-of-type {
    border-top: 0;
    padding-top: 0;
}
.skd-orphan-archive .filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}
.skd-orphan-archive .filter-title .chev {
    color: var(--muted);
    font-size: 11px;
}
.skd-orphan-archive .check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink-soft);
}
.skd-orphan-archive .check:hover { color: var(--ink); }
.skd-orphan-archive .check input {
    accent-color: var(--brand);
    margin-right: 10px;
}
.skd-orphan-archive .check .lbl {
    display: flex;
    align-items: center;
}
.skd-orphan-archive .check .count {
    color: var(--muted);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.skd-orphan-archive .range {
    display: flex;
    gap: 8px;
    align-items: center;
}
.skd-orphan-archive .range input[type="number"] {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    background: var(--bg);
    color: var(--ink);
}
.skd-orphan-archive .range span { color: var(--muted); }
.skd-orphan-archive .slider {
    width: 100%;
    accent-color: var(--brand);
}
.skd-orphan-archive .slider-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}
.skd-orphan-archive .filter-search {
    /* Lock the input geometry — Woodmart's input rules push 14 px
       vertical padding + 1.4 line-height which makes this control
       render ~52 px tall. !important here only fights the theme's
       own !important on `.wd-styles input` and friends. */
    width: 100% !important;
    height: 38px !important;
    min-height: 0 !important;
    padding: 0 12px 0 34px !important;
    box-sizing: border-box !important;
    line-height: 36px !important;
    font-size: 14px !important;
    font-family: inherit;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background-color: var(--bg) !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a948e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>");
    background-repeat: no-repeat;
    background-position: 11px center;
    background-size: 14px 14px;
    color: var(--ink) !important;
    box-shadow: none !important;
}
.skd-orphan-archive .filter-search::placeholder {
    color: var(--muted);
    opacity: 1;
}
.skd-orphan-archive .filter-search:focus {
    outline: 0;
    border-color: var(--brand) !important;
    /* Subtle 2 px outer ring instead of a heavy 3 px brand-soft block. */
    box-shadow: 0 0 0 2px rgba(31, 107, 84, 0.18) !important;
}
.skd-orphan-archive .reset {
    margin-top: 18px;
    width: 100%;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 9px;
    border-radius: 8px;
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
    text-align: center;
    display: inline-block;
}
.skd-orphan-archive .reset:hover { background: var(--bg); }

/* ───────── Toolbar ───────── */
.skd-orphan-archive .toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 18px;
    flex-wrap: wrap;
}
.skd-orphan-archive .results {
    font-size: 14px;
    color: var(--ink-soft);
}
.skd-orphan-archive .results b { color: var(--ink); }
.skd-orphan-archive .toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}
.skd-orphan-archive .chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.skd-orphan-archive .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 13px;
    font-weight: 500;
}
.skd-orphan-archive .chip .x {
    color: var(--brand) !important;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
}
.skd-orphan-archive select.sort {
    padding: 8px 30px 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--ink);
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5750' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.skd-orphan-archive .view-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.skd-orphan-archive .view-toggle button {
    background: #fff;
    border: 0;
    padding: 8px 11px;
    cursor: pointer;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 38px;
    line-height: 1;
}
.skd-orphan-archive .view-toggle button svg {
    flex: 0 0 auto;
    display: block;
}
.skd-orphan-archive .view-toggle button.on {
    background: var(--brand-soft);
    color: var(--brand);
}

/* ───────── Card grid ───────── */
.skd-orphan-archive .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.skd-orphan-archive .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: 0.18s;
}
.skd-orphan-archive .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -14px rgba(20,30,25,0.18);
    border-color: #d4cdbe;
}
.skd-orphan-archive .card-photo {
    /* Locked 1536 × 863 frame (16:9) — same crop the partner dropzone
       enforces on upload, so the public listing renders exactly what
       the partner previewed. Object-position keeps the subject centred. */
    aspect-ratio: 1536 / 863;
    position: relative;
    overflow: hidden;
    background: repeating-linear-gradient(135deg, #ded5c4 0 14px, #d3cab8 14px 28px);
    display: block;
}
.skd-orphan-archive .card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.skd-orphan-archive .card-photo .ph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #6b6453;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    letter-spacing: 0.04em;
}
.skd-orphan-archive .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
}
.skd-orphan-archive .badge span {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(255,255,255,0.94);
    color: var(--ink);
    backdrop-filter: blur(4px);
}
.skd-orphan-archive .badge .urgent { background: var(--accent); color: #fff; }
.skd-orphan-archive .badge .new    { background: var(--gold);   color: #1c1408; }
.skd-orphan-archive .badge .sponsored {
    background: #0fdf19;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 10px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    /* box-shadow: 14px 8px 16px rgba(20, 30, 25, 0.25), 0 0 0 0px rgb(76, 199, 81); */
}
.skd-orphan-archive .badge .sponsored::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: rgba(255, 0, 0, 0.22);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

/* Sponsored card: lift the whole card with a brand-soft border. */
.skd-orphan-archive .card.full {
    border-color: rgba(31, 107, 84, 0.35);
    background: linear-gradient(180deg, var(--brand-soft) 0%, var(--card) 110px);
}
.skd-orphan-archive .card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.skd-orphan-archive .card-name {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.skd-orphan-archive .card-name h3 {
    font-size: 19px !important;
    font-weight: 600 !important;
    color: var(--ink) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}
.skd-orphan-archive .card-name h3 a {
    color: inherit !important;
    text-decoration: none !important;
}
.skd-orphan-archive .card-name h3 a:hover { color: var(--brand) !important; }
.skd-orphan-archive .card-name .age {
    color: var(--muted);
    font-size: 13px;
}
.skd-orphan-archive .card-meta {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--ink-soft);
    flex-wrap: wrap;
}
.skd-orphan-archive .card-meta .m {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}
.skd-orphan-archive .card-meta svg { color: var(--brand); }
.skd-orphan-archive .card-blurb {
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.skd-orphan-archive .card-progress { margin-top: 2px; }
.skd-orphan-archive .progress {
    height: 6px;
    background: #ece5d6;
    border-radius: 999px;
    overflow: hidden;
}
.skd-orphan-archive .progress > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--brand), #2c8a6c);
    border-radius: inherit;
}
.skd-orphan-archive .progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px;
    font-variant-numeric: tabular-nums;
}
.skd-orphan-archive .card-foot {
    border-top: 1px dashed var(--line);
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}
.skd-orphan-archive .price {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.skd-orphan-archive .price .amt {
    font-family: var(--wd-entities-title-font, inherit);
    font-weight: 600;
    font-size: 22px;
    color: var(--ink);
    line-height: 1;
}
.skd-orphan-archive .price .amt small {
    font-size: 14px;
    color: var(--muted);
    font-weight: 400;
}
.skd-orphan-archive .price .per {
    font-size: 12px;
    color: var(--muted);
}
.skd-orphan-archive .btn-support {
    background: var(--brand) !important;
    color: #fff !important;
    border: 0;
    padding: 11px 14px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    text-decoration: none !important;
    transition: background-color 0.15s ease;
}
.skd-orphan-archive .btn-support:hover {
    background: var(--brand-ink) !important;
    color: #fff !important;
}
.skd-orphan-archive .btn-support--view {
    background: #fff !important;
    color: var(--brand) !important;
    border: 1px solid var(--brand);
}
.skd-orphan-archive .btn-support--view:hover {
    background: var(--brand-soft) !important;
    color: var(--brand-ink) !important;
}

/* full-sponsored card variant */
.skd-orphan-archive .card.full .card-photo { filter: saturate(.6); }

/* ───────── List view ─────────
   Toggled via JS — `.grid.is-list` lays cards as single-column,
   full-width horizontal rows with photo on the left and body on
   the right. View preference is persisted in localStorage by the
   archive JS. */
.skd-orphan-archive .grid.is-list {
    grid-template-columns: 1fr;
    gap: 14px;
}
.skd-orphan-archive .grid.is-list .card {
    flex-direction: row;
    align-items: stretch;
}
.skd-orphan-archive .grid.is-list .card-photo {
    flex: 0 0 280px;
    width: 280px;
    /* Keep the locked 16:9 frame even in list mode — same crop as grid. */
    aspect-ratio: 1536 / 863;
    align-self: stretch;
}
.skd-orphan-archive .grid.is-list .card-body {
    flex: 1 1 auto;
    padding: 18px 22px 20px;
    gap: 8px;
}
.skd-orphan-archive .grid.is-list .card-name h3 { font-size: 22px !important; }
.skd-orphan-archive .grid.is-list .card-blurb {
    -webkit-line-clamp: 2;
}
.skd-orphan-archive .grid.is-list .card-foot {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    border-top: 1px dashed var(--line);
    padding-top: 12px;
}
.skd-orphan-archive .grid.is-list .price { flex: 1 1 auto; }
.skd-orphan-archive .grid.is-list .btn-support {
    width: auto;
    flex: 0 0 auto;
    padding: 11px 22px;
}
@media (max-width: 780px) {
    /* Mobile list: keep the photo-left + content-right row layout
       so the listing feels like a contact list, not a wide stack of
       hero photos. Photo width drops from 280px → ~120px so the body
       has room to breathe on phones. */
    .skd-orphan-archive .grid.is-list .card {
        flex-direction: row;
        align-items: stretch;
    }
    .skd-orphan-archive .grid.is-list .card-photo {
        flex: 0 0 120px;
        width: 120px;
        aspect-ratio: 1 / 1;
        height: auto;
        align-self: stretch;
    }
    .skd-orphan-archive .grid.is-list .card-body {
        padding: 12px 14px 14px;
        gap: 6px;
    }
    .skd-orphan-archive .grid.is-list .card-name h3 { font-size: 17px !important; }
    .skd-orphan-archive .grid.is-list .card-blurb {
        -webkit-line-clamp: 2;
        font-size: 13px;
    }
    .skd-orphan-archive .grid.is-list .card-foot {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        padding-top: 8px;
    }
    .skd-orphan-archive .grid.is-list .btn-support {
        padding: 9px 14px;
        font-size: 13px;
    }
}
@media (max-width: 420px) {
    /* Very narrow phones — squeeze the photo further so the
       title doesn't truncate aggressively. */
    .skd-orphan-archive .grid.is-list .card-photo {
        flex: 0 0 96px;
        width: 96px;
    }
    .skd-orphan-archive .grid.is-list .card-body { padding: 10px 12px; }
}

/* ───────── Empty state ───────── */
.skd-orphan-archive .empty-state {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 48px 28px;
    text-align: center;
    box-shadow: var(--shadow);
}
.skd-orphan-archive .empty-state h3 {
    font-size: 22px !important;
    color: var(--ink) !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
}
.skd-orphan-archive .empty-state p {
    color: var(--muted);
    margin: 0 0 18px;
}
.skd-orphan-archive .empty-state .reset {
    max-width: 240px;
    margin: 0 auto;
}

/* ───────── Pagination ───────── */
.skd-orphan-archive .pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}
.skd-orphan-archive .pager a,
.skd-orphan-archive .pager span,
.skd-orphan-archive .pager button {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    color: var(--ink-soft);
    text-decoration: none !important;
}
.skd-orphan-archive .pager a:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.skd-orphan-archive .pager .on,
.skd-orphan-archive .pager .current {
    background: var(--brand);
    color: #fff !important;
    border-color: var(--brand);
}

/* ───────── Load more ───────── */
.skd-orphan-archive .load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}
.skd-orphan-archive .load-more {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.skd-orphan-archive .load-more:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft);
}
.skd-orphan-archive .load-more.is-loading {
    opacity: .6;
    cursor: progress;
}
.skd-orphan-archive .load-more:disabled { cursor: not-allowed; }

/* ───────── Mobile filter drawer ─────────
   Industry pattern (Airbnb / Booking.com / Etsy): a sticky "Filters"
   trigger in the toolbar opens a full-height left-side drawer. The
   drawer header carries the title + close button; the existing filter
   form scrolls in the middle; the footer pins a Reset link + a "Show
   results" button. Backdrop closes the drawer on tap. Body scroll is
   locked while the drawer is open (.skd-filters-open on <body>).

   Desktop (≥901px) keeps the inline sticky sidebar — the drawer
   header / footer / trigger / backdrop are hidden by default below. */
.skd-orphan-archive .filters-trigger,
.skd-orphan-archive .filters-head,
.skd-orphan-archive .filters-foot,
.skd-orphan-archive .filters-backdrop,
.skd-orphan-archive .filters-close {
    display: none;
}

.skd-orphan-archive .filters-trigger {
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    position: relative;
}
.skd-orphan-archive .filters-trigger:hover { border-color: #c4baa6; }
.skd-orphan-archive .filters-trigger__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 2px;
}
.skd-orphan-archive .filters-trigger__count[hidden] { display: none; }

/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
    .skd-orphan-archive .hero-inner { grid-template-columns: 1fr; }
    .skd-orphan-archive .wrap { grid-template-columns: 1fr; }
    .skd-orphan-archive aside.filters { position: static; }
    .skd-orphan-archive .grid { grid-template-columns: repeat(2, 1fr); }
}

/* Drawer kicks in below 900px — same breakpoint the single profile uses
   for its photo/info stack collapse. */
@media (max-width: 900px) {
    .skd-orphan-archive .filters-trigger { display: inline-flex; }

    .skd-orphan-archive aside.filters {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(420px, 92vw);
        max-width: 420px;
        z-index: 1000;
        margin: 0;
        padding: 0;
        border-radius: 0;
        border: 0;
        background: var(--card);
        box-shadow: 0 10px 40px -10px rgba(0,0,0,0.35);
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform .25s ease;
        overflow: hidden;
    }
    .skd-orphan-archive aside.filters.is-open { transform: translateX(0); }

    .skd-orphan-archive .filters-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--line);
        flex-shrink: 0;
    }
    .skd-orphan-archive .filters-head__title {
        margin: 0;
        font-size: 16px !important;
        font-weight: 700 !important;
        text-transform: none;
        letter-spacing: 0;
        color: var(--ink) !important;
        font-family: var(--wd-entities-title-font, inherit) !important;
    }
    .skd-orphan-archive .filters-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        color: var(--ink);
        cursor: pointer;
        padding: 0;
    }
    .skd-orphan-archive .filters-close:hover { border-color: #c4baa6; }

    /* Drawer body: no outer scroll. The form is a flex column that
       fits within the available height. Most groups stay at their
       natural height; the country list (variable count) takes the
       leftover space and scrolls internally if it overflows. */
    .skd-orphan-archive aside.filters #skd-orphan-filters {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 4px 18px 8px;
    }
    .skd-orphan-archive aside.filters .filter-group {
        padding: 10px 0;
        border-top: 1px solid var(--line);
        flex-shrink: 0;
    }
    .skd-orphan-archive aside.filters .filter-group:first-of-type {
        border-top: 0;
        padding-top: 6px;
    }
    .skd-orphan-archive aside.filters .filter-title {
        margin-bottom: 6px;
    }
    /* Hide Monthly cost on mobile — power users can still filter via
       URL params; the input markup is preserved on desktop. */
    .skd-orphan-archive aside.filters .filter-group--cost { display: none; }
    /* Country list claims leftover height + scrolls internally only
       if the term count overflows. */
    .skd-orphan-archive aside.filters .filter-group--country {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .skd-orphan-archive aside.filters .filter-group--country .filter-title { flex: 0 0 auto; }
    .skd-orphan-archive aside.filters .filter-group--country label.check {
        flex: 0 0 auto;
    }
    .skd-orphan-archive aside.filters .filter-group--country {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Drop the in-form reset link in the drawer — the footer Reset
       button replaces it (otherwise we'd have two reset CTAs). */
    .skd-orphan-archive aside.filters #skd-orphan-filters .reset { display: none; }
    .skd-orphan-archive aside.filters h3 { display: none; }

    .skd-orphan-archive .filters-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 20px;
        border-top: 1px solid var(--line);
        background: var(--card);
        flex-shrink: 0;
    }
    .skd-orphan-archive .filters-foot__reset {
        color: var(--ink);
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 3px;
        cursor: pointer;
        font-size: 14px;
    }
    .skd-orphan-archive .filters-foot__apply {
        flex: 1 1 auto;
        background: var(--brand);
        color: #fff;
        border: 0;
        border-radius: 10px;
        padding: 13px 18px;
        font-weight: 700;
        font-size: 15px;
        cursor: pointer;
        max-width: 220px;
    }
    .skd-orphan-archive .filters-foot__apply:hover { filter: brightness(.95); }

    .skd-orphan-archive .filters-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20,30,25,0.45);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }
    .skd-orphan-archive .filters-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }
    .skd-orphan-archive .filters-backdrop[hidden] { display: block; }

    body.skd-filters-open {
        overflow: hidden;
        touch-action: none;
    }
}

@media (max-width: 700px) {
    .skd-orphan-archive .hero-inner { padding: 36px 0 28px; }
    .skd-orphan-archive h1.title { font-size: 34px !important; }
    .skd-orphan-archive .wrap { padding: 20px 0 36px; }
    .skd-orphan-archive .grid { grid-template-columns: 1fr; }
    .skd-orphan-archive .toolbar { gap: 10px; }
    .skd-orphan-archive .toolbar-right { width: 100%; flex-wrap: wrap; }
    .skd-orphan-archive select.sort { flex: 1; min-width: 0; }
    /* View toggle stays visible on phone — list mode now keeps a
       compact photo-left row layout (see `.grid.is-list .card`
       overrides below) and is the default on mobile, but the user
       can still flip to grid if they prefer. */
}
