/* ============================================
   RECIPE SINGLE PAGE — Krem.no
   All values use CSS variables from theme.json.
   ============================================ */

/* Full-bleed background: extends beyond .site-main via pseudo-element */
.recipe-breadcrumb-bar,
.recipe-hero {
	position: relative;
}

.recipe-breadcrumb-bar::before,
.recipe-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	left: 50%;
	width: 100vw;
	transform: translateX(-50%);
	background: var(--wp--preset--color--background-alt);
	z-index: -1;
}

.recipe-breadcrumb-bar::before {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* Remove .container padding inside .site-main — site-main already provides it */
@media (min-width: 769px) {
	.recipe-breadcrumb-bar > .container,
	.recipe-hero > .container,
	.recipe-content > .container {
		padding-left: 0;
		padding-right: 0;
	}
}

/* --- Breadcrumb bar --- */
.recipe-breadcrumb-bar {
	padding: var(--wp--custom--spacing--md) 0;
}

.breadcrumb {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-muted);
}

.breadcrumb a {
	color: var(--wp--preset--color--text-muted);
	text-decoration: none;
}

.breadcrumb a:hover {
	color: var(--wp--preset--color--primary);
}

.breadcrumb span {
	margin: 0 var(--wp--custom--spacing--xs);
}

/* --- Recipe Hero --- */
.recipe-hero {
	padding: var(--wp--custom--spacing--xl) 0 var(--wp--custom--spacing--2-xl);
}

.recipe-hero__inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--custom--spacing--2-xl);
	align-items: center;
}

.recipe-hero__cats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--custom--spacing--sm);
	margin-bottom: var(--wp--custom--spacing--md);
}

.recipe-tag {
	display: inline-block;
	padding: 0.35rem 0.9rem;
	background: rgba(247, 109, 25, 0.1);
	color: var(--wp--preset--color--primary);
	font-size: 0.75rem;
	font-weight: 700;
	border-radius: var(--wp--custom--border-radius--pill);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-decoration: none;
	white-space: nowrap;
	transition: all var(--wp--custom--transition);
}

.recipe-tag:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.recipe-hero__title {
	font-size: 2.75rem;
	line-height: 1.15;
	margin-bottom: var(--wp--custom--spacing--md);
}

/* Hero rating */
.recipe-hero__rating {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--spacing--sm);
	margin-bottom: var(--wp--custom--spacing--md);
}

.recipe-hero__stars {
	display: flex;
	gap: 2px;
}

.recipe-hero__stars .icon {
	width: 18px;
	height: 18px;
	stroke: var(--wp--preset--color--primary);
	stroke-width: 2;
}

.recipe-hero__stars .star--filled {
	fill: var(--wp--preset--color--primary);
}

.recipe-hero__stars .star--half {
	fill: var(--wp--preset--color--primary);
	clip-path: inset(0 50% 0 0);
}

.recipe-hero__stars .star--empty {
	fill: none;
}

.recipe-hero__rating-text {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-muted);
}

.recipe-hero__desc {
	font-size: 1.1rem;
	color: var(--wp--preset--color--text-light);
	line-height: 1.75;
	margin-bottom: var(--wp--custom--spacing--lg);
}

/* Quick info pill */
.recipe-hero__quick-info {
	display: flex;
	gap: var(--wp--custom--spacing--lg);
	margin-bottom: var(--wp--custom--spacing--lg);
}

.recipe-hero__quick-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.recipe-hero__quick-icon {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wp--preset--color--white);
	border-radius: 12px;
	box-shadow: var(--wp--custom--shadow--sm);
}

.recipe-hero__quick-icon .icon {
	width: var(--wp--custom--icon-size--md);
	height: var(--wp--custom--icon-size--md);
	stroke: var(--wp--preset--color--text);
}

.recipe-hero__quick-item strong {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--text-muted);
	font-weight: 600;
}

.recipe-hero__quick-item > div > span {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--wp--preset--color--text);
}

/* Actions */
.recipe-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--custom--spacing--sm);
	margin-bottom: var(--wp--custom--spacing--xl);
}

