/* ══════════════════════════════════════════════════════════════════════════
   Home columns: the sections of home.section beside the narrower column of
   home.aside. public/index.html only renders this markup when some feature
   contributes to home.aside, so a home without an aside never matches these
   rules. Loaded via the asset registry (register_asset in init_feature).

   A skin or product changes the split with --home-columns, for example
   `.home-columns { --home-columns: minmax(0, 1fr) 20rem; }`.
   ══════════════════════════════════════════════════════════════════════════ */

.home-columns {
    display: grid;
    grid-template-columns: var(--home-columns, minmax(0, 2fr) minmax(0, 1fr));
    gap: 2rem;
    align-items: start;
}

/* With nothing in home.section the aside is the only content, so it takes
   the whole width instead of leaving an empty column beside it. */
.home-columns--aside-only {
    grid-template-columns: minmax(0, 1fr);
}

/* A contributed section brings its own .container, written for the full
   width of the page. Inside a column the column already is the container,
   so a section that is itself the container must not indent its content a
   second time. A container inside a section keeps its padding, since it
   holds the content off the edges of the section's own background. */
.home-columns .container {
    max-width: none;
}

.home-columns__main > .container,
.home-columns__aside > .container {
    padding-inline: 0;
}

/* Lines the aside up with the first section, which carries the shell's
   .section padding, and spaces whatever several features contribute. */
.home-columns__aside {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-block: 3.5rem;
}

/* Too narrow for a column beside the sections: the aside goes under them. */
@media (max-width: 960px) {
    .home-columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    /* The last section already ends with its own padding. */
    .home-columns__main + .home-columns__aside {
        padding-block-start: 0;
    }
}
