/*
Theme Name: Carbon Software
Author: Carbon Software Corporation
Description: Block theme for Carbon Software Corporation, built from the Carbon Software website concept. Carbon palette with the Flow gradient, self-hosted Manrope and JetBrains Mono, a Light style variation, and patterns for every section of the home and PendantPro pages.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: carbon-software
Tags: block-patterns, full-site-editing, dark, one-column, custom-colors, editor-style, style-variations
*/

/* ---------------------------------------------------------------
   Tokens (follow the palette, so the Light style variation works)
   --------------------------------------------------------------- */
:root {
	--cs-bg: var(--wp--preset--color--base);
	--cs-ink: var(--wp--preset--color--contrast);
	--cs-muted: var(--wp--preset--color--muted);
	--cs-band: var(--wp--preset--color--band);
	--cs-line: var(--wp--preset--color--line);
	--cs-line2: var(--wp--preset--color--line-soft);
	--cs-hl: var(--wp--preset--color--highlight);
	--cs-dim: var(--wp--preset--color--dim);
	--cs-inv-muted: var(--wp--preset--color--inverse-muted);
	--cs-g1: var(--wp--preset--color--flow-1);
	--cs-g2: var(--wp--preset--color--flow-2);
	--cs-g3: var(--wp--preset--color--flow-3);
	--cs-g4: var(--wp--preset--color--flow-4);
	--cs-spark: var(--wp--preset--color--spark);
	--cs-flow: var(--wp--preset--gradient--flow);
	--cs-flow-text: var(--wp--preset--gradient--flow-text);
	--cs-mono: var(--wp--preset--font-family--jetbrains-mono);
	--cs-sans: var(--wp--preset--font-family--manrope);
	--cs-radius: 14px;
}

/* Header, main and footer sit flush against each other, and the footer
   stays at the bottom of the window on short pages. */
body .wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
}

body .wp-site-blocks > * {
	margin-block-start: 0;
}

body .wp-site-blocks > main {
	flex: 1 0 auto;
}

/* Landing pages: full-width sections stack with no gap, as on the home page. */
.wp-block-post-content.cs-landing > * {
	margin-block-start: 0;
}

/* ---------------------------------------------------------------
   Shared text styles
   --------------------------------------------------------------- */
.cs-flow-text {
	background: var(--cs-flow-text);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	padding-bottom: 0.1em;
}

.cs-center {
	text-align: center;
}

.cs-eyebrow {
	font-size: 14px;
	font-weight: 600;
	color: var(--cs-muted);
}

.cs-meta {
	font-size: 13px;
	color: var(--cs-muted);
}

.cs-note {
	font-size: 14px;
	color: var(--cs-muted);
}

.cs-dot {
	display: flex;
	align-items: center;
	gap: 8px;
}

.cs-dot::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--cs-dot, var(--cs-spark));
}

.cs-dot-1 { --cs-dot: var(--cs-g1); }
.cs-dot-2 { --cs-dot: var(--cs-g2); }
.cs-dot-3 { --cs-dot: var(--cs-g3); }
.cs-dot-4 { --cs-dot: var(--cs-g4); }

.cs-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 16px;
	border: 1px solid var(--cs-line);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
}

.cs-pill::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--cs-spark);
}

.cs-hero-title {
	font-weight: 600;
	font-size: clamp(44px, 7.4vw, 104px);
	line-height: 0.97;
	letter-spacing: -0.05em;
	max-width: 1000px;
}

.cs-hero.is-product .cs-hero-title {
	font-size: clamp(42px, 6.6vw, 92px);
	max-width: 960px;
}

.cs-display {
	font-weight: 600;
	font-size: clamp(34px, 4.6vw, 60px);
	line-height: 1;
	letter-spacing: -0.045em;
}

.cs-display.is-cta {
	font-size: clamp(34px, 5vw, 68px);
}

.cs-lead {
	font-size: 19px;
	color: var(--cs-muted);
	max-width: 600px;
}