/* Save button — saved state */
.recipe-save-btn.is-saved svg {
	fill: currentColor;
}

/* Bookmark toast — dropdown below header icon */
.krem-toast {
	position: absolute;
	top: calc(100% + var(--wp--custom--spacing--sm));
	right: 50%;
	transform: translateX(50%) translateY(-4px);
	z-index: 10000;
	white-space: nowrap;
	padding: var(--wp--custom--spacing--xs) var(--wp--custom--spacing--sm);
	background: var(--wp--preset--color--text);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	border-radius: var(--wp--custom--border-radius--default);
	box-shadow: var(--wp--custom--shadow--md);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.krem-toast.is-visible {
	opacity: 1;
	transform: translateX(50%) translateY(0);
}

/* Header bookmark icon pulse */
@keyframes bookmark-pulse {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.3); }
	100% { transform: scale(1); }
}

.bookmark-pulse {
	animation: bookmark-pulse 0.4s ease;
}

/* Share dropdown */
.recipe-share {
	position: relative;
}

.recipe-share__dropdown {
	display: none;
	position: absolute;
	top: calc(100% + var(--wp--custom--spacing--xs));
	left: 0;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--border-radius--md);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	padding: var(--wp--custom--spacing--sm);
	z-index: 10;
	line-height: 1 !important;
}

.recipe-share__dropdown.is-open {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--spacing--xs);
}

.recipe-share__dropdown > a {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--spacing--sm);
	padding: var(--wp--custom--spacing--xs) var(--wp--custom--spacing--sm);
	border-radius: var(--wp--custom--border-radius--sm);
	text-decoration: none;
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--small);
	white-space: nowrap;
	transition: background var(--wp--custom--transition);
}

.recipe-share__dropdown > a:hover {
	background: var(--wp--preset--color--background-alt);
}

/* Author line */
.recipe-hero__author {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--spacing--md);
}

.recipe-hero__author-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
}

.recipe-hero__author-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.recipe-hero__author-name {
	display: block;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--nav);
}

.recipe-hero__author-date {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--text-muted);
}

/* Hero image */
.recipe-hero__figure {
	border-radius: var(--wp--custom--border-radius--xl);
	overflow: hidden;
	box-shadow: var(--wp--custom--shadow--lg);
	aspect-ratio: 1 / 1;
}

.recipe-hero__figure img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* --- Recipe Content Layout --- */
.recipe-content {
	padding: var(--wp--custom--spacing--2-xl) 0;
}

.recipe-layout {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: var(--wp--custom--spacing--2-xl);
	align-items: start;
}

.recipe-main {
	min-width: 0;
}

/* --- Intro text --- */
.recipe-intro {
	font-size: 1.05rem;
	line-height: 1.85;
	color: var(--wp--preset--color--text-light);
	margin-bottom: var(--wp--custom--spacing--xl);
}

.recipe-intro a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* --- Section titles --- */
.recipe-section {
	margin-bottom: var(--wp--custom--spacing--2-xl);
}

.recipe-section__title {
	font-size: var(--wp--preset--font-size--large);
	margin-bottom: var(--wp--custom--spacing--lg);
	padding-bottom: var(--wp--custom--spacing--sm);
	border-bottom: 3px solid var(--wp--preset--color--primary);
	display: inline-block;
}

/* --- Ingredients card --- */
.recipe-ingredients-card {
	background: var(--wp--preset--color--background-alt);
	border-radius: var(--wp--custom--border-radius--xl);
	padding: var(--wp--custom--spacing--xl);
}

.recipe-ingredients-group {
	margin-bottom: var(--wp--custom--spacing--lg);
}

.recipe-ingredients-group:last-child {
	margin-bottom: 0;
}

.recipe-ingredients-group h3 {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.1rem;
	margin-bottom: var(--wp--custom--spacing--md);
	color: var(--wp--preset--color--primary);
}

.recipe-ingredients-list {
	display: flex;
	flex-direction: column;
	list-style: none;
	padding: 0;
	margin: 0;
}

.recipe-ingredients-list li {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--spacing--md);
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.recipe-ingredients-list li:last-child {
	border-bottom: none;
}

