/* =========================================================
   PREVENT ORIGINAL CATEGORY LAYOUT FLASH
   ========================================================= */

/* Hide the original School Life category list immediately */
#mainbody a[href] > .cat-item {
    display: none;
}

/* Hide the heading/container briefly while the new grid builds */
html:not(.hm-category-grid-ready) #mainbody {
    visibility: hidden;
}

/* Show the page when the grid is ready */
html.hm-category-grid-ready #mainbody {
    visibility: visible;
}
/* =========================================================
   UNIVERSAL LARGE TABLE SCROLLER
   ========================================================= */

.hm-table-scroll-wrap {
    width: 100%;
    max-width: 100%;
    margin: 24px 0 32px;
}

.hm-table-scroll {
    width: 100%;
    max-width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: auto;
    scrollbar-color: #0b5d87 #dce7ed;
}

.hm-table-scroll > table {
    width: 100%;
    min-width: var(--hm-table-min-width, 1000px);
}


/* Visible scrollbar where the browser supports it */
.hm-table-scroll::-webkit-scrollbar {
    height: 18px;
}

.hm-table-scroll::-webkit-scrollbar-track {
    background: #dce7ed;
    border-radius: 20px;
}

.hm-table-scroll::-webkit-scrollbar-thumb {
    background: #0b5d87;

    border: 3px solid #dce7ed;
    border-radius: 20px;
}

.hm-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #074565;
}


/* =========================================================
   SCROLL CONTROLS
   ========================================================= */

.hm-table-scroll-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;

    margin: 0 0 10px;
    padding: 8px;

    background: #edf6fa;

    border: 1px solid #d4e3ea;
    border-radius: 8px;

    box-sizing: border-box;
}

.hm-table-scroll-controls-bottom {
    margin:
        10px
        0
        0;
}

.hm-table-scroll-message {
    flex: 1;

    color: #0b5d87;

    font-family:
        "DM Sans",
        Arial,
        sans-serif;

    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.hm-table-scroll-message i {
    margin-right: 7px;
}


/* Buttons */
.hm-table-scroll-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    flex: 0 0 auto;

    min-width: 110px;
    min-height: 42px;

    padding: 9px 14px;

    background: #0b5d87;

    border: 0;
    border-radius: 7px;

    color: #ffffff;

    font-family:
        "DM Sans",
        Arial,
        sans-serif;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.hm-table-scroll-button:hover,
.hm-table-scroll-button:focus {
    background: #074565;
    color: #ffffff;

    outline:
        3px solid
        rgba(11, 93, 135, 0.2);

    outline-offset: 2px;
}

.hm-table-scroll-button:disabled {
    background: #9aabb4;
    opacity: 0.5;

    cursor: default;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .hm-table-scroll-controls {
        gap: 5px;
        padding: 6px;
    }

    .hm-table-scroll-button {
        min-width: 44px;
        width: 44px;

        padding: 7px;
    }

    .hm-table-scroll-button span {
        display: none;
    }

    .hm-table-scroll-message {
        font-size: 12px;
    }
}
/* =========================================================
   CATEGORY CHECKERBOARD GRID
   ========================================================= */

.hm-category-grid-ready #mainbody {
    max-width: 1280px;
}

/* Category page title */
.hm-category-grid-ready #mainbody > .row > [class*="col-"] > .row:first-of-type {
    margin: 0 0 34px;
}

.hm-category-grid-ready #mainbody h2 {
    display: block;
    width: 100%;
    margin: 0;
    padding: 24px 28px;
margin-bottom: 40px;
    background: #0b5d87;
    color: #fff;

    font-family: "DM Sans", sans-serif;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.1;
    font-weight: 700;
}


/* Main grid */
.hm-category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;

    margin: 0 0 60px;
}


/* Every square */
.hm-category-tile {
    position: relative;
    display: flex;

    min-width: 0;
    aspect-ratio: 1 / 1;

    overflow: hidden;
}


/* =========================================================
   TEXT TILE COLOURS
   ========================================================= */

.hm-category-title-tile {
    align-items: center;
    justify-content: center;

    padding: 24px;

    color: #fff !important;
    text-align: center;
    text-decoration: none !important;

    transition:
        transform 180ms ease,
        filter 180ms ease,
        box-shadow 180ms ease;
}


/* Colour 1 */
.hm-category-colour-1 {
    background: #0B5D87;
}


/* Colour 2 */
.hm-category-colour-2 {
    background: #B2B2B2;
}


/* Colour 3 */
.hm-category-colour-3 {
    background: #062F47;
}


/* Colour 4 */
.hm-category-colour-4 {
    background: #337AB9;
}


.hm-category-title-tile:hover,
.hm-category-title-tile:focus {
    color: #fff !important;
    text-decoration: none !important;

    transform: translateY(-3px);

    filter: brightness(0.9);

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.16);
}


.hm-category-title-tile:hover,
.hm-category-title-tile:focus {
    color: #fff !important;
    text-decoration: none !important;

    transform: translateY(-3px);

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.16);
}


.hm-category-title-tile:hover {
    background: #094d70;
}


.hm-category-title-tile.hm-category-alt:hover {
    background: #668f3c;
}


.hm-category-title {
    position: relative;

    font-family: "DM Sans", sans-serif;
    font-size: clamp(18px, 1.75vw, 28px);
    line-height: 1.22;
    font-weight: 700;

    color: inherit;
}


/* Decorative underline similar to example */
.hm-category-title::after {
    content: "";

    display: block;

    width: 42px;
    height: 3px;

    margin: 13px auto 0;

    background: currentColor;
}


/* =========================================================
   IMAGE TILES
   ========================================================= */

.hm-category-image-tile {
    background: #eee;
}


.hm-category-image-tile img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 500ms ease;
}


.hm-category-image-tile:hover img {
    transform: scale(1.045);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .hm-category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

}


/* =========================================================
   SMALL TABLET
   ========================================================= */

@media (max-width: 800px) {

    .hm-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .hm-category-title-tile {
        padding: 18px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 560px) {

    .hm-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;

        margin-bottom: 40px;
    }

    .hm-category-title-tile {
        padding: 16px;
    }

    .hm-category-title {
        font-size: 17px;
    }

    .hm-category-title::after {
        width: 30px;
        height: 2px;
        margin-top: 9px;
    }

    .hm-category-grid-ready #mainbody h2 {
        padding: 18px 20px;
        font-size: 30px;
    }

}