/* Front page and the two product pages (home.php): log in first, the products next to it */

/* Illustration colours (images/home_*.svg). Same theme switch as css_main: light by default,
   dark from the OS setting unless data-theme="light", and always dark with data-theme="dark". */
:root,
[data-theme="light"] {
	--home-ill-bg: #dde9f5;
	--home-ill-card: #ffffff;
	--home-ill-line: #d3dce6;
	--home-ill-grid: #edf1f6;
	--home-ill-text: #6b7b8c;
	--home-ill-ink: #1b2733;
	--home-ill-blue: #336699;
	--home-ill-teal: #2a9db0;
	--home-ill-green: #5fae4f;
	--home-ill-soft: #e6eff8;
	--home-ill-water: #e4f1f8;
	--home-ill-land: #d9ecd3;
	--home-ill-phone: #1f2d3d;
	--home-ill-shadow: rgba(30, 60, 100, 0.10);
	--home-ill-accent: #d9534f;
	--home-ill-panel: #eef4fa;
	--home-eyebrow: #23899a;
}

@media screen and (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--home-ill-bg: #1b2a3a;
		--home-ill-card: #1f2c3a;
		--home-ill-line: #34465a;
		--home-ill-grid: #28384b;
		--home-ill-text: #93a3b5;
		--home-ill-ink: #e3e9f0;
		--home-ill-blue: #6f9fd3;
		--home-ill-teal: #4fc0d0;
		--home-ill-green: #83c973;
		--home-ill-soft: #26384c;
		--home-ill-water: #1a2d3e;
		--home-ill-land: #23392d;
		--home-ill-phone: #0b1118;
		--home-ill-shadow: rgba(0, 0, 0, 0.35);
		--home-ill-accent: #f08a7e;
		--home-ill-panel: #1a2632;
		--home-eyebrow: #5cc6d4;
	}
}

@media screen {
	[data-theme="dark"] {
		--home-ill-bg: #1b2a3a;
		--home-ill-card: #1f2c3a;
		--home-ill-line: #34465a;
		--home-ill-grid: #28384b;
		--home-ill-text: #93a3b5;
		--home-ill-ink: #e3e9f0;
		--home-ill-blue: #6f9fd3;
		--home-ill-teal: #4fc0d0;
		--home-ill-green: #83c973;
		--home-ill-soft: #26384c;
		--home-ill-water: #1a2d3e;
		--home-ill-land: #23392d;
		--home-ill-phone: #0b1118;
		--home-ill-shadow: rgba(0, 0, 0, 0.35);
		--home-ill-accent: #f08a7e;
		--home-ill-panel: #1a2632;
		--home-eyebrow: #5cc6d4;
	}
}


/* Page. The 60px above the heading is the same on every page, and leaves room for the
   logout notice without the heading moving. */
div.homePage {
	position: relative;
	max-width: 1080px;
	margin: 0 auto;
	padding: 60px 16px 48px;
	text-align: left;
	color: var(--text-neutral-12);
	font-size: 15px;
	line-height: 1.5;
}

/* A notice across the full width, in the space above the heading: after a logout, or for an
   ?ec= state (home.php, homeNotice()). It is pulled up into that space: -54px + 43px + 11px = 0,
   so a one-line notice moves nothing. A longer one that wraps pushes the page down by the
   extra line instead of covering the heading. */
div.homeNotice {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 0.6em;
	min-height: 43px;
	margin: -54px 0 11px;
	padding: 10px 16px;
	border: 1px solid var(--home-notice-border);
	border-radius: 12px;
	background: var(--home-notice-bg);
	font-size: 15px;
	line-height: 1.4;
}

div.homeNotice i {
	flex: none;
	font-size: 17px;
	color: var(--home-notice-icon);
}

/* The same colours as the site's message boxes: green, yellow and red */
div.homeNotice-success {
	--home-notice-border: var(--infobox-success-border);
	--home-notice-bg: var(--infobox-success-bg);
	--home-notice-icon: var(--infobox-success-icon);
}

div.homeNotice-caution {
	--home-notice-border: var(--infobox-caution-border);
	--home-notice-bg: var(--infobox-caution-bg);
	--home-notice-icon: var(--infobox-caution-icon);
}

div.homeNotice-warning {
	--home-notice-border: var(--infobox-warning-border);
	--home-notice-bg: var(--infobox-warning-bg);
	--home-notice-icon: var(--infobox-warning-icon);
}

