/* History timeline */
#wellspring-our-history {
	position: relative;
	margin-block: 2rem;
}

/* Add the vertical line */
#wellspring-our-history::before {
	content: '';
	position: absolute;
	width: 5px;
	height: calc(100% - 12.5rem);
	left: 50%;
	transform: translateX(-50%);
	top: 4rem;
	background-color: gray;
	z-index: 0;
}

/* Each history entry on smaller screens */
.history-entry {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 1rem;
	text-align: center;
	position: relative;
}

/* Format the year */
.history-entry .year {
	font-size: 2rem;
	font-weight: bold;
	color: var(--global-palette9);
	width: 8rem;
	height: 8rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 5px solid var(--global-palette9);
}

/* Cycle through three colours */
.history-entry:nth-child(3n+1) .year { background: var(--global-palette1); }
.history-entry:nth-child(3n+2) .year { background: var(--global-palette5); }
.history-entry:nth-child(3n+3) .year { background: var(--global-palette2); }

/* Format the Title */
.history-entry .history-content-title {
	margin-block: 0;
	border-bottom: 4px solid;
	font-size: 2rem;
	line-height: 3rem;
	padding: 0.5rem 1rem 0;
	background: var(--global-palette9);
	width: 100%;
}

.history-entry:nth-child(3n+1) .history-content-title { color: var(--global-palette1); }
.history-entry:nth-child(3n+2) .history-content-title { color: var(--global-palette5); }
.history-entry:nth-child(3n+3) .history-content-title { color: var(--global-palette2); }

/* Image and content wrapper */
.history-entry .history-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

/* Featured image styling */
.history-entry figure.history-featured-image-wrapper {
	margin: 1rem;
	position: relative;
	aspect-ratio: 1 / 1;
    overflow: hidden;
    width: 100%;
    height: auto;
	max-width: 250px;
}

.history-entry .history-featured-image {
    margin: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Content area styling */
.history-entry .history-content {
	background: var(--global-palette9);
	padding: 0.5rem 1rem;
}

/* Desktop layout */
@media screen and (min-width: 768px) {
	.history-entry {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		grid-template-rows: auto auto;
		grid-column-gap: 0;
		grid-row-gap: 0;
		align-items: start;
		position: relative;
	}

	.history-entry .year {
		grid-area: 1 / 2 / 2 / 3;
		align-self: end;
		margin-bottom: -4rem;
		margin-right: -5px;
		margin-left: -5px;
	}

	.history-entry .history-content-title {
		grid-area: 1 / 1 / 2 / 2;
		background-color: transparent;
		text-align: right;
	}

	.history-entry .history-body {
		grid-area: 2 / 1 / 3 / 2;
		text-align: right;
		align-items: flex-end;
		background: transparent;
	}

	.history-entry:nth-child(even) .history-content-title {
		grid-area: 1 / 3 / 2 / 4;
		text-align: left;
	}

	.history-entry:nth-child(even) .history-body {
		grid-area: 2 / 3 / 3 / 4;
		text-align: left;
		align-items: flex-start;
	}
}