/*
Theme Name: Klowdberry
Theme URI: https://klowdberry.com
Author: Klowdberry
Description: The Klowdberry company theme. A light, fast block theme with self-hosted fonts, built for services, Learn lessons and the blog.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: klowdberry
*/

/* ---------- Base ---------- */

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: #F6E8EF; color: #15131F; }
:where(p, li) { text-wrap: pretty; }
:where(h1, h2, h3) { text-wrap: balance; }
.wp-site-blocks { overflow-x: clip; }

.skip-link.screen-reader-text:focus { background: #15131F; color: #fff; padding: 12px 18px; border-radius: 8px; }

/* Small helper text styles used across patterns */
.kb-eyebrow {
	font-size: 15px;
	font-weight: 700;
	color: var(--wp--preset--color--berry);
	margin-bottom: 0;
}
.kb-breadcrumb { font-size: 15px; color: var(--wp--preset--color--subtle); }
.kb-breadcrumb a { color: inherit; }
.kb-meta { font-size: 15px; color: var(--wp--preset--color--subtle); }
.kb-signature {
	font-family: var(--wp--preset--font-family--hand);
	font-size: 32px;
	line-height: 1;
	color: var(--wp--preset--color--berry);
}
.kb-arrow-link a, a.kb-arrow-link { font-weight: 700; text-decoration: none; }
.kb-arrow-link a::after, a.kb-arrow-link::after { content: " →"; }

/* ---------- Header ---------- */

.kb-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(247, 247, 249, 0.94);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .kb-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .kb-header { top: 0; } }

.kb-header .wp-block-site-title a,
.kb-footer .wp-block-site-title a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.kb-header .wp-block-site-title a::before,
.kb-footer .wp-block-site-title a::before {
	content: "";
	width: 30px;
	height: 30px;
	flex: none;
	background: url("assets/images/logo-mark.svg") center / contain no-repeat;
}
.kb-footer .wp-block-site-title a::before { background-image: url("assets/images/logo-mark-light.svg"); }

.kb-header .wp-block-navigation .wp-block-navigation-item__content { padding: 10px 2px; }
.kb-header .wp-block-navigation .current-menu-item > a,
.kb-header .wp-block-navigation .current-menu-ancestor > a,
.kb-header .wp-block-navigation a[aria-current="page"] { color: var(--wp--preset--color--berry); }
.kb-header .wp-block-navigation__responsive-container.is-menu-open { padding: 24px; }
.kb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { font-size: 22px; gap: 14px; }
.kb-header .wp-block-button__link { padding: 10px 20px; font-size: 15px; }
@media (max-width: 600px) { .kb-header .kb-header-cta { display: none; } }

/* ---------- Footer ---------- */

