/**
 * Layout for the Games hub.
 *
 *   tmt-wp-competitions-games / assets/css/tmt-games-hub.css
 *
 * Structure only, on the same terms as tmt-games.css: colour comes from
 * `--tmt-primary`, which tmt-brand.php already prints per site, so this
 * file names no brand and needs no per-client build.
 *
 * Loaded only where a hub renders. It is a separate file from the stage's
 * stylesheet because the two surfaces never appear together: a product page
 * carrying a stage would otherwise ship a grid it has no cards for.
 *
 * The card is a plain grid item with the disclosure inside it. There is
 * deliberately nothing here that hides the odds or the tier table behind an
 * interaction — no accordion, no "details" toggle, no truncation with a
 * fade. Appendix C.2 requires the odds to be shown before entry, and a
 * disclosure a player has to open is a disclosure some players never see.
 */

.tmt-games-hub {
	--tmt-games-accent: var( --tmt-primary, #00b6d3 );

	margin: 2rem 0;
}

.tmt-games-hub__header {
	margin-bottom: 1.5rem;
}

.tmt-games-hub__heading {
	margin: 0 0 0.5rem;
}

.tmt-games-hub__intro {
	margin: 0;
	opacity: 0.85;
}

.tmt-games-hub__empty {
	border: 1px dashed rgba( 128, 128, 128, 0.4 );
	border-radius: 8px;
	margin: 0;
	padding: 1.5rem;
	text-align: center;
}

/* ------------------------------------------------------------------ */
/*  The index — one tile per game                                      */
/* ------------------------------------------------------------------ */

/*
 * Bigger than a competition card, and fewer of them: this is the choice the
 * page opens with, so the tiles get the weight. Three games means three
 * tiles, which is why the minimum track is wide enough that they do not
 * strand a single tile on a second row at common widths.
 */
.tmt-games-hub__modes {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat( auto-fit, minmax( 16rem, 1fr ) );
	list-style: none;
	margin: 0;
	padding: 0;
}

.tmt-games-hub__mode {
	margin: 0;
}

/* The whole tile is the link, so there is no small target inside a large
   clickable-looking box. */
.tmt-games-hub__tile {
	border: 1px solid rgba( 128, 128, 128, 0.25 );
	border-radius: 10px;
	color: inherit;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	text-decoration: none;
	transition: border-color 150ms ease, transform 150ms ease;
}

.tmt-games-hub__tile:hover,
.tmt-games-hub__tile:focus-visible {
	border-color: var( --tmt-games-accent );
	transform: translateY( -2px );
}

.tmt-games-hub__tile:focus-visible {
	outline: 3px solid var( --tmt-games-accent );
	outline-offset: 2px;
}

.tmt-games-hub__tile-media {
	display: block;
	line-height: 0;
}

.tmt-games-hub__tile-media .tmt-games-hub__image {
	aspect-ratio: 4 / 3;
}

.tmt-games-hub__tile-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.25rem;
	padding: 1rem 1.25rem 1.25rem;
}

.tmt-games-hub__tile-name {
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.2;
}

/* The approved wording. Never smaller than body text and never dimmed to
   decoration — it is the sentence that says what the game asks of you. */
.tmt-games-hub__tile-how {
	font-size: 1rem;
	opacity: 0.9;
}

.tmt-games-hub__tile-count {
	color: var( --tmt-games-accent );
	font-size: 0.875rem;
	font-weight: 600;
	margin-top: auto;
	padding-top: 0.75rem;
}

/* ------------------------------------------------------------------ */
/*  One game's page                                                    */
/* ------------------------------------------------------------------ */

.tmt-games-hub__back {
	font-size: 0.875rem;
	margin: 0 0 0.5rem;
}

.tmt-games-hub__mine {
	margin-bottom: 2.5rem;
}

.tmt-games-hub__mine-heading,
.tmt-games-hub__more-heading {
	margin: 0 0 1rem;
}

/* A stage on this page is one of several, so it gets a divider rather than
   the standalone spacing it has on a product page. */
