/* ==========================================================================
   Mobile-only fixes (loaded after style.css so it overrides safely).
   Kept as a plain CSS file because the SCSS/gulp build is not running.
   When the build is restored, fold these rules back into style.scss.
   ========================================================================== */

@media only screen and (max-width: 767px) {

    /* Category grid: force a clean 2-column layout instead of the
       content-width inline-block items that the framework collapses to.
       Flexbox keeps every cell the same width and top-aligned. */
    .browse-category .row.centre-row {
        display: flex;
        flex-wrap: wrap;
        font-size: 1rem; /* undo the centre-row font-size:0 trick */
    }

    .browse-category .row.centre-row .item.columns,
    .browse-category .row.centre-row .item.resize-me {
        width: 50% !important;       /* beats the framework's width:auto !important */
        float: none !important;
        height: auto !important;     /* drop the inline height matchHeight injects */
        margin: 0 0 2.2rem !important;
        padding: 0 12px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .browse-category .row.centre-row .item a {
        display: block;
        width: 100%;
        text-align: center;
    }

    .browse-category .row.centre-row .item .category-icon {
        margin-left: auto;
        margin-right: auto;
    }

    .browse-category .row.centre-row .item h3 {
        text-align: center;
    }

    /* Footer star: the inline width:100% makes it fill the whole screen
       once the grid column goes full width on mobile, so hide it on mobile. */
    .footer-top .one.column {
        display: none;
    }

    /* Events listing: the three filter buttons (View map / View calendar /
       Search events) had mismatched Bootstrap classes, so only one was
       full width. Force all of them to stack full width on mobile. */
    .card-listing .filter-container .btn {
        display: block;
        width: 100%;
        margin: 0 0 0.5rem !important; /* override the m-1 / col-md-2 sizing */
        text-align: center;
    }
}
