/*
 * Mobile quick bar (inc/mobile-quickbar.php). The nav also carries the parent's
 * .mobile-tabbar class for position, the 768px cut-off and body padding; this file
 * only restyles it: side groups around a raised, centred home button.
 */
.mobile-tabbar.mobile-quickbar {
	--qb-wine: #9e1f3a;
	--qb-wine-deep: #6b1a2c;
	--qb-rose: #c92c55;
	--qb-gold: #c9a063;
	--qb-ink: #4a3a3e;
	--qb-ease: cubic-bezier(0.16, 1, 0.3, 1);

	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	grid-auto-flow: row;
	align-items: end;
	gap: 4px;
	padding: 8px 8px 6px;
	overflow: visible;
	border: 0;
	background: none;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	box-shadow: none;
	color: var(--qb-ink);
	/* No panel any more: taps between the buttons reach the page. */
	pointer-events: none;
}

.mobile-quickbar__item {
	pointer-events: auto;
}

.mobile-quickbar__group {
	display: flex;
	justify-content: space-evenly;
	min-width: 0;
}

.mobile-quickbar__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-width: 56px;
	padding: 2px 4px;
	border-radius: 16px;
	color: var(--qb-ink);
	font-family: var(--font);
	font-size: 11px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	/* A long press shows the label instead of the browser's link menu. */
	-webkit-touch-callout: none;
	touch-action: manipulation;
}

.mobile-quickbar__icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient(145deg, var(--qb-rose), var(--qb-wine));
	box-shadow: 0 6px 14px rgba(107, 26, 44, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.25);
	color: #fff;
	transition: transform 0.18s var(--qb-ease), box-shadow 0.18s ease;
}

.mobile-quickbar__item .dtc-icon {
	width: 22px;
	height: 22px;
	stroke-width: 1.8;
}

/*
 * Labels are a tooltip pill above the button, shown on hover, keyboard focus or touch
 * (.is-peek, set by mobile-quickbar.js). Hidden with opacity, not display, so they stay
 * the links' accessible names. Absolute, so showing one never moves the bar.
 */
.mobile-quickbar__label {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 4px 12px rgba(65, 28, 44, 0.18);
	white-space: nowrap;
	opacity: 0;
	transform: translate(-50%, 4px);
	transition: opacity 0.16s ease, transform 0.16s var(--qb-ease);
	pointer-events: none;
}

/* Edge buttons: keep the pill inside a 320px screen. */
.mobile-quickbar__group--start .mobile-quickbar__item:first-child .mobile-quickbar__label {
	left: 0;
	transform: translate(0, 4px);
}

.mobile-quickbar__group--end .mobile-quickbar__item:last-child .mobile-quickbar__label {
	left: auto;
	right: 0;
	transform: translate(0, 4px);
}

.mobile-quickbar__item.is-peek .mobile-quickbar__label,
.mobile-quickbar__item:focus-visible .mobile-quickbar__label {
	opacity: 1;
	transform: translate(-50%, 0);
}

.mobile-quickbar__group--start .mobile-quickbar__item:first-child.is-peek .mobile-quickbar__label,
.mobile-quickbar__group--start .mobile-quickbar__item:first-child:focus-visible .mobile-quickbar__label,
.mobile-quickbar__group--end .mobile-quickbar__item:last-child.is-peek .mobile-quickbar__label,
.mobile-quickbar__group--end .mobile-quickbar__item:last-child:focus-visible .mobile-quickbar__label {
	transform: translate(0, 0);
}

/* Home: larger, lifted out of the bar, wine with a white ring and a gold edge. */
.mobile-quickbar__item--home {
	margin-top: -30px;
	color: var(--qb-wine);
	font-weight: 600;
}

.mobile-quickbar__item--home .mobile-quickbar__icon {
	width: 62px;
	height: 62px;
	border: 4px solid #fff;
	background: linear-gradient(150deg, var(--qb-rose) 0%, var(--qb-wine) 55%, var(--qb-wine-deep) 100%);
	box-shadow: 0 0 0 1px var(--qb-gold), 0 10px 22px rgba(107, 26, 44, 0.32);
}

.mobile-quickbar__item--home .dtc-icon {
	width: 28px;
	height: 28px;
}

.mobile-quickbar__item:active .mobile-quickbar__icon {
	transform: scale(0.92);
}

.mobile-quickbar__item:focus-visible {
	outline: none;
}

.mobile-quickbar__item:focus-visible .mobile-quickbar__icon {
	outline: 3px solid var(--qb-gold);
	outline-offset: 2px;
}

@media (hover: hover) {
	.mobile-quickbar__item:hover .mobile-quickbar__icon {
		transform: translateY(-2px);
		box-shadow: 0 10px 20px rgba(107, 26, 44, 0.3);
	}

	.mobile-quickbar__item:hover .mobile-quickbar__label {
		opacity: 1;
		transform: translate(-50%, 0);
	}

	.mobile-quickbar__group--start .mobile-quickbar__item:first-child:hover .mobile-quickbar__label,
	.mobile-quickbar__group--end .mobile-quickbar__item:last-child:hover .mobile-quickbar__label {
		transform: translate(0, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mobile-quickbar__icon,
	.mobile-quickbar__label {
		transition: none;
	}
}

/* Narrowest phones: five buttons still fit in 296px. */
@media (max-width: 359px) {
	.mobile-quickbar__item {
		min-width: 48px;
		padding: 2px;
		font-size: 10px;
	}

	.mobile-quickbar__icon {
		width: 40px;
		height: 40px;
	}

	.mobile-quickbar__item--home .mobile-quickbar__icon {
		width: 56px;
		height: 56px;
	}
}
