/* Noun catalog, noun detail, and selected-noun practice surfaces. */
.rh-noun-catalog,
.rh-noun-detail {
    width: min(100%, var(--rh-wide-width));
}

.rh-noun-catalog__hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--rh-space-4);
    padding: clamp(1rem, 2.4vw, 1.55rem);
}

.rh-noun-catalog__hero > div {
    min-width: 0;
}

.rh-noun-catalog__hero h1 {
    margin-bottom: var(--rh-space-1);
}

.rh-noun-catalog__hero .rh-panel__lead {
    max-width: 62ch;
    margin: 0;
}

.rh-noun-catalog__count {
    flex: 0 0 auto;
    padding: 0.48rem 0.72rem;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface-subtle);
    color: var(--rh-text);
    font-size: 0.88rem;
}

.rh-noun-catalog__tools {
    display: grid;
    gap: var(--rh-space-3);
    padding: clamp(0.85rem, 2vw, 1.2rem);
}

.rh-noun-catalog__tools-heading,
.rh-noun-catalog__search-row,
.rh-noun-filter-panel__heading,
.rh-noun-filter-panel__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rh-space-3);
    min-width: 0;
}

.rh-noun-catalog__tools-heading > div,
.rh-noun-filter-panel__heading > div {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.rh-noun-catalog__tools-heading strong {
    color: var(--rh-text);
}

.rh-noun-filter-count {
    color: var(--rh-action);
    font-size: 0.8rem;
    font-weight: 780;
}

.rh-noun-catalog__search-row .rh-search-field {
    flex: 1 1 auto;
    min-width: 0;
}

.rh-noun-catalog__filter-actions {
    display: flex;
    align-items: end;
    gap: var(--rh-space-2);
    padding-top: 1.25rem;
}

.rh-noun-catalog__filter-actions .rh-button,
.rh-noun-filter-panel__actions .rh-button {
    min-height: 2.85rem;
    white-space: nowrap;
}

.rh-noun-catalog .rh-button--quiet {
    border: 1px solid transparent;
    background: transparent;
    color: var(--rh-text-muted);
}

.rh-noun-catalog .rh-button--quiet:hover,
.rh-noun-catalog .rh-button--quiet:focus-visible {
    border-color: var(--rh-border);
    background: var(--rh-surface-subtle);
    color: var(--rh-text);
}

.rh-noun-catalog .rh-button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.rh-noun-filter-toggle {
    display: none;
}

.rh-noun-filter-panel {
    display: grid;
    gap: var(--rh-space-3);
    padding-top: var(--rh-space-3);
    border-top: 1px solid var(--rh-border);
}

.rh-noun-filter-panel__heading strong {
    color: var(--rh-text);
}

.rh-noun-filter-panel__heading span {
    color: var(--rh-text-muted);
    font-size: 0.82rem;
}

.rh-noun-filter-panel__close {
    display: none;
    min-height: 2.75rem;
    padding: 0.55rem 0.72rem;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface);
    color: var(--rh-text);
    font: inherit;
    font-weight: 700;
}

.rh-noun-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--rh-space-3);
}

.rh-noun-filter-grid label {
    display: grid;
    gap: var(--rh-space-2);
    min-width: 0;
    color: var(--rh-text-muted);
    font-size: 0.78rem;
    font-weight: 760;
}

.rh-noun-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 2.9rem;
    padding: 0.65rem 2rem 0.65rem 0.75rem;
    border: 1px solid var(--rh-border-strong);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface);
    color: var(--rh-text);
    font: inherit;
}

.rh-noun-filter-grid select:focus-visible,
.rh-noun-filter-panel__close:focus-visible {
    outline: 3px solid var(--rh-focus-ring);
    outline-offset: 2px;
}

.rh-noun-filter-panel__actions {
    justify-content: flex-end;
}

.rh-noun-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--rh-space-3);
}

.rh-noun-gender--masculine {
    --rh-noun-theme-surface: var(--noun-masculine-surface);
    --rh-noun-theme-border: var(--noun-masculine-border);
    --rh-noun-theme-accent: var(--noun-masculine-accent);
}

