/* -------------------------------------------------------------------------- */
/* Terms of Use page                                                          */
/* Add to your theme stylesheet. Markup is unchanged — styles only.           */
/* Uses existing tokens: --dit-navy, --dit-teal, --dit-teal-mid, --dit-mist,  */
/* --dit-muted, --dit-line, --dit-white, --dit-ease                           */
/* -------------------------------------------------------------------------- */

.dit-terms {
	background: #f5f9fa;
}

/* ---------- Hero (matches About / Contact / service heroes) ---------- */

.dit-terms-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	min-height: clamp(420px, 62vh, 580px);
	padding-block: clamp(3rem, 7vw, 5.25rem);
	background-color: #eef5f6;
	background-image: url("../assets/img/terms-hero.jpg");
	background-repeat: no-repeat;
	background-position: center right;
	background-size: cover;
}

.dit-terms-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: linear-gradient(
		90deg,
		rgba(247, 251, 251, 0.97) 0%,
		rgba(247, 251, 251, 0.92) 36%,
		rgba(247, 251, 251, 0.55) 54%,
		rgba(247, 251, 251, 0.12) 70%,
		transparent 84%
	);
}

.dit-terms-hero::after {
	content: "";
	position: absolute;
	right: -8%;
	bottom: -22%;
	z-index: 0;
	width: min(50vw, 520px);
	height: min(32vw, 260px);
	background: var(--dit-teal);
	border-radius: 55% 45% 0 70% / 70% 40% 0 60%;
	opacity: 0.95;
	pointer-events: none;
}

.dit-terms-hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	align-items: center;
	width: 100%;
	min-height: inherit;
}

.dit-terms-hero__content {
	position: relative;
	z-index: 2;
	max-width: 38rem;
	opacity: 0;
	transform: translateY(1.1rem);
	animation: dit-terms-hero-in 0.85s var(--dit-ease) forwards;
	animation-delay: 0.08s;
}

.dit-terms-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0 0 1.1rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--dit-teal);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.dit-terms-hero__title {
	margin: 0 0 1.15rem;
	max-width: 14ch;
	color: var(--dit-navy);
	font-size: clamp(2rem, 4.2vw, 3.05rem);
	line-height: 1.15;
	letter-spacing: normal;
}

.dit-terms-hero__title::after {
	content: none;
	display: none;
}

.dit-terms-hero__lead {
	margin: 0;
	max-width: 36rem;
	color: var(--dit-muted);
	font-size: clamp(1rem, 1.6vw, 1.1rem);
	line-height: 1.65;
}

/* Legacy media block (if present in content) — hide; image is the hero background */
.dit-terms-hero__media {
	display: none !important;
}

@keyframes dit-terms-hero-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------- Body wrapper ---------- */

.dit-terms-body {
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
	background: transparent;
}

.dit-terms-content {
	display: flex;
	flex-direction: column;
	gap: 1.35rem;
	box-sizing: border-box;
	width: 100% !important;
	max-width: 56rem !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.dit-terms-content > *,
.dit-terms-content > .wp-block-html,
.dit-terms-content .dit-terms-notice {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	margin-block: 0 !important;
}

/* ---------- Intro ---------- */

.dit-terms-intro {
	padding: clamp(1.5rem, 3vw, 2rem);
	background: var(--dit-white);
	border: 1px solid rgba(13, 115, 119, 0.12);
	border-radius: 20px;
	box-shadow: 0 14px 34px rgba(11, 42, 74, 0.06);
}

.dit-terms-intro > * {
	max-width: none !important;
}

.dit-terms-intro__updated {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 1rem !important;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	background: var(--dit-mist);
	border: 1px solid rgba(13, 115, 119, 0.18);
	color: var(--dit-teal);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.dit-terms-intro__updated::before {
	content: "";
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: var(--dit-teal-mid);
}

.dit-terms-intro .dit-terms__text {
	margin: 0 !important;
	font-size: 1.08rem;
	line-height: 1.75;
	color: var(--dit-navy);
}

/* ---------- Notice ---------- */

.dit-terms-notice {
	position: relative;
	overflow: hidden;
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	width: 100%;
	padding: 1.35rem 1.5rem;
	border-radius: 18px;
	color: var(--dit-white);
	background:
		radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
		linear-gradient(135deg, var(--dit-navy) 0%, #0c3556 55%, var(--dit-teal) 150%);
	box-shadow: 0 16px 36px rgba(11, 42, 74, 0.18);
}

.dit-terms-notice__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--dit-teal);
	color: var(--dit-white);
	box-shadow: 0 0 0 5px rgba(13, 115, 119, 0.3);
}

.dit-terms-notice__text {
	margin: 0 0 0.45rem;
	font-size: 1rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.92);
}

