/**
 * The contact and question forms, as the design draws them (.form-block and
 * its fields). Colours are the site's own tokens. Every rule is scoped under
 * .asf: the theme styles inputs, selects and buttons by element and attribute,
 * and a lone class loses to those. Anything switched with the hidden attribute
 * has its own [hidden] rule.
 */
.asf {
	--ink: #14231c;
	--ink-2: #3c5147;
	--ink-3: #6d7f76;
	--green: #2e6e51;
	--green-deep: #1a4232;
	--green-tint: #e7eee9;
	--gold-text: #7d5f27;
	--gold-tint: #f1e7d3;
	--cream: #f2ede1;
	--paper: #fbf9f4;
	--line: #ded6c4;
	--line-soft: #ece6da;
	--bad: #a3392b;
	--bad-tint: #fbeeea;

	font-family: Tajawal, sans-serif;
	direction: rtl;
	text-align: right;
	color: var(--ink);
}

.asf *,
.asf *::before,
.asf *::after {
	box-sizing: border-box;
}

.asf [hidden] {
	display: none !important;
}

.asf .asf-i {
	flex: none;
	width: 16px;
	height: 16px;
}

.asf p {
	margin: 0;
}

/* ------------------------------------------------- the fatwa page's section */

.asf.asf-sec {
	width: 100%;
	max-width: 1160px;
	margin-inline: auto;
	padding: 8px 16px 64px;
	scroll-margin-top: 96px;
}

@media ( min-width: 768px ) {
	.asf.asf-sec {
		padding-inline: 24px;
	}
}

@media ( min-width: 1025px ) {
	.asf.asf-sec {
		padding-inline: 32px;
	}
}

.asf .asf-sec-in {
	display: flex;
	flex-direction: column;
	gap: 20px;
	border-top: 1px solid var(--line);
	padding-top: 40px;
}

.asf .asf-sec-head {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 760px;
}

.asf .asf-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font: 700 23px/1.35 Tajawal, sans-serif;
	letter-spacing: 0;
	color: var(--ink);
}

.asf .asf-title .asf-i {
	width: 34px;
	height: 34px;
	padding: 8px;
	border-radius: 50%;
	background: var(--green-tint);
	color: var(--green);
}

.asf .asf-intro {
	font: 400 16px/1.8 Tajawal, sans-serif;
	color: var(--ink-2);
	text-wrap: pretty;
}

/* The contact page already has the design's box; the fatwa page draws its own. */
.asf .asf-box {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 20px;
	padding: 32px;
}

@media ( max-width: 767px ) {
	.asf .asf-box {
		padding: 20px 16px;
		border-radius: 16px;
	}
}

.asf.asf-in-block {
	width: 100%;
	scroll-margin-top: 96px;
}

/* -------------------------------------------------------------------- form */

.asf .asf-form {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 0;
}

.asf .asf-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
}

.asf .asf-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 18px 16px;
}

.asf .asf-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 220px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.asf .asf-field.asf-wide {
	flex-basis: 100%;
}

@media ( max-width: 767px ) {
	.asf .asf-field {
		flex-basis: 100%;
	}
}

.asf .asf-label {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 0;
	font: 700 13.5px/1.4 Tajawal, sans-serif;
	color: var(--ink-2);
}

.asf .asf-opt {
	font-weight: 400;
	font-size: 12px;
	color: var(--ink-3);
}

