/* ==================================================
	PILLARS SECTION - Mobile First
	Loaded only on pages with the checkbox enabled.
================================================== */

.pillars-section {
	background: var(--white);
	border-bottom: 0.0625rem solid var(--border);
}

.pillars-grid {
	display: grid;
	grid-template-columns: 1fr;
	list-style: none;
	margin: 0;
	padding: 0;
}

.pillar {
	position: relative;
	overflow: hidden;
	padding: 2.5rem 1.5rem;
	text-align: center;
	border-bottom: 0.0625rem solid var(--border);
	transition: background 0.35s ease;
}

.pillar:last-child {
	border-bottom: 0;
}

.pillar-num {
	position: absolute;
	top: 0.75rem;
	right: 1rem;
	font-family: var(--serif);
	font-size: 4rem;
	font-weight: 300;
	line-height: 1;
	color: rgba(184, 151, 106, 0.12);
	user-select: none;
	pointer-events: none;
	transition: opacity 0.95s ease;
}

.pillar-line {
	display: block;
	width: 1.75rem;
	height: 0.0625rem;
	background: var(--gold);
	margin: 0 auto 1rem;
}

.pillar-title {
	position: relative;
	z-index: 1;
	font-family: var(--serif);
	font-size: clamp(1.125rem, 4.5vw, 1.5rem);
	font-weight: 400;
	line-height: 1.2;
	color: var(--black);
}

.pillar-toggle {
	width: 100%;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: center;
}

.pillar-toggle:focus-visible {
	outline: 0.125rem solid var(--accent);
	outline-offset: 0.375rem;
}

/* Mobile: simple accordion, opened by tap */
.pillar-text {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	margin-top: 0;
	transform: translateY(1rem);
	transition: max-height 0.9s ease, opacity 0.85s ease, transform 0.9s ease, margin-top 0.9s ease;
}

.pillar-text p {
	font-family: var(--sans);
	font-size: 0.875rem;
	font-weight: 300;
	line-height: 1.7;
	color: var(--mid);
	white-space: pre-line;
}

.pillar.is-open .pillar-text {
	max-height: 25rem;
	margin-top: 1rem;
	opacity: 1;
	transform: translateY(0);
}

.pillar.is-open {
	background: #F7F3EF;
}

/* ==================================================
	TABLET (min-width: 641px)
================================================== */

@media (min-width: 641px) {

	.pillar {
		padding: 3rem 2rem;
	}

	.pillar-num {
		font-size: 5rem;
	}

}

/* ==================================================
	DESKTOP (min-width: 901px)
================================================== */

@media (min-width: 901px) {

	.pillars-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.pillar {
		padding: 0;
		border-bottom: 0;
		border-right: 0.0625rem solid var(--border);
		min-height: 12rem;
	}

	.pillar:last-child {
		border-right: 0;
	}

	.pillar-inner {
		position: relative;
		height: 100%;
		min-height: 12rem;
		display: flex;
		align-items: center;
		justify-content: center;
    flex-direction: column;
		padding: 3rem;
	}

	.pillar-num {
		top: 1rem;
		right: 1.25rem;
		font-size: 6rem;
	}

	.pillar-line {
		margin-bottom: 1.25rem;
	}

}

/* ==================================================
	DESKTOP HOVER - panel slides up from the bottom,
	covering the tile. Pointer devices only.
================================================== */

@media (min-width: 901px) and (hover: hover) and (pointer: fine) {

	.pillar-text {
		position: absolute;
		inset: 0;
		z-index: 2;
		max-height: none;
		margin-top: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 2.5rem 2rem;
		background: #F7F3EF;
		transform: translateY(100%);
		opacity: 1;
		transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.pillar:hover .pillar-text,
	.pillar:focus-within .pillar-text {
		transform: translateY(0);
	}

	.pillar:hover .pillar-num,
	.pillar:focus-within .pillar-num {
		opacity: 0;
	}

	/* Tap-open state is redundant here - hover covers it */
	.pillar.is-open .pillar-text {
		transform: translateY(0);
	}

}

@media (prefers-reduced-motion: reduce) {

	.pillar,
	.pillar-num,
	.pillar-text {
		transition: none !important;
	}

	.pillar-text {
		transform: none !important;
	}

}