/* ISHB Recept – card, grid, step mode, print. Colours follow the theme's palette slugs. */
.ishb-recept {
	--r-bg: var(--wp--preset--color--accent-5, #ebe3d6);
	--r-ink: var(--wp--preset--color--contrast, #2e241d);
	--r-primary: var(--wp--preset--color--accent-3, #6b4f3a);
	--r-accent: var(--wp--preset--color--accent-4, #56634a);
	--r-base: var(--wp--preset--color--base, #f3eee6);
	--r-head: var(--wp--preset--font-family--recipe, inherit);
	background: var(--r-bg);
	color: var(--r-ink);
	border-radius: 6px;
	padding: clamp(1.25rem, 4vw, 2.25rem);
	margin: 2.5rem 0;
	font-size: 1rem;
	line-height: 1.5;
	position: relative;
}
.ishb-recept::before {
	content: "";
	position: absolute;
	inset: 8px;
	border: 1px solid color-mix(in srgb, var(--r-primary) 35%, transparent);
	border-radius: 3px;
	pointer-events: none;
}
.ishb-recept__label {
	margin: 0 0 .25rem;
	font-size: .75rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--r-accent);
}
.ishb-recept__title {
	font-family: var(--r-head);
	font-size: clamp(1.6rem, 3.5vw, 2.2rem);
	line-height: 1.15;
	margin: 0 0 1rem;
	color: var(--r-primary);
}
.ishb-recept__image img { width: 100%; height: auto; border-radius: 4px; display: block; margin-bottom: 1rem; }
.ishb-recept__meta { display: flex; flex-wrap: wrap; gap: .75rem 2rem; align-items: center; }
.ishb-recept__servings { display: inline-flex; align-items: center; gap: .5rem; }
.ishb-recept__step-btn {
	width: 2.25rem; height: 2.25rem; border-radius: 50%;
	border: 1px solid var(--r-primary); background: transparent; color: var(--r-primary);
	font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.ishb-recept__step-btn:hover { background: var(--r-primary); color: var(--r-base); }
.ishb-recept__servings-count { font-weight: 600; font-size: 1.15rem; min-width: 1.5ch; text-align: center; }
.ishb-recept__facts { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0; }
.ishb-recept__facts div { display: flex; gap: .35rem; }
.ishb-recept__facts dt { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--r-accent); align-self: center; }
.ishb-recept__facts dd { margin: 0; }
.ishb-recept__allergens { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ishb-recept__allergens::before { content: "Allergener:"; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--r-accent); align-self: center; margin-right: .25rem; }
.ishb-recept__allergens li { font-size: .8rem; border: 1px solid var(--r-accent); color: var(--r-accent); border-radius: 999px; padding: .1rem .6rem; }
.ishb-recept__body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2rem; margin-top: 1.75rem; }
@media (max-width: 720px) { .ishb-recept__body { grid-template-columns: 1fr; } }
.ishb-recept--drinkar .ishb-recept__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 600px) { .ishb-recept--drinkar .ishb-recept__body { grid-template-columns: 1fr; } }
.ishb-recept h3 {
	font-family: var(--r-head);
	font-size: 1.15rem; margin: 0 0 .75rem; color: var(--r-primary);
	border-bottom: 1px solid color-mix(in srgb, var(--r-primary) 40%, transparent); padding-bottom: .35rem;
}
.ishb-recept h4 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--r-accent); margin: 1rem 0 .4rem; }
.ishb-recept ul, .ishb-recept ol { margin: 0; padding: 0; }
.ishb-recept__ingredients ul { list-style: none; }
.ishb-recept__ingredients li { padding: .3rem 0; border-bottom: 1px dotted color-mix(in srgb, var(--r-ink) 20%, transparent); }
.ishb-recept__ingredients label { display: grid; grid-template-columns: 1.25rem 5.5rem 1fr; gap: .5rem; align-items: baseline; cursor: pointer; }
.ishb-recept--drinkar .ishb-recept__ingredients label { grid-template-columns: 1.25rem 4.5rem 1fr; }
.ishb-recept__qty { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ishb-recept.is-scaled .ishb-recept__amount { color: var(--r-accent); }
.ishb-recept__note { font-style: italic; opacity: .8; }
.ishb-recept__method ol { list-style: none; counter-reset: step; }
.ishb-recept__method li { counter-increment: step; margin-bottom: .9rem; }
.ishb-recept__method label { display: grid; grid-template-columns: 1.25rem 1.75rem 1fr; gap: .5rem; align-items: baseline; cursor: pointer; }
.ishb-recept__method label::after { content: counter(step) "."; order: -1; grid-column: 2; grid-row: 1; font-weight: 600; color: var(--r-primary); }
.ishb-recept__method label input { grid-column: 1; grid-row: 1; }
.ishb-recept__method label span { grid-column: 3; grid-row: 1; }
.ishb-recept__check { accent-color: var(--r-accent); width: 1rem; height: 1rem; margin: 0; transform: translateY(.15em); }
.ishb-recept li:has(.ishb-recept__check:checked) > label > span:not(.ishb-recept__qty),
.ishb-recept li:has(.ishb-recept__check:checked) .ishb-recept__qty { opacity: .45; text-decoration: line-through; text-decoration-thickness: 1px; }
.ishb-recept__notes { margin-top: 1.5rem; }
.ishb-recept__notes p { margin: 0; }
.ishb-recept__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1.75rem; }
.ishb-recept__btn {
	font: inherit; font-size: .9rem; cursor: pointer;
	background: var(--r-primary); color: var(--r-base);
	border: 1px solid var(--r-primary); border-radius: 999px; padding: .45rem 1.1rem;
}
.ishb-recept__btn:hover { filter: brightness(1.1); }
.ishb-recept__btn--quiet { background: transparent; color: var(--r-primary); }
.ishb-recept__source { display: none; margin: 0 0 0 auto; font-size: .8rem; opacity: .7; }

