/**
 * Listings, dog profile and single post layout. Colours come from the Neve
 * palette, so they follow the Customizer; the card look mirrors the front
 * page adoption cards and the gutters match the front page sections.
 */

:root {
	--psi-gutter: 80px;
	--psi-content: 1280px;
	--psi-card-bg: #f2f2f2;
	--psi-radius: 16px;
	--psi-accent: var(--nv-primary-accent, #dc3c41);
	--psi-text: var(--nv-text-color, #272626);
}

@media (max-width: 1024px) {
	:root {
		--psi-gutter: 64px;
	}
}

@media (max-width: 767px) {
	:root {
		--psi-gutter: 32px;
	}
}

.psi-wrap {
	box-sizing: border-box;
	max-width: calc(var(--psi-content) + 2 * var(--psi-gutter));
	margin-inline: auto;
	padding-inline: var(--psi-gutter);
}

/* Neve's full-width container left post text touching the window edges. */
.single-post .single-post-container.container-fluid {
	max-width: calc(var(--psi-content) + 2 * var(--psi-gutter));
	padding-inline: var(--psi-gutter);
}

.single-post .single-post-container > .row {
	margin-inline: 0;
}

.single-post .single-post-container .nv-single-post-wrap {
	padding-inline: 0;
}

.psi-listing-title {
	margin-block: 48px 0;
	font-size: 40px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--psi-text);
}

@media (max-width: 767px) {
	.psi-listing-title {
		margin-top: 32px;
		font-size: 32px;
	}
}

.psi-listing {
	margin-block: 32px 64px;
}

.psi-listing__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 28px;
}

.psi-listing__empty {
	margin-block: 32px;
}

.psi-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--psi-radius);
	background: var(--psi-card-bg);
	color: var(--psi-text);
}

/**
 * The image is taken out of flow: with "aspect-ratio" alone a taller photo
 * still stretches the box, and cards in one row came out uneven.
 */
.psi-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #e6e6e6;
}

.psi-card--dog .psi-card__media {
	aspect-ratio: 2 / 3;
}

/* Project posts have no images at all; an empty box on each card would only look broken. */
.psi-card--event .psi-card__media--empty {
	display: none;
}

.psi-card__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.psi-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
}

.psi-card__title {
	margin: 0;
	font-size: 24px;
	line-height: 1.2;
}

.psi-card--article .psi-card__title,
.psi-card--event .psi-card__title {
	font-size: 20px;
	line-height: 1.3;
}

.psi-card__title a {
	color: inherit;
	text-decoration: none;
}

.psi-card__title a:hover,
.psi-card__title a:focus-visible {
	color: var(--psi-accent);
}

.psi-card__date {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--psi-accent);
}

.psi-card__excerpt {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
}

/**
 * Doubled selectors: Neve spaces every list inside ".nv-content-wrap"
 * (30 px around the list, 10 px above each item) with higher specificity.
 */
.psi-card .psi-card__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.psi-card__chips .psi-chip {
	display: inline-flex;
	margin: 0;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	border-radius: var(--psi-radius);
	background: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
}

.psi-icon {
	flex: none;
	width: auto;
	height: 12px;
}

/* Pushes the button to the card bottom, so buttons line up across a row. */
.psi-card__cta {
	align-self: flex-start;
	margin-top: auto;
	padding: 6px 16px;
	border-radius: 999px;
	background: var(--psi-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
}

.psi-card__cta:hover {
	color: #fff;
	filter: brightness(0.92);
}

.psi-listing__pagination {
	margin-top: 40px;
}

.psi-listing__pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* WordPress puts "page-numbers" on the list itself too, hence the element selectors. */
.psi-listing__pagination a.page-numbers,
.psi-listing__pagination span.page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 8px 12px;
	border-radius: 999px;
	background: var(--psi-card-bg);
	color: var(--psi-text);
	text-align: center;
	text-decoration: none;
}

.psi-listing__pagination span.page-numbers.current {
	background: var(--psi-accent);
	color: #fff;
}

.psi-listing__pagination span.page-numbers.dots {
	background: none;
}

.psi-dog-profile {
	display: grid;
	gap: 16px;
	margin-bottom: 32px;
	padding: 24px;
	border-radius: 16px;
	background: var(--nv-light-bg, #f4f5f7);
}

.psi-dog-profile .psi-dog-profile__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.psi-dog-profile .psi-dog-profile__badges li {
	margin: 0;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--nv-primary-accent, #dc3c41);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
}

.psi-dog-profile__data {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px 24px;
	margin: 0;
}

.psi-dog-profile__row dt {
	font-size: 14px;
	font-weight: 700;
}

/* Neve indents definitions with padding ("dl dd"); the extra class outweighs it. */
.psi-dog-profile .psi-dog-profile__row dd {
	margin: 0;
	padding: 0;
}

.psi-listing-intro {
	margin-top: 32px;
}

/**
 * Phones: a 2:3 photo across the full width made each dog card ~700 px
 * tall, and the profile listed one short fact per line.
 */
@media (max-width: 767px) {
	.psi-card--dog .psi-card__media {
		aspect-ratio: 4 / 3;
	}

	.psi-dog-profile {
		padding: 20px;
	}

	.psi-dog-profile .psi-dog-profile__data {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px 16px;
	}

	.psi-dog-profile__row--wide {
		grid-column: 1 / -1;
	}
}
