/**
 * QH Tix responsive discovery guard — v0.1.16.
 *
 * Eventchamp applies responsive widths to the child columns and, in some
 * environments, retains a two-track grid/flex layout on the parent container.
 * This file controls both the parent layout and every direct card item.
 */

/* Search fields: one control per row on phones and tablets. */
@media (max-width: 1100px) {
    body.qhtix-theme .gt-event-search-tool .search-content > .gt-columns,
    body.qhtix-theme .qhtix-search-band .search-content > .gt-columns,
    body.qhtix-event-archive .qhtix-archive-filters {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        column-count: 1 !important;
        width: 100% !important;
    }

    body.qhtix-theme .gt-event-search-tool .search-content > .gt-columns > *,
    body.qhtix-theme .qhtix-search-band .search-content > .gt-columns > * {
        box-sizing: border-box !important;
        clear: both !important;
        float: none !important;
        flex: 0 0 100% !important;
        grid-column: 1 / -1 !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* Tablet: exactly two event cards per row. */
@media (min-width: 768px) and (max-width: 1100px) {
    body.qhtix-theme .gt-categorized-contents .gt-columns,
    body.qhtix-theme .qhtix-section--events .gt-columns {
        align-items: stretch !important;
        column-count: 1 !important;
        display: grid !important;
        gap: 24px !important;
        grid-auto-flow: row !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        height: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    body.qhtix-theme .gt-categorized-contents .gt-columns > *,
    body.qhtix-theme .qhtix-section--events .gt-columns > * {
        box-sizing: border-box !important;
        clear: none !important;
        float: none !important;
        flex: none !important;
        grid-column: auto !important;
        left: auto !important;
        margin: 0 !important;
        max-width: none !important;
        min-width: 0 !important;
        position: relative !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        width: auto !important;
    }

    body.qhtix-event-archive .qhtix-archive-grid,
    body.qhtix-event-archive .qhtix-related-grid,
    body.qhtix-event-page .qhtix-related-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Phone: exactly one event card per row. */
@media (max-width: 767px) {
    body.qhtix-theme .gt-categorized-contents .gt-columns,
    body.qhtix-theme .qhtix-section--events .gt-columns {
        align-items: stretch !important;
        column-count: 1 !important;
        columns: auto 1 !important;
        display: grid !important;
        gap: 22px !important;
        grid-auto-flow: row !important;
        grid-template-columns: minmax(0, 1fr) !important;
        height: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    body.qhtix-theme .gt-categorized-contents .gt-columns > *,
    body.qhtix-theme .qhtix-section--events .gt-columns > * {
        box-sizing: border-box !important;
        clear: both !important;
        float: none !important;
        flex: none !important;
        grid-column: 1 / -1 !important;
        left: auto !important;
        margin: 0 !important;
        max-width: 100% !important;
        min-width: 0 !important;
        position: relative !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
    }

    body.qhtix-theme .gt-categorized-contents .gt-columns > .gt-col > .gt-inner,
    body.qhtix-theme .gt-categorized-contents .gt-event-style-3,
    body.qhtix-theme .gt-categorized-contents .gt-event-style-4,
    body.qhtix-theme .qhtix-section--events .gt-event-style-3,
    body.qhtix-theme .qhtix-section--events .gt-event-style-4 {
        box-sizing: border-box !important;
        display: block !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    body.qhtix-event-archive .qhtix-archive-grid,
    body.qhtix-event-archive .qhtix-related-grid,
    body.qhtix-event-page .qhtix-related-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
    }

    body.qhtix-event-archive .qhtix-archive-card,
    body.qhtix-event-archive .qhtix-related-card,
    body.qhtix-event-page .qhtix-related-card {
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* JavaScript-applied device classes provide a fallback if optimisation or
 * browser behaviour prevents normal media-query evaluation. */
html.qhtix-phone-layout body.qhtix-theme .gt-categorized-contents .gt-columns,
html.qhtix-phone-layout body.qhtix-theme .qhtix-section--events .gt-columns {
    column-count: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
}
html.qhtix-phone-layout body.qhtix-theme .gt-categorized-contents .gt-columns > *,
html.qhtix-phone-layout body.qhtix-theme .qhtix-section--events .gt-columns > * {
    clear: both !important;
    float: none !important;
    grid-column: 1 / -1 !important;
    left: auto !important;
    max-width: 100% !important;
    position: relative !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
}
html.qhtix-tablet-layout body.qhtix-theme .gt-categorized-contents .gt-columns,
html.qhtix-tablet-layout body.qhtix-theme .qhtix-section--events .gt-columns {
    column-count: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    height: auto !important;
}