.asf .asf-field .asf-input {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 11px 14px;
	font: 400 15px/1.6 Tajawal, sans-serif;
	color: var(--ink);
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: none;
	outline: none;
	text-align: right;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.asf .asf-field .asf-input::placeholder {
	color: var(--ink-3);
	opacity: 1;
}

/* Typed addresses and numbers run left to right; their hint is Arabic. */
.asf .asf-field .asf-input[dir="ltr"] {
	text-align: left;
}

.asf .asf-field .asf-input[dir="ltr"]:placeholder-shown {
	direction: rtl;
	text-align: right;
}

.asf .asf-field .asf-area {
	min-height: 168px;
	resize: vertical;
}

.asf .asf-field .asf-select {
	padding-left: 40px;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d7f76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	background-size: 16px 16px;
	cursor: pointer;
}

.asf .asf-field .asf-input:hover {
	border-color: #cdc3ad;
}

.asf .asf-field .asf-input:focus {
	background-color: #fff;
	border-color: var(--green);
	box-shadow: 0 0 0 3px rgba( 46, 110, 81, 0.16 );
}

.asf .asf-field.is-bad .asf-input {
	border-color: var(--bad);
	background-color: #fff;
}

.asf .asf-field.is-bad .asf-input:focus {
	box-shadow: 0 0 0 3px rgba( 163, 57, 43, 0.14 );
}

.asf .asf-err {
	font: 400 13px/1.5 Tajawal, sans-serif;
	color: var(--bad);
}

/* Choices: one of several, and a single agreement. */
.asf .asf-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.asf .asf-choice,
.asf .asf-check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font: 400 15px/1.5 Tajawal, sans-serif;
	color: var(--ink);
	cursor: pointer;
}

.asf .asf-choice {
	padding: 10px 14px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 999px;
}

.asf .asf-choice:has( input:checked ) {
	background: var(--green-tint);
	border-color: var(--green);
}

.asf .asf-choice input,
.asf .asf-check input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--green);
	flex: none;
}

.asf .asf-check {
	align-items: flex-start;
}

.asf .asf-check input {
	margin-top: 3px;
}

/* ----------------------------------------------------------------- actions */

.asf .asf-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
}

.asf .asf-form .asf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	margin: 0;
	padding: 12px 28px;
	font: 700 15px/1 Tajawal, sans-serif;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
	background: var(--green);
	border: 1px solid transparent;
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.asf .asf-form .asf-btn .asf-i {
	transform: scaleX( -1 );
}

.asf .asf-form .asf-btn:hover,
.asf .asf-form .asf-btn:focus {
	color: #fff;
	background: var(--green-deep);
}

.asf .asf-form .asf-btn:focus-visible {
	outline: 2px solid var(--green);
	outline-offset: 3px;
}

.asf .asf-form .asf-btn:disabled {
	opacity: 0.7;
	cursor: progress;
}

.asf .asf-fine {
	flex: 1 1 260px;
	font: 400 13px/1.7 Tajawal, sans-serif;
	color: var(--ink-3);
	text-wrap: pretty;
}

@media ( max-width: 767px ) {
	.asf .asf-form .asf-btn {
		width: 100%;
	}
}

.asf .asf-status {
	padding: 12px 14px;
	font: 700 14px/1.6 Tajawal, sans-serif;
	color: var(--bad);
	background: var(--bad-tint);
	border-radius: 8px;
}

/* Notices after a post without script. */
.asf .asf-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 16px;
	font: 700 14.5px/1.7 Tajawal, sans-serif;
	border-radius: 10px;
}

.asf .asf-note .asf-i {
	margin-top: 4px;
}

.asf .asf-note-ok {
	color: var(--green-deep);
	background: var(--green-tint);
}

.asf .asf-note-err {
	color: var(--bad);
	background: var(--bad-tint);
}

/* -------------------------------------------------------------- the thanks */

.asf .asf-done {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 28px 12px;
	text-align: center;
	outline: none;
}

.asf .asf-done-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--green-tint);
	color: var(--green);
}

.asf .asf-done-mark .asf-i {
	width: 28px;
	height: 28px;
}

.asf .asf-done-t {
	max-width: 520px;
	font: 700 17px/1.8 Tajawal, sans-serif;
	color: var(--ink);
	text-wrap: pretty;
}

.asf .asf-done .asf-again {
	margin: 0;
	padding: 10px 22px;
	font: 700 14px/1 Tajawal, sans-serif;
	letter-spacing: 0;
	text-transform: none;
	color: var(--green-deep);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
}

.asf .asf-done .asf-again:hover,
.asf .asf-done .asf-again:focus {
	color: var(--green);
	background: #fff;
	border-color: var(--green);
}

@media ( prefers-reduced-motion: reduce ) {
	.asf .asf-field .asf-input,
	.asf .asf-form .asf-btn {
		transition: none;
	}
}
