/*
Theme Name: Lok's Notes
Theme URI: https://lokarithm.com
Author: Lok
Description: A fast, simple block theme for a tech notes blog. Built to keep Gutenberg code snippets readable.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.3.14
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: loks-notes
Tags: blog, one-column, custom-colors, custom-menu, featured-images, full-site-editing, threaded-comments, translation-ready, wide-blocks
*/

:root {
	--ln-rule: color-mix(in srgb, var(--wp--preset--color--ink) 8%, transparent);
}

body {
	background: var(--wp--preset--color--paper);
}

.wp-site-blocks {
	background: var(--wp--preset--color--paper);
}

a:where(:not(.wp-element-button)) {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

/* Keep Gutenberg snippet structure: pre.wp-block-code > code */
.wp-block-code,
.wp-block-preformatted,
pre {
	background: var(--wp--preset--color--code-bg);
	color: var(--wp--preset--color--code-text);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--code-text) 12%, transparent);
	border-left: 3px solid var(--wp--preset--color--rust);
	border-radius: 8px;
	margin: 1.5rem 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.wp-block-code code,
.wp-block-preformatted,
pre,
code {
	font-family: var(--wp--preset--font-family--ibm-plex-mono), ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9rem;
	font-weight: 400;
	line-height: 1.65;
	tab-size: 4;
}

.wp-block-code code,
pre {
	display: block;
	white-space: pre;
	word-wrap: normal;
	overflow-wrap: normal;
}

pre.wp-block-code {
	padding: 1.1rem 1.25rem;
}

:not(pre) > code,
:not(.wp-block-code) > code {
	background: color-mix(in srgb, var(--wp--preset--color--rust) 12%, var(--wp--preset--color--paper));
	color: var(--wp--preset--color--ink);
	padding: 0.12em 0.35em;
	border-radius: 3px;
	font-size: 0.9em;
	white-space: break-spaces;
}

.wp-block-code .ln-copy {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	font-family: var(--wp--preset--font-family--ibm-plex-sans);
	font-size: 0.7rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: color-mix(in srgb, var(--wp--preset--color--code-text) 12%, transparent);
	color: var(--wp--preset--color--code-text);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--code-text) 22%, transparent);
	padding: 0.25rem 0.5rem;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.wp-block-code {
	position: relative;
}

.wp-block-code:hover .ln-copy,
.wp-block-code:focus-within .ln-copy {
	opacity: 1;
}

.ln-brand .wp-block-site-logo img {
	display: block;
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 8px;
}

.ln-site-header {
	border-bottom: 1px solid var(--ln-rule);
	background: color-mix(in srgb, var(--wp--preset--color--paper) 94%, #ffffff);
}

.ln-header-tools {
	gap: 0.35rem;
	position: relative;
}

@media (max-width: 781px) {
	.ln-site-header > .wp-block-group.alignwide {
		flex-wrap: nowrap !important;
		gap: 0.75rem;
	}

	.ln-header-tools {
		flex: 0 0 auto;
		margin-left: auto;
	}

	.ln-site-header .ln-header-search.wp-block-search {
		width: 44px;
		min-width: 44px;
		margin: 0;
	}

	.ln-site-header .ln-header-search .wp-block-search__inside-wrapper {
		width: 44px;
		min-height: 44px;
		border: none;
		background: transparent;
		padding: 0;
	}

	.ln-site-header .ln-header-search .wp-block-search__input {
		position: absolute;
		width: 1px;
		height: 1px;
		opacity: 0;
		padding: 0;
		border: 0;
		pointer-events: none;
	}

	.ln-site-header .ln-header-search .wp-block-search__button {
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: none;
		border-radius: 8px;
		background: transparent;
		color: var(--wp--preset--color--ink);
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.ln-site-header .ln-header-search .wp-block-search__button:hover,
	.ln-site-header .ln-header-search .wp-block-search__button:focus {
		color: var(--wp--preset--color--rust);
	}

	.ln-site-header .ln-header-search .wp-block-search__button svg {
		width: 24px;
		height: 24px;
		fill: currentColor;
	}

	.ln-site-header .ln-header-search.is-open {
		position: absolute;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		width: min(18rem, calc(100vw - 2rem));
		z-index: 20;
	}

	.ln-site-header .ln-header-search.is-open .wp-block-search__inside-wrapper {
		width: 100%;
		border: 1px solid var(--ln-rule);
		background: var(--wp--preset--color--paper);
		padding: 0 0 0 0.75rem;
		border-radius: 8px;
	}

	.ln-site-header .ln-header-search.is-open .wp-block-search__input {
		position: static;
		width: 100%;
		height: auto;
		opacity: 1;
		pointer-events: auto;
		border: 0;
		background: transparent;
		padding: 0.55rem 0.35rem;
	}
}

.ln-kicker {
	font-family: var(--wp--preset--font-family--ibm-plex-mono);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--rust);
}

.wp-block-post-excerpt p {
	margin-bottom: 0;
}

.wp-block-query .wp-block-post {
	padding-bottom: 1.75rem;
	margin-bottom: 1.75rem;
	border-bottom: 1px solid var(--ln-rule);
}

.ln-post-card {
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: flex-start !important;
}

.ln-post-card .wp-block-post-title {
	margin: 0.15rem 0 0.2rem;
}

.ln-home-main .wp-block-query .wp-block-post {
	padding-bottom: 1.4rem;
	margin-bottom: 1.4rem;
}

.ln-post-card .wp-block-post-featured-image:not(:has(img)) {
	display: none;
}

.ln-post-card .wp-block-post-featured-image {
	flex: 0 0 160px;
	width: 160px;
	height: 110px;
	margin: 0;
	overflow: hidden;
	border-radius: 8px;
	background: color-mix(in srgb, var(--wp--preset--color--ink) 6%, var(--wp--preset--color--paper));
}

.ln-post-card .wp-block-post-featured-image a {
	display: block;
	width: 160px;
	height: 110px;
}

.ln-post-card .wp-block-post-featured-image img {
	display: block;
	width: 160px !important;
	height: 110px !important;
	object-fit: contain !important;
	aspect-ratio: auto !important;
	border-radius: 8px;
}

@media (max-width: 640px) {
	.ln-post-card {
		flex-wrap: wrap !important;
	}
}

.wp-block-post-title a {
	text-decoration: none;
}

.wp-block-post-title a:hover {
	color: var(--wp--preset--color--rust);
}

.ln-post-cats,
.ln-post-cats a {
	font-family: var(--wp--preset--font-family--ibm-plex-mono), ui-monospace, monospace;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--rust);
}