div.homePage h1 {
	margin: 0 0 0.3em;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.01em;
	color: var(--text-brand-accent);
}

/* h1 and h2 in the same blue as the lobby heading (css_tables, #lobby_headline) */
div.homePage h2 {
	margin: 0;
	font-size: 21px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--text-brand-accent);
}

div.homePage h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}

p.homeLede {
	margin: 0;
	max-width: 56ch;
	font-size: 17px;
	color: var(--text-neutral-7);
}

span.homeEyebrow {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--home-eyebrow);
}

a.homeLink {
	font-weight: 600;
	color: var(--text-brand-accent);
	text-decoration: none;
}

a.homeLink:hover {
	text-decoration: underline;
}

span.homeMuted {
	font-size: 14px;
	color: var(--text-neutral-7);
}


/* Buttons: a filled one for the main action, an outlined one next to it */
div.homePage .homeButton,
div.homePage .homeButtonGhost {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 10px 18px;
	border: 1px solid var(--bg-brand);
	border-radius: 8px;
	box-shadow: none;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

div.homePage .homeButton {
	background: var(--bg-brand);
	color: var(--text-neutral-1);
}

div.homePage .homeButton:hover {
	background: var(--bg-brand-dark);
	border-color: var(--bg-brand-dark);
	color: var(--text-neutral-1);
}

div.homePage .homeButtonGhost {
	background: transparent;
	color: var(--text-brand-accent);
}

div.homePage .homeButtonGhost:hover {
	background: var(--bg-surface-2);
}


/* Illustrations */
div.homeIll {
	padding: 6px;
	border-radius: 8px;
	background: var(--home-ill-panel);
}

div.homeIll svg {
	display: block;
	width: 100%;
	height: auto;
}

div.homeIll text {
	font-family: "Exo 2", "Helvetica Neue", Verdana, Arial, sans-serif;
}

.hi-bg { fill: var(--home-ill-bg); }
.hi-card { fill: var(--home-ill-card); stroke: var(--home-ill-line); stroke-width: 1; }
.hi-shadow { fill: var(--home-ill-shadow); }
.hi-gridline { stroke: var(--home-ill-grid); stroke-width: 1; }
.hi-gridfill { fill: var(--home-ill-grid); }
.hi-text { fill: var(--home-ill-text); }
.hi-ink { fill: var(--home-ill-ink); }
.hi-on { fill: #ffffff; }
.hi-blue { fill: var(--home-ill-blue); }
.hi-teal { fill: var(--home-ill-teal); }
.hi-green { fill: var(--home-ill-green); }
.hi-fade { opacity: 0.4; }
.hi-soft { fill: var(--home-ill-soft); }
.hi-water { fill: var(--home-ill-water); stroke: var(--home-ill-line); stroke-width: 1; }
.hi-land { fill: var(--home-ill-land); }
.hi-route { fill: none; stroke: var(--home-ill-blue); stroke-width: 1.8; stroke-linecap: round; }
.hi-trail { fill: none; stroke: var(--home-ill-text); stroke-width: 1.5; stroke-dasharray: 3 5; stroke-linecap: round; opacity: 0.7; }
.hi-phone { fill: var(--home-ill-phone); }
.hi-now { stroke: var(--home-ill-accent); stroke-width: 2; }
.hi-nowdot { fill: var(--home-ill-accent); }
.hi-dot { fill: var(--home-ill-card); stroke: var(--home-ill-blue); stroke-width: 2; }
.hi-avatar { stroke: var(--home-ill-card); stroke-width: 3; }
.hi-check { fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }


/* Front page: the products on the left, the login on the right (first on a phone) */
/* Both columns get the same height, so the login card ends level with the last product row */
div.homeSplit {
	display: grid;
	grid-template-columns: 1.35fr 1fr;
	gap: 36px;
	align-items: stretch;
}

div.homeMain {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

/* When the login card is the taller column, the product rows grow to fill the height */
div.homeProducts {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 14px;
	margin-top: 10px;
}

a.homeProductRow {
	flex: 1;
	display: grid;
	grid-template-columns: 170px 1fr;
	gap: 18px;
	align-items: center;
	padding: 14px;
	border: 1px solid var(--border-neutral-4);
	border-radius: 12px;
	background: var(--bg-neutral-1);
	color: inherit;
	text-decoration: none;
}

a.homeProductRow:hover {
	border-color: var(--border-brand);
}

a.homeProductRow p {
	margin: 4px 0 6px;
	font-size: 14.5px;
	color: var(--text-neutral-7);
}

a.homeProductRow span.homeLinkText {
	font-weight: 600;
	color: var(--text-brand-accent);
}


/* Login card (mwlIncludes/f_login_card.php), on the front page and on login.php */
section.loginCard {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px;
	border: 1px solid var(--border-neutral-4);
	border-radius: 14px;
	background: var(--bg-neutral-1);
	box-shadow: 0 8px 24px rgba(20, 40, 70, 0.08);
}

/* The heading is h1 on login.php and h2 on the front page; both look the same */
div.homePage section.loginCard h1,
div.homePage section.loginCard h2 {
	margin: 0;
	font-size: 21px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--text-brand-accent);
}

section.loginCard form {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

section.loginCard label {
	margin-top: 4px;
	font-size: 14px;
	font-weight: 600;
}

section.loginCard input[type=text],
section.loginCard input[type=password] {
	box-sizing: border-box;
	width: 100%;
	height: 2.4em;
	margin: 0;
	font-size: 15px;
	letter-spacing: normal;
}

/* The user and key icons inside the left edge of the fields (span.iconInput in css_main).
   Here the field takes the full width and has no margin, so the icon sits a little differently. */
section.loginCard span.iconInput {
	display: block;
}

section.loginCard span.iconInput > i {
	left: 0.8em;
	top: 50%;
}

/* The password after a failed login */
section.loginCard input[aria-invalid=true] {
	border: 1px solid var(--border-danger-3);
}

section.loginCard label.loginCardRemember {
	display: flex;
	align-items: center;
	gap: 0.5em;
	font-size: 13px;
	font-weight: normal;
	cursor: pointer;
}

section.loginCard label.loginCardRemember[hidden] {
	display: none;
}

section.loginCard label.loginCardRemember input {
	flex-shrink: 0;
	width: 1.2em;
	height: 1.2em;
	margin: 0;
}

section.loginCard button.homeButton {
	margin-top: 10px;
}

div.loginCardForgot {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 6px;
	font-size: 13.5px;
}

section.loginCard hr,
aside.homeAside hr {
	width: 100%;
	margin: 6px 0;
	border: 0;
	border-top: 1px solid var(--border-neutral-4);
}

/* On the front page "New to myWebLog?" sits at the bottom of the card, level with the last product row */
div.homeSplit section.loginCard hr {
	margin-top: auto;
}

div.loginCardNew {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

div.loginCardNew a.homeLink {
	font-size: 14px;
	text-align: center;
}

/* login.php: the card alone in the middle of the page */
div.loginPage {
	max-width: 420px;
	margin: 0 auto;
}


/* Product pages: the product on the left, "Get started" on the right */
div.homeProductPage {
	display: grid;
	grid-template-columns: 1fr 270px;
	gap: 36px;
	align-items: start;
}

div.homeProductMain {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

div.homeProductTop {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 24px;
	align-items: center;
}

div.homeProductTop > div:first-child {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

div.homeGroups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 22px 24px;
	padding-top: 24px;
	border-top: 1px solid var(--border-neutral-4);
}

div.homeGroup h3 {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

span.homeGroupIcon {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: var(--bg-surface-2);
	color: var(--text-brand-accent);
	font-size: 16px;
}

div.homeGroup ul {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--text-neutral-7);
}

div.homeGroup li {
	padding-left: 44px;
}

p.homeApp {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 14px;
	color: var(--text-neutral-7);
}

p.homeApp i {
	color: var(--text-brand-accent);
	font-size: 18px;
}

/* Follows along when scrolling, below the fixed menu (76px) */
aside.homeAside {
	position: sticky;
	top: 96px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
	border: 1px solid var(--border-neutral-4);
	border-radius: 14px;
	background: var(--home-ill-panel);
}


@media (max-width: 800px) {
	div.homeSplit,
	div.homeProductPage {
		grid-template-columns: 1fr;
	}

	div.homeSplit section.loginCard {
		order: -1;
	}

	aside.homeAside {
		position: static;
	}
}

@media (max-width: 640px) {
	div.homeProductTop {
		grid-template-columns: 1fr;
	}

	div.homeProductTop div.homeIll {
		max-width: 420px;
	}
}

@media (max-width: 480px) {
	div.homePage h1 {
		font-size: 27px;
	}

	a.homeProductRow {
		grid-template-columns: 1fr;
	}

	div.homeNotice {
		padding: 8px 12px;
		font-size: 14px;
	}
}