.recipe-ingredients-list input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: var(--wp--preset--color--primary);
	cursor: pointer;
	flex-shrink: 0;
}

.recipe-ingredients-list label {
	cursor: pointer;
	font-size: 0.95rem;
	line-height: 1.5;
}

.recipe-ingredients-list input:checked + label {
	text-decoration: line-through;
	color: var(--wp--preset--color--text-muted);
}

.recipe-ingredients-list em {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

.krem-recipe__ingredient-link {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	font-weight: 600;
}

.krem-recipe__ingredient-link:hover {
	color: var(--wp--preset--color--primary-dark);
}

/* --- Instruction group title --- */
.recipe-instruction-group-title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.15rem;
	color: var(--wp--preset--color--primary);
	margin-bottom: var(--wp--custom--spacing--md);
	margin-top: var(--wp--custom--spacing--lg);
}

/* --- Steps --- */
.recipe-steps {
	counter-reset: step;
	list-style: none;
	padding: 0;
	margin: 0;
}

.recipe-step {
	counter-increment: step;
	margin-bottom: var(--wp--custom--spacing--md);
	padding-bottom: var(--wp--custom--spacing--md);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.recipe-step:last-child {
	border-bottom: none;
}

.recipe-step__content {
	position: relative;
	padding-left: 60px;
}

.recipe-step__content::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 1rem;
	font-family: var(--wp--preset--font-family--heading);
}

.recipe-step__content h3 {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.15rem;
	margin-bottom: 0.35rem;
}

.recipe-step__content p,
.recipe-step__description {
	color: var(--wp--preset--color--text-light);
	line-height: 1.8;
	font-size: 0.95rem;
	margin: 0;
}

.recipe-step__description a {
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	text-decoration: none;
}

.recipe-step__description a:hover {
	color: var(--wp--preset--color--primary-dark);
}

.recipe-step__note {
	margin-top: var(--wp--custom--spacing--md);
	background: var(--wp--preset--color--cream);
	padding: 0.75rem 1rem;
	border-radius: var(--wp--custom--border-radius--default);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text);
	line-height: 1.6;
}

/* --- Recipe gallery --- */
.recipe-gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wp--custom--spacing--md);
	margin-top: var(--wp--custom--spacing--xl);
}

.recipe-gallery figure {
	margin: 0;
}

.recipe-gallery .img-recipe {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--wp--custom--border-radius--default);
}

.recipe-gallery .img-recipe img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.recipe-gallery figcaption {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-light);
	margin-top: var(--wp--custom--spacing--xs);
	text-align: center;
}

/* --- Rating --- */
.recipe-rating-card {
	background: var(--wp--preset--color--cream);
	border-radius: var(--wp--custom--border-radius--xl);
	padding: var(--wp--custom--spacing--xl);
	text-align: center;
}

.recipe-rating-card p {
	margin-bottom: var(--wp--custom--spacing--md);
	font-size: 0.95rem;
}

.recipe-rating-stars {
	display: flex;
	justify-content: center;
	gap: var(--wp--custom--spacing--sm);
}

.recipe-rating-stars button {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--wp--preset--color--text-muted);
	transition: color var(--wp--custom--transition);
	padding: 0.25rem;
	line-height: 1;
}

.recipe-rating-stars button .icon {
	width: 28px;
	height: 28px;
}

.recipe-rating-stars:hover button {
	color: var(--wp--preset--color--primary);
}

.recipe-rating-stars:hover button .icon {
	fill: var(--wp--preset--color--primary);
}

.recipe-rating-stars button:hover ~ button {
	color: var(--wp--preset--color--text-muted);
}

.recipe-rating-stars button:hover ~ button .icon {
	fill: none;
}

/* Rated state — stars locked, no hover effect. */
.recipe-rating-stars.is-rated button {
	cursor: default;
	pointer-events: none;
}

.recipe-rating-stars.is-rated .icon.is-filled {
	color: var(--wp--preset--color--primary);
	fill: var(--wp--preset--color--primary);
}

