/*
Theme Name: Jhumel
Author: Jhumel Bonganciso
Description: Block theme for the Jhumel Builds portfolio site.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.2.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jhumel
*/

/*
 * Only what theme.json and block settings cannot express lives here:
 * hover and focus states, decorative pieces (the hero illustration, numerals, pills), and small-screen fixes.
 */

/* The quote form plugin reads these so its button, focus ring, and checkboxes match the theme. */
:root {
	--quote-form-accent: var(--wp--preset--color--navy);
	--quote-form-accent-hover: var(--wp--preset--color--amber);
	--quote-form-accent-hover-text: var(--wp--preset--color--black);
	--quote-form-button-radius: 999px;
}

/* theme.json styles focus only for links and buttons; the menu toggles need it too. */
.wp-block-navigation__responsive-container-open:focus-visible,
.wp-block-navigation__responsive-container-close:focus-visible {
	outline: 2px solid var(--wp--preset--color--navy);
	outline-offset: 2px;
}

/* On the navy bands a navy focus ring would vanish, so it turns sky blue there. */
.band-dark :focus-visible {
	outline-color: var(--wp--preset--color--sky);
}

/* Links in running text: navy with an amber underline. theme.json cannot set the underline colour. */
main :is(p, li) a:not(.wp-element-button),
footer p a {
	text-decoration-color: var(--wp--preset--color--amber);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

main :is(p, li) a:not(.wp-element-button):hover,
footer p a:hover {
	text-decoration-color: currentColor;
}

/*
 * Buttons share one hover language. Primary: navy flips to amber, lifts 1px, and its arrow slides forward.
 * Outline: fills with the amber tint and turns navy. theme.json sets the primary colours; it cannot animate,
 * add the arrow, or give the outline variation its own hover.
 */
.wp-element-button,
.quote-form__submit {
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link::after,
.quote-form__submit::after {
	content: "→";
	display: inline-block;
	margin-inline-start: 0.5em;
	transition: transform 0.18s ease;
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:is(:hover, :focus-visible),
.quote-form__submit:is(:hover, :focus-visible) {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px -12px rgba(245, 158, 11, 0.75);
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:is(:hover, :focus-visible)::after,
.quote-form__submit:is(:hover, :focus-visible)::after {
	transform: translateX(4px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:is(:hover, :focus-visible) {
	border-color: var(--wp--preset--color--navy);
	background-color: var(--wp--preset--color--amber-50);
	color: var(--wp--preset--color--navy);
}

@media (prefers-reduced-motion: reduce) {
	.wp-element-button,
	.quote-form__submit,
	.wp-block-button__link::after,
	.quote-form__submit::after {
		transition: none;
	}

	.wp-block-button:not(.is-style-outline) > .wp-block-button__link:is(:hover, :focus-visible),
	.quote-form__submit:is(:hover, :focus-visible) {
		transform: none;
	}

	.wp-block-button__link:is(:hover, :focus-visible)::after,
	.quote-form__submit:is(:hover, :focus-visible)::after {
		transform: none;
	}
}

/* Short pages like the 404 keep the footer at the bottom of the screen instead of halfway up it. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

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

/* The divider above the footer; the footer is a template part, which has no border support. */
footer.wp-block-template-part {
	border-top: 1px solid var(--wp--preset--color--gray-200);
}

/* Even line lengths in headings, so a headline never ends on a lone word or splits "follow-up" at the hyphen. */
h1,
h2,
h3 {
	text-wrap: balance;
}

/* One emphasised phrase per headline: italic serif with an amber underline drawn under the words. */
.accent-underline {
	font-style: italic;
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--amber);
	text-decoration-thickness: 0.09em;
	text-underline-offset: 0.12em;
	text-decoration-skip-ink: none;
}

/* Hero trust row: three short facts, each with its own amber dot so the row wraps cleanly on phones. */
.trust-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem 1.25rem;
}

.trust-row span {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.trust-row span::before {
	content: "";
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 999px;
	background: var(--wp--preset--color--amber);
}

/* The label above the hero illustration, marking it as one example with a pulsing "live" dot. */
.scene-label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-block-end: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--gray-600);
}

.scene-label::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 999px;
	background: var(--wp--preset--color--success);
	box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.15);
}

/* Hero illustration: a lead arriving, built from plain HTML so it is sharp at any size and weighs nothing. */
.lead-scene {
	display: grid;
	gap: 0.875rem;
	max-width: 26rem;
	margin-inline: auto;
	font-size: var(--wp--preset--font-size--small);
}

.lead-scene__alert,
.lead-scene__card,
.lead-scene__pipeline {
	border-radius: 18px;
	box-shadow: var(--wp--preset--shadow--soft);
}

.lead-scene__alert {
	display: grid;
	gap: 0.125rem;
	width: 86%;
	margin-inline-start: auto;
	padding: 0.875rem 1.125rem;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--navy-muted);
	transform: rotate(1.5deg);
}

