/* static/css/core/components/tiles.css
   The home page's Tiles section, moved out of includes/tiles.html
   unchanged. core/index.html links it while the section is switched on. */

body {
    background: var(--ink);
}
.tiles {
    display: grid;
    /* Six to a line, closed or open, so no line ever ends empty and nothing
       changes size when the bar opens. */
    grid-template-columns: repeat(6, minmax(0, 220px));
    justify-content: center;
    gap: 8px;
    /* Steps out of the 1400px page frame, the way the top section does,
       and stops at 1920px on a bigger screen. */
    box-sizing: border-box;
    width: min(1920px, 100vw);
    margin: 16px 0 16px calc(50% - min(960px, 50vw));
    padding: 0 16px;
}
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 2;
    overflow: hidden;
    border: 2px solid var(--ink);
    background: var(--bg-footer);
    color: var(--bg-primary);
    text-align: center;
    text-decoration: none;
}
.tile--news {
    background: var(--bg-primary);
    color: var(--ink);
}
.tile__img {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}
span.tile__img {
    font-size: 3rem;
}
.tile__words {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
}
.tile__name {
    margin: 0;
    font-family: Roboto, Arial, sans-serif;
    font-size: 1rem;
    font-weight: normal;
    line-height: 1.2;
}
.tile__desc {
    margin: 4px 0 0;
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.tile__news {
    margin: 8px 0 0;
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.3;
}
.tile--rest {
    display: none;
}
.tiles--open .tile--rest {
    display: flex;
}
.tiles__more {
    grid-column: 1 / -1;
    padding: 14px 8px;
    border: 2px solid var(--ink);
    background: var(--bg-footer);
    color: var(--bg-primary);
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    cursor: pointer;
}
.tiles--open .tiles__more {
    background: var(--bg-primary);
    color: var(--ink);
}
/* Three to a line on a tablet, two on a phone. */
@media (max-width: 899px) {
    .tiles {
        grid-template-columns: repeat(3, minmax(0, 220px));
    }
}
@media (max-width: 480px) {
    .tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        padding: 0 2px;
    }
    .tile__words { padding: 8px 4px; }
}
