/*!
 * Terms & Conditions — page-terms-template.css
 *
 * Enqueued automatically by inc/assets.php (filename must match the
 * template basename). Loads after gravityprojex-theme.
 *
 * PROPRIETARY SOFTWARE LICENSE — GRAVITY PROJEX
 * Copyright (c) 2026 Gravity Projex. All Rights Reserved.
 * Unauthorised copying, modification, distribution, or sale prohibited.
 * Contact: admin@gravityprojex.com | https://gravityprojex.com
 *
 * @package Gravity_Projex
 * @since   4.6.0
 */

.gp-terms {
	--gp-terms-accent: #8b5cf6;
	--gp-terms-accent-2: #22d3ee;
	--gp-terms-text: #94a3b8;
	--gp-terms-strong: #e2e8f0;
	--gp-terms-rule: rgb(255 255 255 / 8%);
	/* Fixed header height — anchors must clear it. */
	--gp-terms-offset: 6.5rem;
}

/* ------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------ */

.gp-terms-layout {
	display: grid;
	gap: 3rem;
}

@media (min-width: 1024px) {
	.gp-terms-layout {
		grid-template-columns: 17rem minmax(0, 1fr);
		gap: 4rem;
		align-items: start;
	}
}

/* Spacing declared here rather than via utilities: the global stylesheet
   zeroes list and paragraph margins, which flattened the utility-based
   rhythm this box relied on. */

.gp-terms-summary {
	container-type: inline-size;
}

.gp-terms .gp-terms-summary-title {
	margin: 0 0 1.25rem;
	font-size: 1.125rem;
	font-weight: 600;
	color: #fff;
	line-height: 1.4;
}

.gp-terms .gp-terms-summary-list {
	display: grid;
	gap: 1rem 2.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.gp-terms .gp-terms-summary-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.gp-terms .gp-terms-summary-list li {
	position: relative;
	margin: 0;
	padding-left: 1.35rem;
	list-style: none;
	font-size: 0.875rem;
	line-height: 1.65;
	color: #cbd5e1;
}

.gp-terms .gp-terms-summary-list li::marker {
	content: "";
}

.gp-terms .gp-terms-summary-note {
	margin: 1.75rem 0 0;
	padding-top: 1.25rem;
	border-top: 1px solid var(--gp-terms-rule);
	font-size: 0.75rem;
	line-height: 1.6;
	color: #64748b;
}

.gp-terms-summary-list li::before {
	content: "";
	position: absolute;
	inset-block-start: 0.55rem;
	inset-inline-start: 0;
	inline-size: 0.4rem;
	block-size: 0.4rem;
	pointer-events: none;
	border-radius: 9999px;
	background-image: linear-gradient(135deg, var(--gp-terms-accent), var(--gp-terms-accent-2));
}

/* ------------------------------------------------------------------
   Clause navigator
   ------------------------------------------------------------------ */

.gp-terms-nav-wrap {
	position: relative;
}

@media (min-width: 1024px) {
	.gp-terms-nav {
		position: sticky;
		top: var(--gp-terms-offset);
		max-block-size: calc(100vh - var(--gp-terms-offset) - 2rem);
		overflow-y: auto;
		overscroll-behavior: contain;
		padding-inline-end: 0.5rem;
		scrollbar-width: thin;
		scrollbar-color: rgb(255 255 255 / 15%) transparent;
	}
}

.gp-terms-nav-title {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gp-terms-accent-2);
	margin-block-end: 1rem;
}

.gp-terms-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-inline-start: 1px solid var(--gp-terms-rule);
}

