/*
 * Recipe pages inside any theme: the theme's fonts, the plugin's structure.
 * A theme or site plugin can retune the look through the custom properties below.
 */
.sublime-recipes-page,
.sr-grid {
	--sr-accent: #1b7c3f;
	--sr-accent-soft: #e8f3eb;
	--sr-ink: #1d2420;
	--sr-muted: #5f6b64;
	--sr-line: #e3e8e4;
	--sr-paper: #ffffff;
	--sr-wash: #f6f8f6;
	--sr-radius: 14px;
	--sr-shadow: 0 1px 2px rgba(20, 30, 24, 0.06), 0 8px 24px rgba(20, 30, 24, 0.06);
}

.sublime-recipes-page {
	max-width: 1200px;
	margin: 0 auto;
	padding-block: 28px 72px;
	padding-inline: 20px;
	box-sizing: border-box;
	color: var(--sr-ink);
}

.sublime-recipes-page *,
.sr-grid * {
	box-sizing: border-box;
}

.sublime-recipes-page ul,
.sublime-recipes-page ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sublime-recipes-page h1,
.sublime-recipes-page h2,
.sublime-recipes-page h3 {
	margin: 0;
	color: var(--sr-ink);
	text-wrap: balance;
}

.sublime-recipes-page a {
	text-decoration: none;
}

.sr-icon {
	flex: none;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Hero (index) ---------- */
.sr-hero {
	display: grid;
	gap: 10px;
	padding: 36px clamp(20px, 4vw, 48px);
	margin-bottom: 28px;
	border-radius: calc(var(--sr-radius) + 6px);
	background: linear-gradient(135deg, var(--sr-accent-soft), var(--sr-wash));
}

.sr-kicker {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--sr-accent);
}

.sr-hero__title {
	margin: 0;
	font-size: clamp(2rem, 4.5vw, 3rem);
	font-weight: 800;
	line-height: 1.08;
	color: var(--sr-ink);
}

.sr-hero__lede {
	max-width: 60ch;
	margin: 0;
	color: var(--sr-muted);
	font-size: 1.05rem;
	line-height: 1.6;
}

.sr-search {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 560px;
	margin-top: 8px;
	padding: 6px 6px 6px 16px;
	border: 1px solid var(--sr-line);
	border-radius: 999px;
	background: var(--sr-paper);
	box-shadow: var(--sr-shadow);
	color: var(--sr-muted);
}

.sr-search input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 40px;
	margin: 0;
	padding: 0 4px;
	border: 0;
	background: transparent;
	font: inherit;
	color: var(--sr-ink);
	box-shadow: none;
	outline: none;
}

.sr-search button {
	height: 40px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--sr-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.sr-search:focus-within {
	border-color: var(--sr-accent);
}

/* ---------- Two-column layout ---------- */
.sr-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.sr-single .sr-layout {
	grid-template-columns: minmax(0, 1fr) 300px;
}

.sr-side {
	position: sticky;
	top: 24px;
	padding: 18px;
	border: 1px solid var(--sr-line);
	border-radius: var(--sr-radius);
	background: var(--sr-paper);
}

.sr-side__title {
	margin: 0 0 12px !important;
	font-size: 0.8rem !important;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sr-muted) !important;
}

.sr-cats {
	display: grid;
	gap: 2px;
	max-height: 70vh;
	overflow-y: auto;
}

.sr-cats a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	color: var(--sr-ink);
	font-size: 0.95rem;
}

.sr-cats a:hover,
.sr-cats a:focus-visible {
	background: var(--sr-wash);
}

.sr-cats a.is-current {
	background: var(--sr-accent-soft);
	color: var(--sr-accent);
	font-weight: 600;
}

.sr-cats__n {
	min-width: 30px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--sr-wash);
	font-size: 0.78rem;
	text-align: center;
	color: var(--sr-muted);
	font-variant-numeric: tabular-nums;
}

.sr-count {
	margin: 0 0 14px;
	font-size: 0.9rem;
	color: var(--sr-muted);
}

/* ---------- Cards ---------- */
.sr-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 22px;
}

