/**
 * App-style homepage news deck (every viewport below 1600px): stacked, overlapping news cards, the category pills and the article
 * preview sheet. Loaded on the unpaged homepage only and ONLY applied in the theme's ONE app range, GNP_APP_MEDIA
 * (inc/app-breakpoint.php): the stylesheet is enqueued with that media query (inc/mobile-home-deck.php) and every rule
 * is inside it AND scoped to `body.gnp-mobile-home`, so desktops and every other template never apply one rule of it.
 * Tablets get the phone deck unchanged in behaviour, in one centred column (section 8), never a multi-column grid.
 *
 * The cards are the homepage's own Latest News cards (`li.wp-block-post > article.gnp-card`), restyled here, never
 * re-created: each stays a real link. Layout is plain flow with negative margins (no script needed to look right):
 * every card has the same height and each one overlaps the previous so only a "band" of it shows, the last one in
 * full. assets/js/mobile-home-deck.js only adds the drag / flick / preview behaviour on top.
 *
 * Colours: by STORY, never by position. inc/mobile-home-deck.php puts a `data-gnp-deck-tone` on every card (the
 * story's platform when it has exactly one, otherwise its display category): PlayStation blue, Xbox green, Nintendo
 * red, PC purple, News yellow, Entertainment orange, Reviews green, VR teal. The pill dots, the cards and the preview
 * sheet all read the same `--gnp-tone-*` pairs, so they cannot disagree. Every pair is a background + the foreground
 * that meets WCAG AA on it (white on the three brand colours, near-black on the light ones; test/mobileHomeDeckLoadMore
 * checks the ratios). The cards and the sheet keep their colours in Light and Dark; the pills and every other surface use
 * the site's own theme tokens, which the existing Light/Dark switch re-points live.
 *
 * Layering (the theme's existing scale): header 40, preview backdrop 43, preview sheet 44, bottom navigation 45
 * (so the nav stays visible and usable, and the sheet sits just above it), drawer / search above that.
 */
