/*
 * Hub listing template (UX-M4, job ux-m4-w2p-1101; docs/ux/ux-root-spec.md C.7 + C.11). Property-owned, loaded by
 * themes/blocks/hub-listing.blade.php on every directory hub except /services. Section header, toolbar (count, type
 * chips, sort links), the card grid on the shared .w2p-mcard component (w2p-media-cards.css), pagination and the empty
 * state. Colours, radii, shadows and the focus ring only through the w2p-theme.css tokens; chips reuse .w2p-chip.
 */
.w2p-hl {
    padding: clamp(2.5rem, 1.75rem + 3vw, 4.5rem) 0 0;
}

.w2p-hl--tail {
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) 0 clamp(2.5rem, 1.75rem + 3vw, 4.5rem);
}

/* Section header: eyebrow + H2 + lede (C.7). */
.w2p-hl__head {
    max-width: 46rem;
    margin: 0 0 clamp(1.25rem, 1rem + 1vw, 2rem);
}

.w2p-hl__eyebrow {
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
    margin: 0 0 0.6rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--w2p-accent-text);
}

.w2p-hl__eyebrow::before {
    width: 1.75rem;
    height: 2px;
    content: "";
    background: var(--w2p-brand-accent);
}

.w2p-hl .w2p-hl__title {
    margin: 0 0 0.6rem;
    font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: var(--w2p-text);
}

.w2p-hl__lede {
    max-width: 60ch;
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--w2p-text-body);
}

/* Toolbar (C.11): count, type chips and sort links in one bar; on phones the rows stack and the chips wrap (no hidden
   chip behind a scroll, no horizontal page overflow). */
.w2p-hl__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
    margin: 0 0 clamp(1.25rem, 1rem + 1vw, 2rem);
    padding: 0.875rem 1rem;
    background: var(--w2p-surface-muted);
    border: 1px solid var(--w2p-border-color);
    border-radius: var(--w2p-radius-card);
}

.w2p-hl__count {
    margin: 0 auto 0 0;
    font-size: 0.9375rem;
    color: var(--w2p-text-body);
}

.w2p-hl__count strong {
    color: var(--w2p-text);
}

.w2p-hl__filters,
.w2p-hl__sort {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

.w2p-hl__label {
    flex: none;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--w2p-text-muted);
}

.w2p-hl__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-width: 0;
}

.w2p-hl__chips .w2p-chip,
.w2p-hl__sortlink {
    min-height: 2.5rem;
}

.w2p-hl__sortlink {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--w2p-text-body);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: var(--w2p-radius-pill);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.w2p-hl__sortlink:hover {
    color: var(--w2p-accent-text);
    border-color: var(--w2p-border-color);
}

.w2p-hl__sortlink.is-current {
    color: var(--w2p-text);
    background: var(--w2p-surface);
    border-color: var(--w2p-border-color);
    box-shadow: var(--w2p-shadow-card);
}

.w2p-hl__sortlink:focus-visible,
.w2p-hl__page:focus-visible {
    outline: none;
    box-shadow: var(--w2p-focus-ring);
}

@media (max-width: 767.98px) {
    .w2p-hl__bar {
        flex-direction: column;
        align-items: stretch;
    }

    .w2p-hl__count {
        margin: 0;
    }

    .w2p-hl__filters,
    .w2p-hl__sort {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .w2p-hl__chips .w2p-chip,
    .w2p-hl__sortlink {
        min-height: 2.75rem;
    }
}

/* Cards (C.7) on the shared .w2p-mcard: equal height in a row, label, three-line excerpt, meta. The title size is set
   here because the shared rule is scoped to .w2p-mcards, which this section does not use. */
.w2p-hl__grid {
    align-items: stretch;
}

.w2p-hl .w2p-mcard__name {
    margin: 0 0 0.5rem;
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: normal;
    color: var(--w2p-text);
}

.w2p-hl-card__label {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--w2p-accent-text);
}

.w2p-hl-card__text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.w2p-hl-card__meta {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: var(--w2p-text-muted);
}

.w2p-hl-card .w2p-mcard__media img {
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* No image: the icon tile sits in the flow of the body instead of over the image edge. */
.w2p-hl-card--icon .w2p-mcard__body {
    padding-top: 1.5rem;
}

.w2p-hl-card--icon .w2p-mcard__icon {
    position: static;
    margin: 0 0 1rem;
    border-color: transparent;
}

.w2p-hl-card .w2p-mcard__icon:empty {
    display: none;
}

@media (hover: hover) {
    .w2p-hl-card:hover .w2p-mcard__media img {
        transform: scale(1.045);
    }
}

/* Pagination (C.11): real links, 44 px targets. */
.w2p-hl__pages ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.w2p-hl__page {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0 0.85rem;
    font-weight: 600;
    color: var(--w2p-text);
    text-decoration: none;
    background: var(--w2p-surface);
    border: 1px solid var(--w2p-border-color);
    border-radius: var(--w2p-radius-control);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

a.w2p-hl__page:hover {
    color: var(--w2p-accent-text);
    border-color: color-mix(in srgb, var(--w2p-accent-text) 45%, var(--w2p-border-color));
}

.w2p-hl__page.is-current {
    color: var(--w2p-on-brand);
    background: var(--w2p-accent);
    border-color: var(--w2p-accent);
}

.w2p-hl__page.is-disabled {
    color: var(--w2p-text-muted);
    background: var(--w2p-surface-muted);
}

@media (max-width: 575.98px) {
    .w2p-hl__page--step span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* Empty state (C.7/C.11). */
.w2p-hl__empty {
    max-width: 40rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    text-align: center;
    background: var(--w2p-surface-muted);
    border: 1px dashed var(--w2p-border-color);
    border-radius: var(--w2p-radius-card);
}

.w2p-hl__empty-title {
    margin: 0 0 0.4rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--w2p-text);
}

.w2p-hl__empty-text {
    margin: 0 0 1.25rem;
    color: var(--w2p-text-body);
}

@media (prefers-reduced-motion: reduce) {
    .w2p-hl-card .w2p-mcard__media img,
    .w2p-hl__sortlink,
    .w2p-hl__page {
        transition: none;
    }

    .w2p-hl-card:hover .w2p-mcard__media img {
        transform: none;
    }
}
