/* Rescue Listings: neutral, themeable styles. Override the --rl-* variables in your theme to restyle.
 *
 * Photo shape (works with any theme): every animal photo is shown in one fixed box so cards line up whatever the
 * shape of the original. Change the shape or focal point from your theme or Additional CSS, for example:
 *   :root { --rl-photo-ratio: 1 / 1; --rl-photo-position: center 20%; }
 *   --rl-photo-ratio     shape of the card photos (default 4 / 3)
 *   --rl-detail-ratio    shape of the large photo on the detail view (default 4 / 3)
 *   --rl-photo-position  which part of the photo stays visible when it is cropped (default center 30%, which keeps faces) */
.rl-wrap {
	--rl-gap: 1.25rem;
	--rl-radius: 8px;
	--rl-border: rgba(0, 0, 0, 0.12);
	--rl-muted: rgba(0, 0, 0, 0.6);
	--rl-accent: currentColor;
	--rl-card-bg: transparent;
	box-sizing: border-box;
}
.rl-wrap *,
.rl-wrap *::before,
.rl-wrap *::after {
	box-sizing: inherit;
}

.rl-grid {
	display: grid;
	gap: var(--rl-gap);
	list-style: none;
	margin: 0;
	padding: 0;
	grid-template-columns: repeat(var(--rl-cols, 3), minmax(0, 1fr));
	align-items: stretch;
}
.rl-cols-1 { --rl-cols: 1; }
.rl-cols-2 { --rl-cols: 2; }
.rl-cols-3 { --rl-cols: 3; }
.rl-cols-4 { --rl-cols: 4; }
.rl-cols-5 { --rl-cols: 5; }
@media (max-width: 900px) {
	.rl-grid { grid-template-columns: repeat(min(var(--rl-cols, 3), 2), minmax(0, 1fr)); }
}
@media (max-width: 520px) {
	.rl-grid { grid-template-columns: minmax(0, 1fr); }
}

.rl-card {
	margin: 0;
	padding: 0;
	border: 1px solid var(--rl-border);
	border-radius: var(--rl-radius);
	background: var(--rl-card-bg);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.rl-card-link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}
.rl-card-link:hover .rl-name,
.rl-card-link:focus .rl-name { text-decoration: underline; }
.rl-photo {
	display: block;
	position: relative;
	flex: none;
	aspect-ratio: var(--rl-photo-ratio, 4 / 3);
	background: rgba(0, 0, 0, 0.06);
	overflow: hidden;
}
.rl-photo img {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--rl-photo-position, center 30%);
	margin: 0;
}
.rl-nophoto {
	display: flex;
	position: absolute;
	inset: 0;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 0.9em;
	color: var(--rl-muted);
}
.rl-name { display: block; padding: 0.75rem 0.9rem 0; font-weight: 700; font-size: 1.1em; }
.rl-meta { display: block; margin-top: auto; padding: 0.15rem 0.9rem 0; color: var(--rl-muted); font-size: 0.9em; }
.rl-status { display: block; padding: 0.4rem 0.9rem 0.8rem; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--rl-muted); }
.rl-featured { border-color: var(--rl-accent); }

.rl-notice { padding: 1rem; border: 1px solid var(--rl-border); border-radius: var(--rl-radius); }
.rl-admin-note { font-size: 0.85em; color: var(--rl-muted); border-style: dashed; }

.rl-back { margin: 0 0 1rem; }
.rl-title { margin: 0 0 1rem; }
.rl-detail-body { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) {
	.rl-detail-body { grid-template-columns: minmax(0, 1fr); }
}
.rl-main { display: block; width: 100%; height: auto; aspect-ratio: var(--rl-detail-ratio, 4 / 3); object-fit: cover; object-position: var(--rl-photo-position, center 30%); border-radius: var(--rl-radius); }
.rl-main--empty { position: relative; background: rgba(0, 0, 0, 0.06); }
.rl-thumbs { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr)); list-style: none; margin: 0.5rem 0 0; padding: 0; }
.rl-thumbs li { margin: 0; }
.rl-thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: var(--rl-photo-position, center 30%); border-radius: 4px; }
.rl-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0 0 1rem; }
.rl-facts dt { font-weight: 600; margin: 0; }
.rl-facts dd { margin: 0; }
.rl-description > :first-child { margin-top: 0; }

.rl-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0 0 0.75rem; }
.rl-card-tags { padding: 0 0.9rem 0.8rem; }
.rl-card-tags .rl-tags { margin: 0; }
.rl-tag { display: inline-block; padding: 0.1rem 0.55rem; border: 1px solid var(--rl-border); border-radius: 999px; font-size: 0.75em; }

/* Donation / payment embeds (the app's own pages in an iframe) */
.rl-pay { margin: 1.5rem 0; }
.rl-pay-frame { display: block; width: 100%; min-height: 300px; border: 0; background: transparent; }
.rl-pay-fallback { margin: .75rem 0 0; font-size: .9em; color: #475569; }
.rl-pay-link { display: inline-block; padding: 0.6rem 1.1rem; border-radius: var(--rl-radius); background: var(--rl-pay-bg, #1e3a5f); color: #fff; font-weight: 600; text-decoration: none; }
.rl-pay-link:hover, .rl-pay-link:focus { filter: brightness(0.92); color: #fff; }
