/**
 * Frontend styling for the [restaurant_menu] shortcode. Layout mirrors
 * https://islands.erg5egvpws-9249ggj8o3kr.p.temp-site.link/food-menu-example-2/ :
 * each section is a photo (2/3 width) beside its title/divider/description,
 * or — with no photo — that same text block centered at full width, followed
 * by that section's items in a responsive, equal-height 3/2/1 column grid.
 *
 * Breakpoints (1024px tablet, 600px phone) match the ones already used by
 * the Islands Locations Map plugin's own grid shortcode, for consistency
 * across the site's plugins.
 */

.irm-menu {
	width: 100%;
	max-width: 1350px;
	margin: 0 auto;
	padding: 0 1.5rem;
	box-sizing: border-box;
}

.irm-menu * {
	box-sizing: border-box;
}

/* ---- Section jump-nav: anchors to each section, styled after the same
   reference page's own jump-nav bar (teal pill, white uppercase links) ---- */

.irm-section-nav {
	margin: 4rem 0;
	padding: 1.5rem;
	background-color: #5cb9bba8;
	border-radius: 17px;
}

.irm-section-nav-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.75rem 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.irm-section-nav-list a {
	display: inline-block;
	white-space: nowrap;
	/* #0d2e2f on this #5cb9bb background is ~6.3:1 — WCAG AA requires 4.5:1
	   for normal-size text; plain white text here was only ~2.3:1. */
	color: #0d2e2f;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	font-size: 1rem;
	transition: color 0.2s ease;
}

.irm-section-nav-list a:hover,
.irm-section-nav-list a:focus {
	/* ~7.6:1 against the same background, plus an underline so the hover/
	   focus state isn't conveyed by color alone. */
	color: #1a1a1a;
	text-decoration: underline;
}

/* ---- Section wrapper (photo/title/description header + its items grid) ---- */

.irm-section {
	margin-bottom: 4rem;
}

/* ---- Section header: photo + title/divider/description ---- */

.irm-section-header {
	display: grid;
	align-items: center;
	gap: 40px;
}

.irm-section-header-has-photo {
	grid-template-columns: 2fr 1fr;
}

.irm-section-header-no-photo {
	grid-template-columns: 1fr;
	max-width: 700px;
	margin: 0 auto;
}

.irm-section-photo img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 1em;
	border: 5px solid #5bab85;
}

.irm-section-text {
	text-align: center;
}

.irm-section-divider {
	display: inline-block;
	height: auto;
	width: 100%;
	max-width: 350px;
	margin: 0 0 16px;
}

.irm-section-description {
	margin: 0;
	font-size: 1.5rem;
	line-height: 1.6;
	color: #64717a;
}

/* ---- Items grid: 3 columns desktop, equal height, cream cards ---- */

.irm-items-grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 1.5rem;
	margin: 2rem 0;
	align-items: stretch;
}

.irm-item-card {
	background-color: #f4ead4;
	border: 1px solid #d3cbbc;
	border-radius: 0.5em;
	padding: 1rem;
	height: 100%;
}

.irm-item-description {
	margin: 0 0 10px;
	font-size: 1.2rem;
	line-height: 1.55;
	color: #56656d;
}

.irm-item-calories {
	margin: 0;
	margin-bottom: 0 !important;
	font-size: 0.9rem;
	letter-spacing: 0.7px;
	text-transform: uppercase;
	/* #8b7464 on this card's #f4ead4 background was only ~3.7:1; #796557 is
	   the closest match that clears WCAG AA's 4.5:1 for normal-size text. */
	color: #796557;
}

/* ---- Back to Top: sits after the last section, same teal/uppercase
   treatment as the jump-nav above but as a single small pill link ---- */

.irm-back-to-top {
	margin: 1rem 0 2rem;
	text-align: center;
}

.irm-back-to-top-link {
	display: inline-flex;
	align-items: center;
	/* Same #0d2e2f on #5cb9bb pairing as .irm-section-nav-list a (~6.3:1,
	   clears WCAG AA's 4.5:1 for normal-size text). */
	color: #0d2e2f;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	font-size: 1rem;
	padding: 0.6rem 1.25rem;
	border-radius: 999px;
	background-color: #5cb9bba8;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.irm-back-to-top-link:hover,
.irm-back-to-top-link:focus {
	/* Same ~7.6:1 hover/focus pairing as .irm-section-nav-list a, plus an
	   underline so the state isn't conveyed by color alone. */
	color: #1a1a1a;
	text-decoration: underline;
	background-color: #5cb9bb;
}

/* ---- Tablet: 2-column item grid ---- */
@media ( max-width: 1024px ) {
	.irm-items-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

/* ---- Phone: stacked section header (photo full width, on top), 1-column item grid ---- */
@media ( max-width: 600px ) {
	.irm-section-header-has-photo {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.irm-items-grid {
		grid-template-columns: 1fr;
	}
}