.kb-footer { font-size: 15px; }
.kb-footer a { color: #EDEBF3; text-decoration: none; }
.kb-footer a:hover { color: var(--wp--preset--color--berry-light); }
.kb-footer .kb-footer-label { font-size: 13px; font-weight: 700; color: #8E8AA6; margin-bottom: 4px; }
.kb-footer .wp-block-site-title a { color: #fff; }
.kb-footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kb-footer-bottom { border-top: 1px solid #2E2B40; color: #8E8AA6; font-size: 14px; }

/* ---------- Group variations ---------- */

.is-style-kb-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 18px;
	padding: clamp(24px, 3vw, 32px);
}
a.is-style-kb-card, .is-style-kb-card.is-link { text-decoration: none; }

.is-style-kb-blush {
	background: var(--wp--preset--color--blush);
	border-radius: 24px;
	padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px);
}

.is-style-kb-berry {
	background: var(--wp--preset--color--berry);
	color: #fff;
	border-radius: 22px;
	padding: clamp(32px, 4.5vw, 48px);
}
.is-style-kb-berry :where(h1, h2, h3, h4, a, a:hover) { color: #fff; }
.is-style-kb-berry p { color: rgba(255, 255, 255, 0.94); }

.is-style-kb-dark {
	background: var(--wp--preset--color--ink);
	color: #EDEBF3;
}
.is-style-kb-dark :where(h1, h2, h3, h4) { color: #fff; }
.is-style-kb-dark p { color: var(--wp--preset--color--on-dark); }
.is-style-kb-dark a { color: #fff; }
.is-style-kb-dark a:hover { color: var(--wp--preset--color--berry-light); }
.is-style-kb-dark .kb-eyebrow { color: var(--wp--preset--color--berry-light); }
.is-style-kb-dark .kb-breadcrumb { color: #A9A6BC; }
.is-style-kb-dark .kb-meta { color: #A9A6BC; }
.is-style-kb-dark.is-style-kb-dark { border-radius: 0; }
.is-style-kb-dark:not(.alignfull) { border-radius: 22px; padding: clamp(32px, 4.5vw, 48px); }

.is-style-kb-band {
	background: var(--wp--preset--color--white);
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.is-style-kb-note {
	background: #FFFDF6;
	border: 1px solid #E8E2CF;
	border-radius: 6px;
	padding: 32px 32px 26px;
	box-shadow: 0 18px 40px -24px rgba(21, 19, 31, 0.35);
	color: var(--wp--preset--color--ink-soft);
	font-size: 16px;
}
@media (min-width: 900px) { .is-style-kb-note { transform: rotate(1.2deg); } }

.is-style-kb-faq { border-top: 1px solid #D6D4E0; }
.is-style-kb-faq > * + * { margin-block-start: 0 !important; }

/* Details (FAQ) */
.wp-block-details {
	border-bottom: 1px solid #D6D4E0;
	padding: 18px 0;
}
.wp-block-details summary {
	cursor: pointer;
	font-weight: 700;
	font-size: 18px;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 16px;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; font-weight: 500; font-size: 24px; line-height: 1; color: var(--wp--preset--color--berry); }
.wp-block-details[open] summary::after { content: "–"; }
.wp-block-details > :not(summary) { margin-top: 10px; color: var(--wp--preset--color--muted); }

/* ---------- List variations ---------- */

:where(.is-style-kb-checks, .is-style-kb-ruled, .is-style-kb-steps, .is-style-kb-grid-ruled, .is-style-kb-two-col, .is-style-kb-stack, .is-style-kb-risks, .is-style-kb-pills) {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

.is-style-kb-checks {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	gap: 18px 32px;
}
.is-style-kb-checks li { position: relative; padding-left: 34px; }
.is-style-kb-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 3px;
	width: 22px;
	height: 22px;
	background: var(--wp--preset--color--leaf);
	-webkit-mask: 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.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: 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.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
}

.is-style-kb-ruled li { padding: 14px 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.is-style-kb-ruled li:last-child { border-bottom: 0; }
.is-style-kb-berry .is-style-kb-ruled li { border-color: rgba(255, 255, 255, 0.28); }
.is-style-kb-card .is-style-kb-ruled li { padding: 12px 0 0; border-bottom: 0; border-top: 1px solid #EDECF2; }
.is-style-kb-card .is-style-kb-ruled li + li { margin-top: 14px; }

.is-style-kb-steps {
	counter-reset: kb-step;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
	gap: 0 40px;
}
.is-style-kb-steps li {
	counter-increment: kb-step;
	padding: 24px 0;
	border-top: 3px solid var(--wp--preset--color--berry);
	color: var(--wp--preset--color--muted);
}
.is-style-kb-steps li::before {
	content: counter(kb-step);
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 30px;
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--berry);
	margin-bottom: 10px;
}
.is-style-kb-steps li strong {
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 21px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: var(--wp--preset--color--ink);
	margin-bottom: 4px;
}

.is-style-kb-grid-ruled {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
	border-top: 1px solid #D6D4E0;
	font-size: 18px;
	color: var(--wp--preset--color--ink-soft);
}
.is-style-kb-grid-ruled li { padding: 24px 28px 24px 0; border-bottom: 1px solid #D6D4E0; }

.is-style-kb-two-col {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	gap: 14px 32px;
	font-size: 16px;
}
.is-style-kb-two-col a { font-weight: 700; }

.is-style-kb-stack { border-top: 1px solid #3A3750; }
.is-style-kb-stack li {
	display: grid;
	grid-template-columns: 110px 1fr;
	column-gap: 24px;
	padding: 22px 0;
	border-bottom: 1px solid #3A3750;
	font-size: 15px;
	color: var(--wp--preset--color--on-dark);
}
.is-style-kb-stack li:last-child { border-bottom: 0; }
.is-style-kb-stack li em { grid-row: span 2; font-style: normal; font-size: 14px; color: #A9A6BC; padding-top: 6px; }
.is-style-kb-stack li strong { font-family: var(--wp--preset--font-family--heading); font-size: 22px; font-weight: 600; color: #fff; }
@media (max-width: 480px) {
	.is-style-kb-stack li { grid-template-columns: 1fr; }
	.is-style-kb-stack li em { grid-row: auto; padding-top: 0; }
}

.is-style-kb-risks li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #EDECF2; font-size: 15px; }
.is-style-kb-risks li :is(strong, em) {
	width: 64px;
	flex: none;
	text-align: center;
	padding: 3px 0;
	border-radius: 999px;
	font-weight: 700;
	font-style: normal;
	font-size: 13px;
}
.is-style-kb-risks li strong { background: #FBE4E1; color: #8A1C11; }
.is-style-kb-risks li em { background: #FCF0D8; color: #6B4F12; }

.is-style-kb-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.is-style-kb-pills li { padding: 8px 14px; border: 1px solid #D6D4E0; border-radius: 999px; font-size: 14px; color: var(--wp--preset--color--subtle); }

/* ---------- Columns variation ---------- */

.is-style-kb-bordered { padding: 40px 0; border-bottom: 1px solid #D6D4E0; margin-block-start: 0 !important; }

/* ---------- Buttons ---------- */

.wp-block-button__link { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.is-style-kb-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 1.5px solid var(--wp--preset--color--ink);
	padding: 12.5px 26.5px;
}
.is-style-kb-outline .wp-block-button__link:hover { background: var(--wp--preset--color--ink); color: #fff; }
.is-style-kb-light .wp-block-button__link { background: #fff; color: var(--wp--preset--color--ink); }
.is-style-kb-light .wp-block-button__link:hover { background: var(--wp--preset--color--blush); color: var(--wp--preset--color--ink); }
.is-style-kb-pink .wp-block-button__link { background: var(--wp--preset--color--berry-light); color: var(--wp--preset--color--ink); }
.is-style-kb-pink .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--ink); }
.is-style-kb-ink .wp-block-button__link { background: var(--wp--preset--color--ink); color: #fff; }
.is-style-kb-ink .wp-block-button__link:hover { background: var(--wp--preset--color--berry); }
.is-style-kb-dark .is-style-kb-outline .wp-block-button__link { color: #fff; border-color: #fff; }

/* ---------- Cards that are links ---------- */

.kb-card-link { position: relative; transition: border-color .15s ease, transform .15s ease; }
.kb-card-link:hover { border-color: #C9C4D6; transform: translateY(-2px); }
.kb-card-link .wp-block-heading a::after,
.kb-card-link .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kb-card-link .wp-block-heading a,
.kb-card-link .wp-block-post-title a { text-decoration: none; color: inherit; }

/* Team avatars (replace with a photo later) */
.kb-avatar {
	height: 220px;
	border-radius: 14px;
	background: var(--wp--preset--color--blush);
	color: var(--wp--preset--color--berry);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 64px;
	font-weight: 700;
	margin: 0;
}
.kb-avatar--sky { background: #E6EEF7; color: #1F4E7A; }
.kb-avatar--leaf { background: #E8F1EC; color: #2C5E43; }

/* Value list on About */
.kb-values > * { border-top: 3px solid var(--wp--preset--color--berry); padding-top: 20px; }

/* ---------- Blog ---------- */

.kb-post-grid .wp-block-post-template { gap: 20px; }
.kb-post-grid .wp-block-post { margin: 0; }
@media (min-width: 900px) {
	.kb-post-grid.is-first-featured .wp-block-post-template > li:first-child { grid-column: 1 / -1; }
	.kb-post-grid.is-first-featured .wp-block-post-template > li:first-child .wp-block-post-title { font-size: 34px; }
}
.kb-post-card { height: 100%; display: flex; flex-direction: column; }
.kb-post-card .wp-block-post-terms a { color: var(--wp--preset--color--berry); font-weight: 700; text-decoration: none; position: relative; z-index: 1; }
.kb-post-card .wp-block-post-terms { font-size: 14px; }

.wp-block-categories.kb-pills-nav { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.wp-block-categories.kb-pills-nav li a,
.kb-track-filter a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1.5px solid #D6D4E0;
	border-radius: 999px;
	background: #fff;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}
.wp-block-categories.kb-pills-nav li.current-cat a,
.kb-track-filter a[aria-current="page"] { background: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--ink); color: #fff; }
.kb-track-filter { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }

/* Article body */
.kb-prose { font-size: 18px; }
.kb-prose > * + * { margin-block-start: 1.1em; }
.kb-prose h2 { font-size: 28px; margin-block-start: 1.6em; }
.kb-prose h3 { font-size: 22px; margin-block-start: 1.4em; }
.kb-prose ul, .kb-prose ol { padding-left: 1.3em; }
.kb-prose li + li { margin-top: 0.4em; }

/* ---------- Learn ---------- */

.kb-tag a, .kb-tag {
	font-size: 14px;
	font-weight: 700;
	color: var(--wp--preset--color--berry);
	text-decoration: none;
	position: relative;
	z-index: 1;
}

.kb-course-outline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; counter-reset: kb-lesson; }
.kb-course-outline li { counter-increment: kb-lesson; }
.kb-course-outline a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--wp--preset--color--ink); }
.kb-course-outline a::before { content: counter(kb-lesson); color: var(--wp--preset--color--subtle); width: 1.2em; flex: none; }
.kb-course-outline a:hover { background: var(--wp--preset--color--mist); }
.kb-course-outline a[aria-current="page"] { background: var(--wp--preset--color--blush); font-weight: 700; }
.kb-course-outline a[aria-current="page"]::before { color: var(--wp--preset--color--berry); }
.kb-course-title { font-family: var(--wp--preset--font-family--heading); font-size: 19px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
.kb-course-title a { text-decoration: none; }

.kb-pager { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--wp--preset--color--line); }
.kb-pager a { font-weight: 700; text-decoration: none; }
.kb-pager .kb-pager-next { margin-left: auto; }

.kb-lesson-count { font-size: 14px; color: var(--wp--preset--color--subtle); margin: 0; }

.kb-example {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 15px;
}
.kb-bad { color: #B42318; }
.kb-good { color: var(--wp--preset--color--leaf); }

/* ---------- Contact form ---------- */

.kb-form { display: flex; flex-direction: column; gap: 20px; }
.kb-form .kb-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 20px; }
.kb-form .kb-field { display: flex; flex-direction: column; gap: 6px; }
.kb-form label { font-size: 15px; font-weight: 700; }
.kb-form :is(input[type="text"], input[type="email"], select, textarea) {
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #D6D4E0;
	border-radius: 12px;
	background: #fff;
	font: inherit;
	font-size: 16px;
	color: var(--wp--preset--color--ink);
	width: 100%;
	box-sizing: border-box;
}
.kb-form textarea { resize: vertical; min-height: 150px; }
.kb-form :is(input, select, textarea):focus-visible { outline: 2px solid var(--wp--preset--color--berry); outline-offset: 1px; border-color: transparent; }
.kb-form .kb-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--wp--preset--color--muted); }
.kb-form .kb-consent label { font-weight: 400; }
.kb-form .kb-consent input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--wp--preset--color--berry); }
.kb-form button {
	align-self: flex-start;
	min-height: 52px;
	padding: 0 30px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--ink);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.kb-form button:hover { background: var(--wp--preset--color--berry); }
.kb-form .kb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.kb-form-note { font-size: 14px; color: var(--wp--preset--color--subtle); margin: 0; }
.kb-form-notice { padding: 16px 18px; border-radius: 12px; font-weight: 600; }
.kb-form-notice.is-success { background: var(--wp--preset--color--leaf-tint); color: #1F3D2E; }
.kb-form-notice.is-error { background: #FBE4E1; color: #8A1C11; }

/* ---------- Small screens ---------- */

@media (max-width: 781px) {
	.kb-hide-mobile { display: none !important; }
}

/* Lesson layout: content first on phones, outline after */
@media (max-width: 781px) {
	.kb-lesson-layout .kb-lesson-sidebar { order: 2; }
}
.kb-eyebrow.kb-lesson-count { font-size: 15px; font-weight: 700; color: var(--wp--preset--color--berry); }
.wp-block-post-terms.kb-breadcrumb a { color: inherit; text-decoration: underline; }

/* Full-width coloured sections keep the page gutters and lose the card radius */
.is-style-kb-berry.alignfull {
	border-radius: 0;
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}
.kb-card-link .kb-arrow-link::after { content: " →"; }
.kb-contact-card { padding: clamp(24px, 3.5vw, 36px); border-radius: 22px; }
.kb-footer.is-style-kb-dark { border-radius: 0; padding-left: var(--wp--style--root--padding-left); padding-right: var(--wp--style--root--padding-right); }
.wp-block-group.kb-fit { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
