/*
 * Sponsorship page only. Enqueued in functions.php whenever the page slug is
 * "sponsorship".
 */


.sponsorship {
	padding-block: clamp(3rem, 6vw, 5rem);
}

.sponsorship__group {
	margin-bottom: clamp(3rem, 6vw, 4.5rem);
	scroll-margin-block-start: calc(var(--nav-h-condensed) + 1.5rem);
}

.sponsorship__group-title {
	margin: 0 0 1.75rem;
	font-size: clamp(1.4rem, 2.4vw, 1.85rem);
	font-weight: 600;
	letter-spacing: -0.02em;
}

/*
 * Wider floor than a typical card grid, on purpose: each card holds two
 * buttons side by side, and a narrow card forces them to wrap onto their own
 * lines. 360px keeps two buttons on one row down to small-tablet widths, and
 * settles into 2 per row on desktop instead of 3-4.
 */
.tier-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
	gap: var(--step);
	margin: 0;
	padding: 0;
	list-style: none;
}

.tier {
	display: flex;
	flex-direction: column;
	padding: clamp(1.75rem, 2.2vw, 2.25rem);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg);
}

/* The plan most sponsors should pick gets the brand-blue treatment; every
   other tier stays neutral so it doesn't compete. */
.tier--featured {
	border-color: var(--accent);
	box-shadow: 0 12px 28px rgb(11 58 92 / 12%);
}

.tier__name {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 600;
}

.tier__price {
	margin: 0.35rem 0 1.25rem;
	color: var(--accent);
	font-size: 1.6rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* Flags that this tier folds in everything from a smaller tier below it. */
.tier__includes {
	display: inline-block;
	margin: 0 0 1rem;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: var(--tint);
	color: var(--accent-dark);
	font-size: 0.8rem;
	font-weight: 600;
}

.tier__items {
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--muted);
	font-size: 0.95rem;
	line-height: 1.7;
}

.tier__items li {
	padding-left: 1.15rem;
	position: relative;
}

.tier__items li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.7em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
}

/* Add-on: rides along with the plan above it rather than standing as its own
   card, so it sits inside as a lighter, dashed-off sub-section. */
.tier__addon {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px dashed var(--line);
}

/*
 * Checkbox sits at left: 0, same as the bullet dots in .tier__items below it,
 * so the label text lines up with the bulleted text instead of sitting a full
 * checkbox-width further right.
 */
.tier__addon-label {
	position: relative;
	display: block;
	padding-left: 2.1rem;
	margin: 0 0 0.5rem;
	color: var(--accent);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}

.tier__addon-toggle {
	position: absolute;
	left: 0;
	top: 0.1em;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--accent);
	cursor: pointer;
}

.sponsorship__pending {
	margin: 0;
	color: var(--muted);
}

.sponsorship__cta {
	padding: clamp(2rem, 4vw, 3rem);
	border-radius: var(--radius);
	background: var(--sand);
	text-align: center;
}

.sponsorship__cta-text {
	margin: 0 0 1.25rem;
	font-size: clamp(1.1rem, 1.8vw, 1.3rem);
	font-weight: 500;
}

/* margin-top: auto pins the actions row to the card bottom; the 1.25rem floor
   keeps it from touching the list in the tallest card of a row. */
.tier__actions {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.75rem;
	margin-top: auto;
}

.tier__sponsor-btn,
.tier__contact-btn {
	flex: 1 1 0;
	padding-inline: 1rem;
	white-space: nowrap;
}

.tier > .tier__items,
.tier > .tier__addon {
	margin-bottom: 1.25rem;
}

/*
 * Sponsorship checkout modal.
 */

.sponsor-modal-open {
	overflow: hidden;
}

.sponsor-modal[hidden] {
	display: none;
}

.sponsor-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.sponsor-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(11 20 32 / 55%);
	opacity: 0;
	transition: opacity 0.22s ease;
}

.sponsor-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--bg);
	box-shadow: 0 24px 60px rgb(11 20 32 / 25%);
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

@media (min-width: 640px) {
	.sponsor-modal__dialog {
		max-width: 640px;
	}

	.sponsor-modal__scroll {
		padding: 2.5rem;
	}
}

.sponsor-modal--visible .sponsor-modal__backdrop {
	opacity: 1;
}

.sponsor-modal--visible .sponsor-modal__dialog {
	opacity: 1;
	transform: none;
}

.sponsor-modal__scroll {
	max-height: 90vh;
	overflow-y: auto;
	padding: 2rem;
}

.sponsor-modal__close {
	position: absolute;
	z-index: 2;
	top: 0.75rem;
	right: 0.75rem;
	width: 2rem;
	height: 2rem;
	border: 0;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--muted);
}

.sponsor-modal__header {
	margin: 0 0 1.5rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--line);
}

.sponsor-modal__title {
	margin: 0 0 0.35rem;
	font-size: 1.3rem;
	font-weight: 600;
}

.sponsor-modal__amount {
	margin: 0;
	color: var(--accent);
	font-weight: 700;
	font-size: 1.2rem;
}

