/* Bite The Trouble — design system condiviso (menu principale + menu speciale).
   Fedele al design "Menu completo": fondo marrone, card nere, accento rosa,
   titoli Retrohead Serif, schede birra su verde. */

@font-face {
	font-family: "Retrohead Serif";
	src: url("fonts/retrohead-serif.otf") format("opentype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	color-scheme: dark;
	--bg: #482018;
	--header: #1a1a1a;
	--surface: #1a1a1a;
	--surface-2: #2a2a2a;
	--panel: #255444;
	--border: #5a3328;
	--leader: #7a5a4c;
	--text: #e4dbce;
	--text-strong: #ffffff;
	--text-body: #d4c9ba;
	--text-muted: #d3bb9f;
	--accent: #e569d7;
	--accent-hover: #f08ce3;
	--accent-ink: #1a1a1a;
	--tag: #8cc3cc;
	--note-bg: #d3bb9f;
	--note-text: #482018;

	--maxw: 640px;
	--gutter: 20px;
	--font: "Schibsted Grotesk", -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Retrohead Serif", Georgia, serif;
	--font-serif: "STIX Two Text", Georgia, serif;

	/* Movimento: curve forti, durate brevi */
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--dur-press: 140ms;
	--dur-ui: 200ms;
}

/* ===================== BASE ===================== */

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	/* a tinta con l'header: Safari/iOS colora la barra di stato con il colore in cima alla pagina */
	background: var(--header);
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	min-height: 100vh;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

button {
	font: inherit;
	color: inherit;
	cursor: pointer;
	border: 0;
	background: none;
}

a {
	color: var(--accent);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 6px;
}

.skip-link {
	position: absolute;
	left: 12px;
	top: -60px;
	z-index: 100;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	text-decoration: none;
}
.skip-link:focus {
	top: 12px;
}

/* ===================== MASTHEAD ===================== */

.masthead {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: max(40px, calc(env(safe-area-inset-top) + 24px)) var(--gutter) 0;
	overflow: hidden;
	text-align: center;
	background: var(--header);
}

.masthead-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}
.masthead-mascot {
	display: block;
	width: 128px;
	height: auto;
}
.masthead-logo {
	display: block;
	width: 250px;
	height: auto;
}

.masthead-tagline {
	color: var(--text);
	font-family: var(--font-serif);
	font-size: 17px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.masthead-title {
	margin-top: 4px;
	padding-left: 0.24em; /* compensa il letter-spacing finale */
	color: var(--accent);
	font-family: var(--font-display);
	font-size: 30px;
	line-height: 1;
	font-weight: 400;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}

/* Fascia a scacchi rosa/nera, in testa e in coda alla pagina */
.checker {
	display: block;
	width: calc(100% + 2 * var(--gutter));
	max-width: none;
	height: 76px;
	object-fit: cover;
	object-position: top;
}
.masthead .checker {
	margin: 10px calc(-1 * var(--gutter)) 0;
}

/* ===================== NAV CATEGORIE ===================== */

.cat-nav {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(26, 26, 26, 0.96);
	border-bottom: 3px solid var(--accent);
	transition: box-shadow var(--dur-ui) var(--ease-out);
}
.cat-nav.is-stuck {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.cat-nav-inner {
	display: flex;
	gap: 8px;
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 10px var(--gutter);
	overflow-x: auto;
	scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar {
	display: none;
}

.pill {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border-radius: 999px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: #f2eee8;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition:
		background-color 150ms ease,
		border-color 150ms ease,
		color 150ms ease,
		transform var(--dur-press) var(--ease-out);
}
.pill:active {
	transform: scale(0.97);
}
.pill[aria-current="true"] {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
}
@media (hover: hover) and (pointer: fine) {
	.pill:not([aria-current="true"]):hover {
		border-color: var(--leader);
	}
}

.pill-skeleton {
	width: 96px;
	animation: pulse 1.2s ease-in-out infinite;
}

/* ===================== SEZIONI ===================== */

.menu-container {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 8px var(--gutter) 0;
	outline: none;
}

.section {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 40px;
	scroll-margin-top: calc(var(--nav-h, 66px) + 10px);
}

/* Ingresso solo al primo caricamento, con stagger breve */
.is-entering .section {
	animation: rise 320ms var(--ease-out) both;
	animation-delay: calc(var(--i, 0) * 45ms);
}

.section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 12px;
	border-bottom: 3px solid var(--accent);
}

.section-heading {
	display: flex;
	align-items: flex-end;
	gap: 14px;
	min-width: 0;
}

.section-num {
	font-family: var(--font-display);
	font-size: 60px;
	line-height: 0.8;
	font-weight: 400;
	color: transparent;
	-webkit-text-stroke: 1.5px var(--accent);
	font-variant-numeric: tabular-nums;
}

.section-title {
	color: var(--text-strong);
	font-family: var(--font-display);
	font-size: 34px;
	line-height: 1;
	font-weight: 400;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.section-count {
	flex-shrink: 0;
	color: var(--text-muted);
	font-size: 14px;
	font-weight: 600;
}

.section-note {
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--note-bg);
	color: var(--note-text);
	font-size: 14.5px;
	line-height: 1.5;
	font-weight: 600;
}

/* ===================== CARD ===================== */

.cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	border-radius: 18px;
	background: var(--surface);
	border: 1px solid var(--border);
}

.card-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
}

