/*
 * Public site: the grids of a page and the two small cards that live in them — the section tile and
 * the principle. One block, a modifier per content: products by two, posts by three, tiles by four,
 * principles by three. On a phone every grid is one column, tiles are two.
 */

.app-grid {
    display: grid;
    gap: var(--space-4);
}

.app-grid--products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* One visible product: the card takes the whole column (pcard.css .app-pcard--single draws it large). */
.app-grid--products.app-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.app-grid--posts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-grid--tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-1);
}

.app-grid--principles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5) var(--space-6);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A tile of "What we make": a link to a direction; the pointer changes its border, not its shadow. */
.app-dir {
    display: flex;
    flex-direction: column;
    gap: var(--space-0);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color var(--transition);
}

.app-dir:hover {
    border-color: var(--border-3);
    text-decoration: none;
}

.app-dir__title {
    color: var(--text);
    font-size: var(--fs-site-read);
    font-weight: var(--fw-semibold);
    letter-spacing: -0.01em;
    line-height: var(--lh-tight);
}

.app-dir__text {
    color: var(--text-3);
    font-size: var(--fs-site-read);
    line-height: 1.5;
}

/*
 * The link of a card that stretches over the whole card (the card is its positioned parent): the title of a product card and of
 * a book card. The focus frame is drawn on the card, not on the title (in each card's own file).
 */
.app-cardlink {
    color: inherit;
}

.app-cardlink:hover {
    color: inherit;
    text-decoration: none;
}

.app-cardlink::after {
    content: "";
    position: absolute;
    inset: 0;
}

.app-cardlink:focus-visible {
    outline: 0;
}

.app-principle {
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-2);
}

.app-principle__title {
    margin: 0 0 var(--space-half);
    font-size: var(--fs-body);
    letter-spacing: -0.01em;
}

.app-principle__text {
    color: var(--text-2);
    font-size: var(--fs-site-read);
    line-height: var(--lh-text);
}

@container (max-width: 719px) {
    .app-grid--products,
    .app-grid--posts,
    .app-grid--principles {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-grid--tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-grid--posts {
        gap: var(--space-2);
    }

    .app-grid--principles {
        gap: var(--space-3);
    }
}
