/* ==========================================================================
   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;
    }
}

/* Main navigation: tighter gaps on desktop so the Map link fits on one row
   (the theme sets 17px; below 1100px it already uses tighter values). */
@media all and (min-width: 1101px) {
    #site-navigation ul li {
        margin-left: 4px;
    }
}

/* Homepage link to the map, under the search box */
.home-map-link {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.home-map-link a {
    text-decoration: underline;
}

/* "Open on Map" button on the organisation page: organisation pink */
#content .admin-edit.open-on-map a,
.admin-edit.open-on-map a {
    background: #cd1d7c;
}

#content .admin-edit.open-on-map a:hover,
#content .admin-edit.open-on-map a:focus,
.admin-edit.open-on-map a:hover,
.admin-edit.open-on-map a:focus {
    background: #a81765;
}