.recipe-rating-stars.is-rated:hover button {
	color: var(--wp--preset--color--text-muted);
}

.recipe-rating-stars.is-rated:hover button .icon {
	fill: none;
}

.recipe-rating-stars.is-rated:hover .icon.is-filled {
	color: var(--wp--preset--color--primary);
	fill: var(--wp--preset--color--primary);
}

/* Submitting state. */
.recipe-rating-stars.is-submitting {
	opacity: 0.5;
	pointer-events: none;
}

/* Confirmation message + nudge. */
.recipe-rating-message {
	margin-top: var(--wp--custom--spacing--sm);
	min-height: 1.5em;
}

.recipe-rating-message.is-error {
	color: var(--wp--preset--color--error, #c62828);
}

.recipe-rating-nudge {
	color: var(--wp--preset--color--primary);
	font-size: 0.9rem;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.recipe-rating-nudge:hover {
	color: var(--wp--preset--color--primary-dark, var(--wp--preset--color--primary));
}

/* --- Comments --- */
.recipe-comment-count {
	font-size: var(--wp--preset--font-size--small);
	background: var(--wp--preset--color--cream);
	padding: 0.15rem 0.6rem;
	border-radius: var(--wp--custom--border-radius--pill);
	font-weight: 600;
	vertical-align: middle;
}

.recipe-comments-list {
	margin-bottom: var(--wp--custom--spacing--xl);
}

.recipe-comment {
	padding: var(--wp--custom--spacing--lg) 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.recipe-comment:last-child {
	border-bottom: none;
}

.recipe-comment__inner {
	display: flex;
	gap: var(--wp--custom--spacing--md);
}

/* Threaded replies — only the first reply level (depth-2) is indented.
   Deeper replies sit under the depth-2 thread without further shifting,
   since WordPress nests child comments inside their parent's <div> so
   they inherit the parent's indent visually. */
.recipe-comment.depth-2,
.recipe-comment.depth-3,
.recipe-comment.depth-4,
.recipe-comment.depth-5 {
	padding-left: var(--wp--custom--spacing--lg);
	border-left: 2px solid var(--wp--preset--color--border);
	border-bottom: none;
	padding-top: var(--wp--custom--spacing--md);
	padding-bottom: var(--wp--custom--spacing--md);
}

.recipe-comment.depth-2 {
	margin-left: 56px;
}

.recipe-comment__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--text);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1.1rem;
	flex-shrink: 0;
	overflow: hidden;
}

.recipe-comment__avatar--image {
	background: transparent;
}

.recipe-comment__avatar--image img {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}

.recipe-comment__header {
	display: flex;
	align-items: baseline;
	gap: var(--wp--custom--spacing--md);
	margin-bottom: 0.35rem;
}

.recipe-comment__header strong {
	font-size: var(--wp--preset--font-size--nav);
}

.recipe-comment__header time {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--text-muted);
}

.recipe-comment__body p {
	font-size: var(--wp--preset--font-size--nav);
	color: var(--wp--preset--color--text-light);
	line-height: 1.7;
	margin: 0;
}

.recipe-comment__reply {
	margin-top: var(--wp--custom--spacing--sm);
}

.recipe-comment__reply a {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.recipe-comment__reply a:hover {
	text-decoration: underline;
}

/* Comment form — styles target .comment-respond (the #respond div) so they
   follow the form when comment-reply.js moves it inline for threaded replies. */
.recipe-comment-form {
	margin-top: var(--wp--custom--spacing--xl);
}

.comment-respond {
	background: var(--wp--preset--color--background-alt);
	border-radius: var(--wp--custom--border-radius--xl);
	padding: var(--wp--custom--spacing--xl);
}

/* When form is moved inline for a reply, use tighter padding. */
.recipe-comment > .comment-respond {
	margin-top: var(--wp--custom--spacing--md);
	padding: var(--wp--custom--spacing--md);
}

.comment-respond .comment-reply-title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.15rem;
	margin-bottom: var(--wp--custom--spacing--lg);
}

.comment-respond .comment-reply-title small {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	margin-left: var(--wp--custom--spacing--sm);
}

