/**
 * Sponsors.
 *
 * Two pieces: the logo band and the tiers cards. Both size themselves from the
 * level's prominence rather than from a fixed class list, because levels are
 * per-site config and a PTA can add a fourth one without touching CSS.
 *
 * No Tailwind here, and no theme-only tokens assumed: this has to render under
 * a foreign theme where no utilities are loaded, as Cox was under Divi until 2026-08-08. It uses
 * the --pta-* custom properties, which the plugin prints on every front-end
 * page, with literal fallbacks for anything that might be missing.
 */

/* ---- The logo band ---------------------------------------------------- */

.pta-sp-band {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 2.5rem 3rem;
}

.pta-sp-item {
	/* --pta-sp-w is set inline, from the level's prominence step. */
	flex: 0 1 var(--pta-sp-w, 220px);
	max-width: var(--pta-sp-w, 220px);
	text-align: center;
}

.pta-sp-link {
	display: block;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

a.pta-sp-link:hover,
a.pta-sp-link:focus-visible {
	transform: translateY(-3px);
	opacity: 0.9;
}

.pta-sp-logo {
	display: block;
	width: 100%;
	height: auto;
	/*
	 * Cap the height as well as the width. Sponsor artwork arrives in whatever
	 * shape the business has: a tall stacked logo next to a wide wordmark at
	 * the same width makes the tall one tower over a level it did not pay for.
	 */
	max-height: calc(var(--pta-sp-w, 220px) * 0.55);
	object-fit: contain;
	margin: 0 auto;
}

/* Name shown when a sponsor has no logo yet. */
.pta-sp-name {
	display: block;
	font-family: var(--pta-font-heading, inherit);
	font-weight: 700;
	line-height: 1.25;
	color: inherit;
}

.pta-sp-item--large .pta-sp-name {
	font-size: 1.5rem;
}

.pta-sp-item--medium .pta-sp-name {
	font-size: 1.25rem;
}

.pta-sp-item--small .pta-sp-name {
	font-size: 1.05rem;
}

@media (max-width: 640px) {
	.pta-sp-band {
		gap: 1.75rem 2rem;
	}

	/*
	 * On a phone the prominence steps stop being readable as sizes: a 320px
	 * and a 220px logo both just fill the column. Levels still order the band,
	 * which is what a sponsor is actually buying at that width.
	 */
	.pta-sp-item {
		flex-basis: min(var(--pta-sp-w, 220px), 42vw);
		max-width: min(var(--pta-sp-w, 220px), 42vw);
	}
}

/* ---- The tiers cards --------------------------------------------------- */

.pta-sp-levels {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1.5rem;
	align-items: start;
}

.pta-sp-level {
	background: var(--pta-white, #fff);
	border: 1px solid var(--pta-line, rgba(0, 0, 0, 0.1));
	border-radius: var(--pta-radius, 10px);
	box-shadow: var(--pta-shadow, 0 2px 10px rgba(0, 0, 0, 0.08));
	padding: 1.5rem;
}

/*
 * The top level looks like the top level. Prominence drives the tiers card as
 * well as the logo, so the page that sells sponsorship makes the same promise
 * the home page keeps.
 */
.pta-sp-level--large {
	border-top: 4px solid var(--pta-primary, #091e3d);
}

.pta-sp-level-label {
	margin: 0 0 0.25rem;
	font-family: var(--pta-font-heading, inherit);
	color: var(--pta-primary, #091e3d);
}

.pta-sp-level--large .pta-sp-level-label {
	font-size: 1.5rem;
}

.pta-sp-level-amount {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--pta-ink, #1a1a1a);
}

.pta-sp-level-benefits {
	margin: 0;
	padding-left: 1.15rem;
	line-height: 1.6;
}

.pta-sp-level-benefits li + li {
	margin-top: 0.4rem;
}

/* ---- Standalone (foreign theme) --------------------------------------- */

/*
 * Under a theme that gives the shortcode no content width, the module
 * constrains itself. Same pattern as the other modules.
 */
.pta-sp-standalone {
	max-width: var(--pta-maxw, 1200px);
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}
