/*
 * Copyright (c) 2026 Philip Necsulescu.
 * All rights reserved.
 */

.listing-section {
    margin-top: 32px;
    min-width: 0;
}

.table-shell {
    display: grid;
    gap: 0;
    min-width: 0;
}

.table-shell .results-panel-content {
    transition: opacity 0.16s ease;
}

.table-shell--loading .results-panel-content {
    opacity: 0.62;
}

.results-panel-content {
    min-width: 0;
    background: var(--panel-warm-glass);
    border: var(--card-border-external) solid var(--accent);
    border-radius: 0;
    box-shadow: 0 16px 40px var(--shadow-soft);
}

.results-table-scroll-content {
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.results-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.results-table--compact {
    min-width: 640px;
}

.results-table--clubs {
    min-width: 980px;
}

.results-table th,
.results-table td {
    padding: 16px 20px;
    border-bottom: 4px solid var(--accent-rule);
    text-align: left;
    vertical-align: top;
}

.results-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: var(--catalog-table-header-height);
    padding: 0 16px;
    border-bottom: 0;
    background: var(--menu-bar-action-background);
    box-shadow: inset 0 -4px 0 var(--menu-bar-background);
    color: var(--menu-bar-action-color);
    font-size: var(--menu-bar-font-size);
    font-weight: var(--menu-bar-action-font-weight);
    line-height: var(--menu-bar-line-height);
    letter-spacing: 0;
    text-transform: uppercase;
}

.results-table tbody td {
    background: var(--panel-warm-row);
    vertical-align: middle;
}

.results-table tbody tr:nth-child(even) td {
    background: var(--panel-warm-row-alt);
}

.results-table tbody tr[data-table-row]:hover td {
    background: var(--ball-dot-yellow-soft);
}

.results-table tbody tr:last-child td {
    border-bottom: 0;
}

.results-table--clubs th:first-child,
.results-table--clubs .table-club-cell {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
}

