/*
 * The server rendered pages of the site: the help topics (infrastructure.seo.HelpPageController) and, in time,
 * the landing page. They live outside the Vaadin application, but they are not a separate site: the template
 * loads the application's own two stylesheets first, so everything below is written in the design system the
 * application uses.
 *
 *   /aura/aura.css        the Aura theme: the --vaadin-* and --aura-* tokens, the Instrument Sans font
 *   /css/aura-theme.css   the application's semantic roles: --app-ink, --app-surface, --app-highlight, ...
 *
 * This file therefore only names roles and a reading layout; it carries no colour of its own, so a change of
 * palette reaches the application and these pages at the same time.
 */

:root {
	/* Light only for now: Aura's light-dark() tokens need a colour scheme, and the application's dark
	   theme is a per user choice that has no meaning for a page a visitor lands on from a search result. */
	color-scheme: light;

	/* The application's MAXWIDTH (BaseAppLayout), so both surfaces break at the same place. */
	--static-max-width: 1200px;
	/* Reading measure: a help text is prose, not a form. */
	--static-reading-width: 45rem;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
	background: var(--app-background);
	color: var(--app-ink);
	font-family: var(--aura-font-family);
	font-size: 1rem;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

/* The footer closes the page, also when the text is as short as a not found message. */
body > main {
	flex: 1 0 auto;
}

a {
	color: var(--app-link);
	text-underline-offset: 0.15em;
}

a:hover {
	text-decoration-thickness: 2px;
}

:is(a, button):focus-visible {
	outline: 2px solid var(--app-highlight);
	outline-offset: 2px;
	border-radius: var(--vaadin-radius-m);
}

/* ==========================================================================
   Masthead
   The same mark and the same actions as the application's navbar, without
   its per user menu. The bar reacts to its own width (container query), so it
   stacks on a phone whatever the window does around it.
   ========================================================================== */

.staticMasthead {
	background: var(--app-surface);
	border-bottom: 1px solid var(--app-border);
	container-type: inline-size;
}

.staticBar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--vaadin-gap-m) var(--vaadin-gap-l);
	max-width: var(--static-max-width);
	margin-inline: auto;
	padding: var(--vaadin-padding-m) var(--vaadin-padding-l);
}

.staticBrand {
	display: flex;
	align-items: center;
	gap: var(--vaadin-gap-s);
	color: var(--app-ink);
	text-decoration: none;
}

.staticBrandLogo {
	width: 40px;
	height: 40px;
	object-fit: contain;
}

.staticBrandTitle {
	font-size: var(--app-page-title-font-size, 1.2rem);
	font-weight: 600;
	letter-spacing: -0.01em;
}

.staticBrand:hover .staticBrandTitle {
	color: var(--app-link);
}

.staticNav {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--vaadin-gap-m) var(--vaadin-gap-l);
}

.staticNavLink {
	color: var(--app-secondary);
	font-size: 0.95rem;
	text-decoration: none;
}

.staticNavLink:hover {
	color: var(--app-link);
}

/* The primary action, shaped like Aura's primary button: the accent colour, the theme's radius and a small
   shadow, so it reads as the same button the application shows. */
.staticNavAction,
.staticActionPrimary {
	background: var(--app-highlight);
	border: 1px solid var(--app-highlight);
	border-radius: var(--vaadin-radius-m);
	box-shadow: var(--aura-shadow-xs, none);
	color: var(--app-cta-text);
	font-weight: 600;
	text-decoration: none;
}

.staticNavAction {
	padding: 0.4rem 0.9rem;
	font-size: 0.95rem;
	/* the primary action sits at the end of the row, also when the bar stacks */
	margin-inline-start: auto;
}

.staticNavAction:hover,
.staticActionPrimary:hover {
	filter: brightness(0.94);
}

@container (max-width: 34rem) {
	.staticBar {
		align-items: stretch;
		flex-direction: column;
	}

	.staticNav {
		gap: var(--vaadin-gap-s) var(--vaadin-gap-m);
	}
}

/* ==========================================================================
   The page
   ========================================================================== */

.staticPage {
	max-width: var(--static-reading-width);
	margin-inline: auto;
	padding: 2rem var(--vaadin-padding-l) var(--vaadin-padding-l);
}

