/*
Theme Name: Klarhim
Theme URI: https://klarhim.com
Author: Klarhim
Author URI: https://klarhim.com
Description: The Klarhim company theme. A simple, playful block theme with big headlines, pill buttons and soft rounded cards. Every section, the menu and the colors are editable in the Site Editor; products have their own pages; a contact form is built in.
Version: 2.1.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: klarhim
Tags: block-theme, full-site-editing, one-column, custom-colors, custom-logo, editor-style, featured-images, translation-ready
*/

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

html {
	scroll-behavior: smooth;
}

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

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

.wp-site-blocks > main {
	flex-grow: 1;
}

:where(.wp-site-blocks) :where(p, h1, h2, h3, h4) {
	margin-block: 0;
}

/* Sections ------------------------------------------------------------------ */

.klarhim-section {
	padding: 120px 48px;
}

.klarhim-section--flush {
	padding-block: 0;
}

.klarhim-section--top-flush {
	padding-top: 0;
}

.klarhim-section > * + * {
	margin-block-start: 56px;
}

/* Section heading: small round badge above a large headline. */
.klarhim-head > .wp-block-heading,
.klarhim-head > p {
	max-width: 760px;
}

.klarhim-head > * + * {
	margin-block-start: 32px;
}

.wp-block-image.klarhim-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--surface-tint);
}

.wp-block-image.klarhim-badge img {
	width: 22px;
	height: auto;
}

.klarhim-head--night .wp-block-image.klarhim-badge {
	background: var(--wp--preset--color--night-soft);
}

.klarhim-head-row {
	gap: 32px;
}

/* Buttons: pill shape with an arrow ----------------------------------------- */

.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link::after {
	content: "";
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	background-color: currentColor;
	-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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
}

.wp-block-button.is-style-light .wp-block-button__link {
	background: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--brand-strong);
}

.wp-block-button.is-style-light .wp-block-button__link:hover,
.wp-block-button.is-style-light .wp-block-button__link:focus {
	background: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--brand-deep);
}

/* Header and footer --------------------------------------------------------- */

.klarhim-header {
	padding: 28px 48px;
}

.klarhim-header__bar {
	gap: 24px;
}

.wp-block-image.klarhim-logo {
	margin: 0;
}

.wp-block-image.klarhim-logo img {
	display: block;
	height: 40px;
	width: auto;
}

.klarhim-header .wp-block-navigation {
	gap: 40px;
}

.klarhim-footer {
	padding: 0 48px 48px;
}

.klarhim-footer__bar {
	gap: 24px;
	padding-top: 32px;
	border-top: 1px solid var(--wp--preset--color--line);
}

.klarhim-footer .wp-block-image.klarhim-logo img {
	height: 28px;
}

/* Hero ---------------------------------------------------------------------- */

.klarhim-hero {
	position: relative;
	overflow: hidden;
	padding-top: 72px;
	padding-bottom: 64px;
}

.klarhim-hero::before,
.klarhim-hero::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
	pointer-events: none;
}

.klarhim-hero::before {
	top: -40px;
	right: 8%;
	width: 420px;
	height: 420px;
}

.klarhim-hero::after {
	top: 220px;
	right: 28%;
	width: 160px;
	height: 160px;
}

.klarhim-hero > * {
	position: relative;
	z-index: 1;
}

.klarhim-hero__row {
	gap: 48px;
}

.klarhim-hero__title {
	line-height: 1.05;
	letter-spacing: -0.04em;
}

.klarhim-hero__aside {
	max-width: 360px;
	padding-bottom: 8px;
}

.klarhim-hero__aside > * + * {
	margin-block-start: 24px;
}

.klarhim-hero .wp-block-button__link {
	padding: 22px 36px;
	font-size: 16px;
}

/* Mascot banner ------------------------------------------------------------- */

.klarhim-banner {
	position: relative;
	min-height: 440px;
	overflow: hidden;
	border-radius: 32px;
	background-image:
		radial-gradient(circle at 160px 160px, var(--wp--preset--color--brand) 0 160px, transparent 161px),
		radial-gradient(circle at calc(100% - 130px) calc(100% + 70px), var(--wp--preset--color--brand) 0 190px, transparent 191px),
		radial-gradient(circle at 336px calc(100% - 80px), var(--wp--preset--color--cream) 0 24px, transparent 25px),
		radial-gradient(circle at 50% 50%, var(--wp--preset--color--surface-tint) 0 150px, transparent 151px);
	background-position: -240px -240px, 0 0, 0 0, 0 0;
	background-repeat: no-repeat;
}