.dit-terms-notice__text:first-child {
	font-weight: 700;
	color: var(--dit-white);
}

.dit-terms-notice__text:last-child {
	margin-bottom: 0;
}

/* ---------- Numbered section cards ---------- */

.dit-terms-section {
	position: relative;
	padding: clamp(1.4rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2.15rem) clamp(1.5rem, 3vw, 2.1rem);
	background: var(--dit-white);
	border: 1px solid rgba(13, 115, 119, 0.1);
	border-radius: 20px;
	box-shadow: 0 10px 28px rgba(11, 42, 74, 0.05);
	scroll-margin-top: 6rem;
	transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s var(--dit-ease);
}

.dit-terms-section::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1.6rem;
	width: 4px;
	height: 2.75rem;
	border-radius: 0 4px 4px 0;
	background: linear-gradient(180deg, var(--dit-teal), var(--dit-teal-mid));
}

.dit-terms-section:hover,
.dit-terms-section:target {
	border-color: rgba(13, 115, 119, 0.28);
	box-shadow: 0 16px 38px rgba(11, 42, 74, 0.1);
}

.dit-terms-section > * {
	max-width: none !important;
}

.dit-terms {
	counter-reset: dit-terms-section;
}

.dit-terms-section__title {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin: 0 0 1.15rem !important;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--dit-line);
	color: var(--dit-navy);
	font-size: clamp(1.2rem, 2.2vw, 1.5rem);
	line-height: 1.25;
}

.dit-terms-section__title::before {
	counter-increment: dit-terms-section;
	content: counter(dit-terms-section);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-sizing: border-box;
	width: 2.6rem;
	height: 2.6rem;
	padding: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--dit-teal) 0%, var(--dit-teal-mid) 100%);
	color: var(--dit-white);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 0 0 5px rgba(13, 115, 119, 0.12), 0 8px 16px rgba(13, 115, 119, 0.25);
}

.dit-terms-section__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-sizing: border-box;
	width: 2.6rem;
	height: 2.6rem;
	padding: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--dit-teal) 0%, var(--dit-teal-mid) 100%);
	color: var(--dit-white);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 0 0 5px rgba(13, 115, 119, 0.12), 0 8px 16px rgba(13, 115, 119, 0.25);
}

.dit-terms__text {
	margin: 0 0 0.95rem !important;
	color: var(--dit-muted);
	font-size: 1.02rem;
	line-height: 1.75;
}

.dit-terms-section .dit-terms__text:last-child {
	margin-bottom: 0 !important;
}

