.tile-grid {
    margin-left: calc(-1 * var(--paperMargin));
    width: calc(100% + 2 * var(--paperMargin));
    display: flex;
    flex-wrap: wrap;
}

.nav-tile {
    height: calc(var(--paperWidth) / 3 * 0.8);
    position: relative;
}

.nav-tile div, .nav-tile a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.nav-tile .tile-overlay {
    background-color: var(--tilecolor);
    mix-blend-mode: multiply;
    opacity: 0.7;
}

.nav-tile .tile-title {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.nav-tile .tile-title h2 {
    color: white;
    filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
    font-size: 3rem;
    width: 90%;
    margin: auto;
    text-align: center;
}

.tile-grid .nav-tile {
    width: calc(100% / 3);
}

.tile-grid[data-tile-count="4"] .nav-tile[data-tile-number="4"] {
    width: 100%;
    height: calc(var(--paperWidth) / 4.5);
}

.tile-grid[data-tile-count="5"] .nav-tile[data-tile-number="4"], .tile-grid[data-tile-count="5"] .nav-tile[data-tile-number="5"] {
    width: 50%;
    height: calc(var(--paperWidth) / 3.5);
}

@media screen and (max-width: 1320px) {
    .nav-tile .tile-title h2 {
        font-size: 2.5rem;
    }
}

@media screen and (max-width: 1080px) {
    .tile-grid .nav-tile {
        width: calc(100% / 2);
    }
    
    .tile-grid[data-tile-count="3"] .nav-tile[data-tile-number="3"], .tile-grid[data-tile-count="5"] .nav-tile[data-tile-number="5"] {
        width: 100%;
        height: calc(var(--paperWidth) / 3);
    }
    .nav-tile {
        height: calc(var(--paperWidth) / 2 * 0.8) !important;
        position: relative;
    }
}

@media screen and (max-width: 680px) {
    .nav-tile {
        width: 100% !important;
        height: calc(var(--paperWidth) / 2) !important;
    }
}

@media screen and (max-width: 480px) {
    .nav-tile {
        height: calc(var(--paperWidth) * 0.8) !important;
    }
}