/* ==========================================================================
   Ingredient Page — Quick Facts, Pill Bar, Browse, Pantry Index
   Conditionally enqueued on foods taxonomy, single recipe, and pantry index.
   ========================================================================== */

/* ==========================================================================
   Ingredient Quick Facts Band
   Full-width warm band with 2-column layout: macros + Annie's quote
   ========================================================================== */

.kf-ing-band {
	background: #fdf9f5;
	border-top: 1px solid #e8e2d9;
	border-bottom: 1px solid #e8e2d9;
	padding: 36px 0;
	margin: 0 0 8px;
}

.kf-ing-grid {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 40px;
	align-items: start;
}

/* --- Verdict badge --- */

.kf-ing-verdict {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 18px;
	border-radius: 20px;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 24px;
}

.kf-ing-verdict--friendly {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.kf-ing-verdict--sparingly {
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #fde68a;
}

.kf-ing-verdict--avoid {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.kf-ing-verdict-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	flex-shrink: 0;
}

.kf-ing-verdict--friendly .kf-ing-verdict-dot { background: #10b981; }
.kf-ing-verdict--sparingly .kf-ing-verdict-dot { background: #f59e0b; }
.kf-ing-verdict--avoid .kf-ing-verdict-dot { background: #ef4444; }

/* --- Macro stat boxes --- */

.kf-ing-macros {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 24px;
}

.kf-ing-macro {
	background: #fff;
	border: 1px solid #e8e2d9;
	border-radius: 10px;
	padding: 16px 12px 14px;
	text-align: center;
	border-top: 3px solid #2B354F;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kf-ing-macro:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(120, 90, 50, 0.1);
}

.kf-ing-macro--fat { border-top-color: #f59e0b; }
.kf-ing-macro--protein { border-top-color: #c4714b; }
.kf-ing-macro--carbs { border-top-color: #10b981; }

.kf-ing-macro-val {
	display: block;
	font-family: 'Libre Baskerville', Georgia, serif;
	font-size: 1.5rem;
	font-weight: 700;
	color: #2B354F;
	line-height: 1.1;
	margin-bottom: 4px;
}

.kf-ing-macro-lbl {
	display: block;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #8a7e6e;
}

/* --- Detail tags (best for, sub, storage) --- */

.kf-ing-tags {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.kf-ing-tag {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #e8e2d9;
	border-radius: 8px;
}

.kf-ing-tag-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: #f5f0ea;
	border-radius: 8px;
	color: #c4714b;
	flex-shrink: 0;
}

.kf-ing-tag-label {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8a7e6e;
	min-width: 60px;
}

.kf-ing-tag-value {
	font-size: 0.92rem;
	font-weight: 600;
	color: #2B354F;
	line-height: 1.3;
}

/* --- Annie's quote (right column) --- */

.kf-ing-quote {
	background: #fff;
	border: 1px solid #e8e2d9;
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 4px 24px rgba(120, 90, 50, 0.07);
	position: relative;
}

.kf-ing-quote::before {
	content: '';
	position: absolute;
	top: 0;
	left: 24px;
	right: 24px;
	height: 3px;
	background: linear-gradient(90deg, #c4714b, #f59e0b);
	border-radius: 0 0 3px 3px;
}

.kf-ing-quote-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid #efe9e0;
}

.kf-ing-quote-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #e8e2d9;
}

.kf-ing-quote-name {
	display: block;
	font-weight: 700;
	font-size: 0.92rem;
	color: #2B354F;
	line-height: 1.3;
}

.kf-ing-quote-role {
	display: block;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #c4714b;
}

.kf-ing-quote-text {
	font-size: 0.95rem;
	line-height: 1.7;
	color: #3a3f4b;
	margin: 0;
	padding: 0;
	border: none;
	font-style: normal;
}

.kf-ing-quote-text p {
	margin: 0 0 10px;
}

.kf-ing-quote-text p:last-child {
	margin: 0;
}


/* ==========================================================================
   Related Ingredients Pill Bar
   ========================================================================== */

.kf-ingredient-related {
	margin: 0 0 32px;
}

.kf-ingredient-related-title {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8a7e6e;
	margin: 0 0 12px;
}

.kf-ingredient-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.kf-ingredient-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 14px;
	background: #fdf9f5;
	border: 1px solid #e8e2d9;
	border-radius: 20px;
	color: #6b5e4b;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
	white-space: nowrap;
}

.kf-ingredient-pill:hover {
	background: #c4714b;
	border-color: #c4714b;
	color: #fff;
	transform: translateY(-1px);
	text-decoration: none;
}

.kf-ingredient-pill-count {
	font-size: 0.75rem;
	opacity: 0.65;
	font-weight: 500;
}


/* ==========================================================================
   Browse by Ingredient (on single recipe pages)
   ========================================================================== */

.kf-browse-ingredients {
	margin: 32px 0;
	padding: 20px 24px;
	background: #f8f5f0;
	border: 1px solid #e8e2d9;
	border-radius: 12px;
}

.kf-browse-ingredients-title {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8a7e6e;
	margin: 0 0 12px;
}

.kf-browse-ingredients .kf-ingredient-pills {
	/* inherits from pill bar above */
}


/* ==========================================================================
   Ingredients Index / Pantry Page
   ========================================================================== */

/* Hero */
.kf-pantry-hero {
	text-align: center;
	padding: 48px 0 32px;
}

.kf-pantry-hero-title {
	font-family: 'Libre Baskerville', Georgia, serif;
	font-size: 2.2rem;
	font-weight: 700;
	color: #2B354F;
	margin: 0 0 12px;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.kf-pantry-hero-subtitle {
	font-size: 1.05rem;
	line-height: 1.6;
	color: #8a7e6e;
	max-width: 540px;
	margin: 0 auto;
}

/* Category block */
.kf-pantry-category {
	margin-bottom: 48px;
}

.kf-pantry-category-title {
	font-family: 'Libre Baskerville', Georgia, serif;
	font-size: 1.35rem;
	font-weight: 700;
	color: #2B354F;
	margin: 0 0 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid #c4714b;
	display: inline-block;
	line-height: 1.3;
}

/* Card grid — wider minmax for larger cards */
.kf-pantry-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

/* Individual card */
.kf-pantry-card {
	background: #fff;
	border: 1px solid #e8e2d9;
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	display: block;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	box-shadow: 0 2px 8px rgba(120, 90, 50, 0.07);
}

.kf-pantry-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(120, 90, 50, 0.12), 0 2px 6px rgba(120, 90, 50, 0.06);
	text-decoration: none;
}

/* Card image — 4:3 aspect ratio, relative for badge positioning */
.kf-pantry-card-img {
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f5f0ea;
	position: relative;
}

.kf-pantry-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

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

/* No-image placeholder */
.kf-pantry-card-img-placeholder {
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #f5f0ea;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #c4b99a;
	font-size: 2rem;
}

/* Card info */
.kf-pantry-card-info {
	padding: 12px 14px;
}

.kf-pantry-card-name {
	display: block;
	font-weight: 700;
	font-size: 0.92rem;
	color: #2B354F;
	line-height: 1.3;
	margin-bottom: 3px;
}

.kf-pantry-card-count {
	font-size: 0.78rem;
	color: #6b5e4b;
	font-weight: 500;
}

/* Card meta row — recipe count + net carbs side by side */
.kf-pantry-card-meta {
	display: flex;
	align-items: center;
	gap: 8px;
}

.kf-pantry-card-carbs {
	font-size: 0.72rem;
	font-weight: 600;
	color: #10b981;
	background: #ecfdf5;
	padding: 1px 7px;
	border-radius: 8px;
}

/* Verdict badge overlay on card image */
.kf-pantry-card-badge {
	position: absolute;
	bottom: 8px;
	left: 8px;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 4px 10px;
	border-radius: 12px;
	line-height: 1;
}

.kf-pantry-card-badge--keto-friendly {
	background: rgba(209, 250, 229, 0.92);
	color: #065f46;
}

.kf-pantry-card-badge--use-sparingly {
	background: rgba(254, 243, 199, 0.92);
	color: #92400e;
}

.kf-pantry-card-badge--avoid {
	background: rgba(254, 226, 226, 0.92);
	color: #991b1b;
}


/* ==========================================================================
   Responsive — Mobile (max-width: 575px)
   ========================================================================== */

@media (max-width: 575px) {

	/* Quick Facts Band — stack to single column */
	.kf-ing-band {
		padding: 24px 0;
	}

	.kf-ing-grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.kf-ing-macros {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
		margin-bottom: 20px;
	}

	.kf-ing-macro {
		padding: 12px 8px 10px;
	}

	.kf-ing-macro-val {
		font-size: 1.25rem;
	}

	.kf-ing-macro-lbl {
		font-size: 0.62rem;
	}

	.kf-ing-verdict {
		margin-bottom: 18px;
	}

	.kf-ing-quote {
		padding: 18px;
	}

	.kf-ing-quote-text {
		font-size: 0.9rem;
	}

	/* Pill bar */
	.kf-ingredient-pill {
		font-size: 0.82rem;
		padding: 5px 12px;
	}

	/* Browse by ingredient */
	.kf-browse-ingredients {
		padding: 14px 16px;
		margin: 24px 0;
	}

	/* Pantry hero */
	.kf-pantry-hero {
		padding: 32px 0 24px;
	}

	.kf-pantry-hero-title {
		font-size: 1.6rem;
	}

	.kf-pantry-hero-subtitle {
		font-size: 0.95rem;
	}

	/* Pantry category */
	.kf-pantry-category {
		margin-bottom: 36px;
	}

	.kf-pantry-category-title {
		font-size: 1.15rem;
	}

	/* Pantry grid — 2-up on mobile */
	.kf-pantry-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.kf-pantry-card-info {
		padding: 10px 10px;
	}

	.kf-pantry-card-name {
		font-size: 0.85rem;
	}

	.kf-pantry-card-count {
		font-size: 0.72rem;
	}

	.kf-pantry-card-meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}

	.kf-pantry-card-badge {
		font-size: 0.58rem;
		padding: 3px 8px;
	}
}