.rh-noun-gender--feminine {
    --rh-noun-theme-surface: var(--noun-feminine-surface);
    --rh-noun-theme-border: var(--noun-feminine-border);
    --rh-noun-theme-accent: var(--noun-feminine-accent);
}

.rh-noun-gender--neuter {
    --rh-noun-theme-surface: var(--noun-neuter-surface);
    --rh-noun-theme-border: var(--noun-neuter-border);
    --rh-noun-theme-accent: var(--noun-neuter-accent);
}

.rh-noun-gender--special {
    --rh-noun-theme-surface: var(--noun-special-surface);
    --rh-noun-theme-border: var(--noun-special-border);
    --rh-noun-theme-accent: var(--noun-special-accent);
}

.rh-noun-card {
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
    min-width: 0;
    min-height: 9.8rem;
    padding: 1rem;
    border: 1px solid var(--rh-noun-theme-border, var(--rh-border));
    border-radius: var(--rh-radius-card);
    background: var(--rh-noun-theme-surface, var(--rh-surface));
    color: var(--rh-text);
    box-shadow: var(--rh-shadow-1);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.rh-noun-card:hover {
    border-color: var(--rh-noun-theme-accent, var(--rh-action));
    box-shadow: var(--rh-shadow-2);
    transform: translateY(-2px);
}

.rh-noun-card:focus-visible {
    outline: 3px solid var(--rh-focus-ring);
    outline-offset: 3px;
    border-color: var(--rh-action);
}

.rh-noun-card__heading {
    display: flex;
    gap: var(--rh-space-3);
    justify-content: space-between;
    align-items: flex-start;
    min-width: 0;
}

.rh-noun-card__heading > span:first-child {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.rh-noun-card__heading strong {
    color: var(--rh-text);
    font-family: var(--rh-font-display);
    font-size: clamp(1.35rem, 2.2vw, 1.68rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.rh-noun-card__heading > span > span,
.rh-noun-card__detail {
    color: var(--rh-text-muted);
}

.rh-noun-card__arrow {
    flex: 0 0 auto;
    color: var(--rh-noun-theme-accent, var(--rh-action));
    font-size: 1.25rem;
    font-weight: 800;
}

.rh-noun-card__meta {
    margin-top: auto;
    color: var(--rh-noun-theme-accent, var(--rh-text));
    font-size: 0.88rem;
    font-weight: 740;
}

.rh-noun-card__detail {
    font-size: 0.8rem;
    line-height: 1.45;
}

.rh-noun-empty-state {
    display: grid;
    justify-items: start;
    gap: var(--rh-space-2);
}

.rh-noun-empty-state h2,
.rh-noun-empty-state p {
    margin: 0;
}

.rh-noun-detail__hero {
    padding: clamp(0.9rem, 2vw, 1.2rem);
    border-color: var(--rh-noun-theme-border, var(--rh-border));
    background: var(--rh-noun-theme-surface, var(--rh-surface));
}

.rh-noun-detail__back {
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--rh-noun-theme-accent, var(--rh-action));
    font: inherit;
    font-weight: 760;
    cursor: pointer;
}

.rh-noun-detail__hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--rh-space-4);
    align-items: end;
}

.rh-noun-detail__identity {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
    max-width: 46rem;
}

.rh-noun-detail__identity h1,
.rh-noun-detail__identity p {
    margin: 0;
}

.rh-noun-detail__identity h1 {
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    line-height: 1;
}

.rh-noun-detail__primary-meta,
.rh-noun-detail__secondary-meta {
    margin: var(--rh-space-2) 0 0;
}

.rh-noun-detail__primary-meta {
    color: var(--rh-noun-theme-accent, var(--rh-text));
    font-weight: 760;
}

.rh-noun-detail__secondary-meta {
    color: var(--rh-text-muted);
    font-size: 0.9rem;
}

.rh-noun-detail__actions {
    display: flex;
    align-items: end;
    margin: 0;
}

.rh-noun-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface);
}