.cs-sub {
	font-size: 18px;
	color: var(--cs-muted);
	max-width: 600px;
}

.cs-statement {
	font-weight: 600;
	font-size: clamp(26px, 3.4vw, 44px);
	line-height: 1.12;
	letter-spacing: -0.035em;
	max-width: 1000px;
}

.cs-card-title {
	font-weight: 700;
	font-size: 21px;
	line-height: 1.55;
	letter-spacing: -0.03em;
}

.cs-card-title.is-large {
	font-size: 26px;
	letter-spacing: -0.035em;
}

.cs-product-name {
	font-weight: 700;
	font-size: 30px;
	line-height: 1.55;
	letter-spacing: -0.04em;
}

.cs-muted {
	color: var(--cs-muted);
}

.cs-strong {
	font-weight: 600;
}

.cs-head {
	max-width: 760px;
}

/* ---------------------------------------------------------------
   Header and footer
   --------------------------------------------------------------- */
.cs-header {
	padding-block: 18px;
}

.cs-footer {
	padding-block: 36px;
	font-size: 14px;
}

.cs-brand {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.55;
	--cs-mark: 28px;
}

.cs-brand.is-small {
	font-size: 14px;
	letter-spacing: 0;
	--cs-mark: 24px;
}

.cs-brand a {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	color: inherit;
	text-decoration: none;
}

/* The Carbon mark: hexagon in the text colour, spark dot in Spark. */
.cs-brand a::before {
	content: "";
	flex: none;
	width: var(--cs-mark);
	height: var(--cs-mark);
	background: currentColor;
	-webkit-mask: url("assets/images/mark-mask.svg") center / contain no-repeat;
	mask: url("assets/images/mark-mask.svg") center / contain no-repeat;
}

.cs-brand a::after {
	content: "";
	position: absolute;
	left: calc(var(--cs-mark) * 0.8608 - var(--cs-mark) * 0.09375);
	top: 50%;
	width: calc(var(--cs-mark) * 0.1875);
	height: calc(var(--cs-mark) * 0.1875);
	border-radius: 50%;
	background: var(--cs-spark);
	transform: translateY(-50%);
}

.cs-brand a:hover {
	color: inherit;
}

.cs-nav {
	font-size: 15px;
	font-weight: 500;
}

.cs-nav.is-footer {
	font-size: 14px;
}

.cs-nav .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	min-height: 44px;
	text-decoration: none;
}

.cs-nav .wp-block-navigation-item__content:hover {
	color: var(--cs-muted);
}

.cs-header .cs-nav .current-menu-item > .wp-block-navigation-item__content,
.cs-header .cs-nav [aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 6px;
}

