/**
 * Recipe WP — collections (recipe books & roundups).
 *
 * Same idea as the card: every color and size is a custom property
 * on .rwp-collection, set inside :where() so any theme rule wins.
 * Buttons (.rwp-button) and stars (.rwp-stars) come from recipe-card.css.
 */

:where(.rwp-collection) {
	--rwp-bg: #ffffff;
	--rwp-text: inherit;
	--rwp-muted: #6b6b6b;
	--rwp-border: #e2e2e2;
	--rwp-accent: #b5401f;
	--rwp-accent-text: #ffffff;
	--rwp-radius: 8px;
	--rwp-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	--rwp-font-heading: inherit;
	--rwp-font-label: inherit; /* The "No. 1" labels. */
	--rwp-bg-image: none;
}

.rwp-collection {
	margin: 2em 0;
	container-type: inline-size; /* Lets items adapt to the column they're in. */
}

.rwp-collection__items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rwp-collection__item {
	margin: 0;
	color: var(--rwp-text);
	background: var(--rwp-bg);
	background-image: var(--rwp-bg-image);
	border: 1px solid var(--rwp-border);
	border-radius: var(--rwp-radius);
	box-shadow: var(--rwp-shadow);
	overflow: hidden;
}

.rwp-collection__image {
	display: block;
}

.rwp-collection__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.rwp-collection__body {
	padding: 16px 18px 18px;
}

.rwp-collection__num {
	display: block;
	margin-bottom: 0.2em;
	font-family: var(--rwp-font-label);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rwp-accent);
}

.rwp-collection__title {
	margin: 0 0 0.35em;
	font-family: var(--rwp-font-heading);
	line-height: 1.2;
}

.rwp-collection__title a {
	color: inherit;
	text-decoration: none;
}

.rwp-collection__title a:hover,
.rwp-collection__title a:focus-visible {
	text-decoration: underline;
}

.rwp-collection__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 0.6em;
	font-size: 0.875rem;
	color: var(--rwp-muted);
}

.rwp-collection__desc {
	margin: 0 0 0.75em;
}

.rwp-collection__link {
	margin: 0;
	font-weight: 600;
}

.rwp-collection__link a {
	color: var(--rwp-accent);
}

.rwp-collection__download {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 1.5em;
}

.rwp-collection__size {
	font-size: 0.85rem;
	color: var(--rwp-muted);
}

.rwp-collection__more {
	margin: 1.5em 0 0;
	text-align: center;
}

/* ---------- List (roundup): photo beside text, one per row ---------- */

.rwp-collection--list .rwp-collection__items {
	display: grid;
	gap: 24px;
}

.rwp-collection--list .rwp-collection__title {
	font-size: 1.5rem;
}

@container (min-width: 600px) {
	.rwp-collection--list .rwp-collection__item {
		display: grid;
		grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	}

	.rwp-collection--list .rwp-collection__item--noimage {
		display: block;
	}

	.rwp-collection--list .rwp-collection__image img {
		height: 100%;
	}

	.rwp-collection--list .rwp-collection__body {
		align-self: center;
		padding: 20px 24px;
	}
}

/* ---------- Grid: small cards ---------- */

.rwp-collection--grid .rwp-collection__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 20px;
}

.rwp-collection--grid .rwp-collection__title {
	font-size: 1.1rem;
}

/* ---------- Email-for-download form ([rwp_download] / gated collections) ---------- */

.rwp-gate {
	max-width: 560px;
	margin: 0 0 2em;
	padding: 20px 22px;
	color: var(--rwp-text);
	background: var(--rwp-bg);
	background-image: var(--rwp-bg-image);
	border: 1px solid var(--rwp-border);
	border-radius: var(--rwp-radius);
	box-shadow: var(--rwp-shadow);
}

.rwp-gate__title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
	margin: 0 0 12px;
	font-family: var(--rwp-font-heading);
	font-size: 1.25rem;
	font-weight: 700;
}

.rwp-gate__fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}

.rwp-gate__field span {
	display: block;
	margin-bottom: 4px;
	font-size: 0.85rem;
	font-weight: 600;
}

.rwp-gate__field abbr {
	text-decoration: none;
	color: var(--rwp-accent);
}

.rwp-gate__field input {
	box-sizing: border-box;
	width: 100%;
	padding: 9px 11px;
	font: inherit;
	background: #fff;
	border: 1px solid var(--rwp-border);
	border-radius: 4px;
}

.rwp-gate__consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 12px 0 14px;
	font-size: 0.875rem;
	color: var(--rwp-muted);
}

.rwp-gate__consent input {
	margin-top: 0.2em;
}

.rwp-gate__hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.rwp-gate button.rwp-button {
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}

.rwp-gate__error {
	margin: 0 0 12px;
	padding: 8px 12px;
	color: #8a1f11;
	background: #fbeae5;
	border-radius: 4px;
}

.rwp-gate--done p:last-child {
	margin-bottom: 0;
}
