/* Focused geometry for the public tools catalogue. Shared skin stays in visual-system.css. */

.tools-hub {
    display: grid;
    width: min(100%, 1120px);
    gap: clamp(20px, 3vw, 30px);
    margin-inline: auto;
}

.tools-hub-header {
    margin-bottom: 0;
}

.tools-hub-header > div:first-child {
    max-width: 760px;
}

.tools-hub-summary {
    align-self: start;
    justify-content: flex-end;
}

.tools-hub-summary .summary-pill {
    min-width: 150px;
    justify-content: center;
    font-weight: 850;
    text-align: center;
}

.tools-hub-catalog {
    display: grid;
    gap: clamp(20px, 3vw, 28px);
    padding: clamp(18px, 3.2vw, 34px);
}

.tools-hub-catalog-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 410px);
    gap: 18px 28px;
    align-items: end;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--bh-line);
}

.tools-hub-catalog-heading > * {
    min-width: 0;
    margin-bottom: 0;
}

.tools-hub-catalog-heading .eyebrow,
.tools-hub-catalog-heading h2 {
    margin-bottom: 4px;
}

.tools-hub-catalog-heading > p {
    color: var(--muted);
    line-height: 1.55;
}

.tools-hub-filter {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius-panel);
    background: var(--bh-paper-raised);
}

.tools-hub-filter label {
    color: var(--text);
    font-weight: 800;
}

.tools-hub-filter select,
.tools-hub-filter button,
.tools-hub-filter .ghost-link {
    min-height: var(--bh-control-height);
}

.tools-hub-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(18px, 2.5vw, 26px);
    align-items: stretch;
}

.tools-hub-group {
    display: grid;
    min-width: 0;
    grid-template-rows: auto 1fr;
    gap: 11px;
}

.tools-hub-group-heading {
    min-width: 0;
    padding-left: 11px;
    border-left: 3px solid var(--bh-signal);
}

.tools-hub-group-heading .eyebrow,
.tools-hub-group-heading h3 {
    margin-bottom: 0;
}

.tools-hub-group-heading h3 {
    font-size: clamp(1rem, 1.6vw, 1.18rem);
    line-height: 1.25;
}

.tools-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 14px;
}

.tools-hub-card {
    display: flex;
    min-width: 0;
    min-height: 330px;
    flex-direction: column;
    align-items: stretch;
    padding: clamp(18px, 2.4vw, 24px);
    text-decoration: none;
}

.tools-hub-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.tools-hub-card-meta .eyebrow {
    margin: 0;
}

.tools-hub-card-access {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius-small);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}

.tools-hub-card-access.is-public {
    border-color: color-mix(in srgb, var(--bh-signal) 62%, var(--bh-line));
    color: var(--bh-signal-strong);
}

.tools-hub-card-title {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: clamp(1.22rem, 2.1vw, 1.5rem);
    line-height: 1.2;
    text-wrap: balance;
}

.tools-hub-card-description {
    display: block;
    color: var(--muted);
    line-height: 1.55;
}

.tools-hub-card-facts {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--bh-line);
}

.tools-hub-card-facts > span {
    display: grid;
    gap: 3px;
}

.tools-hub-card-facts small {
    color: var(--bh-metal);
    font-size: 0.69rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.tools-hub-card-facts b {
    color: var(--text);
    font-size: 0.84rem;
    line-height: 1.45;
}

.tools-hub-card-action {
    display: inline-flex;
    min-height: var(--bh-control-height);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 17px;
    color: var(--bh-signal-strong);
    font-weight: 850;
}

.tools-hub-card-action > span {
    font-size: 1.12rem;
    transition: transform 140ms ease;
}

.tools-hub-card:hover .tools-hub-card-action > span,
.tools-hub-card:focus-visible .tools-hub-card-action > span {
    transform: translateX(3px);
}

@media (max-width: 760px) {
    .tools-hub-catalog-heading,
    .tools-hub-groups {
        grid-template-columns: 1fr;
    }

    .tools-hub-catalog-heading {
        align-items: start;
    }

    .tools-hub-filter {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .tools-hub-filter label {
        grid-column: 1 / -1;
    }

    .tools-hub-filter .ghost-link {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .tools-hub-card {
        min-height: 0;
    }
}

@media (max-width: 460px) {
    .tools-hub-summary {
        justify-content: flex-start;
    }

    .tools-hub-summary .summary-pill {
        width: min(100%, 220px);
    }

    .tools-hub-filter {
        grid-template-columns: 1fr;
    }

    .tools-hub-filter > * {
        width: 100%;
        grid-column: 1;
    }

    .tools-hub-filter .ghost-link {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tools-hub-card-action > span {
        transition: none;
    }
}

@media (forced-colors: active) {
    .tools-hub-filter,
    .tools-hub-card,
    .tools-hub-card-access {
        border: 1px solid CanvasText;
        background: Canvas;
        color: CanvasText;
    }
}
