/**
 * Restaurant Menu Manager - default front-end stylesheet.
 *
 * Deliberately minimal, with every rule keyed off a class in the
 * `.rmm-` namespace so a child theme (or a Customizer "Additional CSS"
 * block) can override any part of it with a single more-specific rule or
 * by simply enqueueing a stylesheet after this one and re-declaring the
 * class it wants to change. No IDs, no `!important`, no element selectors
 * outside of this file's own components.
 */

/* The menu is a size container: the @container rules below adapt the layout
 * to the width the menu actually gets on the page (a narrow page column, a
 * sidebar, a phone), not to the width of the whole screen. `width: 100%`
 * keeps it from collapsing when a theme places it inside a flex layout. */
.rmm-menu {
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
	container-type: inline-size;
}

.rmm-menu-empty {
	font-style: italic;
	opacity: 0.75;
}

.rmm-section {
	margin: 0 0 3em;
}

.rmm-section__title {
	font-size: 1.5em;
	margin: 0 0 1em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-weight: 600;
}

.rmm-section__description {
	margin: 0 0 1.25em;
	opacity: 0.85;
}

.rmm-subsection {
	margin: 0 0 2.25em;
}

.rmm-subsection:last-child {
	margin-bottom: 0;
}

.rmm-section > .rmm-dishes + .rmm-subsection,
.rmm-section > .rmm-dishes + .rmm-columns {
	margin-top: 2.25em;
}

/* Sections split into columns by a Column Break in the admin. */
.rmm-menu--columns {
	max-width: 1200px;
}

.rmm-columns {
	display: grid;
	grid-template-columns: repeat(var(--rmm-columns, 2), minmax(0, 1fr));
	gap: 0 56px;
	align-items: start;
}

/* Too little room for two readable columns: stack them. The @media rule is
 * the fallback for browsers without container queries. */
@media (max-width: 767px) {
	.rmm-columns {
		grid-template-columns: minmax(0, 1fr);
	}

	.rmm-column + .rmm-column {
		margin-top: 2.25em;
	}
}

@container (max-width: 760px) {
	.rmm-columns {
		grid-template-columns: minmax(0, 1fr);
	}

	.rmm-column + .rmm-column {
		margin-top: 2.25em;
	}
}

/* A narrow menu (e.g. on a phone): smaller photos leave the name more room. */
@container (max-width: 480px) {
	.rmm-dish .rmm-dish__image img {
		width: 64px;
		height: 64px;
	}
}

.rmm-subsection__title {
	font-size: 1.15em;
	margin: 0 0 1em;
	font-weight: 600;
}

.rmm-dishes {
	display: flex;
	flex-direction: column;
	gap: 2.25em;
}

.rmm-dish {
	display: flex;
	gap: 1em;
	align-items: flex-start;
}

.rmm-dish__image {
	flex: 0 0 auto;
}

.rmm-dish__image img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

.rmm-dish__image-link {
	display: block;
	border-radius: 6px;
	cursor: zoom-in;
}

.rmm-dish__image-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Photo lightbox (assets/js/rmm-frontend.js). */
html.rmm-lightbox-open {
	overflow: hidden;
}

.rmm-lightbox {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 64px 16px 24px;
	background: rgba(0, 0, 0, 0.88);
	animation: rmm-lightbox-fade 0.15s ease-out;
}

.rmm-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
}

.rmm-lightbox__image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100vh - 140px);
	object-fit: contain;
	border-radius: 4px;
}

.rmm-lightbox__caption {
	margin: 12px 0 0;
	color: #fff;
	font-size: 1em;
	line-height: 1.4;
	text-align: center;
}

.rmm-lightbox__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	box-shadow: none;
	color: #fff;
	font-size: 28px;
	line-height: 44px;
	text-align: center;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}

.rmm-lightbox__close:hover,
.rmm-lightbox__close:focus-visible {
	background: rgba(255, 255, 255, 0.3);
}

.rmm-lightbox__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@keyframes rmm-lightbox-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rmm-lightbox {
		animation: none;
	}
}

.rmm-dish__body {
	flex: 1 1 auto;
	min-width: 0;
}

/* Title (+ optional prefix) and, for a dish with exactly one price, its
 * price sit on this one row, price pushed to the far right - a classic
 * printed-menu layout. A dish with several price variants instead shows
 * just the title here; its price list renders as its own block below
 * (see .rmm-price-list further down) since several prices don't fit
 * legibly on one line with the title. */
.rmm-dish__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.25em 1em;
}

/* The name takes the free space next to the price. If even that would
 * leave it narrower than ~8em, the price moves to its own line (still on
 * the right) instead of the name breaking after every word. */
.rmm-dish__title {
	flex: 1 1 8em;
	min-width: 0;
	font-size: 1.1em;
	margin: 0;
}

.rmm-dish__prefix {
	font-weight: 400;
	opacity: 0.75;
}

.rmm-dish__row .rmm-price-single {
	flex: 0 0 auto;
	margin-left: auto;
	white-space: nowrap;
}

.rmm-dish__description {
	margin: 0.4em 0 0.5em;
	opacity: 0.85;
}

.rmm-dish__description p:last-child {
	margin-bottom: 0;
}

/* Allergens line up with the start of the dish name, with some space below
 * it. The extra `.rmm-dish ul` / `li` specificity beats themes (e.g.
 * Flatsome) that indent every list and give each list item a left margin,
 * which would push the badges away from the name and apart. */
.rmm-dish ul.rmm-dish__allergens {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 0.4em;
	margin: 0.75em 0 0.5em;
	padding: 0;
}

.rmm-dish ul.rmm-dish__allergens > li.rmm-allergen {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0;
}

.rmm-allergen__icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	border-radius: 3px;
}

.rmm-allergen__label {
	font-size: 0.75em;
	padding: 0.15em 0.5em;
	border: 1px solid currentColor;
	border-radius: 999px;
	opacity: 0.75;
}

.rmm-price-single,
.rmm-price-list {
	margin: 0;
	font-weight: 600;
}

.rmm-price-list {
	list-style: none;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15em;
}

.rmm-price-row {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	max-width: 320px;
}

.rmm-price-row__measure,
.rmm-price-single__measure {
	font-weight: 400;
	opacity: 0.75;
}

.rmm-price-row__comment,
.rmm-price-single__comment {
	font-weight: 400;
	font-size: 0.85em;
	opacity: 0.65;
}