.comment-respond .comment-reply-title small a {
	color: var(--wp--preset--color--primary);
}

/* Form layout: Navn + E-post side by side on top, Kommentar below, submit last.
   WP renders comment_field before the author/email fields in DOM, so we reorder
   with flex `order`. */
.comment-respond .comment-form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--custom--spacing--md);
}

.recipe-comment-form__field {
	flex: 1 1 100%;
	margin-bottom: 0;
	order: 2;
}

.recipe-comment-form__field--half {
	flex: 1 1 calc(50% - var(--wp--custom--spacing--md) / 2);
	order: 1;
}

.comment-respond .form-submit {
	flex: 1 1 100%;
	order: 3;
}

.comment-respond label {
	display: block;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	color: var(--wp--preset--color--text);
	margin-bottom: 0.35rem;
}

.comment-respond input,
.comment-respond textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 2px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--border-radius--default);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--nav);
	transition: border-color var(--wp--custom--transition);
	background: var(--wp--preset--color--white);
}

.comment-respond input:focus,
.comment-respond textarea:focus {
	border-color: var(--wp--preset--color--primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(204, 46, 46, 0.12);
}

.comment-respond textarea {
	resize: vertical;
}

/* Hide unnecessary WP comment form elements */
.comment-respond .comment-form-url,
.comment-respond .comment-form-cookies-consent,
.comment-respond .comment-notes {
	display: none;
}

/* Logged-in user message */
.comment-respond .logged-in-as,
.comment-respond .comment-guest-prompt {
	flex: 1 1 100%;
	order: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-muted);
	margin-bottom: 0;
}

.comment-respond .logged-in-as a,
.comment-respond .comment-guest-prompt a {
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	text-decoration: none;
}

.comment-respond .logged-in-as a:hover,
.comment-respond .comment-guest-prompt a:hover {
	text-decoration: underline;
}

.recipe-comments-closed {
	color: var(--wp--preset--color--text-muted);
	font-style: italic;
}

.recipe-comments-nav {
	display: flex;
	justify-content: space-between;
	margin-top: var(--wp--custom--spacing--md);
}

.recipe-comments-nav a {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--primary);
}

/* ============================================
   SIDEBAR
   ============================================ */
.recipe-sidebar__sticky {
	position: sticky;
	top: calc(var(--wp--custom--sizes--header-height) + var(--wp--custom--spacing--lg));
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--spacing--lg);
}

/* Sidebar info card */
.recipe-sidebar-card {
	background: var(--wp--preset--color--cream);
	border-radius: var(--wp--custom--border-radius--xl);
	padding: var(--wp--custom--spacing--lg);
}

.recipe-sidebar-card__info {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--spacing--sm);
	margin-bottom: var(--wp--custom--spacing--lg);
	font-size: var(--wp--preset--font-size--small);
}

.recipe-sidebar-card__info div {
	display: flex;
	gap: var(--wp--custom--spacing--sm);
}

.recipe-sidebar-card .btn {
	display: block;
	margin-bottom: var(--wp--custom--spacing--sm);
}

/* Related recipes sidebar */
.recipe-sidebar-related {
	background: var(--wp--preset--color--white);
	border: 2px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--border-radius--xl);
	padding: var(--wp--custom--spacing--lg);
}

.recipe-sidebar-related h3 {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.05rem;
	margin-bottom: var(--wp--custom--spacing--md);
}

.recipe-sidebar-related__item {
	display: flex;
	gap: var(--wp--custom--spacing--md);
	align-items: center;
	padding: var(--wp--custom--spacing--sm) 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	text-decoration: none;
	color: var(--wp--preset--color--text);
	transition: all var(--wp--custom--transition);
}

.recipe-sidebar-related__item:last-child {
	border-bottom: none;
}

.recipe-sidebar-related__item:hover {
	color: var(--wp--preset--color--primary);
}

.recipe-sidebar-related__img {
	width: 64px;
	height: 64px;
	border-radius: var(--wp--custom--border-radius--default);
	overflow: hidden;
	flex-shrink: 0;
}