.gp-terms-nav-list a {
	display: flex;
	gap: 0.65rem;
	padding: 0.45rem 0 0.45rem 1rem;
	margin-inline-start: -1px;
	border-inline-start: 2px solid transparent;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: #64748b;
	text-decoration: none;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.gp-terms-nav-list a:hover,
.gp-terms-nav-list a:focus-visible {
	color: #e2e8f0;
	border-inline-start-color: rgb(255 255 255 / 25%);
}

.gp-terms-nav-num {
	flex: 0 0 auto;
	min-inline-size: 1.15rem;
	font-variant-numeric: tabular-nums;
	color: #475569;
}

.gp-terms-nav-list a[aria-current="true"] {
	color: #fff;
	border-inline-start-color: var(--gp-terms-accent);
}

.gp-terms-nav-list a[aria-current="true"] .gp-terms-nav-num {
	color: var(--gp-terms-accent-2);
}

/* Mobile: collapse to a scrollable strip rather than 25 stacked rows. */
@media (max-width: 1023px) {
	.gp-terms-nav {
		border: 1px solid var(--gp-terms-rule);
		border-radius: 1rem;
		padding: 1.25rem;
		background: rgb(255 255 255 / 2%);
	}

	.gp-terms-nav-list {
		max-block-size: 13rem;
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}

/* ------------------------------------------------------------------
   Document body
   ------------------------------------------------------------------ */

.gp-terms .gp-terms-body {
	max-inline-size: 46rem;
}

.gp-terms .gp-terms-body h2 {
	scroll-margin-top: var(--gp-terms-offset);
	font-size: 1.5rem;
	font-weight: 700;
	color: #fff;
	margin-block: 3rem 1rem;
	padding-block-start: 2rem;
	border-block-start: 1px solid var(--gp-terms-rule);
}

.gp-terms .gp-terms-body > h2:first-child {
	margin-block-start: 0;
	padding-block-start: 0;
	border-block-start: 0;
}

.gp-terms .gp-terms-body p {
	color: var(--gp-terms-text);
	line-height: 1.8;
	margin-block-end: 1.25rem;
}

.gp-terms .gp-terms-body ul {
	margin-block-end: 1.25rem;
	padding-inline-start: 1.5rem;
	list-style-type: disc;
}

.gp-terms .gp-terms-body li {
	color: var(--gp-terms-text);
	line-height: 1.8;
	margin-block-end: 0.65rem;
	list-style-type: disc;
}

.gp-terms .gp-terms-body li::marker {
	color: var(--gp-terms-accent);
}

.gp-terms .gp-terms-body strong {
	color: var(--gp-terms-strong);
}

.gp-terms .gp-terms-body em {
	font-style: italic;
	color: #cbd5e1;
}

.gp-terms .gp-terms-body a {
	color: #a5b4fc;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
	transition: color 0.2s ease;
}

.gp-terms .gp-terms-body a:hover,
.gp-terms .gp-terms-body a:focus-visible {
	color: #fff;
}

/* Prescribed ACL statement — must read as quoted, not as our own words. */
.gp-terms-quote {
	margin: 0 0 1.5rem;
	padding: 1.25rem 1.5rem;
	border-inline-start: 3px solid var(--gp-terms-accent);
	border-radius: 0 0.75rem 0.75rem 0;
	background: rgb(139 92 246 / 8%);
}

.gp-terms .gp-terms-quote p {
	margin-block-end: 0;
	color: #cbd5e1;
	font-size: 0.9375rem;
}

/* Payment-fraud warning — deliberately louder than surrounding prose. */
.gp-terms-callout {
	margin-block-end: 1.5rem;
	padding: 1.25rem 1.5rem;
	border: 1px solid rgb(251 191 36 / 30%);
	border-radius: 0.875rem;
	background: rgb(251 191 36 / 7%);
}

.gp-terms .gp-terms-callout p:last-child {
	margin-block-end: 0;
}

.gp-terms .gp-terms-callout strong {
	color: #fcd34d;
}

.gp-terms-footnote {
	margin-block-start: 3rem;
	padding-block-start: 1.5rem;
	border-block-start: 1px solid var(--gp-terms-rule);
	font-size: 0.875rem;
	color: #64748b;
}

/* ------------------------------------------------------------------
   Back to top
   ------------------------------------------------------------------ */

.gp-terms-top {
	position: fixed;
	inset-block-end: 1.5rem;
	inset-inline-end: 1.5rem;
	z-index: 40;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.6rem 1rem;
	border: 1px solid rgb(255 255 255 / 12%);
	border-radius: 9999px;
	background: rgb(15 23 42 / 90%);
	backdrop-filter: blur(8px);
	color: #cbd5e1;
	font-size: 0.8125rem;
	font-weight: 500;
	cursor: pointer;
	transition: opacity 0.25s ease, transform 0.25s ease, color 0.2s ease;
}

.gp-terms-top[hidden] {
	display: none;
}

.gp-terms-top:hover,
.gp-terms-top:focus-visible {
	color: #fff;
	border-color: rgb(255 255 255 / 25%);
}

/* ------------------------------------------------------------------
   Focus visibility — WCAG 2.2 AA (2.4.11 / 2.4.13)
   ------------------------------------------------------------------ */

.gp-terms a:focus-visible,
.gp-terms button:focus-visible {
	outline: 2px solid var(--gp-terms-accent-2);
	outline-offset: 3px;
	border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.gp-terms * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ------------------------------------------------------------------
   Print — legal pages get printed and filed
   ------------------------------------------------------------------ */

@media print {
	.gp-terms {
		background: #fff !important;
		color: #000 !important;
	}

	.gp-terms-nav-wrap,
	.gp-terms-top,
	.gp-terms-summary,
	#main-navigation,
	footer,
	.gp-terms section > .absolute {
		display: none !important;
	}

	.gp-terms-layout {
		display: block;
	}

	.gp-terms .gp-terms-body,
	.gp-terms .gp-terms-body p,
	.gp-terms .gp-terms-body li,
	.gp-terms .gp-terms-body strong,
	.gp-terms .gp-terms-body h1,
	.gp-terms .gp-terms-body h2 {
		max-inline-size: none;
		color: #000 !important;
	}

	.gp-terms .gp-terms-body h2 {
		page-break-after: avoid;
		break-after: avoid;
		font-size: 1.15rem;
		padding-block-start: 1rem;
	}

	.gp-terms .gp-terms-body p,
	.gp-terms-quote,
	.gp-terms-callout {
		page-break-inside: avoid;
		break-inside: avoid;
	}

	.gp-terms .gp-terms-body a {
		color: #000 !important;
		text-decoration: underline;
	}

	/* Print the destination so a filed copy stays verifiable. */
	.gp-terms .gp-terms-body a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.75em;
		word-break: break-all;
	}
}