/* Tools & frameworks accordion: text tabs left, active tool visual right. */

.tools-section {
	background: var(--paper);
}

.tools-intro {
	max-width: 571px;
}

/* Desktop: header and accordion form the left column; each panel's visual
   escapes into an absolute right column spanning the full layout height. */
.tools-layout {
	position: relative;
}

@media (min-width: 1024px) {
	.tools-main {
		width: calc(50% - 15px);

		/* Keep the header text clear of the adjacent visual column. */
		> .section-label,
		> .section-headline,
		> .tools-intro {
			padding-right: 40px;
		}
	}
}

.tool-item {
	border-top: 3px solid var(--white);
	background: var(--white);

	&.is-open {
		border-top-color: var(--gold-mid);
	}

	& + .tool-item {
		margin-top: 2px;
	}
}

.tool-heading {
	margin: 0;
}

.tool-toggle {
	width: 100%;
	padding: 52px 48px;
	border: 0;
	background: none;
	color: var(--slate);
	font: 700 22px/1.6 var(--display);
	text-align: left;
	cursor: pointer;
	transition: color 0.3s ease;

	.tool-item.is-open & {
		padding-bottom: 16px;
		color: var(--navy-nav);
	}

	@media (max-width: 767.98px) {
		padding: 24px;

		.tool-item.is-open & {
			padding-bottom: 12px;
		}
	}
}

/* Collapse animates via grid rows so the layout height glides, never jumps. */
.tool-panel {
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows 0.3s ease, visibility 0s;
}

.tool-item:not(.is-open) .tool-panel {
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows 0.3s ease, visibility 0s 0.3s;
}

.tool-panel-body {
	min-height: 0;
	overflow: hidden;
}

.tool-desc {
	padding: 0 48px 52px;
	color: var(--slate);
	font-size: 15px;
	line-height: 1.6;

	@media (max-width: 767.98px) {
		padding: 0 24px 24px;
	}
}

.tool-visual {
	display: grid;
	place-items: stretch;
	background: var(--navy);

	img {
		width: 100%;
		height: 100%;
		object-fit: contain;
	}

	/* Single column: fixed-height window onto the top of the app. */
	@media (max-width: 1023.98px) {
		img {
			max-height: 420px;
			object-fit: cover;
			object-position: top;
		}
	}

	@media (min-width: 1024px) {
		position: absolute;
		inset: 0 0 0 auto;
		width: calc(50% + 13px);
		padding: 24px;
		opacity: 1;
		transition: opacity 0.3s ease;

		.tool-item:not(.is-open) & {
			opacity: 0;
		}
	}

	@media (max-width: 1023.98px) {
		margin-top: 2px;
		padding: 24px;
		min-height: 480px;
	}
}

/* Placeholder until the real tool thumbnails arrive. */
.tool-placeholder {
	display: grid;
	place-content: center;
	gap: 16px;
	height: 100%;
	border: 1px solid rgb(255 255 255 / 12%);
	text-align: center;
}

.tool-placeholder-acronym {
	margin: 0;
	color: var(--gold-mid);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.6;
	text-transform: uppercase;
}

.tool-placeholder-title {
	max-width: 10em;
	margin: 0 auto;
	color: var(--white);
	font: 500 clamp(2rem, 3vw, 2.75rem)/1.11 var(--display);
	text-wrap: balance;
}
/* Research panel below the accordion: navy band carrying the stat strip,
   attribution, panel line, pricing note and closing line from the brief. */
.tools-research {
	margin-top: 80px;
	padding: 64px 64px 56px;
	background: var(--navy-nav);

	@media (max-width: 767.98px) {
		margin-top: 48px;
		padding: 40px 24px 36px;
	}
}

.tools-stats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 24px 96px;

	.stat-label {
		max-width: 300px;
	}

	@media (max-width: 767.98px) {
		flex-direction: column;
	}
}

.tools-attribution {
	margin: 20px 0 0;
	color: rgb(255 255 255 / 65%);
	font-size: 12px;
	letter-spacing: 0.02em;
	text-align: center;

	@media (max-width: 767.98px) {
		text-align: left;
	}
}

.tools-panel-line {
	max-width: 640px;
	margin: 48px auto 0;
	padding-top: 48px;
	border-top: 1px solid rgb(255 255 255 / 12%);
	color: rgb(255 255 255 / 75%);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
	text-align: center;
	text-wrap: balance;

	@media (max-width: 767.98px) {
		margin-top: 36px;
		padding-top: 36px;
	}
}

.tools-pricing-note {
	margin: 20px 0 0;
	color: var(--gold-mid);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-align: center;
	text-transform: uppercase;
}

.tools-closing-line {
	margin: 40px 0 0;
	color: var(--white);
	font: italic 500 clamp(1.125rem, 2vw, 1.375rem)/1.5 var(--display);
	text-align: center;

	@media (max-width: 767.98px) {
		margin-top: 32px;
	}
}

.tools-section .section-headline em {
	color: var(--bronze);
}