.cs-header .wp-block-button__link {
	min-height: 44px;
	padding-inline: 20px;
	font-size: 15px;
	font-weight: 500;
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	box-sizing: border-box;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.wp-block-button__link:hover {
	opacity: 0.85;
}

.is-style-outline .wp-block-button__link {
	min-height: 52px;
}

.cs-arrow .wp-block-button__link {
	min-height: 48px;
	padding-inline: 24px;
}

.cs-arrow .wp-block-button__link::after {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	background: currentColor;
	-webkit-mask: url("assets/images/arrow.svg") center / contain no-repeat;
	mask: url("assets/images/arrow.svg") center / contain no-repeat;
}

/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */
.cs-section {
	padding-block: clamp(56px, 7vw, 96px);
}

.cs-hero {
	padding-top: clamp(48px, 7vw, 88px);
	padding-bottom: clamp(56px, 7vw, 96px);
}

.cs-hero.is-product {
	padding-top: clamp(40px, 6vw, 72px);
	padding-bottom: clamp(56px, 7vw, 88px);
}

.cs-hero > .cs-window {
	max-width: 1040px;
}

.cs-hero.is-product > .cs-window {
	max-width: 1100px;
}

.cs-grow {
	flex: 1 1 480px;
	min-width: 0;
}

/* Inverted band (light on dark, or dark on light in the Light style). */
.cs-invert {
	background: var(--cs-ink);
	color: var(--cs-bg);
}

.cs-invert a:where(:not(.wp-element-button)) {
	color: var(--cs-bg);
}

.cs-invert .wp-block-button__link,
.cs-invert .wp-block-button__link:hover {
	background: var(--cs-bg);
	color: var(--cs-ink);
}

.cs-invert .wp-block-button__link {
	min-height: 52px;
	padding-inline: 28px;
}

.cs-invert .cs-sub {
	color: var(--cs-inv-muted);
	max-width: 520px;
}

/* Cards */
.cs-card {
	background: var(--cs-bg);
	border-radius: var(--cs-radius);
	padding: 28px;
}

.cs-card.is-featured {
	border: 1px solid var(--cs-ink);
}

/* Editions list (home page) */
.cs-editions {
	background: var(--cs-bg);
	border-radius: var(--cs-radius);
	padding: 8px 28px;
}

.cs-edition {
	padding-block: 18px;
	border-bottom: 1px solid var(--cs-line2);
}

.cs-edition:last-child {
	border-bottom: 0;
}

.cs-edition > :nth-child(1) {
	flex: 0 0 160px;
	font-weight: 700;
	font-size: 18px;
	letter-spacing: -0.02em;
}

.cs-edition > :nth-child(2) {
	flex: 1 1 300px;
	color: var(--cs-muted);
}

.cs-edition > :nth-child(3) {
	flex: 0 0 auto;
	font-weight: 600;
}

/* Coming next */
.cs-next {
	border-top: 2px solid;
	border-image: var(--cs-flow) 1;
}

.cs-next > .wp-block-column {
	padding: 28px;
}

.cs-next > .wp-block-column:first-child {
	padding-left: 0;
}

.cs-next > .wp-block-column:last-child {
	padding-right: 0;
}

.cs-next > .wp-block-column + .wp-block-column {
	border-left: 1px solid var(--cs-line);
}

.cs-next .cs-link a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
}

@media (max-width: 781px) {
	.cs-next > .wp-block-column,
	.cs-next > .wp-block-column:first-child,
	.cs-next > .wp-block-column:last-child {
		padding: 28px 0;
	}

	.cs-next > .wp-block-column + .wp-block-column {
		border-left: 0;
		border-top: 1px solid var(--cs-line);
	}
}

/* Steps (Find. Edit. Compare. Apply.) */
.cs-step {
	border-top: 2px solid var(--cs-g1);
	padding-top: 18px;
}

.cs-steps > .cs-step:nth-child(4n+2) { border-top-color: var(--cs-g2); }
.cs-steps > .cs-step:nth-child(4n+3) { border-top-color: var(--cs-g3); }
.cs-steps > .cs-step:nth-child(4n+4) { border-top-color: var(--cs-g4); }

/* ---------------------------------------------------------------
   Product window drawings (HTML blocks in the hero patterns)
   --------------------------------------------------------------- */
.cs-window {
	overflow: hidden;
	border: 1px solid var(--cs-line);
	border-radius: var(--cs-radius);
	background: var(--cs-bg);
	color: var(--cs-ink);
	text-align: left;
	font-size: 13px;
	line-height: 1.55;
}

.cs-window-flow {
	height: 3px;
	background: var(--cs-flow);
}

.cs-window-head,
.cs-window-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 18px;
}

.cs-window-head {
	border-bottom: 1px solid var(--cs-line2);
	font-weight: 500;
}

.cs-window-foot {
	border-top: 1px solid var(--cs-line2);
	color: var(--cs-muted);
}

.cs-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.cs-tabs span {
	padding: 5px 12px;
	border-radius: 999px;
	color: var(--cs-muted);
}

.cs-tabs .is-active {
	background: var(--cs-ink);
	color: var(--cs-bg);
}

.cs-status {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--cs-muted);
}

