/* The page is fluid: it fills the window minus a gutter, up to a maximum width.
   The grid fits as many columns as it can, each card at least 440px wide, so it
   goes 3 -> 2 -> 1 columns on its own instead of jumping between fixed widths. */

.page-middle-offseter {
    padding-top: 100px;
    width: min(1700px, calc(100vw - 64px));

    display: grid;
    justify-self: center;
}

.featured-projects {
    margin-top: 150px;

    display: flex;
    flex-direction: column;
}

.featured-text-holder {
    display: flex;
    justify-self: center;
}

.featured-project-grid {
    padding-bottom: 5%;
    display: grid;
    gap: 24px;
    /* auto-fill (not auto-fit) keeps a lone card, like Game Jams, the same width as the rest. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));

    width: 100%;
}

.project-category-title {
    grid-column: 1 / -1;

    margin: 30px 0px 0px 0px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--surface-raised);

    font-size: 26px;
}

.project-category-title:first-child {
    margin-top: 0px;
}

.project-card {
    width: 100%;
}

.project-card-link {
    width: 100%;
}

/* Tablets: a bit less space above the grid. */
@media (max-width: 1100px) {
    .page-middle-offseter {
        padding-top: 80px;
    }

    .featured-projects {
        margin-top: 60px;
    }
}

/* Tablets and small laptops: two narrower columns instead of one huge card. */
@media (min-width: 761px) and (max-width: 1100px) {
    .featured-project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phones: 16px gutter, smaller headings and tighter gaps. */
@media (max-width: 700px) {
    .page-middle-offseter {
        width: calc(100vw - 32px);
    }

    .featured-projects {
        margin-top: 30px;
    }

    .featured-project-grid {
        gap: 18px;
    }

    .project-category-title {
        font-size: 22px;
        margin-top: 18px;
    }

    .project-title {
        font-size: 21px;
    }

    .project-description {
        font-size: 15px;
    }
}
