/* =====================================================================
 * 43-mobile-density.css — shorter pages on a phone
 * ---------------------------------------------------------------------
 * Al, voice note 2026-11-20: "I hate mobile sites... never ending
 * scrolls." Measured page heights at 390px on 28 Nov: home 6,661px,
 * /guests/ 12,710px, /episodes/ 22,278px. This file changes density
 * (columns, rows, a swipe strip), not type size, so it stays clear of
 * the "make everything smaller" question gated on Al's screenshots.
 * ===================================================================== */

@media (max-width: 640px) {

	/* ---- /guests/: three across instead of two ------------------------
	   The plugin prints .ppe-g-grid {minmax(150px,1fr)} and 120px discs in
	   an inline <style> (GuestRender.php:249-252, 0,1,0). At 390px that is
	   two per row and 109 guests run 12,710px. Three per row with 76px discs
	   roughly halves it. */
	body .ppe-g-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 22px 10px;
	}
	body .ppe-g-grid .ppe-g-av {
		width: 76px;
		height: 76px;
	}
	body .ppe-g-grid .ppe-g-ini {
		font-size: 1.35rem;
	}
	body .ppe-g-grid .ppe-g-name {
		font-size: 13px;
		line-height: 1.3;
	}
	body .ppe-g-grid .ppe-g-n {
		font-size: 12px;
	}

	/* ---- front page: the discussion strip swipes ----------------------
	   29-home-widgets.css stacks the four comments into one column below
	   900px (~800px tall at 390px). A horizontal strip keeps all four
	   (Ricky's limit) in one row; the next card peeks in to show it moves. */
	body .fb-rc-list {
		display: flex;
		gap: 12px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--fb-gutter-m);
		margin: 0 calc(-1 * var(--fb-gutter-m));
		padding: 0 var(--fb-gutter-m) 8px;
		scrollbar-width: none;
	}
	body .fb-rc-list::-webkit-scrollbar {
		display: none;
	}
	body .fb-rc-item {
		flex: 0 0 84%;
		scroll-snap-align: start;
	}
}

/* ---- footer: the two link lists side by side -------------------------
   19-footer.css drops to one column below 561px, stacking Explore over
   Listen & support. Both lists are short; side by side saves ~200px on
   every page. */
@media (max-width: 560px) {
	body .fb-footer-row {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 1.8rem 1.2rem;
	}
	body .fb-foot-brand {
		grid-column: 1 / -1;
	}
}

/* ---- /episodes/ filter bar: straight right edge ----------------------
   Below 900px the plugin wraps the controls as a flex row and the right
   edges land at 360, 356 and 336px (390px screenshot, TODO.md:1931).
   A two-column grid: search and guest full width, media and access
   half each. The series and season selects stay hidden (24-episodes-
   page.css), and grid ignores display:none children. */
@media (max-width: 900px) {
	body.page-id-20 .ppe-controls {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 10px;
	}
	body.page-id-20 .ppe-controls > .ppe-search,
	body.page-id-20 .ppe-controls > .ppe-sel-guest,
	body.page-id-20 .ppe-controls > .ppe-clear {
		grid-column: 1 / -1;
	}
	body.page-id-20 .ppe-controls > label {
		min-width: 0;
	}
	body.page-id-20 .ppe-controls > label > select {
		width: 100%;
		box-sizing: border-box;
	}
}