.lead-scene__alert strong {
	color: var(--wp--preset--color--white);
}

.lead-scene__alert-source {
	color: var(--wp--preset--color--sky);
	font-size: 0.75rem;
}

.lead-scene__card {
	padding: 1.25rem;
	border: 1px solid var(--wp--preset--color--gray-200);
	background: var(--wp--preset--color--white);
}

.lead-scene__card-top,
.lead-scene__card-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.lead-scene__card-top strong {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--medium);
}

.lead-scene__card-top span:not(.lead-scene__badge) {
	color: var(--wp--preset--color--gray-600);
}

.lead-scene__badge {
	padding: 0.25rem 0.625rem;
	border-radius: 999px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-weight: 600;
}

.lead-scene__reason {
	margin: 0.875rem 0;
	color: var(--wp--preset--color--gray-600);
}

.lead-scene__pill {
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: var(--wp--preset--color--amber-50);
	color: var(--wp--preset--color--amber-dark);
	font-weight: 600;
}

.lead-scene__price {
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium);
}

.lead-scene__pipeline {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	align-items: end;
	gap: 0.5rem;
	width: 90%;
	padding: 1rem 1.125rem 0.875rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--gray-600);
	font-size: 0.75rem;
	transform: rotate(-1deg);
}

.lead-scene__pipeline span::before {
	content: "";
	display: block;
	height: calc(var(--count) * 0.875rem);
	margin-bottom: 0.375rem;
	border-radius: 6px;
	background: var(--wp--preset--color--gray-50);
	border-top: 3px solid var(--wp--preset--color--navy);
}

@media (prefers-reduced-motion: no-preference) {
	.lead-scene__alert {
		animation: lead-scene-arrive 0.7s 0.5s ease-out both;
	}

	.lead-scene__card {
		animation: lead-scene-rise 0.7s 0.15s ease-out both;
	}
}

@keyframes lead-scene-arrive {
	from {
		opacity: 0;
		transform: translateY(-14px) rotate(1.5deg);
	}
}

@keyframes lead-scene-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}

/* Cards that respond to the pointer, a small lift so the grid feels alive without moving on its own. */
.lift-card {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lift-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--wp--preset--shadow--soft);
}

@media (prefers-reduced-motion: reduce) {
	.lift-card {
		transition: none;
	}

	.lift-card:hover {
		transform: none;
	}
}

/* Numbered steps in the demo: serif numerals in circles instead of plain list numbers. */
.numbered-steps {
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.numbered-steps li {
	position: relative;
	padding-inline-start: 2.75rem;
	counter-increment: step;
}

.numbered-steps li + li {
	margin-block-start: var(--wp--preset--spacing--20);
}

.numbered-steps li::before {
	content: counter(step);
	position: absolute;
	inset-inline-start: 0;
	top: -0.125rem;
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 999px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 600;
}

/* Capability cards on the navy band: a faint lighter surface instead of white. */
.dark-card {
	border: 1px solid rgba(199, 208, 230, 0.16);
	background: rgba(255, 255, 255, 0.04);
}

.dark-card:hover {
	background: rgba(255, 255, 255, 0.07);
}

.band-dark .card-index {
	color: var(--wp--preset--color--amber);
}

/* Small serif index on capability cards. */
.card-index {
	margin: 0;
	color: var(--wp--preset--color--amber-dark);
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 600;
}

/* Large serif figures: results in the track record. */
.result-figure {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 600;
	line-height: 1;
}

.result-figure {
	font-size: clamp(1.875rem, 3vw, 2.25rem);
	letter-spacing: -0.02em;
}

/* Screenshots sit in a white frame with a soft shadow, like a print on the page. */
.screenshot-frame {
	margin: 0;
}

/* The screenshots are printed as HTML, so the Image block's own sizing rules are not loaded for them. */
.screenshot-frame img {
	display: block;
	max-width: 100%;
	height: auto;
	padding: 0.5rem;
	border-radius: 16px;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--soft);
}

.screenshot-frame + .screenshot-frame {
	margin-block-start: var(--wp--preset--spacing--40);
}

