/*
Theme Name: Kanso Mono
Template: kanso
Description: Child theme of Kanso for Mine In Mono: section labels with a trailing rule, tag pills at the end of posts, and previous/next post links.
Version: 1.0.0
Requires at least: 6.5
Text Domain: kanso-mono
License: GNU General Public License v2 or later
*/

/* ---------- Section labels with a rule running to the right ---------- */
/* Featured Posts / Recent Posts on the homepage, and Posts on the Archive page */
.kc-section-label,
.page-id-119 .wp-block-post-content > p.is-style-text-subtitle {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
}

.kc-section-label::after,
.page-id-119 .wp-block-post-content > p.is-style-text-subtitle::after {
	content: "";
	flex: 1;
	border-top: 1px solid var(--wp--preset--color--theme-4);
}

/* ---------- Tags: tinted pills with a # ---------- */
.kc-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.kc-tags .wp-block-post-terms__separator {
	display: none;
}

body .kc-tags a {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	line-height: 1.4;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--custom-accent) 13%, transparent);
	color: color-mix(in srgb, var(--wp--preset--color--custom-accent) 70%, var(--wp--preset--color--theme-6));
	font-size: 0.75rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

body .kc-tags a::before {
	content: "#";
	opacity: 0.6;
}

body .kc-tags a:hover {
	background: var(--wp--preset--color--custom-accent);
	color: #fff;
}

/* ---------- Previous / next post links ---------- */
.kc-post-nav {
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--theme-4);
}

.kc-post-nav .wp-block-post-navigation-link {
	flex: 1 1 0;
	min-width: 0;
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 0.4rem;
	align-items: baseline;
	line-height: 1.4;
}

.kc-post-nav .post-navigation-link-next {
	grid-template-columns: 1fr auto;
	text-align: right;
}

.kc-post-nav .wp-block-post-navigation-link::before {
	grid-column: 1 / -1;
	margin-bottom: 0.35rem;
	color: var(--wp--preset--color--custom-accent);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.kc-post-nav .post-navigation-link-previous::before {
	content: "Previous";
}

.kc-post-nav .post-navigation-link-next::before {
	content: "Next";
}

.kc-post-nav .wp-block-post-navigation-link a {
	color: var(--wp--preset--color--theme-6);
	font-weight: 500;
	text-decoration: none;
}

.kc-post-nav .wp-block-post-navigation-link a:hover {
	color: var(--wp--preset--color--custom-accent);
}

.kc-post-nav [class*="__arrow"] {
	color: var(--wp--preset--color--custom-accent);
}

/* Newest post has no "Next", oldest has no "Previous": hide the empty side,
   and the whole row if there's neither */
.kc-post-nav .wp-block-post-navigation-link:not(:has(a)) {
	visibility: hidden;
}

.kc-post-nav:not(:has(a)) {
	display: none;
}
