/**
 * Sam4Tech — How We Work page styles.
 *
 * Loaded only on the How We Work template. Uses the design tokens and shared
 * marketing section primitives from style.css.
 *
 * CONTENTS
 *   1. Process timeline
 *   2. Principles
 *   3. FAQ accordion
 *   4. Responsive
 *   5. Motion preferences
 */

/* ==========================================================================
   1. Process timeline
   Numbered markers sit on a vertical rail, cards to their right.
   ========================================================================== */

.s4t-timeline {
	position: relative;
	list-style: none;
	max-width: 780px;
	margin-inline: auto;
	padding: 0 0 0 68px;
}

/* The rail. Stops short at both ends so it does not overrun the markers. */
.s4t-timeline::before {
	content: "";
	position: absolute;
	left: 21px;
	top: 22px;
	bottom: 22px;
	width: 2px;
	border-radius: 2px;
	background: var(--s4t-border-strong);
}

.s4t-timeline__item {
	position: relative;
	margin-block-end: var(--s4t-space-4);
}

.s4t-timeline__item:last-child {
	margin-block-end: 0;
}

.s4t-timeline__num {
	position: absolute;
	left: -68px;
	top: 18px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--s4t-cream);
	border: 2px solid var(--s4t-border-strong);
	color: var(--s4t-brand);
	font-family: var(--s4t-font-display);
	font-size: var(--s4t-text-xs);
	font-weight: 700;
	letter-spacing: 0.02em;
	transition: transform var(--s4t-duration) var(--s4t-ease),
		border-color var(--s4t-duration) var(--s4t-ease),
		background-color var(--s4t-duration) var(--s4t-ease),
		color var(--s4t-duration) var(--s4t-ease);
}

.s4t-timeline__card {
	background: var(--s4t-white);
	border: 1px solid var(--s4t-border);
	border-radius: var(--s4t-radius-md);
	padding: var(--s4t-space-5);
	box-shadow: var(--s4t-shadow-xs);
	transition: transform var(--s4t-duration) var(--s4t-ease),
		border-color var(--s4t-duration) var(--s4t-ease),
		box-shadow var(--s4t-duration) var(--s4t-ease);
}

.s4t-timeline__item:hover .s4t-timeline__card {
	transform: translateX(4px);
	border-color: var(--s4t-brand);
	box-shadow: var(--s4t-shadow-md);
}

.s4t-timeline__item:hover .s4t-timeline__num {
	transform: scale(1.06);
	background: var(--s4t-brand);
	border-color: var(--s4t-brand);
	color: var(--s4t-white);
}

.s4t-timeline__title {
	font-size: var(--s4t-text-xl);
	margin-block-end: var(--s4t-space-3);
}

.s4t-timeline__text {
	font-size: var(--s4t-text-sm);
	line-height: 1.75;
	margin: 0;
}

/* ==========================================================================
   2. Principles
   Icon on the left, title and text on the right, two per row.
   ========================================================================== */

.s4t-principles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s4t-space-4);
	max-width: 980px;
	margin-inline: auto;
}

.s4t-principle {
	display: flex;
	align-items: flex-start;
	gap: var(--s4t-space-4);
	background: var(--s4t-white);
	border: 1px solid var(--s4t-border);
	border-radius: var(--s4t-radius-lg);
	padding: var(--s4t-space-5);
	box-shadow: var(--s4t-shadow-xs);
	transition: transform var(--s4t-duration) var(--s4t-ease),
		border-color var(--s4t-duration) var(--s4t-ease),
		box-shadow var(--s4t-duration) var(--s4t-ease);
}

.s4t-principle:hover {
	transform: translateY(-4px);
	border-color: var(--s4t-brand);
	box-shadow: var(--s4t-shadow-lg);
}

.s4t-principle__icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	flex: none;
	border-radius: 12px;
	background: var(--s4t-brand-soft);
	color: var(--s4t-brand);
	transition: transform var(--s4t-duration) var(--s4t-ease);
}

.s4t-principle:hover .s4t-principle__icon {
	transform: translateY(-2px) rotate(-4deg);
}

.s4t-principle__body {
	min-width: 0;
}

