/*
 * Autoriah Article Series: what the part box, the previous and next and the cards need to work.
 * Loaded whenever they are on a page, whether or not the site keeps the plain look
 * (article-series-look.css). Colours, borders and type are the look's, or the theme's.
 *
 * A theme can set, without asking the plugin: --article-series-gap (the space between cards),
 * --article-series-card-min (a card's narrowest, before the cards go one to a row) and
 * --article-series-picture-ratio (a card picture's shape).
 */

/* Its padding inside its width, so the box keeps to the column on a theme that doesn't say so for every element
   (Twenty Twenty-Five doesn't; Blocksy does). */
.article-series,
.article-series *,
.article-series-cards,
.article-series-cards * {
	box-sizing: border-box;
}

/* ---- the part box -------------------------------------------------------------------------- */
.article-series__parts {
	margin-block: 0;
}
.article-series__link {
	display: inline-block;
	padding-block: 0.25rem;
}
/* A finger needs a bigger target than a pointer: each part at least 44 pixels tall. */
@media (pointer: coarse) {
	.article-series__link {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		padding-block: 0;
	}
}

/* ---- the previous and next ----------------------------------------------------------------- */
.article-series__steps {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	margin: 0;
	padding: 0;
	list-style: none;
}
.article-series__step {
	flex: 1 1 14rem;
	min-width: 0;
	margin: 0;
}
.article-series__step--next {
	text-align: end;
}
/* The only next (the first part has no previous) still sits at the end of the line. */
.article-series__step--next:only-child {
	margin-inline-start: auto;
	flex-grow: 0;
}
.article-series__step-link {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 44px;
	overflow-wrap: anywhere;
}
.article-series__step-word,
.article-series__step-title {
	display: block;
}

/* ---- the cards ----------------------------------------------------------------------------- */
.article-series-cards__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--article-series-card-min, 15rem)), 1fr));
	gap: var(--article-series-gap, 1.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}
.article-series-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
}
/* The heading is first for a screen reader; the picture is drawn above it. */
.article-series-card__picture {
	order: -1;
	margin: 0;
}
.article-series-card__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--article-series-picture-ratio, 16 / 9);
	object-fit: cover;
}
.article-series-card__title {
	margin: 0;
	overflow-wrap: anywhere;
}
.article-series-card__part,
.article-series-card__name {
	display: block;
}
/* The whole card can be pressed: its one link reaches over it. It stays the only stop for Tab. */
.article-series-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
/* The keyboard's ring is drawn round the whole card, where the browser can say which card holds it. */
@supports selector(:has(*)) {
	.article-series-card__link:focus-visible {
		outline: none;
	}
	.article-series-card:has(.article-series-card__link:focus-visible) {
		outline: 2px solid currentColor;
		outline-offset: 4px;
	}
}
