/**
 * @file
 * Looks component.
 *
 * The view block's looks (block style variations): a copy with the class
 * is-style-<name> on its wrapper takes that look; a copy without one keeps
 * the default look of the other stylesheets. Each look reads the design
 * tokens, falling back to a theme.json custom value, then to its default.
 * The calendar, the filter form, the pager and the areas follow the tokens
 * only, not the looks. This stylesheet prints after view.css, so a look's
 * rule wins over a default rule of the same weight.
 *
 * Contents:
 * 1. Cards
 * 2. Minimal
 * 3. Bordered
 * 4. Striped
 */

/* 1. Cards
   ========================================================================== */

/*
 * A look reaches only its own copy's items, so a view embedded in an area or
 * an attachment display inside the copy keeps its own look. The items sit
 * either straight in the wrapper or, in a copy the filter script updates, in
 * its results region, so each rule names both paths with child combinators.
 * Every part after the look's class is wrapped in :where(), on its own, so
 * a rule weighs no more than the look's two classes and a theme overrides it
 * easily; one :where() around the whole path would match nothing.
 */
.viewspress-view.is-style-cards > :where(.viewspress-list),
.viewspress-view.is-style-cards > :where(.viewspress-view__results) > :where(.viewspress-list) {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--viewspress-gap, var(--wp--custom--viewspress--gap, 1.5em));
}

.viewspress-view.is-style-cards > :where(.viewspress-view__items) > :where(.viewspress-view__item),
.viewspress-view.is-style-cards > :where(.viewspress-view__results) > :where(.viewspress-view__items) > :where(.viewspress-view__item) {
	padding: var(--viewspress-card-padding, var(--wp--custom--viewspress--card-padding, 1em));
	border: var(--viewspress-border-width, var(--wp--custom--viewspress--border-width, 1px)) solid var(--viewspress-border-color, var(--wp--custom--viewspress--border-color, color-mix(in srgb, currentcolor 15%, transparent)));
	border-radius: var(--viewspress-radius, var(--wp--custom--viewspress--radius, 0.5em));
	background: var(--viewspress-surface, var(--wp--custom--viewspress--surface, transparent));
}

/* End of 1. Cards */

/* 2. Minimal
   ========================================================================== */

/* Grid items have no divider and no padding already. */
.viewspress-view.is-style-minimal > :where(.viewspress-list) > :where(.viewspress-view__item),
.viewspress-view.is-style-minimal > :where(.viewspress-view__results) > :where(.viewspress-list) > :where(.viewspress-view__item) {
	padding-block: calc(var(--viewspress-row-spacing, var(--wp--custom--viewspress--row-spacing, 0.5em)) / 2);
	border: 0;
}

.viewspress-view.is-style-minimal > :where(.viewspress-table__scroll) > :where(.viewspress-table) > :where(thead, tbody) > :where(tr) > :where(.viewspress-table__heading, .viewspress-table__cell),
.viewspress-view.is-style-minimal > :where(.viewspress-view__results) > :where(.viewspress-table__scroll) > :where(.viewspress-table) > :where(thead, tbody) > :where(tr) > :where(.viewspress-table__heading, .viewspress-table__cell) {
	padding-block: calc(var(--viewspress-row-spacing, var(--wp--custom--viewspress--row-spacing, 0.5em)) / 2);
	border: 0;
}

/* End of 2. Minimal */

/* 3. Bordered
   ========================================================================== */

/* One frame around the items; a list keeps its dividers between them, a
   grid its gap. */
.viewspress-view.is-style-bordered > :where(.viewspress-view__items),
.viewspress-view.is-style-bordered > :where(.viewspress-view__results) > :where(.viewspress-view__items) {
	border: var(--viewspress-border-width, var(--wp--custom--viewspress--border-width, 1px)) solid var(--viewspress-border-color, var(--wp--custom--viewspress--border-color, color-mix(in srgb, currentcolor 15%, transparent)));
	border-radius: var(--viewspress-radius, var(--wp--custom--viewspress--radius, 0));
}

.viewspress-view.is-style-bordered > :where(.viewspress-list) > :where(.viewspress-view__item),
.viewspress-view.is-style-bordered > :where(.viewspress-view__results) > :where(.viewspress-list) > :where(.viewspress-view__item) {
	padding-inline: var(--viewspress-card-padding, var(--wp--custom--viewspress--card-padding, 1em));
}

.viewspress-view.is-style-bordered > :where(.viewspress-grid),
.viewspress-view.is-style-bordered > :where(.viewspress-view__results) > :where(.viewspress-grid) {
	padding: var(--viewspress-card-padding, var(--wp--custom--viewspress--card-padding, 1em));
}

/* A line on every side of every cell. */
.viewspress-view.is-style-bordered > :where(.viewspress-table__scroll) > :where(.viewspress-table) > :where(thead, tbody) > :where(tr) > :where(.viewspress-table__heading, .viewspress-table__cell),
.viewspress-view.is-style-bordered > :where(.viewspress-view__results) > :where(.viewspress-table__scroll) > :where(.viewspress-table) > :where(thead, tbody) > :where(tr) > :where(.viewspress-table__heading, .viewspress-table__cell) {
	border: var(--viewspress-border-width, var(--wp--custom--viewspress--border-width, 1px)) solid var(--viewspress-border-color, var(--wp--custom--viewspress--border-color, color-mix(in srgb, currentcolor 15%, transparent)));
}

/* The headings keep their stronger line below. */
.viewspress-view.is-style-bordered > :where(.viewspress-table__scroll) > :where(.viewspress-table) > :where(thead) > :where(tr) > :where(.viewspress-table__heading),
.viewspress-view.is-style-bordered > :where(.viewspress-view__results) > :where(.viewspress-table__scroll) > :where(.viewspress-table) > :where(thead) > :where(tr) > :where(.viewspress-table__heading) {
	border-block-end-color: var(--viewspress-border-color, var(--wp--custom--viewspress--border-color, currentcolor));
}

/* End of 3. Bordered */

/* 4. Striped
   ========================================================================== */

/* Lists and tables only: a grid keeps the default look. The stripes take
   the dividers' place, and a little inline padding keeps text off their
   edges. */
.viewspress-view.is-style-striped > :where(.viewspress-list) > :where(.viewspress-view__item),
.viewspress-view.is-style-striped > :where(.viewspress-view__results) > :where(.viewspress-list) > :where(.viewspress-view__item) {
	padding-inline: 0.5em;
	border: 0;
}

.viewspress-view.is-style-striped > :where(.viewspress-list) > :where(.viewspress-view__item:nth-child(even)),
.viewspress-view.is-style-striped > :where(.viewspress-view__results) > :where(.viewspress-list) > :where(.viewspress-view__item:nth-child(even)),
.viewspress-view.is-style-striped > :where(.viewspress-table__scroll) > :where(.viewspress-table) > :where(tbody) > :where(.viewspress-table__row:nth-child(even)),
.viewspress-view.is-style-striped > :where(.viewspress-view__results) > :where(.viewspress-table__scroll) > :where(.viewspress-table) > :where(tbody) > :where(.viewspress-table__row:nth-child(even)) {
	background: var(--viewspress-stripe, var(--wp--custom--viewspress--stripe, color-mix(in srgb, currentcolor 6%, transparent)));
}

/* End of 4. Striped */
