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

.listing-section {
    margin-top: 2rem;
}

.section-heading p,
.table-empty p {
    color: var(--muted);
}

.section-heading h2,
.table-empty h3 {
    margin: 0 0 0.4rem;
    font-size: 2rem;
}

.table-shell {
    overflow-x: auto;
    background: linear-gradient(180deg, var(--panel-soft) 0%, var(--panel) 100%);
    box-shadow: 0 18px 40px var(--shadow-soft);
    border: 5px solid var(--accent);
    border-radius: 0;
}

.club-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.club-table th,
.club-table td {
    padding: 1rem 1.1rem;
    border-bottom: 3px solid var(--accent-rule);
    text-align: left;
    vertical-align: top;
}

.club-table th {
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-filter-row th {
    padding: 0;
    background: var(--accent);
    border-bottom: 3px solid var(--accent-dark);
    text-transform: none;
}

.table-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(220px, 1fr)) auto;
    gap: 0;
    align-items: stretch;
    background: var(--accent);
    color: #ffffff;
}

.table-filter-field {
    position: relative;
    min-width: 0;
    min-height: 35px;
    gap: 0;
    background: transparent;
}

.table-filter-field::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0.9rem;
    width: calc(0.6rem * 1.02);
    height: calc(0.35rem * 1.02);
    background: currentColor;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform: translateY(-50%);
    pointer-events: none;
}

.table-filter-field select {
    min-height: 35px;
    height: 100%;
    padding: 0.65rem 2.35rem 0.65rem 1rem;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    appearance: none;
    background-image: none;
}

.table-filter-field select:hover,
.table-filter-field select:focus-visible {
    background-color: var(--ball-dot-yellow);
    color: var(--ink);
    outline: none;
}

.table-filter-field select option {
    color: #ffffff;
    background: var(--accent);
}

.table-filter-field select option:checked,
.table-filter-field select option:hover,
.table-filter-field select option:focus,
.table-filter-field select option:active {
    background: var(--ball-dot-yellow);
    color: var(--ink);
    outline: none;
}

.table-toggle-field {
    min-height: 35px;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-weight: 700;
    padding: 0.65rem 1rem;
}

.table-toggle-field:hover,
.table-toggle-field:focus-within {
    background-color: var(--ball-dot-yellow);
    color: var(--ink);
}

.table-toggle-field input {
    accent-color: var(--ball-dot-yellow);
}

.table-toggle-field span {
    text-transform: none;
    letter-spacing: normal;
}

.table-clear-filters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    padding: 0.65rem 1rem;
    background: transparent;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
}

.table-clear-filters:hover,
.table-clear-filters:focus-visible {
    background-color: var(--ball-dot-yellow);
    color: var(--ink);
    outline: none;
}

.sort-button {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
    line-height: 1.1;
    cursor: pointer;
}

.sort-button:hover,
.sort-button:focus-visible {
    color: var(--accent);
    outline: none;
}

.sort-heading {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: start;
    justify-items: start;
    column-gap: 0.24rem;
}

.sort-label {
    display: block;
    line-height: 1.1;
}

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

.numeric-sort {
    justify-content: flex-end;
}

.numeric-cell {
    text-align: right !important;
}

.sort-chevrons {
    position: relative;
    display: inline-block;
    width: 0.55rem;
    height: 0.85rem;
    flex: 0 0 auto;
    margin-top: 0.06rem;
}

.sort-chevrons::before,
.sort-chevrons::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.sort-chevrons::before {
    top: 0.02rem;
    border-bottom: 6px solid var(--accent-arrow);
}

.sort-chevrons::after {
    bottom: 0.02rem;
    border-top: 6px solid var(--accent-arrow);
}

.sort-button[data-direction="asc"] .sort-chevrons::before {
    border-bottom-color: var(--accent);
}

.sort-button[data-direction="asc"] .sort-chevrons::after {
    border-top-color: var(--accent-arrow-muted);
}

.sort-button[data-direction="desc"] .sort-chevrons::before {
    border-bottom-color: var(--accent-arrow-muted);
}

.sort-button[data-direction="desc"] .sort-chevrons::after {
    border-top-color: var(--accent);
}

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

.club-table tbody tr:nth-child(even) {
    background: var(--wood-grain-light);
}

.table-empty {
    padding: 1.6rem 1.1rem;
    background: linear-gradient(180deg, var(--panel-soft) 0%, var(--panel) 100%);
}

.table-empty h3,
.table-empty p {
    margin: 0;
}

.table-empty p {
    margin-top: 0.45rem;
}

.club-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

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

.table-location-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

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

@media (max-width: 800px) {
    .table-filter-bar {
        grid-template-columns: 1fr;
    }
}
