/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* Flowbase-style full-width documentation shell */
:root {
	--ohjeet-ink: #18211d;
	--ohjeet-muted: #65716b;
	--ohjeet-line: #dde4df;
	--ohjeet-surface: #fbfcfa;
	--ohjeet-soft: #f0f3ef;
	--ohjeet-accent: #157354;
	--ohjeet-mint: #bff4de;
}

#page.site.grid-container {
	width: 100%;
	max-width: none;
	margin-inline: 0;
}

body.left-sidebar .site-content {
	display: grid;
	grid-template-columns: minmax(270px, 24vw) minmax(0, 1fr);
	align-items: start;
	min-height: calc(100vh - 76px);
	padding: 0;
}

body.left-sidebar #left-sidebar {
	grid-column: 1;
	grid-row: 1;
	align-self: start;
	width: auto;
	height: calc(100vh - 76px);
	margin: 0;
	padding: 0;
	border-right: 1px solid var(--ohjeet-line);
	background: var(--ohjeet-surface);
	position: sticky;
	top: 76px;
}

body.left-sidebar #left-sidebar .inside-left-sidebar {
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	padding: 56px clamp(28px, 3vw, 54px) 32px 3.2vw;
	box-sizing: border-box;
	overflow-y: auto;
	scrollbar-color: var(--ohjeet-line) transparent;
	scrollbar-width: thin;
}

body.left-sidebar #left-sidebar .widget {
	margin: 0;
	padding: 0;
	background: transparent;
}

body.left-sidebar #left-sidebar .widget-title {
	margin: 0;
	color: var(--ohjeet-ink);
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(22px, 2vw, 29px);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.035em;
	text-transform: none;
}

body.left-sidebar #left-sidebar .widget-title::before {
	content: "OHJEET";
	display: block;
	margin-bottom: 9px;
	color: var(--ohjeet-accent);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: 800;
	line-height: 1.4;
	letter-spacing: 0.17em;
}

body.left-sidebar #left-sidebar .menu {
	counter-reset: ohjeet-topic;
	margin: 45px 0 0;
	padding: 0;
	list-style: none;
}

body.left-sidebar #left-sidebar .menu > li {
	counter-increment: ohjeet-topic;
	margin: 0;
	padding: 0;
}

body.left-sidebar #left-sidebar .menu > li > a {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr) 7px;
	align-items: center;
	width: calc(100% + 22px);
	min-height: 50px;
	margin-left: -15px;
	padding: 0 15px;
	border-radius: 9px;
	color: #748078;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	transition: color 0.2s ease, background-color 0.2s ease;
}

body.left-sidebar #left-sidebar .menu > li > a::before {
	content: counter(ohjeet-topic, decimal-leading-zero);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
}

body.left-sidebar #left-sidebar .menu > li > a::after {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: transparent;
}

body.left-sidebar #left-sidebar .menu > li > a:hover,
body.left-sidebar #left-sidebar .menu > li > a:focus-visible {
	color: var(--ohjeet-ink);
	background: var(--ohjeet-soft);
}

body.left-sidebar #left-sidebar .menu > .current-menu-item > a,
body.left-sidebar #left-sidebar .menu > .current_page_item > a,
body.left-sidebar #left-sidebar .menu > .current-menu-ancestor > a {
	color: var(--ohjeet-ink);
	font-weight: 800;
}

body.left-sidebar #left-sidebar .menu > .current-menu-item > a::after,
body.left-sidebar #left-sidebar .menu > .current_page_item > a::after,
body.left-sidebar #left-sidebar .menu > .current-menu-ancestor > a::after {
	background: var(--ohjeet-accent);
}

body.left-sidebar #left-sidebar .sub-menu {
	margin: 6px 0 20px 32px;
	padding: 2px 0 2px 14px;
	border-left: 1px solid var(--ohjeet-line);
	list-style: none;
}

body.left-sidebar #left-sidebar .sub-menu li {
	margin: 0;
	padding: 0;
}

body.left-sidebar #left-sidebar .sub-menu a {
	display: block;
	margin-left: -6px;
	padding: 7px 9px;
	border-radius: 6px;
	color: #748078;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.35;
	text-decoration: none;
	transition: color 0.2s ease, background-color 0.2s ease;
}

body.left-sidebar #left-sidebar .sub-menu a:hover,
body.left-sidebar #left-sidebar .sub-menu a:focus-visible {
	color: var(--ohjeet-ink);
	background: var(--ohjeet-soft);
}

body.left-sidebar #left-sidebar .sub-menu .current-menu-item > a,
body.left-sidebar #left-sidebar .sub-menu .current_page_item > a {
	color: var(--ohjeet-ink);
	font-weight: 700;
	background: var(--ohjeet-soft);
}

