/* =========================================================================
   BASIC-256 per-platform download pages
   (template-download-*.php → template-parts/download-page.php)

   Builds on landing.css (tokens, header/footer, buttons) and release-notes.css
   (the .b256-rn hero band, .rn-block body rhythm and .rn-cta panel). Only what
   is specific to a download page lives here.
   ========================================================================= */

/* The per-platform .os-* colours live in landing.css, because the homepage
   download rows use them too and download.css does not load there. */

/* ---- Header band ------------------------------------------------------- */
.dlp-title {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 4px;
}

.dlp-title h1 { margin: 0; }

.dlp-title-ico {
	flex: none;
	width: 64px;
	height: 64px;
	border-radius: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(148, 163, 184, 0.10);
	border: 1px solid rgba(148, 163, 184, 0.22);
}

.b256-dlp .b256-rn-hero .rn-sub { margin-top: 16px; }
.b256-dlp .b256-rn-hero .rn-actions { margin-top: 4px; }

/* The taglines emphasise the thing a visitor most often gets wrong — that
   one artefact holds two formats, that the two Mac builds are not
   interchangeable. Muted bold on a muted paragraph does not read as emphasis,
   so lift it to full white. */
.b256-dlp .b256-rn-hero .rn-sub strong { color: #fff; font-weight: 650; }

.b256-dlp .b256-rn-hero .rn-meta a {
	color: var(--text-invert-muted);
	text-decoration: underline;
	transition: color .15s ease;
}
.b256-dlp .b256-rn-hero .rn-meta a:hover { color: #fff; }

/* ---- Platform switcher -------------------------------------------------
   Sits between the dark hero and the light body, so it carries the seam.

   Deliberately not sticky: .b256-header is already position:sticky at top:0,
   so a second sticky bar would slide underneath it and disappear, and pinning
   it below the header would mean hard-coding a header height that the admin
   bar and the mobile breakpoint both change. */
.dlp-switch {
	background: var(--bg-light-2);
	border-bottom: 1px solid var(--border);
}

.dlp-switch ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	/* Scrolls rather than wraps on a narrow screen — see the media query. */
	overflow-x: auto;
	scrollbar-width: none;
}
.dlp-switch ul::-webkit-scrollbar { display: none; }

.dlp-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--text-muted);
	border-bottom: 2px solid transparent;
	white-space: nowrap;
	transition: color .15s ease, border-color .15s ease;
}

/* The icon keeps its platform tint in its own span; the label follows the
   link state, so an unselected chip does not shout in five colours at once. */
.dlp-chip-ico { flex: none; display: inline-flex; }
.dlp-chip:hover { color: var(--text); }

.dlp-chip.is-current {
	color: var(--text);
	border-bottom-color: currentColor;
}

/* ---- The files --------------------------------------------------------- */
/* Cards stretch to the tallest rather than sitting at their natural height,
   so the Download buttons and the filename footers line up across a row even
   when one description is two lines longer than the other. */
.dlp-files {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
	align-items: stretch;
}

/* A platform with one artefact gets one column rather than a card stranded
   beside an empty half — capped at roughly the width a card has on the
   two-artefact pages, so a lone card does not stretch to a shape none of the
   others have. The min() matters: a bare 560px track is wider than a phone
   and would push the whole page sideways. */
.dlp-files.is-single { grid-template-columns: minmax(0, min(560px, 100%)); }

.dl-card {
	display: flex;
	flex-direction: column;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px;
	box-shadow: var(--shadow);
}

.dl-card.is-primary { border-color: rgba(37, 99, 235, 0.45); }

.dl-card-head {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.dl-card h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--text);
}

.dl-pick {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--blue);
	background: rgba(37, 99, 235, 0.10);
	border: 1px solid rgba(37, 99, 235, 0.30);
	border-radius: 999px;
	padding: 3px 10px;
}

.dl-card .dl-desc {
	color: #475569;
	font-size: 15px;
	line-height: 1.6;
	/* Pushes the button to the bottom so buttons line up across cards of
	   unequal text length. */
	margin: 0 0 20px;
	flex: 1;
}

.dl-card .dl-get { align-self: flex-start; }

.dl-card .dl-file {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin: 16px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--border);
	font-size: 13px;
	color: var(--text-muted);
}

.dl-card .dl-file code {
	background: var(--bg-light);
	color: #334155;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 12.5px;
	font-family: "SFMono-Regular", Consolas, Menlo, monospace;
	/* Filenames are long and must never widen the card. */
	overflow-wrap: anywhere;
}

.dl-size { flex: none; font-variant-numeric: tabular-nums; }

.dlp-requires {
	margin: 22px 0 0 !important;
	padding: 14px 18px;
	background: var(--bg-light-2);
	border: 1px solid var(--border);
	border-left: 3px solid var(--blue-2);
	border-radius: 10px;
	font-size: 14.5px !important;
	color: #334155 !important;
}
.dlp-requires a { color: var(--blue); text-decoration: underline; }

/* ---- Notes -------------------------------------------------------------
   Prose blocks: instructions, caveats, the WASM tables. Inherits .rn-block
   spacing; everything below is what release-notes.css does not cover. */
.dlp-note ul {
	margin: 0 0 14px;
	padding-left: 20px;
	max-width: 60em;
}
.dlp-note li {
	color: #334155;
	font-size: 15.5px;
	line-height: 1.6;
	margin-bottom: 9px;
}
.dlp-note a { color: var(--blue); text-decoration: underline; }
.dlp-note strong { color: var(--text); }

.dl-code {
	background: var(--code-bg);
	color: #e6edf3;
	border-radius: 10px;
	padding: 16px 18px;
	margin: 0 0 16px;
	max-width: 60em;
	overflow-x: auto;
	font-size: 13.5px;
	line-height: 1.65;
}
.dl-code code {
	background: none !important;
	color: inherit !important;
	padding: 0 !important;
	font-family: "SFMono-Regular", Consolas, Menlo, monospace;
	white-space: pre;
}

/* Tables (the ?run= / ?mode= references on the browser page).
   The scrolling lives on a wrapper rather than on the table itself: a table
   set to display:block stops being a table, and its cells then size to their
   content instead of filling the width, leaving a dead column on the right. */
.dl-scroll {
	max-width: 60em;
	overflow-x: auto;
	margin: 0 0 18px;
}
.dl-table {
	width: 100%;
	border-collapse: collapse;
	/* Blocksy styles bare tables; reset the frame so only the row rules below
	   are drawn. */
	border: 0;
	margin: 0;
	font-size: 14.5px;
}
.dl-table th,
.dl-table td {
	text-align: left;
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
	color: #334155;
}
.dl-table th {
	color: var(--text);
	font-weight: 700;
	font-size: 13px;
	letter-spacing: .03em;
	text-transform: uppercase;
	background: var(--bg-light-2);
	white-space: nowrap;
}
.dl-table tr:last-child td { border-bottom: 0; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 860px) {
	.dlp-files { grid-template-columns: minmax(0, 1fr); }
	.dlp-title { gap: 12px; }
	.dlp-title-ico { width: 52px; height: 52px; border-radius: 13px; }
	.dlp-title-ico svg { width: 32px; height: 32px; }
}

@media (max-width: 720px) {
	/* Scroll the chips sideways rather than stacking five of them into a
	   block the visitor has to scroll past. */
	.dlp-switch ul { flex-wrap: nowrap; }
	.dl-card { padding: 20px; }
}