/* Grid + index */
.ishb-recept-index__form { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; }
.ishb-recept-index__form input[type=search] { flex: 1 1 16rem; }
.ishb-recept-index__form input, .ishb-recept-index__form select, .ishb-recept-index__form button {
	font: inherit; font-size: 1rem; padding: .55rem .8rem; border-radius: 4px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast, #2e241d) 30%, transparent);
	background: var(--wp--preset--color--base, #fff); color: var(--wp--preset--color--contrast, #2e241d);
}
.ishb-recept-index__form button { background: var(--wp--preset--color--accent-3, #6b4f3a); color: var(--wp--preset--color--base, #fff); border-color: transparent; cursor: pointer; }
.ishb-recept-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2rem 1.5rem; }
.ishb-recept-grid a { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .35rem; }
.ishb-recept-grid__frame { display: block; position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 4px; background: var(--wp--preset--color--accent-5, #ebe3d6); }
.ishb-recept-grid__frame img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; display: block; transition: transform .4s ease; }
.ishb-recept-grid a:hover .ishb-recept-grid__frame img { transform: scale(1.03); }
.ishb-recept-grid__kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wp--preset--color--accent-4, #56634a); margin-top: .35rem; }
.ishb-recept-grid__title { font-family: var(--wp--preset--font-family--recipe, inherit); font-size: 1.25rem; line-height: 1.25; }
.ishb-recept-grid a:hover .ishb-recept-grid__title { text-decoration: underline; text-underline-offset: .2em; }
.ishb-recept-index__pages { display: flex; gap: .75rem; margin-top: 2rem; }

/* Step mode */
html.ishb-steps-open { overflow: hidden; }
.ishb-steps-overlay {
	position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column;
	background: var(--wp--preset--color--base, #f3eee6); color: var(--wp--preset--color--contrast, #2e241d);
}
.ishb-steps-overlay__bar { display: flex; gap: .75rem; align-items: center; padding: .9rem 1.25rem; border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.ishb-steps-overlay__title { flex: 1; font-family: var(--wp--preset--font-family--recipe, inherit); font-size: 1.15rem; }
.ishb-steps-overlay button { font: inherit; cursor: pointer; border-radius: 999px; padding: .5rem 1rem; border: 1px solid var(--wp--preset--color--accent-3, #6b4f3a); background: transparent; color: var(--wp--preset--color--accent-3, #6b4f3a); }
.ishb-steps-overlay__panel[hidden] { display: none; }
.ishb-steps-overlay__panel { flex: none; padding: 1rem 1.25rem; max-height: 40vh; overflow: auto; background: var(--wp--preset--color--accent-5, #ebe3d6); }
.ishb-steps-overlay__panel label { grid-template-columns: 5.5rem 1fr !important; }
.ishb-steps-overlay__body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 2rem 1.25rem; max-width: 46rem; margin: 0 auto; width: 100%; box-sizing: border-box; overflow: auto; }
.ishb-steps-overlay__count { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wp--preset--color--accent-4, #56634a); margin: 0; }
.ishb-steps-overlay__group { margin: .25rem 0 1rem; font-weight: 600; }
.ishb-steps-overlay__text { font-size: clamp(1.4rem, 4.5vw, 2.1rem); line-height: 1.4; }
.ishb-steps-overlay__nav { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom)); }
.ishb-steps-overlay__nav button { font-size: 1.1rem; padding: .8rem 1.4rem; }
.ishb-steps-overlay__nav button[data-dir="1"] { background: var(--wp--preset--color--accent-3, #6b4f3a); color: var(--wp--preset--color--base, #fff); }
.ishb-steps-overlay__nav button:disabled { opacity: .35; cursor: default; }

/* A4 print: only the chosen card */
@media print {
	@page { size: A4; margin: 14mm 16mm; }
	html.ishb-printing body > *:not(#ishb-print-root) { display: none !important; }
	html.ishb-printing body { background: #fff !important; }
	#ishb-print-root { display: block; }
	#ishb-print-root .ishb-recept {
		background: none; color: #222; padding: 0; margin: 0; font-size: 10.5pt; line-height: 1.4;
		--r-primary: #222; --r-accent: #555; --r-ink: #222;
	}
	#ishb-print-root .ishb-recept::before { display: none; }
	#ishb-print-root .ishb-recept__title { font-size: 20pt; }
	#ishb-print-root .ishb-recept__image img { max-height: 70mm; object-fit: cover; }
	#ishb-print-root .ishb-recept__check,
	#ishb-print-root .ishb-recept__step-btn,
	#ishb-print-root .ishb-recept__btn { display: none !important; }
	#ishb-print-root .ishb-recept__ingredients label { grid-template-columns: 5rem 1fr; }
	#ishb-print-root .ishb-recept__method label { grid-template-columns: 1.5rem 1fr; }
	#ishb-print-root .ishb-recept__method label::after { grid-column: 1; }
	#ishb-print-root .ishb-recept__method label span { grid-column: 2; }
	#ishb-print-root li { text-decoration: none !important; opacity: 1 !important; break-inside: avoid; }
	#ishb-print-root li * { text-decoration: none !important; opacity: 1 !important; }
	#ishb-print-root .ishb-recept__body { grid-template-columns: 2fr 3fr; gap: 8mm; }
	#ishb-print-root .ishb-recept__servings::after { content: ""; }
	#ishb-print-root .ishb-recept__source { display: block; }
	#ishb-print-root .ishb-recept__actions { margin-top: 8mm; border-top: .5pt solid #999; padding-top: 3mm; }
}
@media screen { #ishb-print-root { display: none; } }

/* "Vad kan jag blanda?" */
.ishb-bar { border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; margin: 0 0 2.5rem; }
.ishb-bar summary { cursor: pointer; list-style: none; padding: 1rem 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; }
.ishb-bar summary::-webkit-details-marker { display: none; }
.ishb-bar summary::after { content: "+"; margin-left: auto; font-size: 1.6rem; line-height: 1; color: var(--wp--preset--color--accent-1, #9c5f43); }
.ishb-bar[open] summary::after { content: "−"; }
.ishb-bar__title { font-family: var(--wp--preset--font-family--display, inherit); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); }
.ishb-bar__hint { font-style: italic; opacity: .75; }
.ishb-bar__body { padding-bottom: 1.5rem; }
.ishb-bar__group { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--wp--preset--color--accent-1, #9c5f43); margin: 1rem 0 .5rem; }
.ishb-bar__chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.ishb-bar__chip input { position: absolute; opacity: 0; pointer-events: none; }
.ishb-bar__chip span { display: inline-block; padding: .35rem .85rem; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); border-radius: 999px; cursor: pointer; font-size: .95rem; transition: background .15s, color .15s; }
.ishb-bar__chip input:checked + span { background: var(--wp--preset--color--contrast, #2e241d); color: var(--wp--preset--color--base, #f3eee6); border-color: transparent; }
.ishb-bar__chip input:focus-visible + span { outline: 2px solid var(--wp--preset--color--accent-1, #9c5f43); outline-offset: 2px; }
.ishb-bar__staples { display: block; margin: 1.1rem 0 1.5rem; font-size: .95rem; }
.ishb-bar__head { font-family: var(--wp--preset--font-family--display, inherit); font-weight: 400; font-size: 1.4rem; margin: 1.5rem 0 1rem; }
.ishb-bar__empty { font-style: italic; opacity: .75; }