.rh-noun-table {
    width: 100%;
    border-collapse: collapse;
}

.rh-noun-table th,
.rh-noun-table td {
    padding: 0.78rem 0.9rem;
    border-bottom: 1px solid var(--rh-border);
    text-align: left;
}

.rh-noun-table tr:last-child > * {
    border-bottom: 0;
}

.rh-noun-table thead th {
    background: var(--rh-surface-subtle);
    color: var(--rh-text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.rh-noun-table tbody th {
    color: var(--rh-text-muted);
    font-size: 0.86rem;
}

.rh-noun-table tbody td {
    color: var(--rh-text);
    font-family: var(--rh-font-display);
    font-size: 1.1rem;
    font-weight: 720;
}

.rh-noun-form-cell__primary,
.rh-noun-form-cell__alternative,
.rh-noun-form-cell__unavailable {
    display: block;
}

.rh-noun-form-cell__alternative {
    margin-top: 0.42rem;
    padding-top: 0.42rem;
    border-top: 1px dashed var(--rh-border);
    color: var(--rh-text-muted);
    font-family: var(--rh-font-ui);
    font-size: 0.76rem;
    font-weight: 560;
    line-height: 1.4;
}

.rh-noun-form-cell__alternative strong {
    display: inline;
    margin-inline: 0.25rem;
    color: var(--rh-text);
    font-family: var(--rh-font-display);
    font-size: 0.96rem;
}

.rh-noun-form-cell__unavailable {
    max-width: 24ch;
    color: var(--rh-text-muted);
    font-family: var(--rh-font-ui);
    font-size: 0.8rem;
    font-weight: 560;
    line-height: 1.35;
}

.rh-noun-detail__usage-note {
    margin-top: var(--rh-space-4);
}

.rh-noun-builds {
    display: grid;
    gap: var(--rh-space-3);
}

.rh-noun-builds h2,
.rh-noun-builds p {
    margin: 0;
}

.rh-noun-build-example {
    display: grid;
    gap: var(--rh-space-2);
    max-width: 42rem;
    padding: var(--rh-space-4);
    border: 1px solid var(--rh-border);
    border-left: 4px solid var(--rh-noun-theme-accent, var(--rh-action));
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface-subtle);
}

.rh-noun-build-example > span,
.rh-noun-build-grid article > span {
    color: var(--rh-text-muted);
    font-size: 0.76rem;
    font-weight: 760;
}

.rh-noun-build-example > strong {
    color: var(--rh-text);
    font-family: var(--rh-font-display);
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.rh-noun-build-disclosure {
    max-width: 52rem;
}

.rh-noun-build-disclosure summary {
    width: fit-content;
    min-height: 2.75rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--rh-border-strong);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface);
    color: var(--rh-text);
    font-weight: 760;
    cursor: pointer;
}

.rh-noun-build-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--rh-space-2);
    margin-top: var(--rh-space-3);
}

.rh-noun-build-grid article {
    display: grid;
    gap: var(--rh-space-1);
    min-width: 0;
    padding: var(--rh-space-3);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface-subtle);
}

.rh-noun-build-grid article strong {
    overflow-wrap: anywhere;
    color: var(--rh-text);
    font-family: var(--rh-font-display);
}

.rh-noun-build-grid article small {
    color: var(--rh-text-muted);
    line-height: 1.4;
}

.rh-noun-detail__learning-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rh-space-4);
}

.rh-noun-detail__learning-action > div {
    display: grid;
    gap: var(--rh-space-1);
}

.rh-noun-detail__learning-action p {
    margin: 0;
    color: var(--rh-text-muted);
}

.rh-practice-domain-banner--noun {
    border-color: color-mix(in srgb, var(--rh-success) 36%, var(--rh-border));
    background: color-mix(in srgb, var(--rh-success-soft) 68%, var(--rh-surface));
}

