/**
 * DSTL State Affiliates – front-end styles.
 *
 * Kept intentionally light-touch: layout + the modal + accents, with text
 * colors inheriting from the surrounding (dark) footer where possible so the
 * output blends into the existing Divi design.
 */

/* ---- Donate button (image stays pixel-identical to the current button) ---- */
.dstl-donate {
	display: inline-block;
}
.dstl-donate__btn {
	display: inline-block;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
}
.dstl-donate__img {
	display: block;
	max-width: 100%;
	height: auto;
}
.dstl-donate__trigger:focus-visible {
	outline: 3px solid #ec1e79;
	outline-offset: 3px;
	border-radius: 8px;
}
.dstl-donate__text {
	display: inline-block;
	padding: 14px 28px;
	border-radius: 40px;
	background: linear-gradient(90deg, #f5b52b 0%, #ec1e79 55%, #a12ec2 100%);
	color: #fff;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	line-height: 1;
}

/* ---- Modal ---- */
.dstl-modal {
	position: fixed;
	inset: 0;
	/* Maximum stacking value, forced, so nothing on the page can paint over it. */
	z-index: 2147483647 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.dstl-modal__backdrop {
	z-index: 2147483646 !important;
}
.dstl-modal__box {
	z-index: 2147483647 !important;
}
.dstl-modal[hidden] {
	display: none;
}
.dstl-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
}
.dstl-modal__box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 440px;
	max-height: 85vh;
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border-radius: 12px;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
	padding: 28px 26px 30px;
	text-align: center;
}
.dstl-modal__x {
	position: absolute;
	top: 8px;
	right: 12px;
	border: 0;
	background: none;
	font-size: 28px;
	line-height: 1;
	color: #888;
	cursor: pointer;
}
.dstl-modal__x:hover {
	color: #1a1a1a;
}
.dstl-modal__title {
	margin: 0 0 16px;
	font-size: 1.4rem;
	color: #ec1e79;
}

/* ---- State list inside the modal ---- */
.dstl-state-list {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
	text-align: left;
}
.dstl-state-list li {
	margin: 0 0 8px;
}
.dstl-state-link {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border: 1px solid #eee;
	border-radius: 8px;
	background: #faf7f9;
	text-decoration: none;
	color: #1a1a1a;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.dstl-state-link:hover,
.dstl-state-link:focus {
	background: #fdeaf3;
	border-color: #ec1e79;
}
.dstl-state-link__name {
	font-weight: 700;
}
.dstl-state-link__org {
	font-size: 0.85em;
	color: #777;
}
.dstl-notshown-link {
	border: 0;
	background: none;
	color: #a12ec2;
	text-decoration: underline;
	cursor: pointer;
	font-size: 0.95rem;
	padding: 6px;
}

/* ---- Modal buttons (not-shown view) ---- */
.dstl-btn {
	display: inline-block;
	margin: 8px 0 0;
	padding: 12px 22px;
	border-radius: 40px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	border: 2px solid transparent;
}
.dstl-btn--donate {
	background: linear-gradient(90deg, #f5b52b 0%, #ec1e79 55%, #a12ec2 100%);
	color: #fff;
}
.dstl-btn--outline {
	background: #fff;
	color: #ec1e79;
	border-color: #ec1e79;
}
.dstl-notshown__or {
	margin: 18px 0 4px;
}

/* ---- Affiliates grid ---- */
.dstl-affiliates {
	margin: 0 0 10px;
}
.dstl-affiliates__heading,
.dstl-featured__heading {
	margin: 0 0 16px;
	/* Divi's default h3 color is #333 — near-invisible on the dark footer.
	   Force white, matching the original Text module. */
	color: var(--dstl-heading-color, #ffffff);
}
/* Rendered as a <p>, not a heading — so give it the weight explicitly, and
   strip Divi's blanket paragraph padding-bottom (1em), which otherwise stacks
   with the margin below and opens a full blank line before the contact lines. */
.dstl-featured__heading {
	font-weight: 700;
	margin: 0 0 8px;
	padding-bottom: 0 !important;
}
.dstl-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	/* The grid as a whole is centered on the page... */
	justify-content: center;
	gap: 26px 34px;
	align-items: flex-start;
}
/* Divi styles content lists via `.et_pb_text ul` (class + element), which
   outranks a plain `.dstl-grid` rule and re-adds disc bullets plus the list
   indent. Raise specificity and force them off. */
ul.dstl-grid,
ul.dstl-grid > li {
	list-style: none !important;
	list-style-type: none !important;
	margin-left: 0;
	padding-left: 0;
}
.dstl-grid__item {
	/* ...and each affiliate entry centers its own content. No max-width: the
	   cell is sized by its content so the name never wraps to a second line. */
	text-align: center;
}
.dstl-grid__link {
	display: inline-block;
	text-decoration: none;
	color: inherit;
}
.dstl-grid__logo {
	/* Every logo occupies an identical box no matter its aspect ratio, so the
	   names underneath always line up — essential once affiliates arrive with
	   logos in every shape. object-fit: contain scales to fit without
	   distorting; the box is centered within its cell. */
	display: block;
	width: 160px;
	height: 90px;
	max-width: 100%;
	object-fit: contain;
	object-position: center;
	margin: 0 auto 8px;
}
.dstl-grid__initials {
	display: inline-block;
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	margin-bottom: 8px;
}
.dstl-grid__name {
	display: block;
	font-size: 0.95rem;
	color: var(--dstl-text-color, #ffffff);
	/* Full org names stay on a single line. */
	white-space: nowrap;
}

/* ---- Featured (curator) block ---- */
.dstl-featured__intro {
	margin: 0 0 16px;
	line-height: 1.7;
	color: var(--dstl-text-color, #ffffff);
}
/* Two columns — logo left, wording right — with the pair centered as a group.
   Each column takes only the width its content needs. */
.dstl-featured__row {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 28px;
	flex-wrap: wrap;
}
.dstl-featured__logowrap {
	flex: 0 0 auto;
	line-height: 0;
}
.dstl-featured__text {
	flex: 0 0 auto;
	text-align: left;
	/* every line stays on one line */
	white-space: nowrap;
}
.dstl-featured__logo {
	/* inline-block so Divi's alignment control (left/center) governs the logo
	   exactly as it governs the text. As a block it ignored text-align. */
	display: inline-block;
	max-width: 240px;
	height: auto;
	margin: 0 0 14px;
}
.dstl-featured__contact {
	/* NOTE: the original contact module is line-height 1.1em with
	   padding-bottom: 1em per line. 1.7 here only approximates that spacing;
	   exact parity needs each line as its own block element. */
	line-height: 1.7;
	color: var(--dstl-text-color, #ffffff);
}

@media (max-width: 600px) {
	.dstl-grid {
		gap: 22px;
		justify-content: center;
	}
	.dstl-state-link {
		flex-direction: column;
		gap: 2px;
	}
}