body.left-sidebar #primary {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
	width: min(100%, 1120px);
	padding: 52px clamp(38px, 7vw, 106px) 80px;
	box-sizing: border-box;
}

body.left-sidebar #primary .site-main,
body.left-sidebar #primary .inside-article {
	width: 100%;
	margin: 0;
	padding: 0;
}

@media (max-width: 900px) {
	body.left-sidebar .site-content {
		grid-template-columns: 220px minmax(0, 1fr);
	}

	body.left-sidebar #left-sidebar .inside-left-sidebar {
		padding: 38px 24px;
	}

	body.left-sidebar #primary {
		padding: 42px 34px 70px;
	}
}

@media (max-width: 700px) {
	body.left-sidebar .site-content {
		display: block;
		min-height: 0;
	}

	body.left-sidebar #left-sidebar {
		width: 100%;
		height: auto;
		border-right: 0;
		border-bottom: 1px solid var(--ohjeet-line);
		position: relative;
		top: 0;
	}

	body.left-sidebar #left-sidebar .inside-left-sidebar {
		height: auto;
		padding: 24px 20px;
	}

	body.left-sidebar #left-sidebar .widget-title {
		display: none;
	}

	body.left-sidebar #left-sidebar .menu {
		display: block;
		max-height: 56vh;
		margin: 0;
		padding-right: 5px;
		overflow-y: auto;
		scrollbar-color: var(--ohjeet-line) transparent;
		scrollbar-width: thin;
	}

	body.left-sidebar #left-sidebar .menu > li {
		margin-bottom: 2px;
	}

	body.left-sidebar #left-sidebar .menu > li > a {
		width: 100%;
		min-height: 44px;
		margin: 0;
		padding: 0 12px;
	}

	body.left-sidebar #left-sidebar .sub-menu {
		margin: 4px 0 14px 30px;
		padding-left: 12px;
	}

	body.left-sidebar #left-sidebar .sub-menu a {
		padding: 7px 8px;
		font-size: 13px;
	}

	body.left-sidebar #primary {
		width: 100%;
		max-width: none;
		padding: 30px 20px 60px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.left-sidebar #left-sidebar .menu > li > a {
		transition: none;
	}
}

/* Flowbase-style article sequence navigation */
.single-post #nav-below {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	margin-top: 58px;
	padding: 34px 0;
}

.single-post #nav-below > div {
	display: flex;
	align-items: center;
	flex: 1 1 0;
	gap: 20px;
	min-width: 0;
	position: relative;
}

.single-post #nav-below .nav-previous {
	justify-content: flex-start;
}

.single-post #nav-below .nav-next {
	justify-content: flex-end;
	margin-left: auto;
}

.single-post #nav-below .nav-next .gp-icon {
	order: 2;
}

.single-post #nav-below .nav-next .next {
	order: 1;
	text-align: right;
}

.single-post #nav-below .gp-icon {
	display: grid;
	place-items: center;
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	margin: 0;
	border-radius: 50%;
	color: #ffffff;
	background: var(--ohjeet-accent);
	transition: transform 0.2s ease;
}

.single-post #nav-below .gp-icon svg {
	width: 16px;
	height: 20px;
}

.single-post #nav-below .prev,
.single-post #nav-below .next {
	display: block;
	min-width: 0;
}

.single-post #nav-below .prev a,
.single-post #nav-below .next a {
	display: flex;
	flex-direction: column;
	gap: 7px;
	color: var(--ohjeet-ink);
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(21px, 2vw, 25px);
	font-weight: 500;
	line-height: 1.1;
	text-decoration: none;
}

.single-post #nav-below .prev a::before,
.single-post #nav-below .next a::before {
	color: var(--ohjeet-muted);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 9px;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.single-post #nav-below .prev a::before {
	content: "Edellinen osio";
}

.single-post #nav-below .next a::before {
	content: "Seuraava osio";
}

.single-post #nav-below .prev a::after,
.single-post #nav-below .next a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.single-post #nav-below .nav-previous:hover .gp-icon,
.single-post #nav-below .nav-previous:focus-within .gp-icon {
	transform: translateX(-3px);
}

.single-post #nav-below .nav-next:hover .gp-icon,
.single-post #nav-below .nav-next:focus-within .gp-icon {
	transform: translateX(3px);
}

.single-post #nav-below > div:focus-within .gp-icon {
	outline: 3px solid var(--ohjeet-mint);
	outline-offset: 3px;
}

@media (max-width: 700px) {
	.single-post #nav-below {
		flex-direction: column;
		align-items: stretch;
		gap: 28px;
		margin-top: 42px;
		padding: 28px 0;
	}

	.single-post #nav-below > div {
		width: 100%;
	}

	.single-post #nav-below .nav-next {
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.single-post #nav-below .gp-icon {
		transition: none;
	}
}