.ln-post-cats:not(:has(a)) {
	display: none;
}

.ln-home-layout {
	align-items: flex-start;
}

.ln-home-main .ln-post-card .wp-block-post-featured-image,
.ln-home-main .ln-post-card .wp-block-post-featured-image a {
	flex: 0 0 160px;
	width: 160px;
	height: 110px;
}

.ln-home-main .ln-post-card .wp-block-post-featured-image img {
	width: 160px !important;
	height: 110px !important;
}

.ln-home-aside {
	position: sticky;
	top: 1.25rem;
}

.ln-home-aside > h2,
.ln-home-aside .wp-block-heading:first-child {
	margin-top: 0;
}

.ln-topic {
	margin-bottom: 0.35rem;
	border: none;
	padding: 0;
}

.ln-topic summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.5rem 0;
	font-family: var(--wp--preset--font-family--ibm-plex-mono), ui-monospace, monospace;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--moss);
}

.ln-topic summary::-webkit-details-marker {
	display: none;
}

.ln-topic summary::after {
	content: "+";
	font-weight: 400;
	font-size: 0.95rem;
	line-height: 1;
	color: var(--wp--preset--color--muted);
}

.ln-topic[open] summary {
	color: var(--wp--preset--color--ink);
}

.ln-topic[open] summary::after {
	content: "–";
}

.ln-topic summary:hover {
	color: var(--wp--preset--color--ink);
}

.ln-topic .wp-block-query {
	padding: 0.35rem 0 0.55rem;
}

.ln-home-aside .wp-block-query .wp-block-post {
	padding: 5px;
	margin: 0 0 0.3rem;
	border-bottom: none;
}

.ln-home-aside .wp-block-post-title {
	font-weight: 400;
	line-height: 1.3;
	margin: 0;
}

.ln-home-aside .wp-block-post-title a,
.ln-home-aside .wp-block-post-title a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--rust) !important;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.ln-home-aside .wp-block-post-title a:hover {
	color: var(--wp--preset--color--ink);
}

@media (max-width: 781px) {
	.ln-home-layout {
		flex-direction: column;
	}

	.ln-home-layout > .wp-block-column {
		flex-basis: 100% !important;
		width: 100%;
	}

	.ln-home-aside {
		position: static;
		margin-top: 0.5rem;
		padding-top: 1.75rem;
		border-top: 1px solid var(--ln-rule);
	}

	.ln-topic-grid {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.35rem 1.25rem;
	}

	.ln-topic {
		margin-bottom: 0;
	}
}

@media (max-width: 520px) {
	.ln-topic-grid {
		grid-template-columns: 1fr;
	}
}

.ln-site-footer {
	border-top: 1px solid var(--ln-rule);
}

.ln-footer-links {
	gap: 0.35rem;
}

.ln-footer-policy,
.ln-footer-extra {
	margin: 0;
}

@media (min-width: 641px) {
	.ln-footer-links {
		flex-direction: row !important;
		flex-wrap: wrap !important;
		align-items: baseline !important;
		justify-content: flex-end !important;
		gap: 0 !important;
	}

	.ln-footer-policy::after {
		content: "·";
		margin: 0 0.45rem;
		color: var(--wp--preset--color--muted);
	}
}

.wp-block-navigation__responsive-container.is-menu-open {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100dvh;
	min-height: 100vh;
	padding: 1.25rem !important;
	background-color: var(--wp--preset--color--paper) !important;
	color: var(--wp--preset--color--ink) !important;
	z-index: 100000;
}

.has-modal-open .wp-block-navigation__responsive-close {
	max-width: none;
	width: 100%;
	height: 100%;
	margin: 0;
}

.is-menu-open .wp-block-navigation__responsive-dialog {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	flex: 1;
	display: flex !important;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 3rem 1rem !important;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list {
	align-items: center !important;
	width: 100%;
	gap: 0.35rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	text-align: center;
	font-size: clamp(2rem, 8vw, 3rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.2;
	padding: 0.7rem 0.5rem !important;
	text-decoration: none;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--rust);
}

.wp-block-navigation__responsive-container-close {
	top: 1.1rem;
	right: 1.1rem;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wp-block-navigation__responsive-container-close svg {
	width: 28px;
	height: 28px;
}
