/* Wiki page navigation and homepage layout.
 *
 * Loaded after site.css, facilities.css and the selected theme's stylesheet
 * is applied by theme.js.  Everything here uses the theme variables (--accent,
 * --accent-2, --card, --border, --fg, --muted, --danger), and the navigation
 * reuses each theme's own .btn styling, so all eight themes stay coherent.
 * site.css and themes/standard.css are deliberately left unchanged. */

/* ---- navigation buttons ------------------------------------------------- */

nav.forum-nav { row-gap: 0.55rem; column-gap: 0.45rem; }
nav.forum-nav .nav-btn {
	white-space: nowrap;
	line-height: 1.3;
	padding: 0.3rem 0.65rem;
}
/* LCARS keeps its upper-case pills; the other themes read better in normal
 * case at button size. */
html.theme-site:not([data-theme="standard"]) nav.forum-nav .nav-btn {
	text-transform: none;
	letter-spacing: 0.01em;
	font-size: 0.88rem;
}
/* The current page is shown in inverted colours, which stand out against
 * every theme's ordinary buttons. */
/* themes/alternate.css gives every .btn its background with !important, so
 * the current-page highlight must use !important too. */
html.theme-site nav.forum-nav a.nav-btn[aria-current="page"],
html nav.forum-nav a.nav-btn[aria-current="page"] {
	background: var(--fg) !important;
	color: var(--bg);
	border-color: var(--fg);
}
/* LCARS capitals are wider; keep all nine pills on one row at desktop width. */
html.theme-site[data-theme="standard"] nav.forum-nav .nav-btn {
	font-size: 0.8rem;
	letter-spacing: 0.03em;
	padding: 0.28rem 0.58rem;
}
html.theme-site:not([data-theme="standard"]) nav.forum-nav .nav-btn:not([aria-current="page"]) {
	background: var(--card);
	color: var(--fg);
	border: 1px solid var(--border);
}
html.theme-site:not([data-theme="standard"]) nav.forum-nav .nav-btn:not([aria-current="page"]):hover {
	border-color: var(--accent);
	color: var(--accent);
}
/* Primary buttons on the first row; theme picker, sign-in and editing tools
 * on the second.  The break is an empty full-width flex item. */
nav.forum-nav .nav-break { flex-basis: 100%; height: 0; }

/* ---- homepage ----------------------------------------------------------- */

/* The homepage uses a wider column so its grids have room; other pages keep
 * the comfortable reading width from site.css. */
body:has(main.home) { max-width: 66rem; }

main.home .lead {
	font-size: 1.12rem;
	max-width: 52rem;
	margin: 1.6rem auto;
}

main.home section { margin: 1.4rem 0; }
main.home .card { padding: 1.1rem 1.35rem; border-radius: 0.9rem; }
main.home .card h2 { margin-top: 0.2rem; font-size: 1.3rem; }

/* Start-here tiles. */
main.home .quick-links {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
	gap: 0.9rem;
	margin: 1.6rem 0;
}
main.home .quick-link {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	column-gap: 0.75rem;
	align-items: center;
	padding: 0.95rem 1.1rem;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 0.9rem;
	color: var(--fg);
	text-decoration: none;
	transition: border-color 140ms ease, transform 140ms ease;
}
main.home .quick-link:hover,
main.home .quick-link:focus-visible {
	border-color: var(--accent);
	transform: translateY(-2px);
}
main.home .ql-icon { grid-row: span 2; font-size: 1.9rem; line-height: 1; }
main.home .ql-title { font-weight: 700; font-size: 1.08rem; color: var(--accent); }
main.home .ql-text { color: var(--muted); font-size: 0.92rem; line-height: 1.35; }

/* Two cards side by side on wide screens. */
main.home .home-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
	gap: 1.1rem;
	align-items: start;
	margin: 1.4rem 0;
}
main.home .home-grid > section { margin: 0; }

/* Numbered joining steps. */
main.home ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0.8rem 0 1rem; }
main.home ol.steps li {
	counter-increment: step;
	position: relative;
	padding: 0.15rem 0 0.15rem 2.6rem;
	margin: 0.75rem 0;
	min-height: 1.9rem;
}
main.home ol.steps li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: 0;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: 800;
	background: var(--accent);
	color: #000;
}

main.home .callout {
	padding: 0.55rem 0.8rem;
	border-left: 0.3rem solid var(--accent);
	background: color-mix(in srgb, var(--accent) 10%, transparent);
	border-radius: 0.4rem;
}

/* Experiences as a grid of short labelled notes. */
main.home ul.term-grid {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
	gap: 0.85rem;
}
main.home ul.term-grid li {
	background: var(--card);
	border: 1px solid var(--border);
	border-left: 0.3rem solid var(--accent-2, var(--accent));
	border-radius: 0.7rem;
	padding: 0.75rem 0.95rem;
}
main.home ul.term-grid li > strong:first-child,
main.home ul.tip-list li > strong:first-child {
	display: block;
	color: var(--accent);
	margin-bottom: 0.15rem;
}
main.home ul.tip-list,
main.home ul.myth-list { padding-left: 0; list-style: none; }
main.home ul.tip-list li,
main.home ul.myth-list li { margin: 0.75rem 0; }
main.home ul.myth-list li > em:first-child {
	font-weight: 700;
	color: var(--accent);
}

/* Closing invitation and crisis box. */
main.home .cta-card { text-align: center; }
main.home .cta-card .btn-row { justify-content: center; }
main.home .help-card {
	border-left: 0.4rem solid var(--danger);
	background: color-mix(in srgb, var(--danger) 9%, var(--card));
}
main.home .help-card h2 { border-bottom-color: var(--danger); }
main.home .edit-invite { text-align: center; color: var(--muted); max-width: 46rem; margin: 2rem auto; }

/* The advertisement sits below the start-here tiles.  site.css reserves
 * 90px so the page does not jump when an ad arrives; when Google reports that
 * no ad is available the reservation collapses. */
main.home .home-ad { margin: 1.4rem 0; }
main.home .home-ad:has(ins[data-ad-status="unfilled"]) { min-height: 0; margin: 0; }
main.home ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* Template-rendered extras below the page body, framed to match. */
main.home .live-threads-box {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 0.9rem;
	padding: 1.1rem 1.35rem;
}
main.home .live-threads-box h2 { margin-top: 0.2rem; font-size: 1.3rem; }

@media (max-width: 40rem) {
	main.home .home-grid,
	main.home ul.term-grid { grid-template-columns: 1fr; }
	main.home .card { padding: 0.9rem 1rem; }
	nav.forum-nav .nav-btn { font-size: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
	main.home .quick-link { transition: none; }
	main.home .quick-link:hover, main.home .quick-link:focus-visible { transform: none; }
}