.s4t-principle__title {
	font-size: var(--s4t-text-base);
	font-weight: 700;
	margin-block-end: var(--s4t-space-2);
}

.s4t-principle__text {
	font-size: var(--s4t-text-sm);
	line-height: 1.7;
	margin: 0;
}

/* ==========================================================================
   3. FAQ accordion
   ========================================================================== */

.s4t-faq {
	display: flex;
	flex-direction: column;
	gap: var(--s4t-space-3);
	max-width: 820px;
	margin-inline: auto;
}

.s4t-faq__item {
	background: var(--s4t-white);
	border: 1px solid var(--s4t-border);
	border-radius: var(--s4t-radius-md);
	box-shadow: var(--s4t-shadow-xs);
	transition: border-color var(--s4t-duration) var(--s4t-ease),
		box-shadow var(--s4t-duration) var(--s4t-ease);
}

.s4t-faq__item:hover,
.s4t-faq__item:focus-within {
	border-color: var(--s4t-border-strong);
	box-shadow: var(--s4t-shadow-sm);
}

/* Open item is picked out with the accent border. */
.s4t-faq__item.is-open {
	border-color: var(--s4t-brand);
	box-shadow: var(--s4t-shadow-md);
}

.s4t-faq__heading {
	margin: 0;
	font-size: inherit;
}

.s4t-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s4t-space-4);
	width: 100%;
	background: none;
	border: 0;
	border-radius: var(--s4t-radius-md);
	padding: var(--s4t-space-4) var(--s4t-space-5);
	text-align: left;
	font-family: var(--s4t-font-display);
	font-size: var(--s4t-text-base);
	font-weight: 700;
	line-height: 1.4;
	color: var(--s4t-ink);
	transition: color var(--s4t-duration) var(--s4t-ease);
}

.s4t-faq__question:hover {
	color: var(--s4t-brand);
}

/* The mark is a close icon rotated 45deg when collapsed, so it reads as a
   plus, and rotates back to a cross when the answer opens. */
.s4t-faq__mark {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	flex: none;
	border-radius: 50%;
	color: var(--s4t-brand);
	transform: rotate(45deg);
	transition: transform var(--s4t-duration) var(--s4t-ease),
		background-color var(--s4t-duration) var(--s4t-ease);
}

.s4t-faq__question[aria-expanded="true"] .s4t-faq__mark {
	transform: rotate(0deg);
	background: var(--s4t-brand-soft);
}

.s4t-faq__answer {
	padding: 0 var(--s4t-space-5) var(--s4t-space-5);
}

.s4t-faq__answer p {
	margin: 0;
	font-size: var(--s4t-text-sm);
	line-height: 1.8;
}

/* Collapsed state, applied once the script takes over. */
.s4t-faq[data-s4t-faq="ready"] .s4t-faq__answer {
	max-height: 0;
	padding-block-end: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height var(--s4t-duration-slow) var(--s4t-ease),
		opacity var(--s4t-duration) var(--s4t-ease),
		padding var(--s4t-duration) var(--s4t-ease);
}

.s4t-faq[data-s4t-faq="ready"] .s4t-faq__item.is-open .s4t-faq__answer {
	max-height: 40rem;
	padding-block-end: var(--s4t-space-5);
	opacity: 1;
}

/* ==========================================================================
   4. Responsive
   ========================================================================== */

@media (max-width: 820px) {
	.s4t-principles {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 600px) {
	.s4t-timeline {
		padding-left: 52px;
	}

	.s4t-timeline::before {
		left: 17px;
	}

	.s4t-timeline__num {
		left: -52px;
		width: 36px;
		height: 36px;
		top: 16px;
	}

	.s4t-faq__question {
		padding-inline: var(--s4t-space-4);
		font-size: var(--s4t-text-sm);
	}

	.s4t-faq__answer,
	.s4t-faq[data-s4t-faq="ready"] .s4t-faq__item.is-open .s4t-faq__answer {
		padding-inline: var(--s4t-space-4);
	}
}

/* ==========================================================================
   5. Motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.s4t-faq[data-s4t-faq="ready"] .s4t-faq__answer {
		transition: none;
	}
}