.klarhim-banner::before,
.klarhim-banner::after {
	content: "";
	position: absolute;
	border-radius: 999px;
	background: var(--wp--preset--color--brand-soft);
	pointer-events: none;
}

.klarhim-banner::before {
	left: 200px;
	bottom: 56px;
	width: 96px;
	height: 48px;
}

.klarhim-banner::after {
	right: 240px;
	top: 48px;
	width: 64px;
	height: 32px;
}

.wp-block-image.klarhim-banner__mascot {
	position: relative;
	z-index: 1;
	margin: 0;
}

.wp-block-image.klarhim-banner__mascot img {
	display: block;
	width: 260px;
	max-width: 100%;
	height: auto;
}

/* Partner logos ------------------------------------------------------------- */

.klarhim-logos {
	padding-block: 48px;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.klarhim-logos__grid {
	gap: 24px;
	align-items: center;
}

.wp-block-image.klarhim-logo-item {
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wp-block-image.klarhim-logo-item img {
	display: block;
	max-height: 56px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
}

/* About with steps ---------------------------------------------------------- */

.klarhim-about__grid {
	gap: 64px;
	align-items: center;
}

.klarhim-about__text > * + * {
	margin-block-start: 32px;
}

.klarhim-steps {
	justify-self: end;
	box-sizing: border-box;
	width: 100%;
	max-width: 440px;
	min-height: 340px;
	padding: 48px 40px 40px;
	border: 8px solid var(--wp--preset--color--brand-light);
	border-radius: 40px;
	background: var(--wp--preset--color--surface-raised);
}

.klarhim-steps > * + * {
	margin-block-start: 28px;
}

.klarhim-steps__label {
	font-size: 15px;
	font-weight: 500;
}

.klarhim-step > * + * {
	margin-block-start: 12px;
}

.klarhim-step__num {
	font-size: 18px;
	font-weight: 500;
	color: var(--wp--preset--color--brand-strong);
}

.klarhim-step__title.wp-block-heading {
	font-size: 32px;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

/* With the script running, one step shows at a time with dots under it. */
.klarhim-steps.is-ready .klarhim-step {
	display: none;
	min-height: 168px;
}

.klarhim-steps.is-ready .klarhim-step.is-active {
	display: block;
	animation: klarhim-fade 0.4s ease;
}

.klarhim-steps__dots {
	display: flex;
	gap: 10px;
}

.klarhim-steps__dots button {
	width: 14px;
	height: 14px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--line);
	cursor: pointer;
}

.klarhim-steps__dots button[aria-current="true"] {
	background: var(--wp--preset--color--brand);
}

@keyframes klarhim-fade {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

/* Solution cards ------------------------------------------------------------ */

.klarhim-cards {
	gap: 24px;
}

.klarhim-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
	box-sizing: border-box;
	height: 100%;
	padding: 40px;
	background: var(--wp--preset--color--surface);
	border-radius: 32px;
}

.klarhim-card > * {
	margin: 0;
}

.klarhim-card > p {
	flex-grow: 1;
	font-size: 15px;
	line-height: 1.6;
}

.klarhim-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--wp--preset--color--brand);
}

.klarhim-icon .wp-block-image {
	margin: 0;
	line-height: 0;
}

.klarhim-icon img {
	display: block;
	width: 28px;
	height: 28px;
}

/* Quote --------------------------------------------------------------------- */

.klarhim-quote {
	position: relative;
	overflow: hidden;
}

.klarhim-quote::before,
.klarhim-quote::after {
	position: absolute;
	font-size: 360px;
	line-height: 1;
	font-weight: 700;
	color: var(--wp--preset--color--surface-raised);
	pointer-events: none;
}

.klarhim-quote::before {
	content: "\201C";
	top: -40px;
	left: 24px;
}

.klarhim-quote::after {
	content: "\201D";
	right: 24px;
	bottom: -200px;
}

.klarhim-quote__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
}

.klarhim-quote__inner > * {
	margin: 0 !important;
}

