/**
 * Apogee Page Resources
 *
 * Tokens match the live site: ink #293f45, sage #9aad9a, Poppins.
 * Sage is too light for text on white (about 2.2:1), so it is used for borders,
 * icons and accents; --apr-accent-ink is the darker sage used for text.
 */

.apr-resources {
	--apr-ink: #293f45;
	--apr-muted: #5f7175;
	--apr-accent: #9aad9a;
	--apr-accent-ink: #5d735d;
	--apr-line: #dfe5df;
	--apr-surface: #f3f6f3;
	--apr-radius: 4px;
	--apr-band: #293f45;
	--apr-gap: 16px;
	--apr-related-cols: var(--apr-related-cols-max, 6);

	display: flex;
	flex-direction: column;
	gap: 48px;
	margin: 8px 0 40px;
	color: var(--apr-ink);
}

.apr-resources ul {
	list-style: none;
	margin: 0 !important; /* themes indent lists in content areas */
	padding: 0 !important;
}

.apr-resources li {
	margin: 0;
	padding: 0;
}

.apr-resources li::before {
	content: none;
}

.apr-section__title {
	margin: 0 0 16px;
}

/* ---------------------------------------------------------------- Downloads */

.apr-downloads {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 12px;
}

.apr-download a {
	display: flex;
	align-items: center;
	gap: 14px;
	height: 100%;
	box-sizing: border-box;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid var(--apr-line);
	border-radius: var(--apr-radius);
	color: var(--apr-ink);
	text-decoration: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.apr-download a:hover,
.apr-download a:focus-visible {
	border-color: var(--apr-accent);
	box-shadow: 0 4px 14px rgba(41, 63, 69, .08);
	transform: translateY(-1px);
	color: var(--apr-ink);
}

.apr-download__icon {
	position: relative;
	flex: 0 0 40px;
	height: 48px;
	color: var(--apr-accent);
}

.apr-download__icon svg {
	display: block;
}

.apr-download__ext {
	position: absolute;
	left: 50%;
	bottom: 8px;
	transform: translateX(-50%);
	padding: 1px 4px;
	border-radius: 2px;
	background: var(--apr-ink);
	color: #fff;
	font-size: 9px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .04em;
}

.apr-download__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.apr-download__title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.apr-download__meta {
	font-size: 13px;
	color: var(--apr-muted);
}

.apr-download__arrow {
	flex: 0 0 auto;
	margin-left: auto;
	color: var(--apr-accent-ink);
	transition: transform .2s ease;
}

.apr-download__arrow svg {
	display: block;
}

.apr-download a:hover .apr-download__arrow {
	transform: translateY(2px);
}

/* ----------------------------------------------------------- Media gallery */

/* Without JS this is a plain grid; page-resources.js adds .is-masonry and positions
   the items into the shortest column. Column count comes from the grid definition,
   so the media queries below control both layouts. */
.apr-gallery {
	--apr-gallery-cols: 6;
	--apr-gallery-gap: 12px;
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--apr-gallery-cols), minmax(0, 1fr));
	gap: var(--apr-gallery-gap);
	align-items: start;
}

.apr-gallery[data-cols="1"] { --apr-gallery-cols: 1; }
.apr-gallery[data-cols="2"] { --apr-gallery-cols: 2; }
.apr-gallery[data-cols="3"] { --apr-gallery-cols: 3; }
.apr-gallery[data-cols="4"] { --apr-gallery-cols: 4; }
.apr-gallery[data-cols="5"] { --apr-gallery-cols: 5; }
.apr-gallery[data-cols="6"] { --apr-gallery-cols: 6; }
.apr-gallery[data-cols="7"] { --apr-gallery-cols: 7; }
.apr-gallery[data-cols="8"] { --apr-gallery-cols: 8; }

.apr-gallery.is-masonry .apr-gallery__item {
	position: absolute;
	top: 0;
	left: 0;
	transition: transform .3s ease;
}

.apr-gallery__item {
	margin: 0 !important;
	padding: 0;
}

.apr-gallery__link {
	display: block;
	overflow: hidden;
	margin: 0 !important;
	border-radius: 4px;
	line-height: 0;
	background: var(--apr-surface);
	cursor: zoom-in;
}

.apr-gallery__img {
	display: block;
	width: 100% !important;
	height: auto !important;
	max-width: 100%;
}

.apr-gallery__link {
	transition: transform .2s ease, box-shadow .2s ease;
}