.sr-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--sr-line);
	border-radius: var(--sr-radius);
	background: var(--sr-paper);
	color: var(--sr-ink);
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sr-card__link:hover,
.sr-card__link:focus-visible {
	transform: translateY(-3px);
	border-color: transparent;
	box-shadow: var(--sr-shadow);
}

.sr-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.sr-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 16px;
}

.sr-card__cat {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sr-accent);
}

.sr-card__title {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
}

.sr-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin-top: auto;
	padding-top: 6px;
	font-size: 0.82rem;
	color: var(--sr-muted);
}

.sr-card__meta > span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.sr-card__meta .sr-icon {
	width: 15px;
	height: 15px;
}

/* ---------- Picture: photo or ingredient still life ---------- */
.sr-photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.sr-card__link:hover .sr-photo {
	transform: scale(1.04);
}

.sr-collage {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	width: 100%;
	height: 100%;
	padding: 18px;
	background: var(--sr-tint, var(--sr-wash));
}

.sr-collage--1 {
	grid-template-columns: 1fr;
	padding: 22%;
}

.sr-collage--3 > :first-child {
	grid-row: span 2;
}

.sr-collage--5,
.sr-collage--6 {
	grid-template-columns: repeat(3, 1fr);
}

.sr-collage__tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
	padding: 12%;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.82);
	box-shadow: 0 1px 2px rgba(20, 30, 24, 0.06);
	transition: transform 0.3s ease;
}

.sr-collage__tile img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 100%;
	object-fit: contain;
}

.sr-card__link:hover .sr-collage__tile:nth-child(odd) {
	transform: rotate(-3deg) scale(1.03);
}

.sr-card__link:hover .sr-collage__tile:nth-child(even) {
	transform: rotate(3deg) scale(1.03);
}

.sr-collage__letter {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 3rem;
	font-weight: 800;
	color: var(--sr-accent);
	opacity: 0.4;
}

/* ---------- Pagination ---------- */
.sublime-recipes-page .navigation.pagination {
	margin-top: 32px;
}

.sublime-recipes-page .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.sublime-recipes-page .nav-links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--sr-line);
	border-radius: 10px;
	background: var(--sr-paper);
	color: var(--sr-ink);
	font-variant-numeric: tabular-nums;
}

.sublime-recipes-page .nav-links .page-numbers.current {
	border-color: var(--sr-accent);
	background: var(--sr-accent);
	color: #fff;
}

.sublime-recipes-page .nav-links a.page-numbers:hover {
	border-color: var(--sr-accent);
	color: var(--sr-accent);
}

.sublime-recipes-page .nav-links .dots {
	border: 0;
	background: none;
}

.sr-empty {
	padding: 48px 24px;
	border: 1px dashed var(--sr-line);
	border-radius: var(--sr-radius);
	text-align: center;
	color: var(--sr-muted);
}

.sr-empty a {
	color: var(--sr-accent);
	font-weight: 600;
}

/* ---------- Single recipe ---------- */
.sr-crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
	font-size: 0.88rem;
	color: var(--sr-muted);
}

.sr-crumbs a {
	color: var(--sr-accent);
	font-weight: 600;
}

.sr-titlecard {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 20px 32px;
	padding: 28px clamp(20px, 4vw, 40px);
	margin-bottom: 28px;
	border: 1px solid var(--sr-line);
	border-radius: calc(var(--sr-radius) + 6px);
	background: var(--sr-paper);
	box-shadow: var(--sr-shadow);
}

.sr-titlecard__text {
	flex: 1 1 420px;
	display: grid;
	gap: 12px;
}

.sr-titlecard__title {
	margin: 0;
	font-size: clamp(1.9rem, 4vw, 2.8rem);
	font-weight: 800;
	line-height: 1.1;
	color: var(--sr-ink);
}

.sr-titlecard__lede {
	max-width: 65ch;
	margin: 0;
	color: var(--sr-muted);
	line-height: 1.6;
}

.sr-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 4px !important;
}

.sr-facts li {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px 8px 10px;
	border-radius: 12px;
	background: var(--sr-wash);
	color: var(--sr-accent);
}