.tmt-games-hub__played + .tmt-games-hub__played {
	border-top: 1px solid rgba( 128, 128, 128, 0.25 );
	margin-top: 2rem;
	padding-top: 2rem;
}

.tmt-games-hub__played-title {
	font-size: 1.0625rem;
	margin: 0;
}

/* The stage supplies its own top margin for standalone use; here the
   heading above it is the separator. */
.tmt-games-hub__played .tmt-games {
	margin-top: 0.75rem;
}

.tmt-games-hub__more {
	margin-top: 2rem;
}

/* ------------------------------------------------------------------ */
/*  The competition grid                                               */
/* ------------------------------------------------------------------ */

/*
 * auto-fill with a minimum, rather than a fixed column count per
 * breakpoint: the hub's length is however many competitions are running
 * instant wins today, which is not a number this file can know.
 */
.tmt-games-hub__list {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat( auto-fill, minmax( 18rem, 1fr ) );
	list-style: none;
	margin: 0;
	padding: 0;
}

.tmt-games-hub__item {
	margin: 0;
}

.tmt-games-hub__card {
	border: 1px solid rgba( 128, 128, 128, 0.25 );
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

.tmt-games-hub__media {
	line-height: 0;
}

.tmt-games-hub__image {
	aspect-ratio: 16 / 9;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

/*
 * The body is a column that grows, so the link sits on the baseline of
 * every card in a row however uneven the tier tables above it are.
 */
.tmt-games-hub__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 1rem 1.25rem 1.25rem;
}

.tmt-games-hub__title {
	font-size: 1.125rem;
	margin: 0 0 0.25rem;
}

.tmt-games-hub__presentation {
	color: var( --tmt-games-accent );
	font-size: 0.875rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
	text-transform: none;
}

.tmt-games-hub__odds {
	font-size: 0.9375rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
}

/* ------------------------------------------------------------------ */
/*  Prize tiers                                                        */
/* ------------------------------------------------------------------ */

.tmt-games-hub__tiers {
	border-collapse: collapse;
	font-size: 0.875rem;
	margin: 0 0 0.75rem;
	width: 100%;
}

.tmt-games-hub__tiers caption {
	font-weight: 600;
	margin-bottom: 0.375rem;
	text-align: left;
}

.tmt-games-hub__tiers th,
.tmt-games-hub__tiers td {
	border-bottom: 1px solid rgba( 128, 128, 128, 0.2 );
	padding: 0.375rem 0;
	text-align: left;
}

.tmt-games-hub__tiers td:last-child,
.tmt-games-hub__tiers th:last-child {
	text-align: right;
}

.tmt-games-hub__note {
	font-size: 0.875rem;
	margin: 0 0 0.75rem;
	opacity: 0.85;
}

/* ------------------------------------------------------------------ */
/*  The one link                                                       */
/* ------------------------------------------------------------------ */

/* margin-top:auto pins it to the bottom of the growing body. */
.tmt-games-hub__actions {
	margin: auto 0 0;
	padding-top: 0.75rem;
}

.tmt-games-hub__link {
	background: var( --tmt-games-accent );
	border-radius: 6px;
	color: #fff;
	display: inline-block;
	font-weight: 600;
	/* 44px minimum target, matching the theme's own tap-target floor. */
	min-height: 44px;
	padding: 0.6875rem 1.25rem;
	text-decoration: none;
}

.tmt-games-hub__link:focus-visible {
	outline: 3px solid var( --tmt-games-accent );
	outline-offset: 2px;
}

/*
 * The visible label is short and the accessible name is long, so the
 * card's own title reaches a screen reader reading links out of context.
 * The theme ships .screen-reader-text, but the hub must not depend on it:
 * a site placing the shortcode in a page builder or a bare theme would
 * otherwise print both halves of the link.
 */
.tmt-games-hub .screen-reader-text {
	border: 0;
	clip-path: inset( 50% );
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.tmt-games-hub__basis {
	font-size: 0.8125rem;
	margin: 1.5rem 0 0;
	opacity: 0.75;
}