.cs-status::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--cs-spark);
}

.cs-window-body {
	display: flex;
	flex-wrap: wrap;
}

.cs-files {
	flex: 1 1 150px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 16px 12px;
	border-right: 1px solid var(--cs-line2);
	font-family: var(--cs-mono);
}

.cs-files span {
	padding: 6px 10px;
	color: var(--cs-muted);
}

.cs-files .is-active {
	border-radius: 8px;
	background: var(--cs-hl);
	color: var(--cs-ink);
}

.cs-panel-title {
	font-family: var(--cs-sans);
	font-size: 12px;
	font-weight: 600;
	color: var(--cs-muted);
}

.cs-files .cs-panel-title {
	padding: 0 10px 8px;
}

.cs-code {
	flex: 5 1 320px;
	min-width: 0;
	padding: 14px 0;
	overflow-x: auto;
}

.cs-lines {
	font-family: var(--cs-mono);
}

.cs-line {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 5px 18px 5px 12px;
	white-space: nowrap;
}

.cs-line::before {
	content: "";
	flex: none;
	width: 5px;
	height: 16px;
	border-radius: 2px;
}

.cs-line.is-changed,
.cs-line.is-old {
	background: var(--cs-hl);
}

.cs-line.is-changed::before { background: var(--cs-g3); }
.cs-line.is-old::before { background: var(--cs-dim); }

.cs-ln {
	flex: none;
	width: 20px;
	text-align: right;
	color: var(--cs-dim);
}

.cs-flow-panel {
	flex: 2 1 190px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 16px 16px 14px;
	border-left: 1px solid var(--cs-line2);
}

.cs-flow-list {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-left: 18px;
}

.cs-flow-list::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 4px;
	bottom: 4px;
	width: 2px;
	border-radius: 2px;
	background: linear-gradient(180deg, var(--cs-g1), var(--cs-g2), var(--cs-g3), var(--cs-g4));
}

.cs-node {
	display: flex;
	align-items: center;
	gap: 8px;
	overflow: hidden;
	border: 1px solid var(--cs-line);
	border-radius: 6px;
	background: var(--cs-band);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.cs-node::before {
	content: "";
	flex: none;
	align-self: stretch;
	width: 3px;
	background: var(--node, #5A606A);
}

.cs-node span {
	padding: 5px 10px 5px 0;
}

.cs-pane {
	flex: 1 1 340px;
	min-width: 0;
	overflow-x: auto;
}

.cs-pane + .cs-pane {
	border-left: 1px solid var(--cs-line2);
}

.cs-pane .cs-panel-title {
	padding: 10px 18px;
	border-bottom: 1px solid var(--cs-line2);
}

.cs-pane .cs-lines {
	padding: 10px 0;
}

.cs-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-weight: 600;
}

.cs-fake-btn {
	padding: 6px 16px;
	border-radius: 999px;
	background: var(--cs-ink);
	color: var(--cs-bg);
	font-weight: 600;
}

.cs-fake-btn.is-outline {
	border: 1px solid var(--cs-ink);
	background: none;
	color: var(--cs-ink);
}

/* ---------------------------------------------------------------
   Ordinary pages, posts and the blog
   --------------------------------------------------------------- */
.cs-page {
	padding-block: clamp(48px, 7vw, 88px);
}

.cs-page-title {
	font-size: clamp(34px, 4.6vw, 60px);
	letter-spacing: -0.045em;
	line-height: 1;
}

.cs-post-item {
	padding-block: 28px;
	border-bottom: 1px solid var(--cs-line2);
}

.cs-post-item .wp-block-post-title {
	font-size: 26px;
	letter-spacing: -0.035em;
}

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

.wp-block-post-content a:where(:not(.wp-element-button)) {
	text-underline-offset: 3px;
}

:where(.wp-block-post-content) code {
	font-family: var(--cs-mono);
	font-size: 0.9em;
}

.cs-small {
	font-size: 15px;
}