.recipe-sidebar-related__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.recipe-sidebar-related__item strong {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.35;
}

/* Kremvenn CTA banner styles now live with the krem/kremvenn-cta block
   (krem-blocks/src/blocks/kremvenn-cta/style.css) and auto-enqueue wherever
   the block renders, including here on single-oppskrift.php. */

/* ============================================
   ARCHIVE
   ============================================ */

/* Archive grid */
.recipe-archive {
	padding: var(--wp--custom--spacing--xl) 0 var(--wp--custom--spacing--2-xl);
}

@media (min-width: 769px) {
	.recipe-archive > .container {
		padding-left: 0;
		padding-right: 0;
	}
}

.recipe-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wp--custom--spacing--lg);
	/* When .recipe-grid is rendered as a <ul> (krem-blocks pattern),
	   neutralise browser-default list indentation + bullets. Harmless on
	   <div> consumers (the archive) since divs have no default padding. */
	margin: 0;
	padding: 0;
	list-style: none;
}

/* When .recipe-grid is used as a <ul> with <li> wrappers (semantic list,
   per the krem-blocks accessibility convention), reset the default <li>
   styles so they don't add bullets or extra spacing. The <li> becomes
   the grid item; the <article class="recipe-card"> sits inside.

   display:flex on the <li> is ALSO what makes the inner <article> fill
   the grid cell height — see equal-height block below. */
.recipe-grid > li {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
}

/* Equal-height cards within any .recipe-grid.

   The grid row stretches to the tallest item (CSS grid default), but the
   <article class="recipe-card"> inside only sizes to its content — so
   cards with a star rating end up visibly taller than cards without.
   Flex chain: card fills its grid cell, the __body expands to fill any
   remaining vertical space, pushing the rating (when present) to the
   bottom at a consistent visual height. */
.recipe-card {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.recipe-card__link {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.recipe-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* When a card has a rating, pin it to the bottom of the body so the
   stars line up visually across the row regardless of title/excerpt
   length. Cards without a rating just leave empty space at the bottom. */
.recipe-card__meta {
	margin-top: auto;
}

/* Recipe card */
.recipe-card {
	border-radius: var(--wp--custom--border-radius--lg);
	overflow: hidden;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--custom--shadow--card);
	transition: transform var(--wp--custom--transition), box-shadow var(--wp--custom--transition);
}

.recipe-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--wp--custom--shadow--lg);
}

.recipe-card__link {
	display: block;
	text-decoration: none;
	color: var(--wp--preset--color--text);
}

.recipe-card__image {
	position: relative;
	overflow: hidden;
}

.img-recipe {
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.img-recipe img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--wp--custom--transition);
}

.recipe-card:hover .img-recipe img {
	transform: scale(1.04);
}

.img-recipe--placeholder {
	background: var(--wp--preset--color--background-alt);
}

/* Card badge overlay */
.recipe-card__badge {
	position: absolute;
	top: var(--wp--custom--spacing--md);
	left: var(--wp--custom--spacing--md);
	z-index: 2;
}

.badge--popular {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--white);
}

.badge--category {
	background-color: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--primary-dark);
}

/* Star rating on cards */
.recipe-card .stars {
	display: inline-flex;
	gap: 1px;
	align-items: center;
}

.recipe-card .stars .icon {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: var(--wp--preset--color--primary);
	stroke-width: 2;
}

.recipe-card .stars .icon--filled {
	fill: var(--wp--preset--color--primary);
}

.recipe-card__body {
	padding: var(--wp--custom--spacing--md) var(--wp--custom--spacing--lg) var(--wp--custom--spacing--lg);
}

.recipe-card__top-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 var(--wp--custom--spacing--xs);
}

.recipe-card__category {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--primary);
	margin: 0;
}

/* Card bookmark icon — matches header icon style */
.recipe-card__bookmark {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	padding: 0;
	background: none;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	color: var(--wp--preset--color--text);
	transition: all var(--wp--custom--transition);
}

.recipe-card__bookmark:hover {
	background-color: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--primary);
}

.recipe-card__bookmark.is-saved {
	color: var(--wp--preset--color--primary);
}

