/**
 * Fat Boy's — Week Planner
 *
 * Built on the tokens already in mockup.css. Nothing here introduces a new colour,
 * a new font or a new radius; if a value looks arbitrary it is being inherited.
 *
 * Mobile first. The demo is checked at ten widths and must not overflow at any of
 * them, so every grid here collapses to one column and every number is allowed to
 * wrap rather than forcing a minimum width.
 */

.fb-planner {
	--fb-pl-gap: 1rem;
	margin: 2rem 0;
}

.fb-planner__noscript {
	padding: 1rem;
	border: 2px solid currentColor;
}

/* ---------------------------------------------------------------- step frame */

.fb-pl-step {
	margin: 0 0 2rem;
	padding: 0 0 1.75rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.fb-pl-step:last-child {
	border-bottom: 0;
}

.fb-pl-step__head {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin: 0 0 0.35rem;
}

.fb-pl-step__num {
	flex: 0 0 auto;
	width: 1.7em;
	height: 1.7em;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: #c8102e;
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.fb-pl-step__title {
	margin: 0;
	font-size: clamp(1.15rem, 4vw, 1.5rem);
	line-height: 1.15;
}

.fb-pl-step__hint {
	margin: 0 0 1rem;
	opacity: 0.75;
	font-size: 0.95rem;
	max-width: 56ch;
}

/* ------------------------------------------------------------- who is eating */

.fb-pl-who {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
}

.fb-pl-count {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.fb-pl-count__label {
	min-width: 4.5em;
	font-weight: 600;
}

.fb-pl-count__btn {
	width: 2.4rem;
	height: 2.4rem;
	font-size: 1.25rem;
	line-height: 1;
	border: 2px solid currentColor;
	background: transparent;
	color: inherit;
	cursor: pointer;
	border-radius: 4px;
}

.fb-pl-count__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.fb-pl-count__btn:focus-visible {
	outline: 3px solid #c8102e;
	outline-offset: 2px;
}

.fb-pl-count__val {
	min-width: 1.6em;
	text-align: center;
	font-size: 1.2rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------- filters */

.fb-pl-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 1rem;
}

.fb-pl-filter {
	padding: 0.4rem 0.85rem;
	border: 2px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
}

.fb-pl-filter[aria-pressed="true"] {
	background: #1d1d1b;
	color: #fff;
	border-color: #1d1d1b;
}

.fb-pl-filter:focus-visible {
	outline: 3px solid #c8102e;
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- meal picker */

.fb-pl-meals {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 640px) {
	.fb-pl-meals {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1000px) {
	.fb-pl-meals {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.fb-pl-meal {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 0.8rem;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	background: #fff;
	min-width: 0;
}

.fb-pl-meal[data-picked="1"] {
	border-color: #c8102e;
}

.fb-pl-meal__body {
	flex: 1 1 auto;
	min-width: 0;
}

.fb-pl-meal__name {
	display: block;
	font-weight: 700;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.fb-pl-meal__meta {
	display: block;
	font-size: 0.82rem;
	opacity: 0.7;
	margin-top: 0.15rem;
}

.fb-pl-meal__add {
	flex: 0 0 auto;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 50%;
	border: 2px solid currentColor;
	background: transparent;
	color: inherit;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.fb-pl-meal__add:focus-visible {
	outline: 3px solid #c8102e;
	outline-offset: 2px;
}

.fb-pl-meal__qty {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.fb-pl-meal__count {
	min-width: 1.4em;
	text-align: center;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ the list */

.fb-pl-empty {
	padding: 1.25rem;
	border: 2px dashed rgba(0, 0, 0, 0.25);
	border-radius: 6px;
	opacity: 0.8;
}

.fb-pl-list {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.fb-pl-list th,
.fb-pl-list td {
	padding: 0.6rem 0.4rem;
	text-align: left;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	vertical-align: top;
}

.fb-pl-list th:last-child,
.fb-pl-list td:last-child,
.fb-pl-list th:nth-child(2),
.fb-pl-list td:nth-child(2) {
	text-align: right;
	white-space: nowrap;
}

.fb-pl-list__item {
	overflow-wrap: anywhere;
}

.fb-pl-list__sub {
	display: block;
	font-size: 0.8rem;
	opacity: 0.7;
}

.fb-pl-list tfoot td {
	font-weight: 700;
	border-bottom: 0;
	border-top: 2px solid currentColor;
	font-size: 1.05rem;
}

.fb-pl-perkg {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	opacity: 0.8;
}

/* ------------------------------------------------------------- the pack check */

.fb-pl-pack {
	margin: 1.25rem 0 0;
	padding: 1rem 1.1rem;
	border-radius: 6px;
	background: #1d1d1b;
	color: #fff;
}

.fb-pl-pack__head {
	margin: 0 0 0.4rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.fb-pl-pack p {
	margin: 0 0 0.6rem;
}

.fb-pl-pack p:last-child {
	margin-bottom: 0;
}

.fb-pl-pack a {
	color: #fff;
}

.fb-pl-pack__saving {
	font-weight: 700;
}

/* ---------------------------------------------------------------- actions row */

.fb-pl-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 1.25rem 0 0;
}

.fb-pl-note {
	margin: 1.5rem 0 0;
	font-size: 0.85rem;
	opacity: 0.7;
	max-width: 62ch;
}

@media print {
	.fb-pl-step--pick,
	.fb-pl-filters,
	.fb-pl-actions,
	.fb-pl-meal__add,
	.fb-pl-count__btn {
		display: none !important;
	}
}