@media (max-width: 68rem) {
    .rh-noun-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rh-noun-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 44rem) {
    .rh-noun-catalog {
        gap: var(--rh-space-3);
    }

    .rh-noun-catalog__hero {
        align-items: flex-start;
        padding: 0.9rem;
    }

    .rh-noun-catalog__hero h1 {
        font-size: clamp(1.85rem, 10vw, 2.35rem);
    }

    .rh-noun-catalog__hero .rh-panel__lead {
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .rh-noun-catalog__count {
        margin-top: 0.15rem;
        font-size: 0.78rem;
    }

    .rh-noun-catalog__tools {
        gap: var(--rh-space-2);
        padding: 0.8rem;
    }

    .rh-noun-catalog__tools-heading {
        align-items: end;
    }

    .rh-noun-catalog__search-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--rh-space-2);
    }

    .rh-noun-catalog__filter-actions {
        justify-content: space-between;
        padding-top: 0;
    }

    .rh-noun-catalog__filter-actions .rh-button {
        min-height: 2.75rem;
    }

    .rh-noun-filter-toggle {
        display: inline-flex;
    }

    .rh-noun-filter-panel {
        display: none;
        margin-top: var(--rh-space-2);
        padding: var(--rh-space-3);
        border: 1px solid var(--rh-border);
        border-radius: var(--rh-radius-card);
        background: var(--rh-surface-elevated);
        box-shadow: var(--rh-shadow-2);
    }

    .rh-noun-filter-panel.is-open {
        display: grid;
    }

    .rh-noun-filter-panel__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .rh-noun-filter-grid,
    .rh-noun-card-grid {
        grid-template-columns: 1fr;
    }

    .rh-noun-filter-grid {
        gap: var(--rh-space-2);
    }

    .rh-noun-filter-grid select,
    .rh-noun-catalog .rh-search-field__input {
        min-height: 3rem;
        font-size: 1rem;
    }

    .rh-noun-filter-panel__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .rh-noun-filter-panel__actions .rh-button--dark {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .rh-noun-card {
        min-height: 8.6rem;
        padding: 0.9rem;
    }

    .rh-noun-card__heading strong {
        font-size: 1.42rem;
    }

    .rh-noun-detail__hero,
    .rh-noun-detail .rh-reference-panel--section {
        padding: 0.95rem;
    }

    .rh-noun-detail__hero-layout,
    .rh-noun-build-grid {
        grid-template-columns: 1fr;
    }

    .rh-noun-detail__actions .rh-button,
    .rh-noun-detail__learning-action .rh-button {
        width: 100%;
    }

    .rh-noun-detail__learning-action {
        display: grid;
    }

    .rh-noun-table-wrap {
        max-width: 100%;
    }

    .rh-noun-table th,
    .rh-noun-table td {
        padding: 0.68rem 0.72rem;
    }

}

@media (max-width: 25rem) {
    .rh-noun-paradigm-table,
    .rh-noun-paradigm-table tbody,
    .rh-noun-paradigm-table tr,
    .rh-noun-paradigm-table th,
    .rh-noun-paradigm-table td {
        display: block;
        width: 100%;
    }

    .rh-noun-paradigm-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .rh-noun-paradigm-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-bottom: 1px solid var(--rh-border);
    }

    .rh-noun-paradigm-table tr:last-child {
        border-bottom: 0;
    }

    .rh-noun-paradigm-table tbody th {
        grid-column: 1 / -1;
        padding-bottom: 0.45rem;
        border-bottom: 0;
        background: var(--rh-surface-subtle);
        color: var(--rh-text);
    }

    .rh-noun-paradigm-table td {
        border-bottom: 0;
        border-right: 1px solid var(--rh-border);
    }

    .rh-noun-paradigm-table td:last-child {
        border-right: 0;
    }

    .rh-noun-paradigm-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.35rem;
        color: var(--rh-text-muted);
        font-family: var(--rh-font-ui);
        font-size: 0.7rem;
        font-weight: 780;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rh-noun-card {
        transition: none;
    }

    .rh-noun-card:hover {
        transform: none;
    }
}
