/* WhiskeyMate web recipes
 * --------------------------------------------------------------
 * Card-based list + detail view styling that matches the iOS/Android
 * recipes redesign. Pulls accent colors from the shared palette
 * (#FB5607 orange, #3A86FF blue, #FFBE0B yellow) in style.css.
 */

.wm-recipe-page {
	padding-top: 16px;
}

.wm-recipe-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
}

.wm-recipe-header h1 {
	margin: 0;
}

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

/* Card grid */
.wm-recipe-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 18px;
}

.wm-recipe-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid rgba(58, 134, 255, 0.18);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
	color: inherit;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wm-recipe-card:hover,
.wm-recipe-card:focus {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
	text-decoration: none;
	color: inherit;
}

.wm-recipe-card__hero {
	width: 100%;
	aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, rgba(255, 190, 11, 0.22), rgba(58, 134, 255, 0.12));
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

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

.wm-recipe-card__hero i.placeholder {
	font-size: 42px;
	color: rgba(58, 134, 255, 0.7);
}

.wm-recipe-card__body {
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wm-recipe-card__title {
	font-size: 1.05rem;
	font-weight: 600;
	color: #1d2939;
	margin: 0;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wm-recipe-card__preview {
	font-size: 0.82rem;
	color: #6b7280;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wm-recipe-card__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 2px;
}

.wm-recipe-chip {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 600;
	color: #3A86FF;
	background: rgba(58, 134, 255, 0.10);
	padding: 3px 9px;
	border-radius: 999px;
}

.wm-recipe-source-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	font-size: 0.7rem;
	font-weight: 700;
	padding: 4px 9px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	letter-spacing: 0.02em;
}

.wm-recipe-source-badge--fitz { color: #FFBE0B; }
.wm-recipe-source-badge--manual { color: #fff; }

/* Detail view */
.wm-recipe-detail__hero {
	width: 100%;
	max-height: 360px;
	aspect-ratio: 16 / 7;
	background: linear-gradient(135deg, rgba(255, 190, 11, 0.30), rgba(58, 134, 255, 0.18));
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

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

.wm-recipe-detail__hero .secondary {
	position: absolute;
	right: 14px;
	bottom: 14px;
	width: 88px;
	height: 88px;
	border-radius: 12px;
	border: 2px solid #fff;
	overflow: hidden;
	cursor: pointer;
}

.wm-recipe-detail__hero .secondary img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wm-recipe-detail__placeholder {
	font-size: 64px;
	color: rgba(58, 134, 255, 0.7);
}

.wm-recipe-detail__title {
	font-size: 2rem;
	font-weight: 700;
	color: #1d2939;
	margin: 18px 0 4px;
}

.wm-recipe-detail__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.wm-recipe-section {
	background: #ffffff;
	border: 1px solid rgba(58, 134, 255, 0.18);
	border-radius: 14px;
	padding: 16px 18px;
	margin-bottom: 14px;
}

.wm-recipe-section h3 {
	font-size: 1rem;
	font-weight: 700;
	color: #FFBE0B;
	margin: 0 0 8px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.wm-ingredient-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 10px;
}

.wm-ingredient-header h3 {
	margin-bottom: 2px;
}

.wm-ingredient-header p {
	margin: 0;
	font-size: 0.78rem;
	color: #667085;
}

.wm-batch-control {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	border: 1px solid rgba(255, 190, 11, 0.45);
	border-radius: 999px;
	background: rgba(255, 190, 11, 0.08);
	overflow: hidden;
}

.wm-batch-control button {
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	color: #9a6c00;
	font-size: 1.25rem;
	font-weight: 700;
}

.wm-batch-control button:disabled {
	opacity: 0.35;
}

.wm-batch-control button:focus-visible {
	outline: 2px solid #3A86FF;
	outline-offset: -2px;
}

.wm-batch-control output {
	min-width: 42px;
	text-align: center;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: #1d2939;
}

.wm-recipe-section ul.bullets {
	list-style: none;
	padding: 0;
	margin: 0;
}

.wm-recipe-section ul.bullets li {
	padding: 4px 0;
	position: relative;
	padding-left: 18px;
}

.wm-recipe-section ul.bullets li::before {
	content: "•";
	position: absolute;
	left: 4px;
	color: #FFBE0B;
	font-weight: bold;
}

.wm-recipe-section ol.steps {
	list-style: none;
	counter-reset: step;
	padding: 0;
	margin: 0;
}

.wm-recipe-section ol.steps li {
	counter-increment: step;
	padding: 6px 0;
	display: flex;
	gap: 10px;
}

.wm-recipe-section ol.steps li::before {
	content: counter(step);
	width: 28px;
	height: 28px;
	background: #3A86FF;
	color: #fff;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.85rem;
	flex-shrink: 0;
}

/* Form */
.wm-recipe-form .photo-slot {
	width: 120px;
	height: 120px;
	border-radius: 12px;
	border: 1px solid rgba(255, 190, 11, 0.35);
	background: linear-gradient(135deg, rgba(255, 190, 11, 0.20), rgba(58, 134, 255, 0.10));
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	cursor: pointer;
	position: relative;
}

.wm-recipe-form .photo-slot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wm-recipe-form .photo-slot .placeholder-icon {
	font-size: 26px;
	color: rgba(58, 134, 255, 0.7);
}

.wm-recipe-form .photo-slot input[type=file] { display: none; }

.wm-recipe-form .photos-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.wm-recipe-form .photo-slot-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.wm-row-controls {
	display: flex;
	gap: 6px;
	align-items: center;
}

.wm-row-controls .form-control { flex: 1; }

.wm-add-row-btn {
	margin-top: 6px;
}

/* Empty state */
.wm-recipe-empty {
	text-align: center;
	padding: 48px 24px;
	border: 1px dashed rgba(58, 134, 255, 0.25);
	border-radius: 16px;
}

.wm-recipe-empty i {
	font-size: 48px;
	color: rgba(255, 190, 11, 0.7);
	margin-bottom: 14px;
}

/* Lightbox */
.wm-recipe-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1080;
}

.wm-recipe-lightbox.open { display: flex; }

.wm-recipe-lightbox img {
	max-width: 92vw;
	max-height: 90vh;
}

.wm-recipe-lightbox .close-btn {
	position: absolute;
	top: 16px;
	right: 20px;
	background: none;
	border: none;
	color: #fff;
	font-size: 32px;
	cursor: pointer;
}

/* Polish-with-Fitz panel */
.wm-polish-panel {
	border: 1px solid rgba(255, 190, 11, 0.45);
	border-radius: 14px;
	padding: 14px 16px;
	margin-top: 12px;
	background: rgba(255, 190, 11, 0.08);
}

.wm-polish-panel .summary {
	font-size: 0.85rem;
	color: #1d2939;
	margin-top: 8px;
}

.wm-polish-panel .error { color: #b00020; }

/* In-chat recipe card under Fitz reply */
.wm-fitz-recipe-card {
	border: 1px solid rgba(58, 134, 255, 0.22);
	border-radius: 14px;
	padding: 12px 14px;
	margin-top: 10px;
	background: #ffffff;
}

.wm-fitz-recipe-card .title {
	font-weight: 700;
	color: #1d2939;
	margin-bottom: 8px;
}

.wm-fitz-recipe-card .chips {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.wm-fitz-recipe-card .actions {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}

@media (max-width: 575.98px) {
	.wm-ingredient-header {
		align-items: flex-start;
		flex-direction: column;
	}

	.wm-batch-control {
		align-self: stretch;
		justify-content: space-between;
	}
}