.sr-facts span {
	display: grid;
	color: var(--sr-ink);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
}

.sr-facts small {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--sr-muted);
}

.sr-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sr-action {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 40px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--sr-line);
	border-radius: 999px;
	background: var(--sr-paper);
	color: var(--sr-ink);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.sr-action:hover,
.sr-action:focus-visible {
	border-color: var(--sr-accent);
	color: var(--sr-accent);
}

.sr-figure {
	margin: 0 0 24px;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	max-height: 440px;
	width: 100%;
	border-radius: var(--sr-radius);
}

.sr-figure .sr-collage {
	gap: 14px;
	padding: clamp(18px, 4vw, 36px);
}

.sr-figure .sr-collage--1 {
	padding: 10% 32%;
}

.sr-block {
	padding: 24px clamp(18px, 3vw, 28px);
	margin-bottom: 24px;
	border: 1px solid var(--sr-line);
	border-radius: var(--sr-radius);
	background: var(--sr-paper);
}

.sr-block__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 6px;
}

.sr-block__head h2 {
	font-size: 1.4rem !important;
	font-weight: 800;
}

.sr-hint {
	margin: 0 0 12px;
	font-size: 0.85rem;
	color: var(--sr-muted);
}

.sr-lang {
	display: inline-flex;
	padding: 3px;
	border-radius: 999px;
	background: var(--sr-wash);
}

.sr-lang button {
	height: 32px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--sr-muted);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}

.sr-lang button[aria-pressed="true"] {
	background: var(--sr-paper);
	color: var(--sr-accent);
	box-shadow: 0 1px 3px rgba(20, 30, 24, 0.12);
}

/* Ingredient lines */
.sr-ing {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	column-gap: 24px;
}

.sr-ing li {
	border-bottom: 1px solid var(--sr-line);
}

.sr-ing label {
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 10px 2px;
	cursor: pointer;
	font-weight: 400;
}

.sr-ing input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--sr-accent);
}

.sr-ing__pic {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 5px;
	border-radius: 10px;
	background: var(--sr-wash);
}

