/* Daylight Partners
   Mobile first. Inherits Avada typography on purpose; only layout, spacing and
   a single accent are set here, so the grid keeps matching the theme.
   Override any value on .dlp-partners in Avada > Theme Options > Custom CSS. */

.dlp-partners {
	--dlp-columns: 4;        /* desktop only, set inline from the shortcode */
	--dlp-card-min: 250px;   /* smallest a card may get before columns drop */
	--dlp-gap: 1.5rem;
	--dlp-accent: #2f5233;
	--dlp-muted: rgba(0, 0, 0, .58);
	--dlp-rule: rgba(0, 0, 0, .12);
	--dlp-tap: 44px;         /* minimum comfortable touch target */

	max-width: 100%;
}

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

/* Grid ---------------------------------------------------------------
   Below the desktop breakpoint the track count is derived from available
   width rather than hard-coded, so the grid behaves correctly inside any
   Avada column, not just at full page width. min(100%, …) stops a card from
   forcing horizontal scroll on a 320px screen. auto-fill rather than auto-fit
   keeps a single filtered result card-sized instead of stretching it across
   the whole row. */

.dlp-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--dlp-card-min)), 1fr));
	gap: var(--dlp-gap);
	margin: 0;
}

@media (min-width: 1025px) {
	.dlp-partners {
		--dlp-gap: 2rem;
	}

	.dlp-grid {
		grid-template-columns: repeat(var(--dlp-columns), minmax(0, 1fr));
	}
}

/* Filter toggle (small screens only) ---------------------------------- */

.dlp-filters-toggle {
	display: none;
	width: 100%;
	min-height: var(--dlp-tap);
	margin: 0 0 1rem;
	padding: .7rem 1rem;
	font: inherit;
	font-size: 1rem;
	text-align: left;
	background: #fff;
	border: 1px solid var(--dlp-rule);
	border-radius: 2px;
	color: inherit;
	cursor: pointer;
}

.dlp-filters-toggle::after {
	content: "";
	float: right;
	width: .5rem;
	height: .5rem;
	margin-top: .35rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .15s ease;
}

.dlp-filters-toggle[aria-expanded="true"]::after {
	transform: rotate(-135deg);
	margin-top: .6rem;
}

.dlp-filters-toggle .dlp-toggle-count {
	color: var(--dlp-accent);
	font-weight: 600;
}

/* Filters ------------------------------------------------------------- */

.dlp-filters {
	display: grid;
	grid-template-columns: 1fr;
	gap: .9rem;
	padding: 0 0 1.25rem;
	margin: 0 0 1.75rem;
	border-bottom: 1px solid var(--dlp-rule);
}

.dlp-filters.is-collapsed {
	display: none;
}

.dlp-field {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	min-width: 0;
}

.dlp-field label {
	margin: 0;
	font-size: .8125rem;
	letter-spacing: .01em;
	color: var(--dlp-muted);
}

.dlp-filters select,
.dlp-filters input[type="search"] {
	width: 100%;
	min-height: var(--dlp-tap);
	padding: .55rem .7rem;
	font: inherit;
	/* 16px keeps iOS Safari from zooming the page on focus. */
	font-size: 16px;
	line-height: 1.3;
	background: #fff;
	border: 1px solid var(--dlp-rule);
	border-radius: 2px;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.dlp-filters select {
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 13px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 2.25rem;
}

.dlp-filters select:focus-visible,
.dlp-filters input:focus-visible,
.dlp-filters-toggle:focus-visible,
.dlp-reset:focus-visible,
.dlp-card a:focus-visible {
	outline: 2px solid var(--dlp-accent);
	outline-offset: 2px;
}

.dlp-reset {
	min-height: var(--dlp-tap);
	padding: .55rem 1rem;
	font: inherit;
	font-size: .9375rem;
	background: none;
	border: 1px solid var(--dlp-rule);
	border-radius: 2px;
	color: var(--dlp-muted);
	cursor: pointer;
	justify-self: start;
}

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

.dlp-count {
	margin: 0;
	font-size: .875rem;
	color: var(--dlp-muted);
}

@media (min-width: 700px) {
	.dlp-filters {
		grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
		align-items: end;
		gap: 1rem 1.25rem;
	}

	.dlp-reset {
		align-self: end;
	}

	.dlp-count {
		grid-column: 1 / -1;
	}
}

/* Cards --------------------------------------------------------------- */

.dlp-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.dlp-card[hidden] {
	display: none;
}

.dlp-card__media {
	margin: 0 0 .9rem;
	line-height: 0;
}

.dlp-card__img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

.dlp-card__title {
	margin: 0 0 .15rem;
	font-size: 1.125rem;
	line-height: 1.25;
	overflow-wrap: break-word;
}

.dlp-card__title a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.dlp-card__title a:hover {
	border-bottom-color: currentColor;
}

.dlp-card__location {
	margin: 0 0 .6rem;
	font-size: .8125rem;
	color: var(--dlp-muted);
}

.dlp-card__text {
	margin: 0 0 .75rem;
	font-size: .9375rem;
	line-height: 1.55;
	overflow-wrap: break-word;
}

.dlp-card__programs {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
	margin: 0 0 .75rem;
	padding: 0;
}

.dlp-card__programs li {
	--dlp-tag: var(--dlp-accent);
	font-size: .75rem;
	line-height: 1.3;
	padding: .35rem .5rem;
	border: 1px solid var(--dlp-rule);
	border-left: 3px solid var(--dlp-tag);
	border-radius: 2px;
	color: var(--dlp-muted);
}

.dlp-card__more {
	display: inline-block;
	margin-top: auto;
	padding: .35rem 0;
	font-size: .875rem;
	color: var(--dlp-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* On touch screens the read-more link is the tap target, so give it room. */
@media (hover: none) {
	.dlp-card__more {
		min-height: var(--dlp-tap);
		display: flex;
		align-items: flex-end;
	}
}

.dlp-no-results,
.dlp-empty {
	padding: 2rem 0;
	color: var(--dlp-muted);
}

@media (max-width: 699px) {
	.dlp-filters-toggle {
		display: block;
	}

	.dlp-filters {
		padding-bottom: 1rem;
		margin-bottom: 1.25rem;
	}

	.dlp-card__title {
		font-size: 1.0625rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dlp-filters-toggle::after {
		transition: none;
	}
}