.apr-gallery__link:hover,
.apr-gallery__link:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 8px 18px rgba(41, 63, 69, .18);
}

.apr-gallery__link:focus-visible {
	outline: 2px solid var(--apr-accent-ink);
	outline-offset: 2px;
}

/* ------------------------------------------------------------ Testimonials */

.apr-testimonials {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: var(--apr-gap);
}

.apr-testimonial {
	margin: 0;
	padding: 22px 24px;
	background: var(--apr-surface);
	border-left: 3px solid var(--apr-accent);
	border-radius: 0 var(--apr-radius) var(--apr-radius) 0;
}

.apr-testimonial__quote {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 15px;
	font-style: italic;
	line-height: 1.6;
	color: var(--apr-ink);
}

.apr-testimonial__quote p {
	margin: 0 0 .75em;
}

.apr-testimonial__quote p:last-child {
	margin-bottom: 0;
}

.apr-testimonial__customer {
	margin-top: 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--apr-accent-ink);
}

.apr-testimonial__customer::before {
	content: "\2014\00a0";
}

/* -------------------------------------------------------- Related projects */

/* Dark band. The box-shadow + clip-path pair paints the background out to the
   edges of the window without changing layout or needing a full-width row. */
.apr-section--related {
	position: relative;
	margin-top: 8px;
	padding: 44px 0 52px;
	background: var(--apr-band);
	box-shadow: 0 0 0 100vmax var(--apr-band);
	clip-path: inset(0 -100vmax);
	color: #fff;
}

/* No white strip between the band and whatever follows when it is the last section */
.apr-resources:has(> .apr-section--related:last-child) {
	margin-bottom: 0;
}

.apr-resources--contained .apr-section--related {
	padding: 32px;
	box-shadow: none;
	clip-path: none;
	border-radius: var(--apr-radius);
}

.apr-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: 18px;
}

.apr-section__head .apr-section__title {
	margin: 0;
}

.apr-section--related .apr-section__title {
	color: #fff;
}

.apr-section__all,
.apr-section__all:visited {
	font-size: 14px;
	font-weight: 600;
	color: var(--apr-accent);
	text-decoration: none;
	white-space: nowrap;
}

.apr-section__all:hover,
.apr-section__all:focus-visible {
	color: #fff;
}

.apr-projects {
	display: grid;
	grid-template-columns: repeat(var(--apr-related-cols), minmax(0, 1fr));
	gap: 20px var(--apr-gap);
}

.apr-project {
	display: flex;
}

.apr-project a,
.apr-project a:visited {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	background: #fff;
	border-radius: var(--apr-radius);
	color: var(--apr-ink);
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease;
}

.apr-project a:hover,
.apr-project a:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 0 0 2px var(--apr-accent), 0 10px 24px rgba(0, 0, 0, .35);
	outline: none;
}

.apr-project__media {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--apr-surface);
}

.apr-project__media img {
	display: block;
	width: 100%;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
}

.apr-project__media--empty {
	background:
		linear-gradient(135deg, transparent 0 48%, var(--apr-line) 48% 52%, transparent 52% 100%),
		var(--apr-surface);
}

.apr-project__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 12px 14px 14px;
}

.apr-project__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	color: var(--apr-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
}

.apr-project__more {
	margin-top: auto;
	color: var(--apr-accent-ink);
	font-size: 12px;
	font-weight: 600;
}

/* -------------------------------------------------------------- Responsive */

@media (max-width: 1024px) {
	.apr-resources {
		--apr-related-cols: 4;
	}
}

@media (max-width: 900px) {
	.apr-gallery[data-cols="4"],
	.apr-gallery[data-cols="5"],
	.apr-gallery[data-cols="6"],
	.apr-gallery[data-cols="7"],
	.apr-gallery[data-cols="8"] {
		--apr-gallery-cols: 3;
	}
}

@media (max-width: 560px) {
	.apr-resources {
		--apr-related-cols: 2;
		gap: 36px;
	}

	.apr-downloads,
	.apr-testimonials {
		grid-template-columns: 1fr;
	}

	.apr-gallery:not([data-cols="1"]) {
		--apr-gallery-cols: 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apr-download a,
	.apr-download__arrow,
	.apr-project a,
	.apr-gallery__link,
	.apr-gallery.is-masonry .apr-gallery__item {
		transition: none;
	}
}
