/*
 * Sustainers Circle page only. Enqueued in functions.php when the page slug
 * is sustainers-circle.
 */

.page--sustainers {
	/* Wider than the site default — the donor wall and the pledge form both
	   want the extra room. */
	--container: 1360px;

	background: var(--tint);
}

.page--sustainers .intro {
	padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.page--sustainers .intro__lead {
	max-width: 68ch;
}

/* Member roster — a donor-wall plaque, not a list of tags */

.sustainers-wall {
	padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4.5rem);
	text-align: center;
}

.sustainers-wall__title {
	margin: 0;
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	font-weight: 600;
	letter-spacing: -0.02em;
}

.sustainers-wall__lead {
	margin: 0.75rem auto 0;
	max-width: 50ch;
	color: var(--muted);
}

.sustainers-wall__plaque {
	position: relative;
	margin: 2.5rem auto 0;
	padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.5rem);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--sand);
}

.sustainers-wall__plaque::before {
	content: "";
	position: absolute;
	top: 14px;
	left: 14px;
	right: 14px;
	bottom: 14px;
	border: 1px solid var(--tint);
	border-radius: calc(var(--radius) - 10px);
	pointer-events: none;
}

.sustainers-wall__list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: center;
}

.sustainers-wall__name {
	padding: 0.85rem 0.75rem;
	border-bottom: 1px solid var(--line);
	font-family: var(--display);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.03em;
	color: var(--ink);
}

.sustainers-wall__list li:nth-child(3n+1) {
	border-left: none;
}

.sustainers-wall__name:not(:nth-child(3n+1)) {
	border-left: 1px solid var(--line);
}

@media (max-width: 720px) {
	.sustainers-wall__list {
		grid-template-columns: repeat(2, 1fr);
	}

	.sustainers-wall__name:not(:nth-child(3n+1)) {
		border-left: none;
	}

	.sustainers-wall__name:nth-child(odd) {
		border-left: none;
	}

	.sustainers-wall__name:nth-child(even) {
		border-left: 1px solid var(--line);
	}
}

@media (max-width: 480px) {
	.sustainers-wall__list {
		grid-template-columns: 1fr;
	}

	.sustainers-wall__name,
	.sustainers-wall__name:nth-child(even) {
		border-left: none;
	}
}

/* The page runs to 1360px, so three columns of names leave the plaque looking
   half-empty. Go to four once there is room for them. */
@media (min-width: 1100px) {
	.sustainers-wall__list {
		grid-template-columns: repeat(4, 1fr);
	}

	.sustainers-wall__name:not(:nth-child(3n+1)) {
		border-left: none;
	}

	.sustainers-wall__name:not(:nth-child(4n+1)) {
		border-left: 1px solid var(--line);
	}
}

/* Pledge form */

.sustainers-form-section {
	padding-top: clamp(3rem, 6vw, 4.5rem);
	padding-bottom: clamp(4rem, 8vw, 6rem);
}

.sustainers-form {
	max-width: 1080px;
	margin-inline: auto;
	border: 1px solid var(--line);
	box-shadow: 0 18px 48px rgb(11 20 32 / 7%);
}

.sustainers-form .form__title {
	font-size: clamp(1.35rem, 2.2vw, 1.75rem);
	letter-spacing: -0.015em;
}

.sustainers-form__section-title {
	margin: 2rem 0 1rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
	font-size: 1rem;
	font-weight: 600;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.sustainers-form h3.sustainers-form__section-title:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.sustainers-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	align-items: flex-start;
}

.field--country {
	flex: 1 1 220px;
}

.field--address {
	flex: 2 1 320px;
}

.field--address textarea.field__input {
	min-height: 5.5rem;
}

.sustainers-form__row .field {
	flex: 1 1 180px;
	min-width: 0;
}

.field--title,
.field--suffix,
.field--state,
.field--zip {
	flex: 1 1 140px;
}

.sustainers-form__checkbox {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: -0.5rem 0 1.25rem;
	color: var(--ink);
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	user-select: none;
}

.sustainers-form__checkbox-input {
	appearance: none;
	position: relative;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin: 0;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sustainers-form__checkbox-input:hover {
	border-color: var(--accent);
}

.sustainers-form__checkbox-input:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px rgb(0 113 176 / 15%);
	border-color: var(--accent);
}

.sustainers-form__checkbox-input:checked {
	border-color: var(--accent);
	background-color: var(--accent);
}

.sustainers-form__checkbox-input::after {
	content: "";
	width: 16px;
	height: 16px;
	background-color: #fff;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E") center / 16px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E") center / 16px no-repeat;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.sustainers-form__checkbox-input:checked::after {
	opacity: 1;
}

.field__prefixed {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__prefixed:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgb(0 113 176 / 15%);
}

.field__prefixed .field__input {
	flex: 1;
	padding-left: 0;
	border: 0;
	background: none;
	outline: none;
}

.field__prefix {
	color: var(--muted);
	font-weight: 500;
}

.sustainers-form__note {
	margin: 1.5rem 0;
	padding: 1rem 1.25rem;
	border-radius: var(--radius-sm);
	background: var(--tint);
	color: var(--ink);
	font-size: 0.9rem;
	line-height: 1.6;
}

.sustainers-form__status {
	min-height: 1.4em;
	margin: 0 0 1rem;
	font-size: 0.9rem;
	color: var(--accent-dark);
}

.sustainers-form__status--error {
	color: #b3261e;
}