.card-name {
	color: var(--text-strong);
	font-family: var(--font-display);
	font-size: 25px;
	line-height: 1.1;
	font-weight: 400;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.price-pill {
	flex-shrink: 0;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--accent);
	color: var(--accent-ink);
	font-size: 16px;
	line-height: 1.3;
	font-weight: 800;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.price-pill.is-soldout {
	background: var(--surface-2);
	color: var(--text-muted);
	font-size: 14px;
	font-weight: 700;
}
.price-pill.is-included {
	background: transparent;
	border: 1px solid var(--accent);
	color: var(--accent);
	font-size: 14px;
	font-weight: 700;
}

.card-desc {
	color: var(--text-body);
	font-size: 15.5px;
	line-height: 1.55;
}

.card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tag {
	padding: 3px 10px;
	border-radius: 999px;
	border: 1px solid var(--tag);
	color: var(--tag);
	font-size: 13px;
	font-weight: 700;
}

/* Scheda tecnica birre: griglia 2 colonne su verde */
.card-facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 14px;
	padding: 14px;
	border-radius: 12px;
	background: var(--panel);
}
.fact {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.fact-label {
	color: var(--text-body);
	font-size: 13px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.fact-value {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--text-strong);
	font-size: 15px;
	line-height: 1.3;
	font-weight: 700;
	overflow-wrap: anywhere;
}
.fact-swatch {
	flex-shrink: 0;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1px solid var(--text);
}

.card-allergens,
.row-allergens {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin-top: 2px;
	list-style: none;
	color: var(--text-muted);
	font-size: 13px;
	font-weight: 600;
}

/* Icone allergeni: SVG come maschera, colore = currentColor.
   Sui piatti restano piccole, in linea con il testo (16px). */
.allergen-icon {
	display: block;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: var(--icon) center / contain no-repeat;
	mask: var(--icon) center / contain no-repeat;
}

.allergen {
	display: inline-flex;
	align-items: center;
}

/* Legenda in fondo: pannello a scomparsa con griglia a 2 colonne */
.allergen-legend {
	width: 100%;
	max-width: var(--maxw);
	margin-top: 12px;
	color: var(--text);
	text-align: left;
}
.allergen-legend summary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--text);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}
.allergen-legend summary::-webkit-details-marker {
	display: none;
}
.allergen-legend summary::after {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform var(--dur-ui) var(--ease-out);
}
.allergen-legend[open] summary::after {
	transform: rotate(-135deg) translateY(-2px);
}
.allergen-legend-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-top: 12px;
	list-style: none;
}
.allergen-legend-list li {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 6px 12px;
	border-radius: 12px;
	background: var(--surface-2);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
}
.allergen-legend-list .allergen-icon {
	width: 22px;
	height: 22px;
	color: var(--text-muted);
}
@media (min-width: 520px) {
	.allergen-legend-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.card-alt {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-top: 2px;
	padding: 10px 12px;
	border-radius: 12px;
	background: var(--panel);
	color: var(--text-strong);
	font-size: 15px;
	font-weight: 700;
}
.card-alt-price {
	color: var(--accent);
	font-weight: 800;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.card.is-unavailable .card-name,
.card.is-unavailable .card-desc,
.card.is-unavailable .card-tags,
.row.is-unavailable .row-name,
.row.is-unavailable .row-desc {
	opacity: 0.55;
}
.card.is-unavailable .card-name,
.row.is-unavailable .row-name {
	text-decoration: line-through;
	text-decoration-thickness: 1.5px;
}

/* ===================== RIGHE COMPATTE ===================== */

.rows {
	display: grid;
	gap: 1px;
	overflow: hidden;
	border-radius: 16px;
	background: var(--border);
	border: 1px solid var(--border);
}

.row {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 3px;
	min-height: 56px;
	padding: 12px 18px;
	background: var(--surface);
}

.row-line {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.row-name {
	color: var(--text-strong);
	font-size: 16.5px;
	line-height: 1.3;
	font-weight: 700;
}

.row-variant {
	color: var(--text-body);
	font-size: 14px;
	font-weight: 600;
}

.row-leader {
	flex: 1;
	min-width: 12px;
	border-bottom: 2px dotted var(--leader);
	transform: translateY(-3px);
}

.row-price {
	flex-shrink: 0;
	color: var(--accent);
	font-size: 17px;
	font-weight: 800;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.row-line-variant .row-price {
	font-size: 15px;
}

.row-soldout {
	flex-shrink: 0;
	color: var(--text-muted);
	font-size: 14px;
	font-weight: 700;
}

.row-desc {
	color: var(--text-body);
	font-size: 14.5px;
	line-height: 1.4;
}

.row-tag {
	color: var(--tag);
	font-size: 13px;
	font-weight: 700;
}

/* ===================== STATI ===================== */

.empty-state {
	display: grid;
	justify-items: center;
	gap: 6px;
	padding: 56px 16px;
	color: var(--text-muted);
	text-align: center;
}

.empty-title {
	color: var(--text-strong);
	font-family: var(--font-display);
	font-size: 25px;
	font-weight: 400;
}

.btn {
	display: inline-flex;
	align-items: center;
	margin-top: 12px;
	min-height: 46px;
	padding: 0 22px;
	border-radius: 999px;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 800;
	text-decoration: none;
	transition:
		background-color 150ms ease,
		opacity 150ms ease,
		transform var(--dur-press) var(--ease-out);
}
.btn:active {
	transform: scale(0.97);
}
.btn[disabled] {
	opacity: 0.6;
	cursor: progress;
}
@media (hover: hover) and (pointer: fine) {
	.btn:hover {
		background: var(--accent-hover);
	}
}

.skeleton {
	border-radius: 6px;
	background: var(--surface-2);
	animation: pulse 1.2s ease-in-out infinite;
}

/* ===================== FOOTER ===================== */

.site-footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	margin-top: 56px;
	padding: 0 var(--gutter) max(96px, calc(env(safe-area-inset-bottom) + 80px));
	overflow: hidden;
	background: var(--header);
	text-align: center;
}
.site-footer .checker {
	margin: 0 calc(-1 * var(--gutter));
}

.site-footer-mascot {
	display: block;
	width: 120px;
	height: auto;
	margin-top: 8px;
}

.site-footer-words {
	display: flex;
	align-items: center;
	justify-content: center;
}
.site-footer-words img {
	display: block;
	height: auto;
}
.site-footer-words img:first-child {
	width: 110px;
}
.site-footer-words img:last-child {
	width: 150px;
}

.site-footer-tagline {
	color: var(--text);
	font-family: var(--font-serif);
	font-size: 17px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.site-footer-est {
	color: var(--text-body);
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
}

.site-footer-note {
	margin-top: 8px;
	color: var(--text);
	font-size: 14px;
	line-height: 1.5;
}

/* ===================== TORNA SU ===================== */

.to-top {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 40;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--accent-ink);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translateY(12px) scale(0.92);
	pointer-events: none;
	/* uscita più rapida dell'entrata */
	transition:
		opacity 140ms ease,
		transform 140ms var(--ease-out);
}
.to-top.is-visible {
	opacity: 1;
	transform: none;
	pointer-events: auto;
	transition:
		opacity 220ms ease,
		transform 220ms var(--ease-out);
}
.to-top.is-visible:active {
	transform: scale(0.94);
	transition-duration: var(--dur-press);
}

/* ===================== ANIMAZIONI ===================== */

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes fade {
	from {
		opacity: 0;
	}
}

@keyframes pulse {
	50% {
		opacity: 0.45;
	}
}

/* Meno movimento, non zero feedback: restano dissolvenze e cambi colore */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	.is-entering .section {
		animation: fade 200ms ease both;
	}
	.pill:active,
	.btn:active,
	.to-top.is-visible:active {
		transform: none;
	}
	.to-top,
	.to-top.is-visible {
		transform: none;
	}
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 360px) {
	:root {
		--gutter: 14px;
	}
	.section-num {
		font-size: 48px;
	}
	.section-title {
		font-size: 28px;
	}
	.card {
		padding: 16px;
	}
	.card-name {
		font-size: 22px;
	}
	.card-facts {
		gap: 10px 12px;
		padding: 12px;
	}
}

/* ===================== SELETTORE LINGUA IT / EN ===================== */
.lang-switch {
	display: inline-flex;
	padding: 2px;
	gap: 2px;
	border: 2px solid var(--bone, #f3ead7);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.25);
}
.lang-btn {
	min-width: 38px;
	min-height: 30px;
	padding: 0 10px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--bone, #f3ead7);
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.lang-btn.is-active {
	background: var(--bone, #f3ead7);
	color: #111;
}
.lang-btn:focus-visible {
	outline: 3px solid var(--accent, #e0457b);
	outline-offset: 2px;
}
.hero-bar {
	display: flex;
	justify-content: flex-end;
	padding-bottom: 6px;
}
.lang-switch-top {
	position: absolute;
	top: max(14px, env(safe-area-inset-top));
	right: 16px;
}
.topbar-plain { position: relative; }
.masthead-lang {
	position: absolute;
	top: max(14px, env(safe-area-inset-top));
	right: 16px;
}
.masthead { position: relative; }