.klarhim-quote__text {
	max-width: 820px;
	font-size: var(--wp--preset--font-size--quote);
	line-height: 1.15;
	font-weight: 500;
	letter-spacing: -0.03em;
	color: var(--wp--preset--color--brand-strong);
}

.wp-block-separator.klarhim-quote__rule {
	width: 120px;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--line);
	opacity: 1;
}

.klarhim-quote__by {
	font-size: 15px;
	font-weight: 600;
}

/* Products: staggered portfolio --------------------------------------------- */

.klarhim-portfolio .wp-block-post-template {
	column-gap: 48px;
	row-gap: 56px;
	align-items: start;
}

.klarhim-tile {
	display: flex;
	flex-direction: column;
	gap: 20px;
	transition: transform 0.3s ease;
}

.klarhim-tile:hover {
	transform: translateY(-4px);
}

.klarhim-tile > * {
	margin: 0 !important;
}

.klarhim-tile__media {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 340px;
	overflow: hidden;
	border-radius: 32px;
	background: var(--wp--preset--color--surface-tint) url("assets/images/klarhim-emblem.svg") center / auto 80px no-repeat;
}

.klarhim-portfolio .wp-block-post-template > li:nth-child(4n+1) .klarhim-tile__media,
.klarhim-portfolio .wp-block-post-template > li:nth-child(4n+4) .klarhim-tile__media {
	height: 460px;
}

.klarhim-portfolio .wp-block-post-template > li:nth-child(4n+1) .klarhim-tile__media {
	background-color: var(--wp--preset--color--cream);
}

.klarhim-portfolio .wp-block-post-template > li:nth-child(4n+2) .klarhim-tile__media {
	background-color: var(--wp--preset--color--brand-deep);
}

.klarhim-portfolio .wp-block-post-template > li:nth-child(4n+3) .klarhim-tile__media {
	background-color: var(--wp--preset--color--ink);
}

.klarhim-tile__media > * {
	width: 100%;
	height: 100%;
	margin: 0;
}

.klarhim-tile__media .wp-block-post-featured-image a,
.klarhim-tile__media .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.klarhim-tile__meta {
	gap: 16px;
}

.klarhim-tile .wp-block-post-title {
	font-size: 28px;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.klarhim-tile .wp-block-post-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.klarhim-tag,
.klarhim-tag a {
	text-decoration: none;
}

.klarhim-tag {
	flex-shrink: 0;
	font-size: 12px;
	line-height: 16px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-strong);
}

.klarhim-tag a {
	display: inline-block;
	padding: 6px 14px;
	background: var(--wp--preset--color--surface-tint);
	border-radius: 999px;
	color: inherit;
}

.klarhim-tag .wp-block-post-terms__separator {
	display: none;
}

@media (min-width: 782px) {
	.klarhim-portfolio .wp-block-post-template > li:nth-child(even) {
		transform: translateY(120px);
	}

	.klarhim-portfolio .wp-block-post-template:has(> li:nth-child(2)) {
		padding-bottom: 120px;
	}
}

.klarhim-product-hero img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 32px;
}

/* Testimonials -------------------------------------------------------------- */

.klarhim-testimonials .wp-block-heading {
	color: var(--wp--preset--color--on-night);
}

.klarhim-testimonials__grid {
	gap: 24px;
}

.klarhim-testimonial {
	display: flex;
	flex-direction: column;
	gap: 28px;
	box-sizing: border-box;
	height: 100%;
	padding: 40px;
	border-radius: 32px;
}

.klarhim-testimonial > * {
	margin: 0 !important;
}

.klarhim-testimonial__mark {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding-top: 6px;
	border-radius: 50%;
	background: var(--wp--preset--color--brand-night);
	color: var(--wp--preset--color--night);
	font-size: 40px;
	line-height: 1;
	font-weight: 700;
}

.klarhim-testimonial__text {
	flex-grow: 1;
	font-size: 18px;
	line-height: 1.65;
	font-weight: 500;
}

.klarhim-testimonial__person {
	gap: 14px;
}

.wp-block-image.klarhim-avatar {
	margin: 0;
	flex-shrink: 0;
}

.wp-block-image.klarhim-avatar img {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}

.klarhim-testimonial__who > * + * {
	margin-block-start: 2px;
}

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