.sponsor-modal__addon {
	margin: 0.35rem 0 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.sponsor-modal__addon[hidden] {
	display: none;
}

.sponsor-form .field {
	margin-bottom: 1rem;
}

.sponsor-form__section-title {
	margin: 0 0 0.85rem;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.sponsor-form__row {
	display: flex;
	gap: 0.75rem;
}

.sponsor-form__row .field {
	flex: 1;
	min-width: 0;
}

.field--state {
	flex: 0 0 4.5rem;
}

.field--zip {
	flex: 0 0 6rem;
}

.sponsor-form__secure {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.25rem;
	margin-bottom: 1.1rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.85rem;
}

.sponsor-form__lock {
	flex-shrink: 0;
	width: 15px;
	height: 15px;
	color: var(--accent);
}

.sponsor-form__cards {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-left: auto;
}

.sponsor-form__cards img {
	height: 20px;
	width: auto;
}

.sponsor-form__ifield {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 42px;
	border: 1px solid var(--line);
	border-radius: 6px;
	overflow: hidden;
}

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

.sponsor-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;
}

.sponsor-form__error {
	display: block;
	min-height: 1.2em;
	margin-bottom: 0.5rem;
	color: #b3261e;
	font-size: 0.85rem;
}

.sponsor-form__status {
	min-height: 1.2em;
	margin: 0 0 1rem;
	font-size: 0.9rem;
	color: var(--muted);
}

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

/*
 * Where the real Google badge lands once JS re-parents it (256x60px is the
 * badge's own fixed size). Centered since the badge's internal layout is
 * left-aligned by default and looks off-balance pinned to the form's edge.
 */
.sponsor-form__recaptcha-badge {
	display: flex;
	justify-content: center;
	min-height: 60px;
	margin: 0 0 1rem;
}

.sponsor-form__submit {
	width: 100%;
}

/*
 * Custom week picker. Replaces the native <input type="week">: a button-styled
 * trigger showing a readable range, plus a calendar popover that highlights the
 * whole Mon–Sun week on hover/selection. Markup in template-parts/sponsorship/
 * checkout-modal.php; behaviour in assets/js/sponsorship-checkout.js.
 */
.weekpick {
	position: relative;
}

.weekpick__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;
}

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

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

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

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

.weekpick__pop {
	position: absolute;
	z-index: 5;
	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%);
}

.weekpick__pop[hidden] {
	display: none;
}

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

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

.weekpick__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;
}

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

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

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

.weekpick__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;
}

.weekpick__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;
}

/* Square the corners at each end of a highlighted week row so the run of seven
   days reads as one continuous bar. */
.weekpick__day:nth-child(7n + 1) {
	border-radius: 8px 0 0 8px;
}

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

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

/* Days a given tier can't be sponsored on (e.g. only Saturdays for a Shabbos,
   only class days for a class): visible for context, but not pickable. */
.weekpick__day--disabled {
	color: var(--line);
	cursor: default;
	pointer-events: none;
}

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

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

.weekpick__day--in-week {
	background: var(--accent);
	color: #fff;
	font-weight: 600;
}

.weekpick__day--in-week.weekpick__day--muted {
	color: #fff;
}

/* Month mode: a 3-column grid of month buttons instead of the day calendar. */
.weekpick__grid--months {
	grid-template-columns: repeat(3, 1fr);
	gap: 0.4rem;
	padding: 0.25rem 0;
}

.weekpick__monthcell {
	padding: 0.6rem 0;
	border: 1px solid transparent;
	border-radius: 8px;
	background: var(--sand);
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ink);
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

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

.weekpick__monthcell--today {
	border-color: var(--accent);
	color: var(--accent);
}

.weekpick__monthcell--selected {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

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

/*
 * Pay-later confirmation. Replaces the form once a Zelle or check pledge is
 * recorded, so the closing screen is the instructions rather than a thank-you
 * the sponsor closes and forgets. Card payments land here too, saying the
 * charge went through.
 */
.sponsor-modal__done[hidden] {
	display: none;
}

.sponsor-modal__done {
	text-align: center;
	padding: 0.5rem 0 0;
}

.sponsor-modal__done-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 1rem;
	display: block;
	transform: scale(0);
	animation: sponsor-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.sponsor-modal__done-icon-circle {
	stroke: #1e8e5a;
	stroke-width: 3;
	stroke-dasharray: 151;
	stroke-dashoffset: 151;
	animation: sponsor-draw 0.5s ease-out forwards;
}

.sponsor-modal__done-icon-check {
	stroke: #1e8e5a;
	stroke-width: 4;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 36;
	stroke-dashoffset: 36;
	animation: sponsor-draw 0.3s ease-out 0.45s forwards;
}

.sponsor-modal__done-title {
	margin: 0 0 0.5rem;
	font-size: 1.2rem;
	font-weight: 700;
	opacity: 0;
	animation: sponsor-fade-up 0.4s ease-out 0.55s forwards;
}

.sponsor-modal__done-text {
	margin: 0 0 1.5rem;
	line-height: 1.6;
	opacity: 0;
	animation: sponsor-fade-up 0.4s ease-out 0.68s forwards;
}

.sponsor-modal__done .button {
	opacity: 0;
	animation: sponsor-fade-up 0.4s ease-out 0.8s forwards;
}

@keyframes sponsor-bounce {
	0% {
		transform: scale(0);
	}
	60% {
		transform: scale(1.12);
	}
	100% {
		transform: scale(1);
	}
}

@keyframes sponsor-draw {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes sponsor-fade-up {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sponsor-modal__done-icon,
	.sponsor-modal__done-icon-circle,
	.sponsor-modal__done-icon-check,
	.sponsor-modal__done-title,
	.sponsor-modal__done-text,
	.sponsor-modal__done .button {
		animation: none;
		stroke-dashoffset: 0;
		opacity: 1;
		transform: none;
	}
}