.dit-terms__text a {
	color: var(--dit-teal);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: rgba(13, 115, 119, 0.35);
	text-underline-offset: 0.2em;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.dit-terms__text a:hover,
.dit-terms__text a:focus-visible {
	color: var(--dit-teal-mid);
	text-decoration-color: currentColor;
}

/* ---------- Lists with check bullets ---------- */

.dit-terms-list {
	display: grid;
	gap: 0.6rem;
	list-style: none;
	margin: 0.2rem 0 1.1rem;
	padding: 0;
}

.dit-terms-list li {
	position: relative;
	padding: 0.7rem 1rem 0.7rem 2.85rem;
	background: #f7fbfb;
	border: 1px solid rgba(13, 115, 119, 0.1);
	border-radius: 12px;
	color: var(--dit-navy);
	font-size: 0.98rem;
	font-weight: 500;
	line-height: 1.55;
}

.dit-terms-list li::before {
	content: "";
	position: absolute;
	left: 0.85rem;
	top: 50%;
	width: 1.35rem;
	height: 1.35rem;
	border-radius: 50%;
	transform: translateY(-50%);
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 0.8rem no-repeat,
		var(--dit-teal);
}

/* ---------- Contact ---------- */

.dit-terms-section--contact {
	background:
		radial-gradient(circle at 100% 0%, rgba(13, 115, 119, 0.08) 0%, transparent 50%),
		linear-gradient(180deg, var(--dit-white) 0%, #f4fafb 100%);
	border-color: rgba(13, 115, 119, 0.2);
}

.dit-terms-contact {
	margin-top: 1.1rem;
	padding: 1.5rem;
	border-radius: 18px;
	background: var(--dit-white);
	border: 1px solid rgba(13, 115, 119, 0.14);
	box-shadow: 0 12px 28px rgba(11, 42, 74, 0.06);
}

.dit-terms-contact__name {
	margin: 0 0 1.1rem;
	color: var(--dit-navy);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.35rem;
	font-weight: 700;
}

.dit-terms-contact__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.9rem;
	list-style: none;
	margin: 0 0 1.15rem;
	padding: 0;
}

.dit-terms-contact__list li,
.dit-terms-contact__item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1rem;
	border-radius: 14px;
	background: var(--dit-mist);
	border: 1px solid rgba(13, 115, 119, 0.12);
	min-width: 0;
}

.dit-terms-contact__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 50%;
	background: var(--dit-teal);
	color: var(--dit-white);
	box-shadow: 0 0 0 4px rgba(13, 115, 119, 0.16);
}

.dit-terms-contact__icon svg {
	width: 1rem;
	height: 1rem;
}

