/*
 * terms.css
 * Page-specific styles for new/terms.php (Figma node 168:6031, "Terms and Privacy").
 * Reuses the homepage .ft-* design system (homepage.css linked first) for the
 * shell, section padding, and CSS variables (--ft-blue, --ft-text, --ft-muted).
 * Everything here is prefixed .tp-* so it never collides with other pages.
 *
 * Figma tokens used:
 *   Text_Primary #333536 · Text_Secondary #737A82 · Blue_Main #2DA7FA
 *   BG/Background #F7F7F9
 *   Title/Title 24/30 Bold (page title) · Title/H2 16 SemiBold (section titles)
 *   Body/Lead 16/22 Medium (body copy) · Body/Body 14/18 Medium (TOC links)
 *
 * Layout (Figma desktop, 1920 design):
 *   TOC sidebar  x=360  w=264
 *   Doc column   x=672  w=888   (48px gap between the two columns)
 *   So the content band spans 360..1560 = 1200px, centered on the 1920 page.
 */

.tp-main {
	/* Page background per Figma BG/Background. The .ft-* vars are inherited. */
	background: #f7f7f9;
}

.tp-section {
	/* The content sits 128px below the nav in Figma; give it generous top/bottom
	 * breathing room (the .ft-section default is 80/80). */
	padding: 56px 0 96px;
}

/* Two-column band: TOC (264) + 48px gap + doc (888) = 1200px, centered. */
.tp-shell {
	display: grid;
	grid-template-columns: 264px minmax(0, 888px);
	column-gap: 48px;
	align-items: start;
	width: min(1200px, 100% - 80px);
}

/* ---- Table of Content (left, sticky on desktop) ---- */
.tp-toc {
	position: sticky;
	top: calc(var(--shop-header-height, 80px) + 24px);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.tp-toc__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--ft-text);
}

.tp-toc__rule {
	width: 100%;
	height: 0;
	margin: 0;
	border: 0;
	border-top: 2px solid #e4e4e4;
}

.tp-toc__list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.tp-toc__link {
	font-size: 14px;
	line-height: 18px;
	font-weight: 500;
	color: var(--ft-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.tp-toc__link:hover,
.tp-toc__link:focus-visible {
	color: var(--ft-blue);
}

.tp-toc__link.is-active {
	color: var(--ft-blue);
	font-weight: 600;
}

/* ---- Document column (right) ---- */
.tp-doc {
	min-width: 0;
}

.tp-doc__intro {
	display: grid;
	gap: 16px;
}

.tp-doc__title {
	margin: 0;
	font-size: 24px;
	line-height: 30px;
	font-weight: 700;
	color: var(--ft-text);
}

.tp-doc__lead {
	margin: 0;
	font-size: 16px;
	line-height: 22px;
	font-weight: 500;
	color: var(--ft-muted);
}

.tp-doc__rule {
	width: 100%;
	height: 0;
	margin: 24px 0;
	border: 0;
	border-top: 2px solid #e4e4e4;
}

/* ---- Section blocks ---- */
.tp-block {
	display: grid;
	gap: 8px;
	/* Anchor offset so a clicked TOC link doesn't hide the heading under the
	 * fixed header. */
	scroll-margin-top: calc(var(--shop-header-height, 80px) + 24px);
}

.tp-block + .tp-block {
	margin-top: 32px;
}

.tp-block__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--ft-text);
}

.tp-block__body {
	font-size: 16px;
	line-height: 30px;
	font-weight: 500;
	color: var(--ft-muted);
}

.tp-block__body p {
	margin: 0;
}

.tp-block__body p + p,
.tp-block__body p + ul,
.tp-block__body p + ol,
.tp-block__body ul + p,
.tp-block__body ol + p,
.tp-block__body ul + .tp-block__sub,
.tp-block__body ol + .tp-block__sub {
	margin-top: 6px;
}

/* Sub-heading line within a section (e.g. "Customer Relationship Management") */
.tp-block__sub {
	margin: 10px 0 0;
	font-weight: 500;
	color: var(--ft-muted);
}

.tp-block__spacer {
	line-height: 22px;
}

.tp-block__body a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tp-block__body a:hover,
.tp-block__body a:focus-visible {
	color: var(--ft-blue);
}

/* ---- Lists ---- */
.tp-list {
	margin: 0;
	padding-left: 24px;
}

.tp-list--ordered {
	list-style: decimal;
}

.tp-list li {
	margin: 0;
}

.tp-list li + li {
	margin-top: 6px;
}

.tp-list li strong {
	color: var(--ft-text);
	font-weight: 600;
}

/* ---- Responsive: mobile ----
 * Below 990 the TOC moves to the top, in normal flow, and the doc stacks under
 * it (the sticky sidebar only makes sense alongside the doc on desktop). */
@media (max-width: 990px) {
	.tp-section {
		padding: 40px 0 72px;
	}

	.tp-shell {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 32px;
	}

	.tp-toc {
		position: static;
		top: auto;
	}
}

@media (max-width: 680px) {
	.tp-section {
		padding: 32px 0 56px;
	}

	.tp-block__body {
		line-height: 28px;
	}
}

/* Narrow the gutter on small phones (convention: 100% - 32px at <=449). */
@media (max-width: 449px) {
	.tp-shell {
		width: min(1200px, 100% - 32px);
	}
}

/* ---- 4K / ultra-wide ----
 * Match homepage.css: scale the whole layout ~2.2x so it reads as the desktop
 * design zoomed in, and widen the band to line up with the ~2.2x-scaled shared
 * header/footer (body.ft-page overrides in homepage.css). The Figma band is
 * 1200px on a 1920 design → ~2400px here; columns 264/888/48 → 580/1956/106. */
@media (min-width: 3000px) {
	.tp-section {
		padding: 124px 0 210px;
	}

	.tp-shell {
		grid-template-columns: 580px minmax(0, 1956px);
		column-gap: 106px;
		width: min(2642px, 100% - 180px);
	}

	.tp-toc {
		top: calc(var(--shop-header-height, 210px) + 53px);
		gap: 35px;
	}

	.tp-toc__title {
		font-size: 35px;
	}

	.tp-toc__rule,
	.tp-doc__rule {
		border-top-width: 4px;
	}

	.tp-toc__list {
		gap: 35px;
	}

	.tp-toc__link {
		font-size: 31px;
		line-height: 40px;
	}

	.tp-doc__intro {
		gap: 35px;
	}

	.tp-doc__title {
		font-size: 52px;
		line-height: 64px;
	}

	.tp-doc__lead {
		font-size: 35px;
		line-height: 48px;
	}

	.tp-doc__rule {
		margin: 53px 0;
	}

	.tp-block {
		gap: 18px;
	}

	.tp-block + .tp-block {
		margin-top: 70px;
	}

	.tp-block__title {
		font-size: 35px;
	}

	.tp-block__body {
		font-size: 35px;
		line-height: 66px;
	}

	.tp-block__body p + p,
	.tp-block__body p + ul,
	.tp-block__body p + ol,
	.tp-block__body ul + p,
	.tp-block__body ol + p,
	.tp-block__body ul + .tp-block__sub,
	.tp-block__body ol + .tp-block__sub {
		margin-top: 13px;
	}

	.tp-list {
		padding-left: 53px;
	}

	.tp-list li + li {
		margin-top: 13px;
	}
}
