/*
 * BUTTON.CSS
 * .jm-btn: every button on the site (greyed when :disabled or aria-disabled="true"). Variants: --primary, --secondary, --play (round), --icon, --compact (tight rows), --float (pill fixed to the screen).
 * Corner shape comes from --jm-radius-button, so all buttons change together.
 */


/* ============================================================
 * 1. THE BUTTON
 * ============================================================ */

.jm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--jm-space-2);
	min-height: var(--jm-control-size);   /* big enough to tap */
	padding: 0 var(--jm-space-5);
	border: 0;
	border-radius: var(--jm-radius-button);
	font-size: var(--jm-text-s);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--jm-motion-time) var(--jm-ease-out), filter var(--jm-motion-time);
}

.jm-btn:hover  { filter: brightness(1.08); }
.jm-btn:active { transform: scale(0.97); }

.jm-btn:disabled,
.jm-btn[aria-disabled="true"] {   /* a link styled as a button that isn't ready yet (join page countdown) */
	background: var(--jm-colour-disabled);
	color: var(--jm-colour-background);
	cursor: default;
	filter: none;
	transform: none;
}


/* ============================================================
 * 2. VARIANTS
 * ============================================================ */

.jm-btn--primary {
	background: var(--jm-colour-button);
	color: var(--jm-colour-button-text);
}

.jm-btn--secondary {
	background: transparent;
	color: var(--jm-colour-text);
	box-shadow: inset 0 0 0 1.5px currentColor;
}

/* Round play button (cards, Play block). Sand, like the current site. */
.jm-btn--play {
	flex-shrink: 0;                   /* never squashed by text beside it */
	width: var(--jm-control-size);    /* same height as Send and the other buttons (Nick, 19 Oct) */
	height: var(--jm-control-size);
	min-height: 0;
	padding: 0;
	border-radius: 50%;
	background: var(--jm-colour-action);
	color: var(--jm-colour-action-text);
	box-shadow: var(--jm-shadow-2);
}

.jm-btn--play svg {
	width: 20px;
	height: 20px;
	margin-left: 2px;                 /* a triangle looks centred when nudged right */
}

/* A short button for tight rows (the leaflet's stream strip). The one exception to --jm-control-size: the
 * same action is also full size in the cover pop-up. Long text is cut with an ellipsis. */
.jm-btn--compact {
	flex-shrink: 0;
	min-height: 0;
	height: 26px;
	padding: 0 var(--jm-space-3);
	font-size: var(--jm-text-xxs);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* A round button with just an icon (Send). Follows the button shape token like every other button. */
.jm-btn--icon {
	flex-shrink: 0;
	width: var(--jm-control-size);
	height: var(--jm-control-size);
	padding: 0;
	background: var(--jm-colour-action);
	color: var(--jm-colour-action-text);
}

/* Floating pill at the bottom of the screen (Cat: Filter). */
.jm-btn--float {
	position: fixed;
	left: 50%;
	bottom: var(--jm-space-4);
	transform: translateX(-50%);
	z-index: 20;
	background: var(--jm-colour-glass);             /* see-through, frosted, so the covers show behind */
	-webkit-backdrop-filter: blur(var(--jm-glass-blur));
	backdrop-filter: blur(var(--jm-glass-blur));
	color: var(--jm-colour-text);
	border: 1px solid var(--jm-colour-line);
	box-shadow: var(--jm-shadow-1);
}

.jm-btn--float:active {
	transform: translateX(-50%) scale(0.97);   /* keep it centred while pressed (the plain press shrink would drop the centring) */
}

.jm-btn--float:disabled {
	background: var(--jm-colour-glass);
	color: var(--jm-colour-text);
	opacity: 0.9;
	transform: translateX(-50%);
}