.recipe-card__bookmark.is-saved svg {
	fill: currentColor;
}

.recipe-card__bookmark.is-saved:hover {
	background-color: var(--wp--preset--color--cream);
}

.recipe-card__bookmark svg {
	width: 16px;
	height: 16px;
}

.recipe-card__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.15rem;
	line-height: 1.3;
	margin: 0 0 var(--wp--custom--spacing--sm);
}

.recipe-card__excerpt {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-light);
	line-height: 1.6;
	margin: 0 0 var(--wp--custom--spacing--sm);
}

.recipe-card__meta {
	font-size: 0.75rem;
	color: var(--wp--preset--color--text-muted);
	font-weight: 600;
}

/* --- Compact grid modifier (main archive) --- */
.recipe-grid--compact .img-recipe {
	aspect-ratio: 1 / 1;
}

.recipe-grid--compact .recipe-card__title {
	font-size: 1rem;
	margin-bottom: var(--wp--custom--spacing--xs);
}

.recipe-grid--compact .recipe-card__excerpt {
	font-size: 0.8rem;
	line-height: 1.5;
	margin-bottom: var(--wp--custom--spacing--sm);
}

.recipe-grid--compact .recipe-card__meta {
	padding-top: var(--wp--custom--spacing--xs);
	border-top: 1px solid var(--wp--preset--color--border);
}

/* --- 4-column grid modifier (popular section) --- */
.recipe-grid--4col {
	grid-template-columns: repeat(4, 1fr);
}

.recipe-grid--4col .img-recipe {
	aspect-ratio: 1 / 1;
}

.recipe-grid--4col .recipe-card__title {
	font-size: 1rem;
	line-height: 1.3;
}

/* --- Popular recipes section --- */
.recipe-popular {
	padding: var(--wp--custom--spacing--xl) 0;
}

@media (min-width: 769px) {
	.recipe-popular > .container {
		padding-left: 0;
		padding-right: 0;
	}
}

/* --- Recipe categories bar --- */
.recipe-categories {
	padding: var(--wp--custom--spacing--md) 0 var(--wp--custom--spacing--lg);
}

@media (min-width: 769px) {
	.recipe-categories > .container {
		padding-left: 0;
		padding-right: 0;
	}
}

/* --- Hero search --- */
.hero__search {
	margin: var(--wp--custom--spacing--lg) auto 0;
	max-width: 520px;
}

.hero__search form {
	position: relative;
}

.hero__search-input {
	width: 100%;
	padding: 1.1rem 1.75rem;
	padding-right: 64px;
	border: 2px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--border-radius--pill);
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text);
	transition: border-color var(--wp--custom--transition), box-shadow var(--wp--custom--transition);
	box-shadow: var(--wp--custom--shadow--md);
}

.hero__search-input:focus {
	border-color: var(--wp--preset--color--primary);
	outline: none;
	box-shadow: var(--wp--custom--shadow--lg);
}

.hero__search-input::placeholder {
	color: var(--wp--preset--color--text-muted);
}

.hero__search-btn {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border: none;
	cursor: pointer;
	transition: background var(--wp--custom--transition), transform var(--wp--custom--transition);
	display: flex;
	align-items: center;
	justify-content: center;
}

.hero__search-btn:hover {
	background: var(--wp--preset--color--primary-dark);
	transform: translateY(-50%) scale(1.05);
}

.hero__search-btn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* --- Toolbar recipe overrides --- */
.shop-toolbar__count {
	color: var(--wp--preset--color--text-muted);
	font-size: 0.9rem;
}

.shop-toolbar__sort select {
	border: 2px solid var(--wp--preset--color--border);
	padding: 0.5rem 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text);
	background: var(--wp--preset--color--white);
	border-radius: var(--wp--custom--border-radius--pill);
	cursor: pointer;
}

/* Archive empty state */
.recipe-archive__empty {
	text-align: center;
	padding: var(--wp--custom--spacing--2-xl) 0;
	color: var(--wp--preset--color--text-muted);
	font-size: 1.1rem;
}

