/* 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; }
}

/* The front door is a social invitation.  Keep these rules on the homepage:
 * wiki pages and account screens continue using their established layouts. */
body.home-page nav.forum-nav { position: relative; }
body.home-page nav.forum-nav .brand img { width: 36px; height: 36px; }
body.home-page .home-nav-more { position: relative; margin: 0; }
body.home-page .home-nav-more summary {
	list-style: none;
	padding: 7px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--card);
	color: var(--fg);
	font-weight: 800;
	cursor: pointer;
}
body.home-page .home-nav-more summary::-webkit-details-marker { display: none; }
body.home-page .home-nav-more summary::after { content: " +"; color: var(--accent); }
body.home-page .home-nav-more[open] summary::after { content: " −"; }
body.home-page .home-nav-more summary:focus-visible { outline: 3px solid #62eaff; outline-offset: 2px; }
body.home-page .home-nav-more-links {
	position: absolute;
	z-index: 30;
	top: 44px;
	right: 0;
	width: min(310px, calc(100vw - 32px));
	display: grid;
	gap: 6px;
	padding: 12px;
	border: 1px solid #a57cff;
	border-radius: 14px;
	background: #15102f;
	box-shadow: 0 14px 36px #08051c99;
}
body.home-page .home-nav-more-links .btn {
	margin: 0;
	color: #f9f4ff;
	background: #2b2051;
	border: 1px solid #685a95;
	text-align: left;
}
body.home-page .home-nav-more-links .btn:hover { background: #463171; }

body.home-page .hero {
	position: relative;
	overflow: hidden;
	margin: 24px 0 0;
	padding: 32px 38px 38px;
	border: 2px solid #9d69ea;
	border-radius: 26px;
	background: radial-gradient(circle at 18% 10%, #3d206a, transparent 48%),
		linear-gradient(145deg, #100b2d, #241343);
	box-shadow: 0 14px 38px #35185d33;
	color: #fff;
	text-align: left;
}
body.home-page .hero::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 70px;
	background-image: linear-gradient(#7753b34d 1px, transparent 1px),
		linear-gradient(90deg, #7753b34d 1px, transparent 1px);
	background-size: 68px 24px;
	pointer-events: none;
}
body.home-page .hero > * { position: relative; z-index: 1; }
body.home-page .hero .logo-hero,
html.theme-site:not([data-theme="standard"]) body.home-page .hero .logo-hero {
	width: min(440px, 100%);
	max-height: none;
	margin: 0 0 15px;
}
body.home-page .home-headline {
	max-width: 930px;
	margin: 0;
	font-size: clamp(36px, 5vw, 62px);
	line-height: 1;
	letter-spacing: -2px;
	text-transform: none;
	color: #fff3fc;
	text-wrap: balance;
}
body.home-page .home-hero-line {
	margin: 18px 0 24px;
	color: #d1eaf8;
	font-size: clamp(18px, 2vw, 23px);
}
body.home-page .hero-actions { justify-content: flex-start; gap: 10px; margin: 0; }
body.home-page .hero-actions .btn {
	flex: 1 1 185px;
	max-width: 250px;
	min-height: 58px;
	padding: 10px 16px;
	border-radius: 10px;
	font-weight: 900;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: 5px 5px 0 #07051c;
}
body.home-page .hero-actions .btn:first-child { background: #ff70c6 !important; color: #180b2e !important; }
body.home-page .hero-actions .btn:nth-child(2) { background: #68e9ff !important; color: #10102c !important; }
body.home-page .hero-actions .btn:nth-child(3) { background: #e1d4ff !important; color: #1d1240 !important; }
body.home-page .hero-actions .btn-sub { color: inherit; font-size: 12px; }

main.home .home-kicker {
	margin: 0 0 9px;
	font: 800 13px/1.4 ui-monospace, monospace;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #7c47b9;
}
main.home .home-manifesto {
	margin-top: 26px;
	padding: 25px 30px;
	border: 2px solid #caa8ed;
	border-left: 8px solid #dc68c6;
	border-radius: 16px;
	background: var(--card);
	box-shadow: 7px 7px 0 #c8a2eb55;
}
main.home .home-manifesto h2,
main.home .home-hangouts h2,
main.home .home-community h2,
main.home .home-lower-grid h2 {
	margin: 0 0 12px;
	padding: 0;
	border: 0;
	font-size: clamp(24px, 3vw, 36px);
	line-height: 1;
	letter-spacing: -1px;
	text-transform: none;
}
main.home .home-manifesto p:last-child {
	max-width: 820px;
	margin: 0;
	font-size: 19px;
}

main.home .quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
main.home .quick-link {
	min-height: 150px;
	padding: 20px;
	border: 2px solid #6e489d;
	border-radius: 16px;
	box-shadow: 6px 6px 0 #1b123b44;
	color: #fff;
}
main.home .quick-link:nth-child(1) { background: #261540; }
main.home .quick-link:nth-child(2) { background: #143049; }
main.home .quick-link:nth-child(3) { background: #341b43; }
main.home .quick-link:hover, main.home .quick-link:focus-visible { border-color: #65e8ff; }
main.home .quick-link .ql-icon { font-size: 36px; }
main.home .quick-link .ql-title { font-size: 23px; color: #f8b5ee; }
main.home .quick-link:nth-child(2) .ql-title { color: #87ecff; }
main.home .quick-link .ql-text { color: #e0ddec; font-size: 15px; }

main.home .home-hangouts,
main.home .home-community { padding: 20px 2px; }
main.home .home-hangout-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}
main.home .home-hangout-grid p {
	margin: 0;
	padding: 18px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--card);
}
main.home .home-hangout-grid strong { display: block; color: #8c45bd; font-size: 18px; }
main.home .home-lower-grid .card { min-height: 100%; }
main.home .home-join { border-top: 5px solid #68bcd4; }
main.home .home-night { border-top: 5px solid #e773b6; }
main.home .home-join details { margin-top: 18px; }
main.home .home-join summary {
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 9px;
	font-weight: 800;
	cursor: pointer;
}
main.home .home-join details p { margin: 13px 0 0; }
main.home .home-community {
	border-top: 2px solid #ac82d4;
	border-bottom: 2px solid #ac82d4;
}
main.home .home-community p:last-child { max-width: 780px; margin: 0; }
main.home .ops-roster,
main.home .starlink-box {
	margin: 18px 0 0;
	padding: 15px 18px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--card);
	max-width: none;
}
main.home .ops-roster summary,
main.home .starlink-box summary {
	font-weight: 800;
	cursor: pointer;
}
main.home .ops-roster[open] summary,
main.home .starlink-box[open] summary { margin-bottom: 14px; }

@media (max-width: 800px) {
	main.home .quick-links,
	main.home .home-hangout-grid { grid-template-columns: 1fr; }
	main.home .quick-link { min-height: 112px; }
}
@media (max-width: 600px) {
	body.home-page .hero { padding: 22px 20px 25px; margin-top: 14px; }
	body.home-page .home-headline { font-size: 32px; letter-spacing: -1px; }
	body.home-page .hero-actions .btn { max-width: none; flex-basis: 100%; min-height: 50px; }
	main.home .home-manifesto { padding: 20px; }
	main.home .home-manifesto p:last-child { font-size: 17px; }
	main.home .home-hangout-grid strong { font-size: 17px; }
}
