/**
 * WP PDC Recipes — Front-end styles.
 */

/* ─── Reset theme overrides ─────────────────────────── */
/* Theme .page-body forces list-style on ul/ol — we kill it inside our card */

.pdc-recipe-card ul,
.pdc-recipe-card ol,
.pdc-recipe-card ul li,
.pdc-recipe-card ol li,
.pdc-recipe-modal ul,
.pdc-recipe-modal ol,
.pdc-recipe-modal ul li,
.pdc-recipe-modal ol li {
	list-style: none !important;
	list-style-type: none !important;
}

/* ─── Recipe Card ───────────────────────────────────── */

.pdc-recipe-card {
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	margin: 2rem 0;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	max-width: 900px;
}

/* ─── Image (forced landscape 16:9) ─────────────────── */

.pdc-recipe-card__image {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	overflow: hidden;
}

.pdc-recipe-card__image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ─── Header ────────────────────────────────────────── */

.pdc-recipe-card__header {
	padding: 1.5rem;
	border-bottom: 1px solid #f1f5f9;
}

.pdc-recipe-card__title {
	font-size: 1.6rem;
	margin: 0 0 0.5rem;
	line-height: 1.3;
	color: #1e293b;
}

.pdc-recipe-card__description {
	color: #64748b;
	font-size: 0.95rem;
	margin: 0 0 1rem;
	line-height: 1.5;
}

/* Info grid */

.pdc-recipe-card__info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	gap: 0;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 1rem;
}

.pdc-recipe-card__info-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.75rem 0.5rem;
	text-align: center;
	border-right: 1px solid #e2e8f0;
	border-bottom: 1px solid #e2e8f0;
}

.pdc-recipe-card__info-item:last-child {
	border-right: none;
}

.pdc-recipe-card__info-icon {
	color: var(--pdc-color-primary, #e74c3c);
	margin-bottom: 4px;
}

.pdc-recipe-card__info-label {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #94a3b8;
	margin-bottom: 2px;
}

.pdc-recipe-card__info-value {
	font-size: 1rem;
	font-weight: 700;
	color: #1e293b;
}

/* Tags */

.pdc-recipe-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 1rem;
}

.pdc-recipe-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.6rem;
	background: var(--pdc-color-primary, #e74c3c);
	color: #fff;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 600;
}

.pdc-recipe-tag--diet {
	background: #27ae60;
}

.pdc-recipe-tag--diet svg {
	flex-shrink: 0;
}

/* Action buttons */

.pdc-recipe-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.pdc-recipe-card__actions button,
.pdc-recipe-card__actions a {
	padding: 0.5rem 1rem;
	background: none;
	border: 2px solid #cbd5e1;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.82rem;
	color: #475569;
	transition: all 0.2s;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-family: inherit;
}