.screenshot-frame figcaption {
	margin-block-start: 0.875rem;
}

/* Screenshots on navy: a faint translucent frame instead of a white one, and a deeper shadow. */
.band-dark .screenshot-frame img {
	padding: 0.375rem;
	background: rgba(255, 255, 255, 0.1);
	box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
}

/* Text on the navy bands: captions and secondary text use the muted colour, not the light-surface gray. */
.band-dark .wp-element-caption {
	color: var(--wp--preset--color--navy-muted);
}

/*
 * How it works: seven steps on one vertical rail. Each step has a navy number on the rail, a short explanation
 * with tool tags, and a visual. The visuals that are not screenshots are small HTML recreations of the product.
 */
.pipeline-step {
	position: relative;
	padding-inline-start: 4rem;
	padding-block-end: var(--wp--preset--spacing--50);
}

.pipeline-step::before {
	content: "";
	position: absolute;
	inset-block: 2.75rem 0.5rem;
	inset-inline-start: 1.1875rem;
	border-inline-start: 2px dashed var(--wp--preset--color--gray-200);
}

.pipeline-step:last-child {
	padding-block-end: 0;
}

.pipeline-step:last-child::before {
	content: none;
}

.pipeline-step__number {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 600;
	box-shadow: 0 0 0 6px var(--wp--preset--color--white);
}

.pipeline-step__visual--narrow .screenshot-frame {
	max-width: 24rem;
}

.tool-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.tool-tags span {
	padding: 0.2rem 0.625rem;
	border: 1px solid var(--wp--preset--color--gray-200);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--gray-600);
	font-size: var(--wp--preset--font-size--small);
}

/* Shared surface for the HTML visuals: a white card with the soft shadow. */
.mini-form,
.ai-card,
.node-chain,
.tg-chat {
	max-width: 30rem;
	border: 1px solid var(--wp--preset--color--gray-200);
	border-radius: 18px;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--soft);
	font-size: var(--wp--preset--font-size--small);
}

/* Step 1: the quote form, simplified. */
.mini-form {
	display: grid;
	gap: 0.875rem;
	padding: 1.25rem;
}

.mini-form__label {
	margin: 0;
	font-weight: 600;
}

.mini-form__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.mini-form__chips span {
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--wp--preset--color--gray-200);
	border-radius: 999px;
}

.mini-form__chips .is-selected {
	border-color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

.mini-form__field {
	display: grid;
	gap: 0.25rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--wp--preset--color--gray-200);
	border-radius: 10px;
}

.mini-form__field span {
	color: var(--wp--preset--color--gray-600);
	font-size: 0.75rem;
}

.mini-form__estimate {
	padding: 0.625rem 0.75rem;
	border-radius: 10px;
	background: var(--wp--preset--color--amber-50);
	color: var(--wp--preset--color--amber-dark);
}

.mini-form__button {
	justify-self: start;
	padding: 0.55rem 1.1rem;
	border-radius: 999px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-weight: 600;
}

/* Step 2: the signed request, as code. */
.code-card {
	max-width: 30rem;
	margin: 0;
	padding: 1.25rem 1.375rem;
	overflow-x: auto;
	border-radius: 18px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--navy-muted);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	line-height: 1.7;
	white-space: pre;
	box-shadow: var(--wp--preset--shadow--soft);
}

.code-card__method {
	padding: 0.1rem 0.4rem;
	border-radius: 4px;
	background: var(--wp--preset--color--amber);
	color: var(--wp--preset--color--black);
	font-weight: 700;
}

.code-card__key {
	color: var(--wp--preset--color--sky);
}

/* Step 3: the n8n workflow as a chain of steps. */
.node-chain {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 1rem 1.25rem;
	list-style: none;
	counter-reset: node;
}

.node-chain li {
	position: relative;
	padding: 0.5rem 0 0.5rem 2.25rem;
	counter-increment: node;
	font-weight: 600;
}

.node-chain li::before {
	content: counter(node);
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: 0.4rem;
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 7px;
	background: var(--wp--preset--color--gray-50);
	border: 1px solid var(--wp--preset--color--gray-200);
	font-size: 0.75rem;
}

.node-chain li + li::after {
	content: "";
	position: absolute;
	inset-inline-start: 0.72rem;
	inset-block-start: -0.35rem;
	height: 0.75rem;
	border-inline-start: 2px solid var(--wp--preset--color--gray-200);
}