/*
 * Card fields. The card number and CVV inputs live inside Cardknox iFields
 * iframes, so we can only style the frame here — the input inside it is
 * styled from JS via setIfieldStyle(), which is why the frame has no padding
 * of its own and hides overflow.
 */
.sustainers-form__ifield {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 42px;
	border: 1px solid var(--line);
	border-radius: 6px;
	overflow: hidden;
}

.sustainers-form__row--card-meta .field {
	flex: 1;
	min-width: 0;
}

.sustainers-form__row--card-meta select.field__input {
	box-sizing: border-box;
	width: 100%;
	height: 42px;
	padding: 0 0.5rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--bg);
	font-size: 15px;
	font-family: inherit;
}

/* iFields writes its own validation message in here. */
.sustainers-form__error {
	display: block;
	min-height: 1.2em;
	margin-bottom: 0.5rem;
	color: #b3261e;
	font-size: 0.85rem;
}

/*
 * Where the real Google badge lands once grecaptcha.render() draws it
 * (256x60px is the badge's own fixed size). Centered because the badge's
 * internal layout is left-aligned and looks off-balance at the form edge.
 */
.sustainers-form__recaptcha-badge {
	display: flex;
	justify-content: center;
	min-height: 60px;
	margin: 0 0 1rem;
}

/* Full-bleed on a 1080px card would read as a banner, not a button. */
.sustainers-form .sustainers-form__submit {
	display: block;
	width: 100%;
	max-width: 22rem;
	margin-inline: auto;
}

.sustainers-form .sustainers-form__status {
	text-align: center;
}

/*
 * Custom dropdown. A div/button/list stand-in for native <select> chrome,
 * built by sjc_dropdown_field() in functions.php and wired up in
 * assets/js/sustainers-circle.js.
 */
.dropdown {
	position: relative;
}

.dropdown__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	width: 100%;
	text-align: left;
	font-family: inherit;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dropdown__trigger:hover {
	border-color: var(--accent);
}

.dropdown__trigger[aria-expanded="true"] {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgb(0 113 176 / 15%);
}

.dropdown__value {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--ink);
}

.dropdown__value--empty {
	color: var(--muted);
}

.dropdown__chevron {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	color: var(--muted);
	transition: transform 0.15s ease;
}

.dropdown__trigger[aria-expanded="true"] .dropdown__chevron {
	transform: rotate(180deg);
}

.dropdown__panel {
	position: absolute;
	z-index: 6;
	top: calc(100% + 0.4rem);
	left: 0;
	right: 0;
	max-height: 15rem;
	overflow-y: auto;
	margin: 0;
	padding: 0.4rem;
	list-style: none;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--bg);
	box-shadow: 0 16px 40px rgb(11 20 32 / 18%);
}

.dropdown__panel[hidden] {
	display: none;
}

.dropdown__option {
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	color: var(--ink);
	font-size: 0.95rem;
	cursor: pointer;
}

.dropdown__option:hover,
.dropdown__option:focus-visible {
	background: var(--tint);
	outline: none;
}

.dropdown__option--selected {
	color: var(--accent-dark);
	font-weight: 600;
}

/*
 * Custom duration range picker. Same visual language as the sponsorship
 * page's week picker (assets/js/sponsorship-checkout.js), but the grid
 * selects a start/end pair instead of a single week.
 */
.rangepick {
	position: relative;
}

.rangepick__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	width: 100%;
	box-sizing: border-box;
	height: 42px;
	padding: 0 0.85rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--bg);
	font-size: 15px;
	font-family: inherit;
	color: var(--ink);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rangepick__trigger:hover {
	border-color: var(--accent);
}

.rangepick--open .rangepick__trigger {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgb(0 113 176 / 15%);
}

.rangepick__value--empty {
	color: var(--muted);
}

.rangepick__cal {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	color: var(--accent);
}

.rangepick__pop {
	position: absolute;
	z-index: 6;
	top: calc(100% + 0.4rem);
	left: 0;
	width: min(20rem, calc(100vw - 3rem));
	padding: 0.85rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--bg);
	box-shadow: 0 16px 40px rgb(11 20 32 / 18%);
}

.rangepick__pop[hidden] {
	display: none;
}

.rangepick__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.6rem;
}

.rangepick__month {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--ink);
}

.rangepick__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--accent);
	cursor: pointer;
	transition: background 0.15s ease;
}

.rangepick__nav:hover {
	background: var(--tint);
}

.rangepick__nav svg {
	width: 18px;
	height: 18px;
}

.rangepick__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.rangepick__dow {
	padding-bottom: 0.35rem;
	font-size: 0.7rem;
	font-weight: 600;
	text-align: center;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.rangepick__day {
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
	color: var(--ink);
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
}

.rangepick__day:nth-child(7n + 1) {
	border-radius: 8px 0 0 8px;
}

.rangepick__day:nth-child(7n) {
	border-radius: 0 8px 8px 0;
}

.rangepick__day--muted {
	color: var(--line);
}

.rangepick__day--disabled {
	color: var(--line);
	cursor: default;
	pointer-events: none;
}

.rangepick__day--today {
	font-weight: 700;
	color: var(--accent);
}

.rangepick__day--in-range {
	background: var(--tint);
}

.rangepick__day--endpoint {
	background: var(--accent);
	color: #fff;
	font-weight: 600;
	border-radius: 8px;
}

.rangepick__hint {
	margin: 0.7rem 0 0;
	font-size: 0.78rem;
	color: var(--muted);
	text-align: center;
}