.sr-ing__pic img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sr-ing__name {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.sr-ing__en {
	font-weight: 600;
}

.sr-ing__ur {
	order: 1;
	align-self: flex-start;
	font-size: 0.92rem;
	color: var(--sr-muted);
}

.sr-ing__note {
	order: 2;
	font-size: 0.8rem;
	color: var(--sr-muted);
}

.sr-ing__qty {
	font-weight: 700;
	white-space: nowrap;
	text-align: end;
	color: var(--sr-accent);
	font-variant-numeric: tabular-nums;
}

.is-urdu .sr-ing__en {
	order: 1;
	font-size: 0.85rem;
	font-weight: 400;
	color: var(--sr-muted);
}

.is-urdu .sr-ing__ur {
	order: 0;
	font-size: 1.08rem;
	font-weight: 600;
	color: var(--sr-ink);
}

.sr-ing li.is-done .sr-ing__name,
.sr-ing li.is-done .sr-ing__qty {
	text-decoration: line-through;
	opacity: 0.5;
}

/* Method */
.sr-steps {
	display: grid;
	gap: 14px;
	margin: 12px 0 0 !important;
}

.sr-steps li {
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
}

.sr-steps__n {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--sr-accent-soft);
	color: var(--sr-accent);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.sr-steps p,
.sr-steps__text {
	margin: 5px 0 0;
	line-height: 1.7;
}

.sr-steps__head {
	margin: 22px 0 4px !important;
	padding-top: 16px;
	border-top: 1px dashed var(--sr-line);
	font-size: 1.05rem !important;
	font-weight: 700;
}

.sr-directions,
.sr-directions * {
	font-family: inherit !important;
	color: inherit !important;
}

.sr-directions p {
	margin: 0 0 1em !important;
	line-height: 1.7 !important;
}

.sr-published {
	margin: 0 0 18px;
	font-size: 0.85rem;
	color: var(--sr-muted);
}

.sr-pn {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.sr-pn a {
	display: grid;
	gap: 2px;
	padding: 14px 18px;
	border: 1px solid var(--sr-line);
	border-radius: var(--sr-radius);
	color: var(--sr-ink);
	font-weight: 700;
	transition: border-color 0.2s ease;
}

.sr-pn a:hover {
	border-color: var(--sr-accent);
}

.sr-pn small {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sr-accent);
}

.sr-pn__next {
	grid-column: 2;
	text-align: end;
}

/* Sidebar list on the recipe page */
.sr-mini {
	display: grid;
	gap: 4px;
}

.sr-mini a {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	padding: 6px;
	border-radius: 10px;
	color: var(--sr-ink);
	font-weight: 600;
	font-size: 0.92rem;
	line-height: 1.3;
}

.sr-mini a:hover {
	background: var(--sr-wash);
}

.sr-mini__pic {
	display: block;
	width: 56px;
	height: 56px;
	overflow: hidden;
	border-radius: 10px;
}

.sr-mini__pic .sr-collage {
	padding: 8px;
}

.sr-mini__pic .sr-collage__tile {
	padding: 8%;
	border-radius: 8px;
}

.sr-mini__pic .sr-collage__letter {
	font-size: 1.4rem;
}

.sr-side__more {
	display: inline-block;
	margin-top: 12px;
	color: var(--sr-accent);
	font-weight: 600;
	font-size: 0.9rem;
}

.sr-related {
	margin-top: 48px;
}

.sr-related h2 {
	margin: 0 0 18px !important;
	font-size: 1.6rem !important;
	font-weight: 800;
}

/* ---------- Narrow screens ---------- */
@media (max-width: 960px) {
	.sr-layout,
	.sr-single .sr-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sr-side {
		position: static;
	}

	/* On the index the categories become one swipeable row above the recipes. */
	.sr-archive .sr-side {
		padding: 0;
		border: 0;
		background: none;
	}

	.sr-archive .sr-side__title {
		display: none;
	}

	.sr-archive .sr-cats {
		display: flex;
		gap: 8px;
		max-height: none;
		overflow-x: auto;
		padding-bottom: 6px;
		scrollbar-width: thin;
	}

	.sr-archive .sr-cats a {
		white-space: nowrap;
		border: 1px solid var(--sr-line);
		border-radius: 999px;
		background: var(--sr-paper);
	}
}

@media (max-width: 560px) {
	.sublime-recipes-page {
		padding-inline: 16px;
	}

	.sr-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.sr-card__body {
		padding: 10px 12px 12px;
	}

	.sr-card__title {
		font-size: 0.95rem;
	}

	.sr-collage {
		gap: 6px;
		padding: 10px;
	}

	.sr-action span {
		display: none;
	}

	.sr-action {
		width: 40px;
		padding: 0;
		justify-content: center;
	}

	.sr-ing {
		grid-template-columns: minmax(0, 1fr);
	}

	.sr-pn {
		grid-template-columns: minmax(0, 1fr);
	}

	.sr-pn__next {
		grid-column: auto;
		text-align: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sr-card__link,
	.sr-photo,
	.sr-collage__tile {
		transition: none;
	}

	.sr-card__link:hover {
		transform: none;
	}
}

@media print {
	body * {
		visibility: hidden;
	}

	.sr-single,
	.sr-single * {
		visibility: visible;
	}

	.sr-single {
		position: absolute;
		inset: 0 0 auto;
	}

	.sr-actions,
	.sr-side,
	.sr-related,
	.sr-pn,
	.sr-lang,
	.sr-hint,
	.sr-figure,
	.sr-crumbs,
	.sr-ing input {
		display: none !important;
	}

	.sr-titlecard,
	.sr-block {
		border: 0;
		box-shadow: none;
		padding: 0;
	}
}

/* A recipe with nothing to suggest beside it keeps the full width. */
.sr-single .sr-layout:not(:has(> .sr-side)) {
	grid-template-columns: minmax(0, 1fr);
}

/* Grid items default to min-width:auto, so the search field's intrinsic width pushed the hero
   past a phone screen. */
.sr-hero > *,
.sr-layout > * {
	min-width: 0;
}

.sr-search input[type="search"] {
	width: 100%;
}