.node-chain small {
	margin-inline-start: 0.375rem;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	background: var(--wp--preset--color--amber-50);
	color: var(--wp--preset--color--amber-dark);
	font-weight: 600;
}

/* Step 4: the AI's score and draft. */
.ai-card {
	display: grid;
	gap: 0.75rem;
	padding: 1.25rem;
}

.ai-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ai-card__label {
	color: var(--wp--preset--color--gray-600);
	font-size: 0.75rem;
	font-weight: 600;
}

.ai-card__badge {
	padding: 0.2rem 0.7rem;
	border-radius: 999px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-weight: 600;
}

.ai-card__reason {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.35;
}

.ai-card__draft {
	padding: 0.875rem 1rem;
	border-radius: 12px;
	background: var(--wp--preset--color--paper);
}

.ai-card__draft p {
	margin: 0.375rem 0 0;
}

/* Step 5: the Telegram alert, recreated so it is readable and shows no real person's details. */
.tg-chat {
	overflow: hidden;
	background: var(--wp--preset--color--gray-50);
}

.tg-chat__header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--white);
}

.tg-chat__header strong,
.tg-chat__header span:not(.tg-chat__avatar) {
	display: block;
}

.tg-chat__header span:not(.tg-chat__avatar) {
	color: var(--wp--preset--color--gray-600);
	font-size: 0.75rem;
}

.tg-chat__avatar {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 999px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-weight: 700;
	font-size: 0.75rem;
}

.tg-chat__bubble {
	position: relative;
	margin: 1rem;
	padding: 0.875rem 1rem 1.5rem;
	border-radius: 14px 14px 14px 4px;
	background: var(--wp--preset--color--white);
	line-height: 1.5;
}

.tg-chat__bubble p {
	margin: 0 0 0.625rem;
}

.tg-chat__bubble blockquote {
	margin: 0 0 0.625rem;
	padding: 0.375rem 0.75rem;
	border-inline-start: 3px solid var(--wp--preset--color--navy);
	border-radius: 4px;
	background: var(--wp--preset--color--gray-50);
}

.tg-chat__link {
	color: var(--wp--preset--color--navy);
	font-weight: 600;
}

.tg-chat__time {
	position: absolute;
	inset-inline-end: 0.75rem;
	inset-block-end: 0.375rem;
	color: var(--wp--preset--color--gray-600);
	font-size: 0.6875rem;
}

/* Fact lists with amber check marks: Under the hood and Work with me. */
.check-list {
	display: grid;
	gap: 0.625rem;
	margin-inline: 0;
	padding: 0;
	list-style: none;
}

.check-list li {
	position: relative;
	padding-inline-start: 1.625rem;
}

.check-list li::before {
	content: "";
	position: absolute;
	inset-inline-start: 0.125rem;
	inset-block-start: 0.45em;
	width: 0.7rem;
	height: 0.4rem;
	border-inline-start: 2px solid var(--wp--preset--color--amber-dark);
	border-block-end: 2px solid var(--wp--preset--color--amber-dark);
	transform: rotate(-45deg);
}

.check-list--dark li::before {
	border-color: var(--wp--preset--color--amber);
}

/* Demo and contact sections: on wide screens the text column stays in view beside the longer form. Block supports cannot make a column sticky. */
@media (min-width: 782px) {
	.sticky-intro {
		position: sticky;
		top: var(--wp--preset--spacing--40);
		align-self: flex-start;
	}
}

/* Phones: the name, menu button, and the header button share one row, and the two hero buttons fit side by side. */
@media (max-width: 599px) {
	.site-header__actions {
		gap: var(--wp--preset--spacing--20);
	}

	.wp-block-site-title,
	.wp-block-button__link {
		white-space: nowrap;
	}

	.wp-block-button__link {
		padding-inline: 1rem;
	}

	.site-header__actions .wp-block-button__link {
		padding: 0.6rem 0.875rem;
		font-size: var(--wp--preset--font-size--small);
	}

	.site-header__actions .wp-block-button__link::after {
		content: none;
	}

	.wp-block-buttons {
		gap: 0.75rem;
	}

	.form-card {
		padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--20) !important;
	}
}

/* The mobile menu overlay: large tap targets and the site's own type instead of the core defaults.
   The desktop menu is right-aligned; the open overlay reads better left-aligned, like the rest of the page. */
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	align-items: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--20);
	background-color: var(--wp--preset--color--paper);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start;
	padding-top: var(--wp--preset--spacing--50);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	padding: var(--wp--preset--spacing--10) 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	justify-content: center;
}
