/* Custom overrides for The Association */

/* Prevent horizontal scrolling on all viewports */
html, body {
    overflow-x: hidden;
}

/* HTMX loading states */
.loading {
    color: var(--pico-muted-color);
    font-style: italic;
}

/* Season sections spacing */
section[id^="season-"] {
    margin-bottom: 2rem;
}

/* Prevent record column from wrapping */
td:nth-child(4) {
    white-space: nowrap;
}

/* Overflow wrapper for tables */
.overflow-auto {
    overflow-x: auto;
}

/* Mobile: hide Team column, shrink text */
@media (max-width: 500px) {
    .hide-mobile {
        display: none;
    }

    table {
        font-size: 0.85rem;
        width: auto;
        margin: 0 auto;
    }

    th, td {
        padding: 0.4rem 0.5rem;
    }

    /* Nav: stack title above links on mobile */
    nav {
        flex-direction: column;
        align-items: center;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 0.25rem;
        width: 100%;
        justify-content: center;
    }

    nav ul:first-child {
        margin-bottom: 0.25rem;
    }

    nav li {
        padding: 0;
    }

    /* Reduce container padding for narrow viewports */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Form grid: stack vertically on mobile */
    .grid {
        grid-template-columns: 1fr !important;
    }

    /* Prevent select overflow */
    select {
        max-width: 100%;
        min-width: 0;
    }

    /* Center page and section headers */
    h1, h2, p {
        text-align: center;
    }

    /* Spacing between table sections (skip first h2 after article header) */
    article section, article h2 {
        margin-top: 2.5rem;
    }

    article header + h2 {
        margin-top: 0;
    }
}