.pdc-recipe-card__actions button:hover,
.pdc-recipe-card__actions a:hover {
	border-color: var(--pdc-color-primary, #e74c3c);
	color: var(--pdc-color-primary, #e74c3c);
}

.pdc-recipe-card__actions .pdc-share-whatsapp:hover {
	border-color: #25d366;
	color: #25d366;
}

.pdc-recipe-card__actions .pdc-share-messenger:hover {
	border-color: #0084ff;
	color: #0084ff;
}

/* ─── Body ──────────────────────────────────────────── */

.pdc-recipe-card__body {
	padding: 1.5rem;
}

/* Section headers */

.pdc-recipe-card__ingredients h3,
.pdc-recipe-card__tools h3,
.pdc-recipe-card__instructions h3 {
	font-size: 1.3rem;
	margin: 0 0 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--pdc-color-primary, #e74c3c);
	color: #1e293b;
}

.pdc-recipe-card__ingredients h4,
.pdc-recipe-card__instructions h4 {
	font-size: 1rem;
	font-weight: 700;
	color: #475569;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin: 1rem 0 0.5rem;
}

/* ─── Servings selector ─────────────────────────────── */

.pdc-recipe-card__section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.pdc-recipe-card__section-header h3 {
	margin-bottom: 0;
	flex: 1;
}

.pdc-recipe-servings {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	margin-bottom: 0.75rem;
}

.pdc-recipe-servings__btn {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid var(--pdc-color-primary, #e74c3c);
	background: #fff;
	color: var(--pdc-color-primary, #e74c3c);
	font-size: 1.1rem;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	padding: 0;
	line-height: 1;
}

.pdc-recipe-servings__btn:hover {
	background: var(--pdc-color-primary, #e74c3c);
	color: #fff;
}

.pdc-recipe-servings__value {
	font-size: 1.2rem;
	font-weight: 700;
	min-width: 2rem;
	text-align: center;
	color: #1e293b;
}

.pdc-recipe-servings__label {
	font-size: 0.85rem;
	color: #64748b;
}

/* ─── Ingredients list ──────────────────────────────── */

.pdc-recipe-card__ingredients {
	margin-bottom: 1.5rem;
}

.pdc-recipe-ingredients__list {
	padding: 0 !important;
	margin: 0 !important;
	columns: 2;
	column-gap: 1.5rem;
}

.pdc-recipe-ingredients__list li {
	padding: 0.5rem 0 0.5rem 1.8rem !important;
	position: relative;
	break-inside: avoid;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.95rem;
	cursor: pointer;
	transition: opacity 0.2s;
	margin: 0;
}

/* Checkbox circle */
.pdc-ingredient-check {
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border: 2px solid #cbd5e1;
	border-radius: 50%;
	transition: all 0.2s;
	display: block;
}

.pdc-recipe-ingredients__list li.pdc-ingredient--checked .pdc-ingredient-check {
	background: var(--pdc-color-primary, #e74c3c);
	border-color: var(--pdc-color-primary, #e74c3c);
}

.pdc-recipe-ingredients__list li.pdc-ingredient--checked .pdc-ingredient-check::after {
	content: "\2713";
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	line-height: 1;
}

.pdc-recipe-ingredients__list li.pdc-ingredient--checked {
	opacity: 0.45;
	text-decoration: line-through;
	text-decoration-color: #94a3b8;
}

.pdc-ingredient-amount {
	font-weight: 700;
}

.pdc-ingredient-unit {
	color: #64748b;
}

/* ─── Equipment ─────────────────────────────────────── */

.pdc-recipe-card__tools {
	margin-bottom: 1.5rem;
}

.pdc-recipe-card__tools ul {
	padding: 0 !important;
	margin: 0 !important;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.pdc-recipe-card__tools li {
	background: #f1f5f9;
	padding: 0.35rem 0.75rem !important;
	border-radius: 20px;
	font-size: 0.85rem;
	color: #475569;
	margin: 0;
}

/* ─── Steps ─────────────────────────────────────────── */

.pdc-recipe-card__instructions {
	margin-bottom: 1rem;
}

.pdc-recipe-steps {
	padding: 0 !important;
	margin: 0 !important;
	counter-reset: step-counter;
}

.pdc-recipe-step {
	counter-increment: step-counter;
	padding: 0.8rem 0 0.8rem 2.8rem !important;
	border-bottom: 1px solid #f1f5f9;
	position: relative;
	font-size: 0.95rem;
	line-height: 1.6;
	margin: 0;
}

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

.pdc-recipe-step::before {
	content: counter(step-counter);
	position: absolute;
	left: 0;
	top: 0.8rem;
	width: 1.8rem;
	height: 1.8rem;
	background: var(--pdc-color-primary, #e74c3c);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.75rem;
}

.pdc-recipe-step__image {
	margin-top: 0.75rem;
	border-radius: 8px;
	max-width: 100%;
	height: auto;
}

/* ─── Kitchen Mode Modal ───────────────────────────── */

.pdc-recipe-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
}

.pdc-recipe-modal__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
}

.pdc-recipe-modal__content {
	position: relative;
	background: #fff;
	width: 90%;
	max-width: 700px;
	max-height: 90vh;
	margin: 5vh auto;
	border-radius: 12px;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pdc-recipe-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.2rem 1.5rem;
	border-bottom: 1px solid #e2e8f0;
	position: sticky;
	top: 0;
	background: #fff;
	z-index: 1;
}

.pdc-recipe-modal__title {
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0;
	color: #1e293b;
}

.pdc-recipe-modal__close {
	background: none;
	border: none;
	font-size: 2rem;
	cursor: pointer;
	color: #94a3b8;
	padding: 0;
	line-height: 1;
}

.pdc-recipe-modal__close:hover {
	color: var(--pdc-color-primary, #e74c3c);
}

.pdc-recipe-modal__body {
	padding: 1.5rem;
}

.pdc-recipe-modal__section {
	margin-bottom: 2rem;
}

.pdc-recipe-modal__section-title {
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0 0 0.75rem;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--pdc-color-primary, #e74c3c);
	color: #1e293b;
}

.pdc-recipe-modal__group-title {
	font-size: 0.9rem;
	font-weight: 700;
	text-transform: uppercase;
	color: #475569;
	margin: 1rem 0 0.5rem;
}

/* Checklist */
.pdc-recipe-modal__checklist {
	padding: 0 !important;
	margin: 0 !important;
}

.pdc-recipe-modal__checklist li {
	padding: 0.5rem 0 !important;
	border-bottom: 1px solid #f1f5f9;
	margin: 0;
}

.pdc-recipe-modal__checklist label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1.5;
}

.pdc-recipe-modal__checklist input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: var(--pdc-color-primary, #e74c3c);
	flex-shrink: 0;
	margin-top: 2px;
	cursor: pointer;
}

.pdc-recipe-modal__checklist input[type="checkbox"]:checked + span,
.pdc-recipe-modal__checklist label:has(input:checked) {
	opacity: 0.45;
	text-decoration: line-through;
	text-decoration-color: #94a3b8;
}

/* Steps in modal — larger text */
.pdc-recipe-modal__steps li {
	padding: 0.75rem 0 !important;
}

/* ─── Responsive ───────────────────────────────────── */

@media (max-width: 600px) {
	.pdc-recipe-card__info-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.pdc-recipe-ingredients__list {
		columns: 1;
	}

	.pdc-recipe-step {
		padding-left: 2.5rem !important;
	}

	.pdc-recipe-card__actions {
		flex-direction: column;
	}

	.pdc-recipe-modal__content {
		width: 95%;
		margin: 2.5vh auto;
		max-height: 95vh;
	}
}

/* ─── Print ────────────────────────────────────────── */

@media print {
	.pdc-recipe-card__actions,
	.pdc-recipe-servings,
	.pdc-recipe-card__tags,
	.pdc-recipe-modal {
		display: none !important;
	}

	.pdc-recipe-card {
		box-shadow: none;
		border: 1px solid #ccc;
		max-width: 100%;
		break-inside: avoid;
	}

	.pdc-recipe-card__image {
		padding-top: 40%;
	}

	.pdc-recipe-ingredients__list {
		columns: 2;
	}

	.pdc-recipe-step__image {
		max-width: 250px;
	}
}