.dit-terms-contact__meta {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
	color: var(--dit-navy);
	font-size: 0.95rem;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.dit-terms-contact__label {
	color: var(--dit-muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.dit-terms-contact__meta a {
	color: var(--dit-teal);
	text-decoration: none;
}

.dit-terms-contact__meta a:hover,
.dit-terms-contact__meta a:focus-visible {
	color: var(--dit-teal-mid);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.dit-terms-contact__note {
	margin: 0;
	padding-top: 1rem;
	border-top: 1px dashed rgba(13, 115, 119, 0.3);
	color: var(--dit-muted);
	font-size: 0.98rem;
	line-height: 1.65;
}

/* ---------- Help CTA ---------- */

.dit-terms-help {
	padding-block: 0 clamp(3rem, 6vw, 5rem);
	background: transparent;
}

.dit-terms-help__inner {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp(1.5rem, 4vw, 2.5rem);
	width: 100%;
	padding: clamp(2rem, 4.5vw, 3rem);
	border-radius: 24px;
	color: var(--dit-white);
	background:
		radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.1) 0%, transparent 38%),
		radial-gradient(circle at 4% 100%, rgba(13, 115, 119, 0.55) 0%, transparent 45%),
		linear-gradient(135deg, var(--dit-navy) 0%, #0c3556 52%, var(--dit-teal) 140%);
	box-shadow: 0 26px 56px rgba(11, 42, 74, 0.22);
}

.dit-terms-help__inner::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	opacity: 0.5;
	pointer-events: none;
	background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1.5px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 70%);
	mask-image: linear-gradient(90deg, #000 0%, transparent 70%);
}

.dit-terms-help__inner::after {
	content: "";
	position: absolute;
	right: -80px;
	bottom: -120px;
	width: 280px;
	height: 280px;
	z-index: -1;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 0 0 36px rgba(255, 255, 255, 0.03);
	pointer-events: none;
}

.dit-terms-help__copy {
	max-width: 36rem;
}

.dit-terms-help__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.8rem;
	color: #8fd6d8;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.dit-terms-help__eyebrow::before {
	content: "";
	width: 1.75rem;
	height: 2px;
	background: #8fd6d8;
}

.dit-terms-help__title {
	margin: 0 0 0.7rem;
	color: var(--dit-white);
	font-size: clamp(1.7rem, 3.2vw, 2.4rem);
	line-height: 1.15;
}

.dit-terms-help__text {
	margin: 0;
	color: rgba(255, 255, 255, 0.84);
	font-size: 1.05rem;
	line-height: 1.65;
}

.dit-terms-help__actions {
	flex-shrink: 0;
}

.dit-terms-help__actions .dit-btn--primary .wp-block-button__link {
	--dit-btn-glow: rgba(4, 20, 38, 0.4);
	background: var(--dit-white);
	border-color: var(--dit-white);
	color: var(--dit-navy);
	font-weight: 700;
	box-shadow: none;
}

.dit-terms-help__actions .dit-btn--primary .wp-block-button__link:hover,
.dit-terms-help__actions .dit-btn--primary .wp-block-button__link:focus-visible {
	background: var(--dit-mist);
	color: var(--dit-teal);
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
	.dit-terms-hero {
		min-height: auto;
		padding-block: clamp(2.5rem, 6vw, 3.5rem);
		background-position: 70% center;
	}

	.dit-terms-hero::before {
		background: linear-gradient(
			180deg,
			rgba(247, 251, 251, 0.97) 0%,
			rgba(247, 251, 251, 0.94) 55%,
			rgba(247, 251, 251, 0.82) 100%
		);
	}

	.dit-terms-hero::after {
		right: -28%;
		bottom: -18%;
		width: 70vw;
		height: 110px;
		opacity: 0.45;
	}

	.dit-terms-hero__title {
		max-width: 18ch;
	}

	.dit-terms-contact__list {
		grid-template-columns: 1fr;
	}

	.dit-terms-help__inner {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dit-terms-hero__content {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 520px) {
	.dit-terms-section {
		padding: 1.25rem 1.05rem 1.35rem;
		border-radius: 16px;
	}

	.dit-terms-section::before {
		top: 1.35rem;
		height: 2.25rem;
	}

	.dit-terms-section__title {
		gap: 0.7rem;
		align-items: flex-start;
	}

	.dit-terms-section__title::before,
	.dit-terms-section__num {
		width: 2.2rem;
		height: 2.2rem;
		font-size: 0.9rem;
	}

	.dit-terms-notice {
		flex-direction: column;
		padding: 1.2rem;
	}

	.dit-terms-list li {
		padding-left: 2.6rem;
		font-size: 0.94rem;
	}

	.dit-terms-help__inner {
		padding: 1.6rem 1.25rem;
		border-radius: 18px;
	}

	.dit-terms-help__actions,
	.dit-terms-help__actions .wp-block-button,
	.dit-terms-help__actions .wp-block-button__link {
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dit-terms-section,
	.dit-terms-help__actions .dit-btn--primary .wp-block-button__link {
		transition: none;
	}

	.dit-terms-help__actions .dit-btn--primary .wp-block-button__link:hover,
	.dit-terms-help__actions .dit-btn--primary .wp-block-button__link:focus-visible {
		transform: none;
	}
}

/* -------------------------------------------------------------------------- */
/* Block-editor conversion: explicit margins                                  */
/* These elements used to sit in Custom HTML blocks. As core blocks they live */
/* in flow-layout groups, so block-gap margins are reset here.                */
/* -------------------------------------------------------------------------- */

.dit-terms-notice__icon,
.dit-terms-contact__item,
.dit-terms-contact__icon,
.dit-terms-contact__meta,
.dit-terms-contact__label,
.dit-terms-contact__meta-link,
.dit-terms-contact__meta-text {
	margin-block: 0;
}
