/*
 * Contact page ("تماس با ما", page-contact.php). Loaded after home-sections.css (reveal, consult box/form base).
 * Validation never changes layout here: field errors are absolutely positioned inside the form's row gap,
 * and hover/focus/invalid states only change border colour and box-shadow.
 */

/* Design: the footer starts 40px below the form box (site default is 64-74px). */
.site-main--contact + .at-footer {
	margin-top: clamp(32px, 2.1vw, 40px);
}

/* ---------- 1. Title + contact-way cards on the teal band ---------- */
.contact-ways {
	position: relative;
	padding: clamp(24px, 2.1vw, 40px) 0 80px; /* bottom = band part below the cards */
	isolation: isolate;
}

/* Full-width teal band behind the lower 40px of the cards (design: 80px tall, 40px top corners). */
.contact-ways::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	z-index: -1;
	height: 80px;
	border-radius: 40px 40px 0 0;
	background: var(--at-teal);
}

.contact-ways__head {
	margin-bottom: clamp(28px, 2.1vw, 40px);
}

.contact-ways__title {
	margin: 0;
	color: var(--at-ink);
	font-size: clamp(22px, 1.4vw + 4px, 26px);
	font-weight: 600;
	line-height: 1.6;
}

.contact-ways__text {
	margin: 12px 0 0;
	color: var(--at-muted);
	font-size: 16px;
	line-height: 2;
}

.contact-ways__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin: 0 0 -40px; /* cards overlap the band by 40px */
	padding: 0;
	list-style: none;
}

.contact-card {
	display: flex;
	align-items: center;
	gap: 38px;
	min-height: 204px;
	padding: 22px 36px;
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 0 2px rgba(0, 0, 0, 0.25);
}

.contact-card__icon {
	flex: none;
	display: block;
	width: 54px;
	height: 54px;
	color: var(--at-teal);
}

.contact-card__icon .at-icon {
	display: block;
	width: 100%;
	height: 100%;
}

.contact-card__body {
	min-width: 0;
}

.contact-card__title {
	margin: 0 0 14px;
	color: var(--at-ink);
	font-size: clamp(20px, 0.6vw + 13px, 24px);
	font-weight: 600;
	line-height: 1.5;
}

.contact-card__sub {
	margin: 0 0 12px;
	color: var(--at-body);
	font-size: clamp(16px, 0.3vw + 12px, 18px);
	font-weight: 500;
	line-height: 1.5;
}

.contact-card__line {
	margin: 0;
	color: var(--at-muted);
	font-size: 16px;
	font-style: normal;
	line-height: 34px;
}

.contact-card__line a {
	color: inherit;
	text-decoration: none;
	overflow-wrap: anywhere;
	transition: color 0.2s ease;
}

.contact-card__line a:hover {
	color: var(--at-teal-hover);
}

.contact-card__line a:focus-visible {
	border-radius: 4px;
	outline: 2px solid var(--at-teal);
	outline-offset: 2px;
}

/* ---------- 2. Form box (home consult section + organisation/subject fields) ---------- */
.site-main--contact > .home-consult {
	margin-top: 40px;
}

/* <picture> takes the bg img's place, out of the grid flow (same as service.css). */
.site-main--contact .home-consult__picture {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.site-main--contact .home-consult__box {
	min-height: 514px;
	border-radius: 48px;
}

.site-main--contact .home-consult__form {
	gap: 24px 16px;
}

.site-main--contact .at-field {
	position: relative;
}

.site-main--contact .at-field input,
.site-main--contact .at-field textarea,
.site-main--contact .at-field select {
	min-height: 56px;
	border-radius: 16px;
	background: var(--at-soft);
}

.site-main--contact .at-field textarea {
	min-height: 138px;
}

.at-field select {
	width: 100%;
	padding: 12px 16px;
	padding-inline-end: 44px;
	border: 1.5px solid transparent;
	color: var(--at-body);
	font: inherit;
	font-size: 15px;
	line-height: 1.6;
	cursor: pointer;
	appearance: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.at-field select:has(option[value=""]:checked) {
	color: #8a8a8a;
	font-size: 14px;
}

.at-field select option {
	color: var(--at-body);
	font-size: 15px;
}

.at-field select:hover {
	border-color: rgba(87, 179, 183, 0.6);
}

.at-field select:focus {
	border-color: var(--at-teal);
	outline: none;
	box-shadow: 0 0 0 4px rgba(87, 179, 183, 0.35);
}

.at-field select[aria-invalid="true"],
.at-field textarea[aria-invalid="true"] {
	border-color: #e05a5a;
}

/* Down chevron at the inline end of the select (left in RTL); the select stays the click target. */
.at-field__chevron {
	position: absolute;
	inset-inline-end: 20px;
	bottom: 24px;
	width: 9px;
	height: 9px;
	border-right: 1.5px solid #8d8d8d; /* physical on purpose: forms a down chevron after rotate(45deg) */
	border-bottom: 1.5px solid #8d8d8d;
	transform: rotate(45deg);
	pointer-events: none;
}

/* Errors sit in the 24px row gap below the field, so showing one never moves anything. */
.site-main--contact .at-field__error {
	position: absolute;
	top: 100%;
	inset-inline: 0;
	margin-top: 2px;
	overflow: hidden;
	font-size: 12.5px;
	line-height: 20px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* ---------- Responsive ---------- */
@media (min-width: 1280px) {
	.site-main--contact .home-consult__box {
		padding-block: 26px 24px; /* design: 514px box; the 24px row gaps (error space) come out of the padding */
	}
}

@media (max-width: 1439.98px) {
	.contact-card {
		gap: 24px;
		padding: 22px 28px;
	}
}

@media (max-width: 1279.98px) {
	.contact-ways__list {
		gap: 20px;
	}

	.contact-card {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		padding: 24px;
	}

	.contact-card__icon {
		width: 48px;
		height: 48px;
	}

	.contact-card__title {
		margin-bottom: 8px;
	}

	.contact-card__sub {
		margin-bottom: 6px;
	}

	.contact-card__line {
		line-height: 30px;
	}
}

@media (max-width: 991.98px) {
	.contact-ways__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.contact-card {
		flex-direction: row;
		align-items: center;
		gap: 24px;
		min-height: 0;
	}

	.site-main--contact .home-consult__box {
		min-height: 0;
		border-radius: 32px;
	}
}

@media (max-width: 767.98px) {
	.contact-ways__text {
		font-size: 15px;
	}

	.contact-card {
		gap: 16px;
		padding: 20px;
		border-radius: 20px;
	}

	.contact-card__icon {
		width: 44px;
		height: 44px;
	}

	.site-main--contact > .home-consult {
		margin-top: 32px;
	}

	.site-main--contact .home-consult__box {
		border-radius: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.contact-card__line a,
	.at-field select {
		transition: none;
	}
}
