/*!
 * Aura Archives and Posts — Timeline. Posts staggered left and right of a centre line,
 * each pinned to it with an accent dot. Works with every card style.
 */

/* Fixed px on purpose: the dot (inside each card) and the gap (on the grid) must agree. */
.aura-ap--timeline {
	--aap-spine: 80px;
}

.aura-ap--timeline .aura-ap__items {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: start;
	column-gap: var(--aap-spine);
	row-gap: calc(var(--aap-gap) * 1.5);
}

.aura-ap--timeline .aura-ap__items::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	background: var(--aap-line);
	transform: translateX(-50%);
}

.aura-ap--timeline .aura-ap-card {
	--aap-title: 6.5;
	grid-column: 1;
	overflow: visible;
}

.aura-ap--timeline .aura-ap-card:nth-child(even) {
	grid-column: 2;
	margin-top: 120px; /* The stagger. */
}

/* The dot on the line, level with the card's top. */
.aura-ap--timeline .aura-ap-card::before {
	content: "";
	position: absolute;
	top: 28px;
	right: calc(var(--aap-spine) / -2 - 8px);
	z-index: 1;
	width: 16px;
	height: 16px;
	background: var(--aap-accent);
	border: 4px solid var(--aap-card-bg);
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--aap-line);
}

.aura-ap--timeline .aura-ap-card:nth-child(even)::before {
	right: auto;
	left: calc(var(--aap-spine) / -2 - 8px);
}

.aura-ap--timeline .aura-ap-card__media {
	aspect-ratio: var(--aap-ratio, 3 / 2);
	border-radius: var(--aap-radius) var(--aap-radius) 0 0;
}

.aura-ap--timeline .aura-ap-card__meta {
	color: var(--aap-accent);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

@container aura-ap (max-width: 700px) {
	.aura-ap--timeline {
		--aap-spine: 40px;
	}

	.aura-ap--timeline .aura-ap__items {
		grid-template-columns: minmax(0, 1fr);
		padding-left: var(--aap-spine);
	}

	.aura-ap--timeline .aura-ap__items::before {
		left: calc(var(--aap-spine) / 2);
	}

	.aura-ap--timeline .aura-ap-card,
	.aura-ap--timeline .aura-ap-card:nth-child(even) {
		grid-column: 1;
		margin-top: 0;
	}

	.aura-ap--timeline .aura-ap-card::before,
	.aura-ap--timeline .aura-ap-card:nth-child(even)::before {
		right: auto;
		left: calc(var(--aap-spine) / -2 - 8px);
	}
}