.results-table--clubs thead th:nth-child(2),
.results-table--clubs .table-location-cell {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

.results-table--clubs th.numeric-column,
.results-table--clubs td.numeric-cell {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.results-table--clubs thead th.numeric-column {
    padding-right: 4px;
    padding-left: 4px;
}

.results-table--clubs tbody td.numeric-cell {
    padding-right: 8px;
    padding-left: 8px;
}

.results-table .sort-button {
    min-height: var(--catalog-table-header-height);
}

.results-table .sort-button:hover,
.results-table .sort-button:focus-visible {
    background: var(--menu-bar-hover-background);
    color: var(--menu-bar-hover-color);
    outline: none;
}

.numeric-column {
    text-align: center;
}

.numeric-cell,
.results-table td[data-label="Type"],
.results-table td[data-label="Coverage level"] {
    font-size: var(--font-size-small);
    font-weight: 800;
    line-height: 16px;
    overflow-wrap: anywhere;
}

.numeric-cell {
    font-variant-numeric: tabular-nums;
    text-align: center;
}

tr[data-table-row][hidden],
.table-filter-empty-row[hidden] {
    display: none;
}

.results-table tbody td.table-empty,
.results-empty-content.table-empty {
    padding: 32px 24px;
    background: linear-gradient(180deg, var(--panel-soft) 0%, var(--panel) 100%);
}

.table-empty h3 {
    margin: 0 0 8px;
}

.table-empty p {
    color: var(--muted);
    margin: 8px 0 0;
}

.club-link {
    display: inline-block;
    justify-self: start;
    min-width: 0;
    color: inherit;
    font-size: var(--font-size-regular);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.table-filter-match {
    padding: 0;
    background: var(--ball-dot-blue-soft);
    color: var(--ink);
}

.club-link:hover,
.club-link:focus-visible {
    color: var(--accent-dark);
}

.table-club-content,
.table-location-content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.table-club-heading-content,
.result-card-title-content {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
    min-width: 0;
}

.table-location-subtitle {
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: var(--font-size-small);
    line-height: 16px;
}

.table-location-city-link {
    display: inline-block;
    justify-self: start;
    min-width: 0;
    font-size: var(--font-size-small);
    font-weight: 800;
    line-height: 16px;
    overflow-wrap: anywhere;
}

.table-location-link {
    color: inherit;
    overflow-wrap: anywhere;
}

.table-location-link:hover,
.table-location-link:focus-visible {
    color: var(--accent-dark);
}

.table-resource-link {
    color: var(--accent-dark);
    font-size: var(--font-size-small);
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 16px;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-resource-link:hover,
.table-resource-link:focus-visible {
    color: var(--accent-dark);
    text-decoration-color: var(--accent);
    text-decoration-thickness: 4px;
    text-underline-offset: 4px;
    outline: none;
}

.table-access-cell {
    white-space: nowrap;
}

.table-access-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 176px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 0;
    font-size: var(--font-size-small);
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 16px;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-access-badge--public {
    color: var(--ball-dot-blue);
    background: var(--ball-dot-blue-soft);
    border-color: var(--ball-dot-blue-border);
}

.table-access-badge--member {
    color: var(--accent-dark);
    background: var(--booking-subtle);
    border-color: var(--booking-border);
}

.results-list-content {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    background: var(--panel-warm-glass);
}

.results-list-content--mobile-only {
    display: none;
}

.results-empty-content {
    min-width: 0;
    padding: 24px 16px;
}

.results-empty-content h3 {
    --results-empty-heading-font-size: 28px;

    font-size: var(--results-empty-heading-font-size);
    line-height: calc(var(--results-empty-heading-font-size) + 4px);
    overflow-wrap: anywhere;
}

.result-card-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(92px, 108px);
    gap: 12px;
    align-items: start;
    min-width: 0;
    padding: 16px;
    border: var(--card-border-external) solid var(--accent-rule);
    border-radius: 0;
    background: var(--panel-bright-glass);
}

.result-card-content--summary {
    grid-template-columns: minmax(0, 1fr);
}

.result-card-heading-content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.result-card-title {
    color: inherit;
    font-size: 20px;
    font-weight: 800;
    line-height: 24px;
    overflow-wrap: anywhere;
}

.result-location-subtitle {
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: var(--font-size-small);
    font-weight: 700;
    line-height: 16px;
    overflow-wrap: anywhere;
}

.result-type-description {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    font-size: var(--font-size-small);
    font-weight: 800;
    line-height: 16px;
    overflow-wrap: anywhere;
}

.result-courts-content {
    display: grid;
    gap: 4px;
    min-width: 0;
    margin: 0;
}

.result-stat-content {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    padding: 4px 8px;
    border: var(--card-border-internal) solid var(--accent-rule);
    background: var(--panel-soft);
}

.result-stat-label {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-size-small);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 12px;
    text-transform: uppercase;
}

.result-stat-value {
    margin: 0;
    color: var(--ink);
    font-size: var(--font-size-regular);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 20px;
}

.result-meta-content {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 8px 12px;
    align-items: center;
    min-width: 0;
}

.result-meta-content .table-access-badge {
    width: auto;
    min-width: 124px;
    padding: 0 8px;
    letter-spacing: 0;
}

.result-resource-link {
    color: var(--accent-dark);
    font-size: var(--font-size-small);
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 16px;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.result-card-title:hover,
.result-card-title:focus-visible,
.result-resource-link:hover,
.result-resource-link:focus-visible {
    color: var(--accent-dark);
    text-decoration-color: var(--accent);
    text-decoration-thickness: 4px;
    text-underline-offset: 4px;
    outline: none;
}

@media (max-width: 800px) {
    .results-list-content--mobile-only {
        display: grid;
    }

    .results-table-scroll-content {
        display: none;
    }

    .results-table thead th,
    .results-table thead .sort-button,
    .results-table thead .sort-label {
        font-size: var(--menu-bar-mobile-font-size);
        line-height: var(--menu-bar-line-height);
        letter-spacing: 0;
    }

    .result-stat-label {
        font-size: var(--mobile-body-font-size);
        line-height: var(--mobile-body-line-height);
        letter-spacing: 0;
    }

    .result-card-title {
        font-size: var(--font-size-regular);
        line-height: 20px;
    }

    .table-access-badge {
        font-size: var(--font-size-small);
        line-height: 16px;
        letter-spacing: 0;
    }
}

@media (max-width: 400px) {
    .results-list-content {
        padding: 12px 8px;
    }

    .result-card-content {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .result-courts-content {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .result-stat-content {
        display: grid;
        justify-items: center;
        text-align: center;
    }

    .result-meta-content .table-access-badge {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }

    .result-resource-link {
        white-space: normal;
    }
}