/* A step larger than the application's component scale: this is prose that is read, not a form. */
.helpContent {
	font-size: 1.0625rem;
}

.helpContent h1 {
	margin-block: 0 var(--vaadin-padding-m);
	font-size: 1.9rem;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.helpContent h2 {
	margin-block: 2.25rem 0.5rem;
	font-size: 1.35rem;
	line-height: 1.3;
}

.helpContent h3 {
	margin-block: 1.75rem 0.5rem;
	font-size: 1.1rem;
}

.helpContent p,
.helpContent ul,
.helpContent ol {
	margin-block: 0 1rem;
}

.helpContent li {
	margin-block: 0.25rem;
}

.helpContent ul,
.helpContent ol {
	padding-inline-start: 1.25rem;
}

.helpContent img.helpImage {
	max-width: 100%;
	height: auto;
	margin-block: 1rem;
	border: 1px solid var(--app-border);
	border-radius: var(--vaadin-radius-l);
}

.helpContent blockquote {
	margin: 1rem 0;
	padding-inline-start: var(--vaadin-padding-m);
	border-inline-start: 3px solid var(--app-highlight);
	color: var(--app-secondary);
}

.helpContent code {
	padding: 0.1rem 0.3rem;
	border: 1px solid var(--app-border);
	border-radius: var(--vaadin-radius-m);
	background: var(--app-surface);
	font-size: 0.9em;
}

.helpContent pre {
	overflow-x: auto;
	margin-block: 1rem;
	padding: var(--vaadin-padding-m);
	border: 1px solid var(--app-border);
	border-radius: var(--vaadin-radius-l);
	background: var(--app-surface);
}

.helpContent pre code {
	padding: 0;
	border: 0;
	background: none;
}

.helpContent hr {
	margin-block: 2rem;
	border: 0;
	border-top: 1px solid var(--app-border);
}

.helpMissingLink {
	color: var(--app-secondary);
	font-style: italic;
}

/* ==========================================================================
   The closing call to action
   ========================================================================== */

.staticCta {
	margin-block: 2.5rem 0;
	padding: var(--vaadin-padding-l);
	border: 1px solid var(--app-border);
	border-radius: var(--vaadin-radius-l);
	background: var(--app-surface);
}

.staticCta p {
	margin: 0 0 var(--vaadin-padding-m);
	font-size: 1.05rem;
}

.staticCtaActions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--vaadin-gap-s);
}

.staticAction {
	padding: 0.45rem 1rem;
	border: 1px solid var(--app-border);
	border-radius: var(--vaadin-radius-m);
	background: var(--app-background);
	color: var(--app-ink);
	font-weight: 600;
	text-decoration: none;
}

.staticAction:hover {
	filter: brightness(0.97);
}

/* A step above the secondary action it stands next to; declared after .staticAction so it wins. */
.staticActionPrimary {
	background: var(--app-highlight);
	border-color: var(--app-highlight);
	color: var(--app-cta-text);
}

/* ==========================================================================
   More topics
   ========================================================================== */

.helpMoreTopics {
	margin-block: 2.5rem 0;
	padding-block-start: var(--vaadin-padding-m);
	border-top: 1px solid var(--app-border);
}

.helpMoreTopics h2 {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
}

.helpMoreTopics ul {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.staticFooter {
	border-top: 1px solid var(--app-border);
	background: var(--app-surface);
	margin-block-start: 3rem;
}

.staticFooterBar {
	align-items: baseline;
}

.staticFooterLinks,
.staticLanguages {
	display: flex;
	flex-wrap: wrap;
	gap: var(--vaadin-gap-m);
}

.staticFooterLinks a,
.staticLanguages a {
	color: var(--app-secondary);
	font-size: 0.9rem;
	text-decoration: none;
}

.staticFooterLinks a:hover,
.staticLanguages a:hover {
	color: var(--app-link);
}

/* ==========================================================================
   Not found
   ========================================================================== */

.helpNotFound {
	padding-block: 4rem;
}

.helpNotFound p {
	margin: 0 0 var(--vaadin-padding-m);
}