@media (max-width: 1599.98px) {

	body.gnp-mobile-home {
		--gnp-deck-h: 19.5rem;
		--gnp-deck-band: 9.5rem;
		--gnp-deck-overlap: calc(var(--gnp-deck-h) - var(--gnp-deck-band));
		--gnp-deck-radius: 1.75rem;
		--gnp-deck-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

		/* How far below its resting place a Load More card starts, and (in the script) the stagger between cards. */
		--gnp-deck-enter-y: 5.5rem;

		/* Category / platform tones: [background, foreground]. The three platform backgrounds are the theme's own brand
		   tokens (style.css --gnp-platform-*), written out here so they cannot change with the theme switch. Reviews
		   reuses the theme's existing review badge colour; VR had none, so it gets a teal of its own. */
		--gnp-tone-playstation-bg: #00439c;
		--gnp-tone-playstation-fg: #ffffff;
		--gnp-tone-xbox-bg: #107c10;
		--gnp-tone-xbox-fg: #ffffff;
		--gnp-tone-nintendo-bg: #e60012;
		--gnp-tone-nintendo-fg: #ffffff;
		--gnp-tone-pc-bg: #b494ea;
		--gnp-tone-pc-fg: #170f2b;
		--gnp-tone-news-bg: #f2df3d;
		--gnp-tone-news-fg: #1d1a05;
		--gnp-tone-entertainment-bg: #ff9b3d;
		--gnp-tone-entertainment-fg: #231203;
		--gnp-tone-reviews-bg: #17a865;
		--gnp-tone-reviews-fg: #04180d;
		--gnp-tone-vr-bg: #22c3d6;
		--gnp-tone-vr-fg: #021a1d;
		/* The "Latest" pill is not a category: it keeps its original green dot. */
		--gnp-tone-latest-dot: #0f7a45;
	}

	/* ------------------------------------------------------------------
	   1. What the phone homepage does not show
	   ------------------------------------------------------------------ */

	/* The newest story is the deck's first card (the duplicate copy of it at the top of the Latest list); the
	   desktop-style hero would repeat it. */
	body.gnp-mobile-home .gnp-hero-section {
		display: none;
	}

	/* No homepage ad in the phone deck. The unit is not merely hidden: its script never pushes below 600px, so no
	   ad request is made (inc/ads.php, gnp_ad_slot_push_script()). */
	body.gnp-mobile-home .gnp-ad-section {
		display: none;
	}

	/* The deck has its own Load More (.gnp-deck-more, below the cards): the desktop Load More / infinite scroll and its
	   sentinel must not exist for the observer either. */
	body.gnp-mobile-home .gnp-latest-loading-controls {
		display: none;
	}

	body.gnp-mobile-home .gnp-deck-newest {
		display: list-item;
	}

	/* ------------------------------------------------------------------
	   2. "Latest News" heading + category pills
	   ------------------------------------------------------------------ */

	body.gnp-mobile-home .gnp-latest {
		padding-top: 0.5rem;
	}

	body.gnp-mobile-home .gnp-latest .gnp-section-header {
		margin: 0 0 0.5rem;
	}

	body.gnp-mobile-home .gnp-latest .gnp-section-heading {
		margin: 0;
		font-size: 1.625rem;
		font-weight: 800;
		letter-spacing: -0.01em;
		line-height: 1.2;
	}

	/* Pills bleed to the screen edges so the row scrolls under the gutter, with the first pill on the gutter. */
	/* (!important because the group's constrained layout forces margin-inline: auto !important on its children.) */
	body.gnp-mobile-home .gnp-home-category-row {
		max-width: none;
		margin-inline: calc(var(--gnp-gutter, 1rem) * -1) !important;
		margin-bottom: 0.75rem;
	}

	body.gnp-mobile-home .gnp-home-category-row ul {
		gap: 0.5rem;
		padding: 0.25rem var(--gnp-gutter, 1rem);
		background: transparent;
		border: 0;
		border-radius: 0;
		scroll-snap-type: x proximity;
		scroll-padding-inline: var(--gnp-gutter, 1rem);
		-webkit-overflow-scrolling: touch;
	}

	body.gnp-mobile-home .gnp-home-category-row li {
		scroll-snap-align: start;
	}

	body.gnp-mobile-home .gnp-home-category-row .gnp-home-tab {
		position: relative;
		gap: 0.45rem;
		min-height: 2.25rem;
		padding: 0 1rem 0 0.8rem;
		font-size: 0.875rem;
		font-weight: 700;
		color: var(--wp--preset--color--contrast);
		background: var(--wp--preset--color--surface);
		border: 1px solid var(--wp--preset--color--border);
	}

	/* 44px to a finger: the visual pill is 36px, the hit area reaches 4px above and below it. */
	body.gnp-mobile-home .gnp-home-category-row .gnp-home-tab::after {
		content: "";
		position: absolute;
		inset: -0.25rem 0;
	}

	body.gnp-mobile-home .gnp-home-category-row .gnp-home-tab::before {
		content: "";
		flex: none;
		width: 0.55rem;
		height: 0.55rem;
		border-radius: 50%;
		background: var(--gnp-deck-pill-dot, var(--gnp-tone-latest-dot));
		/* A hairline so a light dot (yellow, orange) still reads on a white pill, and a dark one on a black pill. */
		box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28), 0 0 0 2px rgba(255, 255, 255, 0.22);
	}

	/* The dot is the CATEGORY's colour, keyed by the tab (never by position), and it stays that colour when the pill is
	   selected (the selected rule below only recolours the pill itself). */
	body.gnp-mobile-home .gnp-home-tab[data-category-key="latest"] { --gnp-deck-pill-dot: var(--gnp-tone-latest-dot); }
	body.gnp-mobile-home .gnp-home-tab[data-category-key="news"] { --gnp-deck-pill-dot: var(--gnp-tone-news-bg); }
	body.gnp-mobile-home .gnp-home-tab[data-category-key="pc"] { --gnp-deck-pill-dot: var(--gnp-tone-pc-bg); }
	body.gnp-mobile-home .gnp-home-tab[data-category-key="sony"] { --gnp-deck-pill-dot: var(--gnp-tone-playstation-bg); }
	body.gnp-mobile-home .gnp-home-tab[data-category-key="microsoft"] { --gnp-deck-pill-dot: var(--gnp-tone-xbox-bg); }
	body.gnp-mobile-home .gnp-home-tab[data-category-key="nintendo"] { --gnp-deck-pill-dot: var(--gnp-tone-nintendo-bg); }
	body.gnp-mobile-home .gnp-home-tab[data-category-key="reviews"] { --gnp-deck-pill-dot: var(--gnp-tone-reviews-bg); }
	body.gnp-mobile-home .gnp-home-tab[data-category-key="vr"] { --gnp-deck-pill-dot: var(--gnp-tone-vr-bg); }
	body.gnp-mobile-home .gnp-home-tab[data-category-key="ent"] { --gnp-deck-pill-dot: var(--gnp-tone-entertainment-bg); }

	/* Selected: the inverse of the page (near-black on light, near-white on dark) - always readable, always
	   obviously selected, whichever platform brand colour the base stylesheet would otherwise give it. */
	body.gnp-mobile-home .gnp-home-category-row .gnp-home-tab.is-active,
	body.gnp-mobile-home .gnp-home-category-row .gnp-home-tab.is-active:hover,
	body.gnp-mobile-home .gnp-home-category-row .gnp-home-tab.is-active:focus-visible,
	body.gnp-mobile-home .gnp-home-category-row .gnp-home-tab.is-active[data-category-key] {
		color: var(--wp--preset--color--base);
		background: var(--wp--preset--color--contrast);
		border-color: var(--wp--preset--color--contrast);
	}

	body.gnp-mobile-home .gnp-home-category-row .gnp-home-tab:focus-visible {
		outline: 2px solid var(--wp--preset--color--accent);
		outline-offset: 2px;
	}

	/* ------------------------------------------------------------------
	   3. The stack
	   ------------------------------------------------------------------ */

	body.gnp-mobile-home .gnp-deck-list {
		display: block;
		position: relative;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	body.gnp-mobile-home .gnp-deck-list[hidden],
	body.gnp-mobile-home .gnp-deck-list > li[hidden],
	body.gnp-mobile-home .gnp-deck-end[hidden],
	body.gnp-mobile-home .gnp-deck-end__again[hidden],
	body.gnp-mobile-home .gnp-deck-next[hidden] {
		display: none !important;
	}

	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post {
		position: relative;
		/* Each card is its own stacking context: its absolutely positioned picture / chips can never paint over the card
		   that overlaps it. */
		isolation: isolate;
		margin: calc(var(--gnp-deck-overlap) * -1) 0 0;
		list-style: none;
		transition: transform 260ms var(--gnp-deck-ease), opacity 260ms ease;
		-webkit-user-select: none;
		user-select: none;
		-webkit-touch-callout: none;
	}

	/* The first card of the stack never overlaps anything (no JS: first child; with JS: the first not dismissed). */
	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post:first-child,
	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post.is-active {
		margin-top: 0;
	}

	/* A dragged card is moved by the script frame by frame: no transition while the finger is on it. */
	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post.is-dragging {
		transition: none;
		will-change: transform, opacity;
	}

	/* With the script ready, the active card owns upward finger drags: a finger moving UP on it never scrolls the
	   page, it drives the card. Where the browser knows `pan-up` (Chromium - verified with real touch events: it is
	   the value that still lets the page scroll back toward its top, while `pan-down` would let the upward drag
	   scroll it) a finger moving DOWN on the card still scrolls the page. The first declaration is the fallback for
	   browsers that only know pan-x / pan-y. */
	body.gnp-mobile-home .gnp-deck-list[data-gnp-deck-ready] > li.wp-block-post.is-active {
		touch-action: pan-x;
		touch-action: pan-x pan-up;
	}

	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post.is-leaving {
		pointer-events: none;
	}

	/* A card the script has not finished with, or a story the server could not classify, is held back from view only
	   when the script says so (Latest's server cards past one batch, see holdOverflow() in the script). */
	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post[data-gnp-deck-held] {
		display: none !important;
	}

	/* Before the deferred deck script has run, the same cards are held by position: the Latest list ships the hero copy +
	   the desktop grid's 12, and the stacked layout puts every card within a few bands of the first, so without this the
	   browser's lazy-loading would fetch the images of cards the deck is about to hold. Children 1-8 are exactly the one
	   batch (GNP_DECK_BATCH_SIZE) holdOverflow() keeps; once the script marks the list ready this rule no longer applies
	   and Load More's appended cards show as before. */
	body.gnp-mobile-home .gnp-deck-list:not([data-gnp-deck-ready]) > li.wp-block-post:nth-child(n + 9) {
		display: none;
	}

	/* --- card colours, by the story's tone (never by position) --- */
	body.gnp-mobile-home .gnp-deck-list .gnp-card { --gnp-deck-bg: var(--gnp-tone-news-bg); --gnp-deck-fg: var(--gnp-tone-news-fg); }
	body.gnp-mobile-home .gnp-deck-list .gnp-card[data-gnp-deck-tone="playstation"] { --gnp-deck-bg: var(--gnp-tone-playstation-bg); --gnp-deck-fg: var(--gnp-tone-playstation-fg); }
	body.gnp-mobile-home .gnp-deck-list .gnp-card[data-gnp-deck-tone="xbox"] { --gnp-deck-bg: var(--gnp-tone-xbox-bg); --gnp-deck-fg: var(--gnp-tone-xbox-fg); }
	body.gnp-mobile-home .gnp-deck-list .gnp-card[data-gnp-deck-tone="nintendo"] { --gnp-deck-bg: var(--gnp-tone-nintendo-bg); --gnp-deck-fg: var(--gnp-tone-nintendo-fg); }
	body.gnp-mobile-home .gnp-deck-list .gnp-card[data-gnp-deck-tone="pc"] { --gnp-deck-bg: var(--gnp-tone-pc-bg); --gnp-deck-fg: var(--gnp-tone-pc-fg); }
	body.gnp-mobile-home .gnp-deck-list .gnp-card[data-gnp-deck-tone="news"] { --gnp-deck-bg: var(--gnp-tone-news-bg); --gnp-deck-fg: var(--gnp-tone-news-fg); }
	body.gnp-mobile-home .gnp-deck-list .gnp-card[data-gnp-deck-tone="entertainment"] { --gnp-deck-bg: var(--gnp-tone-entertainment-bg); --gnp-deck-fg: var(--gnp-tone-entertainment-fg); }
	body.gnp-mobile-home .gnp-deck-list .gnp-card[data-gnp-deck-tone="reviews"] { --gnp-deck-bg: var(--gnp-tone-reviews-bg); --gnp-deck-fg: var(--gnp-tone-reviews-fg); }
	body.gnp-mobile-home .gnp-deck-list .gnp-card[data-gnp-deck-tone="vr"] { --gnp-deck-bg: var(--gnp-tone-vr-bg); --gnp-deck-fg: var(--gnp-tone-vr-fg); }

	/* --- Load More arrival: new cards start a little below their place and slide up one after another (--gnp-deck-i
	   is the card's index in the batch). transform + opacity only. The script adds these classes only when motion is
	   allowed; with reduced motion the cards are simply appended. --- */
	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post.is-entering {
		opacity: 0;
		transform: translate3d(0, var(--gnp-deck-enter-y), 0);
		transition: none;
	}

	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post.is-arriving {
		transition: transform 460ms var(--gnp-deck-ease), opacity 320ms ease;
		transition-delay: calc(var(--gnp-deck-i, 0) * 60ms);
		will-change: transform, opacity;
	}

	/* --- the card --- */
	body.gnp-mobile-home .gnp-deck-list .gnp-card {
		height: var(--gnp-deck-h);
		aspect-ratio: auto;
		color: var(--gnp-deck-fg);
		background: var(--gnp-deck-bg);
		border-radius: var(--gnp-deck-radius);
		box-shadow: 0 -10px 22px -8px rgba(10, 10, 14, 0.28);
	}

	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post:first-child .gnp-card,
	body.gnp-mobile-home .gnp-deck-list > li.wp-block-post.is-active .gnp-card {
		box-shadow: 0 6px 18px -10px rgba(10, 10, 14, 0.35);
	}

	/* Platform / category identity (left) and the short date (right) share the first row. */
	body.gnp-mobile-home .gnp-deck-list .gnp-deck-id {
		position: absolute;
		top: 0.9rem;
		left: 1rem;
		right: 5.5rem;
		z-index: 3;
		display: flex;
		align-items: center;
		gap: 0.55rem;
		min-width: 0;
		pointer-events: none;
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-deck-id__icon {
		flex: none;
		display: grid;
		place-items: center;
		width: 2rem;
		height: 2rem;
		border-radius: 50%;
		background: rgba(0, 0, 0, 0.14);
		background: color-mix(in srgb, currentColor 16%, transparent);
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-deck-id__icon svg {
		display: block;
		width: 1.25rem;
		height: 1.25rem;
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-deck-id__label {
		min-width: 0;
		overflow: hidden;
		font-size: 0.9375rem;
		font-weight: 800;
		line-height: 1.2;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-badge-date {
		top: 1.1rem;
		right: 1rem;
		padding: 0;
		font-size: 0.8125rem;
		font-weight: 700;
		color: inherit;
		background: transparent;
		border-radius: 0;
		opacity: 0.9;
		pointer-events: none;
	}

	/* The core <time> stays in the page as the accessible name (visually hidden, NOT display:none); the short
	   "Nov 8" is what the eye reads. */
	body.gnp-mobile-home .gnp-deck-list .gnp-badge-date time {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		white-space: nowrap;
		border: 0;
		clip: rect(0, 0, 0, 0);
		clip-path: inset(50%);
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-deck-date-short {
		display: block;
		white-space: nowrap;
	}

	/* The identity chip replaces the category badge on the card (the category link stays in the preview). */
	body.gnp-mobile-home .gnp-deck-list .gnp-badge,
	body.gnp-mobile-home .gnp-deck-list .gnp-card-scrim {
		display: none;
	}

	/* Headline: in flow under the first row. The stretched link (`a::after`, inset 0) then covers the whole card
	   because the body is no longer a positioned box. */
	body.gnp-mobile-home .gnp-deck-list .gnp-card-body {
		position: static;
		display: block;
		padding: 3.6rem 1rem 0;
		pointer-events: none;
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-card-title {
		font-size: 1.0625rem;
		font-weight: 800;
		line-height: 1.22;
		letter-spacing: -0.005em;
		color: inherit;
		/* Re-stated here: the post-title block's own rules can win over the base card rule and turn the title into
		   flow-root, which silently drops the line clamp. */
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		overflow: hidden;
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-card-title a {
		/* Core gives the post-title link display: inline-block, which is one atomic "line" and defeats the clamp. */
		display: inline;
		pointer-events: auto;
		-webkit-user-drag: none;
	}

	/* The stretched link must sit above the picture (z-index 1) so a tap anywhere on the card hits the link. */
	body.gnp-mobile-home .gnp-deck-list .gnp-card-title a::after {
		z-index: 2;
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-card-title a:focus-visible {
		outline: none;
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-card:has(.gnp-card-title a:focus-visible) {
		outline: 3px solid var(--wp--preset--color--contrast);
		outline-offset: 3px;
	}

	/* The picture: the lower part of the card, rounded on top like the person in the reference, cut by the next
	   card in every band but the last. Existing responsive image output, cropped with object-fit. */
	body.gnp-mobile-home .gnp-deck-list .gnp-card .gnp-media-frame {
		inset: auto 1rem 0 1rem;
		top: 8.1rem;
		z-index: 1;
		width: auto;
		height: auto;
		border-radius: 1.25rem 1.25rem 0 0;
		background: rgba(0, 0, 0, 0.12);
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-card .gnp-media-frame img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		-webkit-user-drag: none;
	}

	body.gnp-mobile-home .gnp-deck-list .gnp-deck-card--no-image::after {
		content: "";
		position: absolute;
		inset: 8.1rem 1rem 0 1rem;
		border-radius: 1.25rem 1.25rem 0 0;
		background: rgba(0, 0, 0, 0.12);
		background: color-mix(in srgb, currentColor 12%, transparent);
	}

	/* The hover zoom of the desktop card has no place on the deck. */
	body.gnp-mobile-home .gnp-deck-list .gnp-card:hover .gnp-media-frame img {
		transform: none;
	}

	/* ------------------------------------------------------------------
	   4. Keyboard / assistive controls and the end state
	   ------------------------------------------------------------------ */

	body.gnp-mobile-home .gnp-deck-sr,
	body.gnp-mobile-home .gnp-deck-next:not(:focus):not(:focus-visible) {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		white-space: nowrap;
		border: 0;
		clip: rect(0, 0, 0, 0);
		clip-path: inset(50%);
	}

	body.gnp-mobile-home .gnp-deck-next:focus,
	body.gnp-mobile-home .gnp-deck-next:focus-visible {
		display: inline-flex;
		align-items: center;
		min-height: 2.75rem;
		margin: 0 0 0.75rem;
		padding: 0 1.1rem;
		font: inherit;
		font-size: 0.9375rem;
		font-weight: 700;
		color: var(--wp--preset--color--base);
		background: var(--wp--preset--color--contrast);
		border: 0;
		border-radius: 999px;
		outline: 2px solid var(--wp--preset--color--accent);
		outline-offset: 2px;
	}

	/* ------------------------------------------------------------------
	   4b. Load More (under the deck, there from the first paint) and the end of the feed
	   ------------------------------------------------------------------ */

	body.gnp-mobile-home .gnp-deck-more {
		display: grid;
		justify-items: center;
		gap: 0.6rem;
		margin: 1.5rem 0 0.5rem;
		text-align: center;
	}

	body.gnp-mobile-home .gnp-deck-more__link {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: min(100%, 14rem);
		min-height: 3rem;
		padding: 0 1.75rem;
		font: inherit;
		font-size: 1rem;
		font-weight: 800;
		text-decoration: none;
		color: var(--wp--preset--color--base);
		background: var(--wp--preset--color--contrast);
		border: 1px solid var(--wp--preset--color--contrast);
		border-radius: 999px;
		cursor: pointer;
	}

	body.gnp-mobile-home .gnp-deck-more__link[hidden],
	body.gnp-mobile-home .gnp-deck-more__end[hidden] {
		display: none;
	}

	body.gnp-mobile-home .gnp-deck-more.is-loading .gnp-deck-more__link {
		opacity: 0.65;
		pointer-events: none;
		cursor: progress;
	}

	body.gnp-mobile-home .gnp-deck-more__link:focus-visible {
		outline: 3px solid var(--wp--preset--color--accent);
		outline-offset: 3px;
	}

	body.gnp-mobile-home .gnp-deck-more__status {
		margin: 0;
		font-size: 0.875rem;
		color: var(--wp--preset--color--muted);
	}

	body.gnp-mobile-home .gnp-deck-more__status:empty {
		display: none;
	}

	body.gnp-mobile-home .gnp-deck-more__end {
		margin: 0;
		padding: 0.5rem 0;
		font-size: 0.9375rem;
		font-weight: 700;
		color: var(--wp--preset--color--muted);
	}

	body.gnp-mobile-home .gnp-deck-more__end:focus {
		outline: none;
	}

	/* ------------------------------------------------------------------
	   5. Preview sheet
	   ------------------------------------------------------------------ */

	body.gnp-mobile-home .gnp-deck-backdrop {
		position: fixed;
		inset: 0;
		z-index: 43;
		background: rgba(8, 8, 12, 0.58);
		opacity: 0;
		transition: opacity 260ms ease;
		touch-action: none;
	}

	body.gnp-mobile-home .gnp-deck-backdrop[hidden],
	body.gnp-mobile-home .gnp-deck-sheet[hidden] {
		display: none;
	}

	body.gnp-mobile-home .gnp-deck-backdrop.is-open {
		opacity: 1;
	}

	/* The sheet wears the colour of the card that opened it (the script copies the card's pair into these two
	   properties and sets data-gnp-deck-tone); until then it is the News yellow. Everything on it is the pair's
	   foreground on its background, so its contrast is the card's. */
	body.gnp-mobile-home .gnp-deck-sheet {
		--gnp-deck-accent: var(--gnp-tone-news-bg);
		--gnp-deck-accent-fg: var(--gnp-tone-news-fg);
		position: fixed;
		z-index: 44;
		left: 0.5rem;
		right: 0.5rem;
		bottom: calc(var(--gnp-mobile-nav-h, 3.75rem) + var(--gnp-mobile-nav-gap, 0.75rem) + 0.5rem + env(safe-area-inset-bottom, 0px));
		display: flex;
		flex-direction: column;
		/* 5.5rem keeps the sheet's top clear of the header row; the global Follow Us bar above it adds its own height. */
		max-height: calc(100dvh - var(--gnp-mobile-nav-h, 3.75rem) - var(--gnp-mobile-nav-gap, 0.75rem) - 5.5rem - var(--gnp-follow-bar-height, 0px) - env(safe-area-inset-bottom, 0px));
		overflow: visible;
		color: var(--gnp-deck-accent-fg);
		background: var(--gnp-deck-accent);
		border: 1px solid rgba(0, 0, 0, 0.18);
		border-radius: var(--gnp-deck-radius);
		box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
		transform: translate3d(0, calc(100% + 8rem), 0);
		transition: transform 320ms var(--gnp-deck-ease), opacity 200ms ease;
		touch-action: none;
		-webkit-user-select: none;
		user-select: none;
		outline: none;
	}

	/* While the sheet is pulled up (dragged, or leaving for the article), the area it leaves behind it is filled so
	   the page never shows through. Not present at rest. */
	body.gnp-mobile-home .gnp-deck-sheet.is-dragging::after,
	body.gnp-mobile-home .gnp-deck-sheet.is-going::after {
		content: "";
		position: absolute;
		top: 100%;
		left: -1px;
		right: -1px;
		height: 100dvh;
		background: var(--gnp-deck-accent);
		border-inline: 1px solid rgba(0, 0, 0, 0.18);
		z-index: -1;
	}

	body.gnp-mobile-home .gnp-deck-sheet.is-open {
		transform: none;
	}

	body.gnp-mobile-home .gnp-deck-sheet.is-dragging {
		transition: none;
	}

	body.gnp-mobile-home .gnp-deck-sheet__grip {
		flex: none;
		display: grid;
		place-items: center;
		height: 2.25rem;
		cursor: grab;
	}

	body.gnp-mobile-home .gnp-deck-sheet__handle {
		width: 2.75rem;
		height: 0.3125rem;
		border-radius: 999px;
		background: var(--gnp-deck-accent-fg);
	}

	body.gnp-mobile-home .gnp-deck-sheet__main {
		flex: 0 1 auto;
		min-height: 0;
		overflow: hidden;
		padding: 0 1rem 0.5rem;
		cursor: pointer;
	}

	body.gnp-mobile-home .gnp-deck-sheet__media {
		display: block;
		position: relative;
		overflow: hidden;
		aspect-ratio: 16 / 9;
		max-height: min(34dvh, 15rem);
		width: 100%;
		margin: 0 0 0.85rem;
		background: rgba(0, 0, 0, 0.14);
		border-radius: 1.25rem;
	}

	body.gnp-mobile-home .gnp-deck-sheet__media img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
		-webkit-user-drag: none;
	}

	body.gnp-mobile-home .gnp-deck-sheet__art {
		position: absolute;
		inset: 0;
		display: grid;
		place-items: center;
		color: var(--gnp-deck-accent-fg);
		opacity: 0.55;
	}

	body.gnp-mobile-home .gnp-deck-sheet__art svg {
		width: 4rem;
		height: 4rem;
	}

	body.gnp-mobile-home .gnp-deck-sheet__title {
		margin: 0 0 0.6rem;
		font-size: 1.3125rem;
		font-weight: 800;
		line-height: 1.22;
		letter-spacing: -0.01em;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 4;
		overflow: hidden;
		overflow-wrap: break-word;
	}

	body.gnp-mobile-home .gnp-deck-sheet__title a {
		color: inherit;
		text-decoration: none;
		-webkit-user-drag: none;
	}

	body.gnp-mobile-home .gnp-deck-sheet__meta {
		display: flex;
		flex-wrap: wrap;
		gap: 0.4rem;
		margin: 0 0 0.7rem;
	}

	body.gnp-mobile-home .gnp-deck-sheet__chip {
		display: inline-flex;
		align-items: center;
		min-height: 1.75rem;
		padding: 0 0.7rem;
		font-size: 0.8125rem;
		font-weight: 700;
		line-height: 1.2;
		color: var(--gnp-deck-accent-fg);
		background: transparent;
		border: 1px solid var(--gnp-deck-accent-fg);
		border-radius: 999px;
	}

	/* The date chip is the one solid chip: foreground fill, background text (the same pair, inverted). */
	body.gnp-mobile-home .gnp-deck-sheet__chip--date {
		color: var(--gnp-deck-accent);
		background: var(--gnp-deck-accent-fg);
		border-color: var(--gnp-deck-accent-fg);
	}

	body.gnp-mobile-home .gnp-deck-sheet__excerpt {
		margin: 0;
		font-size: 0.96875rem;
		line-height: 1.5;
		color: inherit;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 5;
		overflow: hidden;
		overflow-wrap: break-word;
	}

	body.gnp-mobile-home .gnp-deck-sheet__actions {
		flex: none;
		display: flex;
		gap: 0.5rem;
		padding: 0.5rem 1rem 1rem;
	}

	body.gnp-mobile-home .gnp-deck-sheet__close,
	body.gnp-mobile-home .gnp-deck-sheet__read {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 3rem;
		font: inherit;
		font-size: 1rem;
		font-weight: 800;
		text-decoration: none;
		border-radius: 999px;
		cursor: pointer;
	}

	body.gnp-mobile-home .gnp-deck-sheet__close {
		flex: 0 0 auto;
		min-width: 6.5rem;
		padding: 0 1.25rem;
		color: var(--gnp-deck-accent-fg);
		background: transparent;
		border: 1.5px solid var(--gnp-deck-accent-fg);
	}

	body.gnp-mobile-home .gnp-deck-sheet__read {
		flex: 1 1 auto;
		padding: 0 1.25rem;
		color: var(--gnp-deck-accent);
		background: var(--gnp-deck-accent-fg);
		border: 1.5px solid var(--gnp-deck-accent-fg);
	}

	body.gnp-mobile-home .gnp-deck-sheet a:focus-visible,
	body.gnp-mobile-home .gnp-deck-sheet button:focus-visible {
		outline: 3px solid var(--gnp-deck-accent-fg);
		outline-offset: 2px;
	}

	/* Short landscape phones: keep the sheet inside the screen (no image, tighter text). */
	@media (max-height: 520px) {
		body.gnp-mobile-home .gnp-deck-sheet__media {
			display: none;
		}

		body.gnp-mobile-home .gnp-deck-sheet__excerpt {
			-webkit-line-clamp: 2;
		}

		body.gnp-mobile-home .gnp-deck-sheet__title {
			-webkit-line-clamp: 2;
		}
	}

	/* ------------------------------------------------------------------
	   6. Dark mode: the pills follow the tokens; the cards and the sheet keep their tone, only depths change
	   ------------------------------------------------------------------ */

	@media (prefers-color-scheme: dark) {
		:root:not([data-theme="light"]) body.gnp-mobile-home .gnp-deck-list .gnp-card {
			box-shadow: 0 -10px 22px -8px rgba(0, 0, 0, 0.7);
		}

		:root:not([data-theme="light"]) body.gnp-mobile-home .gnp-deck-sheet {
			box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.7);
		}
	}

	:root[data-theme="dark"] body.gnp-mobile-home .gnp-deck-list .gnp-card {
		box-shadow: 0 -10px 22px -8px rgba(0, 0, 0, 0.7);
	}

	:root[data-theme="dark"] body.gnp-mobile-home .gnp-deck-sheet {
		box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.7);
	}

	/* ------------------------------------------------------------------
	   7. Reduced motion: no flying, no sliding, no fading - state changes are instant
	   ------------------------------------------------------------------ */

	@media (prefers-reduced-motion: reduce) {
		body.gnp-mobile-home .gnp-deck-list > li.wp-block-post,
		body.gnp-mobile-home .gnp-deck-list > li.wp-block-post.is-arriving,
		body.gnp-mobile-home .gnp-deck-backdrop,
		body.gnp-mobile-home .gnp-deck-sheet {
			transition: none;
		}
	}

	/* ------------------------------------------------------------------
	   8. Wider app layouts: tablet portrait and landscape (600px and up)

	   The same single deck, never a grid: heading, pills, the card stack, Load More and the Play tiles share ONE
	   centred column (--gnp-app-deck-max, set with the other app widths in assets/css/mobile-article.css), and the
	   preview sheet is centred and capped to the same width. Cards are a little taller so the wider picture keeps
	   roughly the phone's proportions. Behaviour (drag, flick, snap-back, preview, history) is the phone's, untouched.
	   ------------------------------------------------------------------ */

	@media (min-width: 600px) {
		body.gnp-mobile-home {
			--gnp-deck-h: 26rem;
			--gnp-deck-band: 10rem;
		}

		/* The block layout centres every capped child (its margin-inline: auto !important). */
		body.gnp-mobile-home .gnp-latest > * {
			max-width: var(--gnp-app-deck-max, 37rem);
		}

		/* The pill row still scrolls past the column by one gutter on each side, so the first pill sits on the column
		   edge exactly as it sits on the gutter on a phone. */
		body.gnp-mobile-home .gnp-latest > .gnp-home-category-row {
			max-width: calc(var(--gnp-app-deck-max, 37rem) + 2 * var(--gnp-gutter, 1rem));
			margin-inline: auto !important;
		}

		body.gnp-mobile-home .gnp-deck-sheet {
			left: max(0.5rem, calc((100% - var(--gnp-app-deck-max, 37rem)) / 2));
			right: max(0.5rem, calc((100% - var(--gnp-app-deck-max, 37rem)) / 2));
		}
	}
}
