/* ==========================================================================
   Acties: Bewaar / Delen-knoppen, meldingen (toast) en Social Snap-deelknoppen.
   Laden na main.css (gebruikt de tokens daaruit). Script: assets/js/recipe-actions.js
   ========================================================================== */

/* ---------- 1. Vierkante icoonknop (receptkop: Bewaar, Delen) ---------- */
.icon-square {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #e6e8ec;
	border-radius: var(--r-md, 12px);
	background: #fff;
	color: var(--c-navy, #384353);
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}
.icon-square:hover {
	border-color: var(--c-underline, #c9cdd3);
	background: var(--c-soft, #f7f8fa);
}
.icon-square:focus-visible {
	outline: 2px solid var(--c-navy, #384353);
	outline-offset: 2px;
}
.icon-square svg { width: 20px; height: 20px; }

@media (min-width: 1024px) {
	.icon-square { width: 46px; height: 46px; }
}

/* ---------- 2. Ghost-knop (receptkaart: Print, Pin, Bewaar, Kookmodus) ---------- */
.btn-ghost {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border: 1.5px solid var(--c-border, #dddddd);
	border-radius: var(--r-pill, 999px);
	background: #fff;
	color: var(--c-dark, #222222);
	font-family: inherit;
	font-size: 15px;
	line-height: 1;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none; /* geen hoofdletters op knoppen (review Quint 3 okt) */
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}
/* Klikvlak 44 px hoog, terwijl de knop er 40 px uitziet. */
.btn-ghost::before {
	content: "";
	position: absolute;
	inset: -2px 0;
}
.btn-ghost:hover {
	border-color: #bbbbbb;
	background: var(--c-soft, #f7f8fa);
	text-decoration: none;
}
.btn-ghost:focus-visible {
	outline: 2px solid var(--c-navy, #384353);
	outline-offset: 2px;
}
.btn-ghost svg { width: 15px; height: 15px; }
.btn-ghost[aria-pressed="true"] { border-color: var(--c-navy, #384353); }

/* ---------- 3. Bewaard-staat (hartje gevuld) ---------- */
[data-save] .icon--heart path { transition: fill 0.15s; }
[data-save].is-saved .icon--heart path { fill: currentColor; }
[data-save].is-saved .icon--heart { animation: lcc-heart-pop 0.3s ease-out; }

@keyframes lcc-heart-pop {
	0% { transform: scale(1); }
	45% { transform: scale(1.22); }
	100% { transform: scale(1); }
}

/* ---------- 4. Melding (toast) ---------- */
.lcc-toast-region {
	position: fixed;
	/* Boven de zwevende deelbalk van Social Snap (z-index 99997); het script
	   zet --lcc-toast-offset op de hoogte van die balk als hij zichtbaar is. */
	/* Ook boven de "10% korting?"-bubbel (.lc-korting-bubble, z-index 999998); een melding staat maar 4 s in beeld. */
	z-index: 1000000;
	left: 0;
	right: 0;
	bottom: calc(16px + var(--lcc-toast-offset, 0px) + env(safe-area-inset-bottom, 0px));
	display: flex;
	justify-content: center;
	padding: 0 16px;
	pointer-events: none;
}
.lcc-toast {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	max-width: 480px;
	min-height: 52px;
	padding: 4px 8px 4px 16px;
	border-radius: 16px;
	background: var(--c-navy, #384353);
	color: #fff;
	font-size: 15px;
	line-height: 20px;
	box-shadow: var(--shadow-float, 0 6px 18px rgba(0, 0, 0, 0.18));
	pointer-events: auto;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.2s, transform 0.2s;
}
.lcc-toast.is-visible {
	opacity: 1;
	transform: none;
}
.lcc-toast__icon { flex-shrink: 0; color: var(--c-blue, #e1eaf3); }
.lcc-toast__text { flex: 1 1 auto; min-width: 0; padding: 10px 0; }
.lcc-toast__action {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-left: auto;
	padding: 0 8px;
	border: 0;
	border-radius: var(--r-sm, 10px);
	background: transparent;
	color: var(--c-blue, #e1eaf3);
	font-family: inherit;
	font-size: 14px;
	line-height: 1;
	font-weight: 700;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.lcc-toast__action:hover { text-decoration: underline; color: #fff; }
.lcc-toast__action:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 0;
}

@media (min-width: 1024px) {
	.lcc-toast-region { bottom: calc(24px + var(--lcc-toast-offset, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
	.lcc-toast { transition: none; transform: none; }
	[data-save].is-saved .icon--heart { animation: none; }
}

@media print {
	.lcc-toast-region,
	.icon-square,
	.btn-ghost { display: none !important; }
}

/* ---------- 5. Social Snap-deelknoppen (inline onder het recept) ----------
   Markup en script van Social Snap blijven staan (tellers, conversie-tag op
   [data-ss-ss-link]). Alleen opmaak: zelfde stijl als nu, strakker.
   :is(.ss-inline-share-wrapper, #lcc-ss) telt als ID-selector (ook al bestaat
   #lcc-ss niet), zodat deze regels altijd winnen van socialsnap.css, ongeacht
   de laadvolgorde en zonder !important. */

:is(.ss-inline-share-wrapper, #lcc-ss) {
	/* Compacte stand hangt af van de kolombreedte, niet van het scherm
	   (desktop met zijbalk kan ook smal zijn). */
	container: lcc-share / inline-size;
	display: block;
	margin: 40px 0 var(--s-6, 24px);
	clear: both;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:is(.ss-inline-share-wrapper, #lcc-ss) .ss-inline-share-content {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 620px;
}

/* Rij met knoppen */
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-social-icons-container {
	order: 1;
	display: flex;
	flex: 1 1 auto;
	gap: 5px;
	min-width: 0;
	margin: 0;
	list-style: none;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-social-icons-container > li {
	float: none;
	display: block;
	flex: 1 1 0;
	min-width: 0;
	/* socialsnap.css zet hier margin met !important (ss-with-spacing). */
	margin: 0 !important;
	padding: 0;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-social-icons-container > li::before { content: none; }

/* Knop */
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-social-icons-container > li > a {
	position: relative;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	height: 44px;
	padding: 0;
	border-radius: 3px;
	overflow: hidden;
	color: #fff;
	line-height: 44px;
	text-decoration: none;
	transition: filter 0.15s;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-social-icons-container > li > a::after { content: none; }
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-social-icons-container > li > a:hover { filter: brightness(0.94); }
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-social-icons-container > li > a:focus-visible {
	outline: 2px solid var(--c-navy, #384353);
	outline-offset: 2px;
}

:is(.ss-inline-share-wrapper, #lcc-ss) .ss-facebook-color { background-color: #3b5998; }
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-whatsapp-color { background-color: #25d366; }
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-pinterest-color { background-color: #bd081c; }

:is(.ss-inline-share-wrapper, #lcc-ss) .ss-share-network-content {
	display: flex;
	align-items: center;
	width: 100%;
	height: 100%;
	line-height: 1;
}

/* Donker vlakje met logo (icoonfont van Social Snap) */
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-share-network-content > i.ss {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	float: none;
	width: 44px;
	min-width: 44px;
	height: 100%;
	margin: 0;
	background-color: rgba(0, 0, 0, 0.1);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	text-shadow: none;
}

/* Label + telbubbel, samen gecentreerd in de rest van de knop */
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-share-network-content > .ss-network-label {
	float: none;
	display: block;
	margin: 0 8px 0 auto;
	padding-left: 6px;
	color: #fff;
	font-size: 14px;
	line-height: 1;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-share-network-content > .ss-network-count {
	float: none;
	display: flex;
	align-items: center;
	flex-shrink: 0;
	height: 20px;
	margin: 0 auto 0 0;
	padding: 0 6px;
	border-radius: 6px 6px 6px 0;
	background: rgba(0, 0, 0, 0.3);
	color: #fff;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	white-space: nowrap;
}
/* Zonder label (instelling Social Snap): bubbel in het midden. */
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-share-network-content > i.ss + .ss-network-count { margin-left: auto; }

/* Totaal "N Shares" rechts, na een scheidingslijn */
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-inline-counter {
	order: 2;
	display: flex;
	align-items: center;
	align-self: center;
	flex-shrink: 0;
	margin: 0 0 0 13px;
	padding: 0 0 0 13px;
	border: 0;
	border-left: 1px solid rgba(0, 0, 0, 0.15);
	line-height: 1;
	text-align: left;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-inline-counter > .ss.ss-share {
	margin: 0 8px 0 0;
	color: #3a424a;
	font-size: 22px;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-total-counter {
	display: flex;
	flex-direction: column;
	padding: 0;
	text-align: left;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-total-counter > span {
	display: block;
	margin: 0;
	padding: 0;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-total-counter > span:first-child {
	color: #323b43;
	font-size: 22px;
	line-height: 24px;
	font-weight: 700;
}
:is(.ss-inline-share-wrapper, #lcc-ss) .ss-total-counter > span:last-child {
	color: rgba(0, 0, 0, 0.55);
	font-size: 14px;
	line-height: 18px;
	font-weight: 400;
	text-transform: none;
}

@media (max-width: 599.98px) {
	:is(.ss-inline-share-wrapper, #lcc-ss) { margin-top: var(--s-8, 32px); }
}

/* Smal (mobiel, of smalle kolom): alleen logo + aantal op één rij, totaal
   rechts. Moet gelijk blijven met COMPACT in recipe-actions.js (560). */
@container lcc-share (max-width: 559.98px) {
	:is(.ss-inline-share-wrapper, #lcc-ss) .ss-social-icons-container { gap: 4px; }
	:is(.ss-inline-share-wrapper, #lcc-ss) .ss-share-network-content > i.ss {
		width: 36px;
		min-width: 36px;
	}
	/* Label verborgen maar voorleesbaar: anders heet de knop alleen "129". */
	:is(.ss-inline-share-wrapper, #lcc-ss) .ss-share-network-content > .ss-network-label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
	:is(.ss-inline-share-wrapper, #lcc-ss) .ss-share-network-content > .ss-network-count { margin: 0 auto; }
	:is(.ss-inline-share-wrapper, #lcc-ss) .ss-inline-counter {
		margin-left: 6px;
		padding-left: 10px;
	}
	:is(.ss-inline-share-wrapper, #lcc-ss) .ss-inline-counter > .ss.ss-share {
		margin-right: 6px;
		font-size: 20px;
	}
	:is(.ss-inline-share-wrapper, #lcc-ss) .ss-total-counter > span:first-child {
		font-size: 18px;
		line-height: 20px;
	}
	:is(.ss-inline-share-wrapper, #lcc-ss) .ss-total-counter > span:last-child { font-size: 14px; }
}

/* ---------- Nieuwsbrief (overal: zijbalk, home, weekmenu, artikelen) ---------- */
.newsletter {
	padding: 22px;
	border-radius: var(--r-xl);
	background: var(--c-blue);
	color: var(--c-text);
}

.newsletter__head {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.newsletter__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: var(--r-pill);
	background: #fff;
	color: var(--c-navy);
}

/* Gewone letters, geen hoofdletters/condensed (besluit 3 okt). */
.newsletter .newsletter__title {
	margin: 0;
	font-family: var(--f-sans);
	font-size: 18px;
	line-height: 24px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
	color: var(--c-navy);
}

.newsletter .newsletter__text {
	margin: 4px 0 0;
	font-size: 14px;
	line-height: 21px;
	color: var(--c-muted);
}

.newsletter__form { margin: var(--s-4) 0 0; }

.newsletter__row {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.newsletter__input {
	width: 100%;
	min-width: 0;
	height: 48px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: var(--r-pill);
	background: #fff;
	color: var(--c-ink);
	font-size: 16px; /* 16px: iOS zoomt anders in */
	-webkit-appearance: none;
	appearance: none;
}
.newsletter__input::placeholder { color: var(--c-muted); opacity: 1; }
.newsletter__input:focus { outline: 0; border-color: var(--c-navy); box-shadow: 0 0 0 2px rgba(56, 67, 83, 0.18); }
.newsletter__input[aria-invalid="true"] { border-color: var(--c-error); }

.newsletter__btn { flex-shrink: 0; }
.newsletter__btn:focus-visible { outline: 2px solid var(--c-navy); outline-offset: 2px; }
.newsletter__form.is-busy .newsletter__btn { opacity: 0.7; cursor: progress; }

/* Honeypot: buiten beeld (niet display:none, sommige bots slaan dat over). */
.newsletter__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.newsletter__msg {
	margin: 0;
	font-size: 14px;
	line-height: 20px;
}
.newsletter__msg:empty { display: none; }
.newsletter__msg.is-error,
.newsletter__msg.is-success { margin-top: 10px; font-weight: 600; }
.newsletter__msg.is-error { color: var(--c-error); }
.newsletter__msg.is-success { color: var(--c-success); }

/* Na aanmelden: alleen de bevestiging, geen invulveld meer. */
.newsletter__form.is-done .newsletter__row { display: none; }
.newsletter__form.is-done .newsletter__msg.is-success { margin-top: 0; }

/* Breed (in de pagina): naar de breedte van het blok zelf (container query),
   niet van het scherm, want het staat soms in een smalle kolom. */
.newsletter--wide { container-type: inline-size; }

@container (min-width: 440px) {
	.newsletter--wide .newsletter__row { flex-direction: row; }
	.newsletter--wide .newsletter__input { flex: 1; }
}

@container (min-width: 760px) {
	.newsletter--wide .newsletter__inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: center;
		gap: var(--s-8);
	}
	.newsletter--wide .newsletter__form { margin: 0; }
	.newsletter--wide .newsletter__title { font-size: 20px; line-height: 26px; }
}

@media (min-width: 1024px) {
	.newsletter--wide { padding: 28px 32px; }
}