/* Pagination */
.nav-links {
	display: flex;
	justify-content: center;
	gap: var(--wp--custom--spacing--sm);
	margin-top: var(--wp--custom--spacing--xl);
}

.nav-links a,
.nav-links span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 var(--wp--custom--spacing--sm);
	border-radius: var(--wp--custom--border-radius--default);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
	transition: all var(--wp--custom--transition);
}

.nav-links a {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text);
}

.nav-links a:hover {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.nav-links .current {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
	.recipe-grid--4col {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 1024px) {
	.recipe-grid,
	.recipe-grid--compact {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Flatten sidebar into the layout grid so the quick-facts card can sit
	   directly under the recipe hero, while related recipes stay at the bottom. */
	.recipe-layout {
		grid-template-columns: 1fr;
		gap: var(--wp--custom--spacing--xl);
	}

	.recipe-sidebar,
	.recipe-sidebar__sticky {
		display: contents;
	}

	.recipe-sidebar-card {
		order: -1;
	}
}

@media (max-width: 768px) {
	.recipe-grid,
	.recipe-grid--compact,
	.recipe-grid--4col {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Grid gap tighter on mobile */
	.recipe-grid {
		gap: var(--wp--custom--spacing--md);
	}

	/* Hide excerpt on narrow 2-col cards */
	.recipe-card__excerpt {
		display: none;
	}

	/* Ellipsize category only when bookmark crowds it; full label shows when space allows */
	.recipe-card__category {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* Single-page recipe */
	.recipe-hero {
		padding: var(--wp--custom--spacing--md) 0 var(--wp--custom--spacing--lg);
	}

	.recipe-content {
		padding: var(--wp--custom--spacing--xl) 0;
	}

	.recipe-hero__inner {
		grid-template-columns: 1fr;
		gap: var(--wp--custom--spacing--lg);
	}

	.recipe-hero__title {
		font-size: 2rem;
	}

	.recipe-hero__quick-info {
		flex-wrap: wrap;
	}

	.recipe-gallery {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Stack Navn + E-post on mobile */
	.recipe-comment-form__field--half {
		flex: 1 1 100%;
	}

	/* Archive hero search */
	.hero__search {
		max-width: 100%;
	}

	.hero__search-input {
		padding: 0.9rem 1.25rem;
		padding-right: 56px;
		font-size: 0.9rem;
	}

	.hero__search-btn {
		width: 40px;
		height: 40px;
	}

	.hero__search-btn svg {
		width: 18px;
		height: 18px;
	}

	/* Category bar horizontal scroll */
	.recipe-categories .category-bar {
		flex-wrap: nowrap;
		overflow-x: auto;
		justify-content: flex-start;
		padding-bottom: var(--wp--custom--spacing--sm);
		-webkit-overflow-scrolling: touch;
	}

	.recipe-categories .category-pill {
		flex-shrink: 0;
	}

	/* Section header */
	.recipe-popular .section-header__title {
		font-size: 1.25rem;
	}

	/* Smaller archive section padding */
	.recipe-archive {
		padding: var(--wp--custom--spacing--lg) 0 var(--wp--custom--spacing--xl);
	}

	.recipe-popular {
		padding: var(--wp--custom--spacing--lg) 0;
	}
}

@media (max-width: 480px) {
	/* Page hero tighter on small screens */
	.page-hero__title {
		font-size: 1.75rem;
	}

	.page-hero__desc {
		font-size: 0.95rem;
	}

	/* Card body tighter padding */
	.recipe-card__body {
		padding: var(--wp--custom--spacing--sm) var(--wp--custom--spacing--md) var(--wp--custom--spacing--md);
	}

	/* Badge smaller on narrow cards */
	.recipe-card__badge {
		top: var(--wp--custom--spacing--sm);
		left: var(--wp--custom--spacing--sm);
	}

	.badge {
		font-size: 0.65rem;
		padding: 0.2rem 0.6rem;
	}
}

@media (max-width: 400px) {
	.recipe-card__category {
		font-size: var(--wp--preset--font-size--micro);
	}
}

/* Login modal styles are in base.css (global — also used by header bookmark) */
