/*
Theme Name: Ploetner Base
Theme URI: https://ploetner-research.eu
Author: Ploetner Research
Author URI: https://ploetner-research.eu
Description: A lean, elegant block base theme for the Ploetner brand family (research, dev, cloud, msls). One system, only the style variation swapped per brand. Carried by whitespace, one typeface (Outfit) and exactly one accent.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.1
Version: 1.2.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ploetner-theme
Tags: full-site-editing, block-patterns, block-styles, one-column, custom-colors, custom-logo
*/

/* --------------------------------------------------------------------------
 * Documentation template (page-docs): navigation, content, aside.
 * One column on phones, navigation + content from 782px, three columns from
 * 1200px. The aside only shows from 1200px and only when the docs-aside part
 * has content (for example a table of contents from a brand plugin).
 * ----------------------------------------------------------------------- */
.ploetner-docs {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
	align-items: start;
}

.ploetner-docs > * {
	margin-block: 0;
}

.ploetner-docs__aside {
	display: none;
}

@media (min-width: 782px) {
	.ploetner-docs {
		grid-template-columns: var(--wp--custom--docs--nav-width) minmax(0, 1fr);
	}

	.ploetner-docs__nav,
	.ploetner-docs__aside {
		position: sticky;
		top: var(--wp--preset--spacing--40);
		max-height: calc(100vh - 2 * var(--wp--preset--spacing--40));
		overflow-y: auto;
	}
}

@media (min-width: 1200px) {
	.ploetner-docs:has(.ploetner-docs__aside *) {
		grid-template-columns: var(--wp--custom--docs--nav-width) minmax(0, var(--wp--style--global--content-size)) var(--wp--custom--docs--aside-width);
	}

	.ploetner-docs__aside:has(*) {
		display: block;
	}
}

.ploetner-docs__main :where(h2, h3, h4)[id] {
	scroll-margin-top: var(--wp--preset--spacing--40);
}

/* Docs navigation: the page tree, current page marked. */
.ploetner-docs__nav {
	font-size: var(--wp--preset--font-size--small);
}

.ploetner-docs__nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ploetner-docs__nav ul ul {
	margin-block: 0.15rem 0.5rem;
	padding-inline-start: var(--wp--preset--spacing--30);
}

.ploetner-docs__nav a {
	display: block;
	padding: 0.4rem 0.75rem;
	border-radius: 8px;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.ploetner-docs__nav a:hover {
	background: var(--wp--preset--color--elevated);
	color: var(--wp--preset--color--contrast);
}

.ploetner-docs__nav .has-child > a {
	font-weight: 600;
}

.ploetner-docs__nav a[aria-current="page"] {
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--primary);
	font-weight: 600;
}

/* --------------------------------------------------------------------------
 * Code: blocks via theme.json (core/code), inline code here.
 * ----------------------------------------------------------------------- */
.wp-block-code {
	overflow-x: auto;
}

:where(p, li, td, th, dd, figcaption, .wp-block-heading) code {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9em;
	background: var(--wp--custom--code--inline-background);
	padding: 0.1em 0.35em;
	border-radius: 6px;
}

/* --------------------------------------------------------------------------
 * Notice boxes (block styles on core/group): tinted surface, icon on the
 * start side, no side stripe.
 * ----------------------------------------------------------------------- */
.wp-block-group:is(.is-style-notice-tip, .is-style-notice-note, .is-style-notice-warning) {
	--ploetner-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
	position: relative;
	padding: 1.1rem 1.25rem 1.1rem 3.25rem;
	border-radius: 12px;
	background: var(--ploetner-notice-background);
	color: var(--ploetner-notice-text);
}

.wp-block-group:is(.is-style-notice-tip, .is-style-notice-note, .is-style-notice-warning)::before {
	content: "";
	position: absolute;
	inset-inline-start: 1.25rem;
	top: 1.3rem;
	width: 1.25rem;
	height: 1.25rem;
	background: var(--ploetner-notice-icon-color);
	-webkit-mask: var(--ploetner-notice-icon) center / contain no-repeat;
	mask: var(--ploetner-notice-icon) center / contain no-repeat;
}

.wp-block-group:is(.is-style-notice-tip, .is-style-notice-note, .is-style-notice-warning) a {
	color: inherit;
}

.wp-block-group.is-style-notice-tip {
	--ploetner-notice-background: var(--wp--custom--notice--tip--background);
	--ploetner-notice-text: var(--wp--custom--notice--tip--text);
	--ploetner-notice-icon-color: var(--wp--custom--notice--tip--icon);
}

.wp-block-group.is-style-notice-note {
	--ploetner-notice-background: var(--wp--custom--notice--note--background);
	--ploetner-notice-text: var(--wp--custom--notice--note--text);
	--ploetner-notice-icon-color: var(--wp--custom--notice--note--icon);
	--ploetner-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M13 7l4 4'/%3E%3C/svg%3E");
}

.wp-block-group.is-style-notice-warning {
	--ploetner-notice-background: var(--wp--custom--notice--warning--background);
	--ploetner-notice-text: var(--wp--custom--notice--warning--text);
	--ploetner-notice-icon-color: var(--wp--custom--notice--warning--icon);
	--ploetner-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l10 18H2z'/%3E%3Cpath d='M12 10v5M12 18h.01'/%3E%3C/svg%3E");
}

@media (forced-colors: active) {
	.wp-block-group:is(.is-style-notice-tip, .is-style-notice-note, .is-style-notice-warning) {
		border: 1px solid CanvasText;
	}

	.wp-block-group:is(.is-style-notice-tip, .is-style-notice-note, .is-style-notice-warning)::before {
		background: CanvasText;
	}
}

/* --------------------------------------------------------------------------
 * Signature bar (block style on core/group): three equal color segments on
 * top, from settings.custom.signature.*. msls.co: Coral, Teal, Amber.
 * ----------------------------------------------------------------------- */
.wp-block-group.is-style-signature {
	border-style: solid;
	border-width: 4px 0 0;
	border-image: linear-gradient(
		90deg,
		var(--wp--custom--signature--1) 0 33.333%,
		var(--wp--custom--signature--2) 33.333% 66.666%,
		var(--wp--custom--signature--3) 66.666% 100%
	) 1;
}