.klarhim-contact {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
	text-align: center;
}

.klarhim-contact > * {
	margin: 0 !important;
}

.klarhim-contact__title {
	line-height: 1.1;
	letter-spacing: -0.04em;
}

.klarhim-form-card {
	box-sizing: border-box;
	width: 100%;
	max-width: 640px;
	padding: 40px;
	border-radius: 32px;
	text-align: left;
}

.klarhim-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.klarhim-form > .klarhim-form__notice,
.klarhim-form > .klarhim-form__field--wide,
.klarhim-form > button {
	grid-column: 1 / -1;
}

.klarhim-form__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.klarhim-form label {
	font-size: 14px;
	line-height: 20px;
	font-weight: 600;
}

.klarhim-form input[type="text"],
.klarhim-form input[type="email"],
.klarhim-form textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 16px 20px;
	border: 2px solid var(--wp--preset--color--line);
	border-radius: 999px;
	background: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: 16px;
	line-height: 24px;
}

.klarhim-form textarea {
	border-radius: 24px;
	resize: vertical;
}

.klarhim-form input:focus,
.klarhim-form textarea:focus {
	border-color: var(--wp--preset--color--brand-strong);
	outline: none;
}

.klarhim-form button {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 18px 30px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--ink);
	color: #ffffff;
	font-family: inherit;
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s ease;
}

.klarhim-form button:hover {
	transform: translateY(-2px);
}

.klarhim-form button::after {
	content: "\2192";
	font-size: 18px;
}

.klarhim-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.klarhim-form__notice {
	margin: 0;
	padding: 14px 20px;
	border-radius: 16px;
	background: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--ink);
	font-size: 14px;
	line-height: 22px;
	font-weight: 600;
}

.klarhim-form__notice--error {
	color: var(--wp--preset--color--danger);
}

.klarhim-form__notice--success {
	color: var(--wp--preset--color--success);
}

.wp-block-social-links.klarhim-social {
	gap: 12px;
}

.wp-block-social-links.klarhim-social .wp-social-link {
	background: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--ink) !important;
	font-size: 14px;
}

/* Focus --------------------------------------------------------------------- */

:where(a, button, input, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-strong);
	outline-offset: 3px;
}

.klarhim-testimonials :where(a, button):focus-visible {
	outline-color: var(--wp--preset--color--on-night);
}

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

@media (max-width: 781px) {
	.klarhim-about__grid,
	.klarhim-cards,
	.klarhim-testimonials__grid {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.klarhim-logos__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.klarhim-about__grid {
		gap: 40px;
	}

	.klarhim-section {
		padding: 72px 24px;
	}

	.klarhim-section--flush {
		padding-block: 0;
	}

	.klarhim-section--top-flush {
		padding-top: 0;
	}

	.klarhim-section > * + * {
		margin-block-start: 40px;
	}

	.klarhim-hero {
		padding-top: 32px;
		padding-bottom: 40px;
	}

	.klarhim-hero::before {
		width: 260px;
		height: 260px;
		right: -80px;
	}

	.klarhim-hero::after {
		display: none;
	}

	.klarhim-header,
	.klarhim-footer {
		padding-inline: 24px;
	}

	.klarhim-banner {
		min-height: 320px;
		border-radius: 24px;
	}

	.klarhim-banner::before,
	.klarhim-banner::after {
		display: none;
	}

	.wp-block-image.klarhim-banner__mascot img {
		width: 200px;
	}

	.klarhim-steps {
		justify-self: stretch;
		max-width: none;
		padding: 32px 28px;
	}

	.klarhim-card,
	.klarhim-testimonial,
	.klarhim-form-card {
		padding: 28px;
	}

	.klarhim-form {
		grid-template-columns: minmax(0, 1fr);
	}

	.klarhim-tile__media,
	.klarhim-portfolio .wp-block-post-template > li:nth-child(4n+1) .klarhim-tile__media,
	.klarhim-portfolio .wp-block-post-template > li:nth-child(4n+4) .klarhim-tile__media {
		height: 280px;
	}

	.klarhim-tile .wp-block-post-title {
		font-size: 22px;
	}

	.klarhim-quote::before,
	.klarhim-quote::after {
		font-size: 200px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	.wp-block-button__link:hover,
	.klarhim-tile:hover {
		transform: none;
	}
}
