/*
Theme Name: Kindred
Description: A single-page block theme for social and matchmaking communities. The landing page and the sign-up / log-in card live on one screen. The forms are a front-end demo: submitting either shows a bot verification notice and sends nothing to a server.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kindred
Tags: one-column, full-site-editing, block-patterns, block-styles, style-variations, custom-colors, editor-style, wide-blocks
*/

/*
 * Only styles theme.json cannot express live here: interactive components
 * (tabs, form controls, toast) and motion. Every value reads from a
 * theme.json custom property so style variations apply.
 */

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

html {
	scroll-padding-top: var(--wp--custom--header-offset);
}

@media (prefers-reduced-motion: no-preference) {

	html {
		scroll-behavior: smooth;
	}
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

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

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

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

.kindred-site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0);
	z-index: 50;
}

/* Blur lives on a pseudo-element so the header never becomes a containing
 * block for fixed-position descendants. */
.kindred-site-header::before {
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	backdrop-filter: blur(14px) saturate(1.4);
	background: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent);
	border-bottom: 1px solid var(--wp--preset--color--border);
	content: "";
	inset: 0;
	position: absolute;
	z-index: -1;
}

@media (max-width: 600px) {

	.kindred-site-header {
		top: 0;
	}
}

.kindred-brand a {
	align-items: center;
	display: inline-flex;
	gap: 0.55rem;
}

.kindred-brand a::before {
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 20.5s-7.5-4.6-7.5-10.6A4.3 4.3 0 0 1 12 7.3a4.3 4.3 0 0 1 7.5 2.6c0 6-7.5 10.6-7.5 10.6Z'/%3E%3C/svg%3E") center / 58% no-repeat,
		var(--wp--preset--gradient--brand);
	border-radius: var(--wp--custom--radius--sm);
	content: "";
	flex: none;
	height: 1.9rem;
	width: 1.9rem;
}

.kindred-button-compact .wp-block-button__link {
	font-size: var(--wp--preset--font-size--small);
	padding: 0.55rem 1.1rem;
}

.kindred-button-compact.is-style-outline .wp-block-button__link {
	padding: calc(0.55rem - 1.5px) calc(1.1rem - 1.5px);
}

@media (max-width: 480px) {

	.kindred-header-login {
		display: none;
	}
}

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

.kindred-hero-photo {
	margin: 0;
}

.kindred-hero-photo img {
	aspect-ratio: 4 / 5;
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--float);
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.kindred-hero-form > * {
	max-width: 32rem;
}

.kindred-hero-form h1 {
	margin-block: 0;
}

.kindred-hero-form h1 em {
	color: var(--wp--preset--color--primary);
	font-style: italic;
	font-weight: 500;
}

.kindred-hero-form .kindred-auth {
	margin-block-start: var(--wp--preset--spacing--40);
}

/*
 * Stacked layout for phones and portrait tablets: headline and form first,
 * centred, photo after at the same width. Core only stacks columns below
 * 782px and enforces it with !important, so the hero overrides it up to 1023px.
 */
@media (max-width: 1023px) {

	.kindred-hero .wp-block-columns {
		flex-wrap: wrap !important;
	}

	.kindred-hero .wp-block-column {
		flex-basis: 100% !important;
	}

	.kindred-hero-form {
		order: -1;
	}

	.kindred-hero-form > *,
	.kindred-hero-photo {
		margin-inline: auto;
		max-width: 32rem;
	}

	.kindred-hero-form > h1,
	.kindred-hero-form > p {
		text-align: center;
	}
}

/* -------------------------------------------------------------------------
 * Auth card
 * ---------------------------------------------------------------------- */

.kindred-auth {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--float);
	box-sizing: border-box;
	padding: var(--wp--preset--spacing--50);
}

/* Tabs */

.kindred-tabs {
	background: var(--wp--preset--color--tint);
	border-radius: var(--wp--custom--radius--pill);
	display: grid;
	gap: 4px;
	grid-template-columns: 1fr 1fr;
	margin-bottom: var(--wp--preset--spacing--40);
	padding: 4px;
}

.kindred-tabs__tab {
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	padding: 0.6rem 1rem;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.kindred-tabs__tab:hover {
	color: var(--wp--preset--color--contrast);
}

.kindred-tabs__tab[aria-selected="true"] {
	background: var(--wp--preset--color--surface);
	box-shadow: 0 1px 3px color-mix(in srgb, var(--wp--preset--color--contrast) 16%, transparent);
	color: var(--wp--preset--color--contrast);
}

.kindred-auth .kindred-panel__title {
	font-size: var(--wp--preset--font-size--large);
	margin: 0;
}

/* Form controls */

.kindred-form {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--30);
}

.kindred-field label {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	margin-bottom: 0.35rem;
}

.kindred-field__hint {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

.kindred-field input,
.kindred-field select {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--field);
	border-radius: var(--wp--custom--radius--md);
	box-sizing: border-box;
	color: var(--wp--preset--color--contrast);
	font-family: inherit;
	font-size: max(16px, var(--wp--preset--font-size--medium));
	line-height: 1.4;
	padding: 0.68rem 0.9rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	width: 100%;
}

.kindred-field select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238F8499' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-position: right 0.8rem center;
	background-repeat: no-repeat;
	background-size: 1.1rem;
	cursor: pointer;
	padding-right: 2.4rem;
}

.kindred-field input:hover,
.kindred-field select:hover {
	border-color: var(--wp--preset--color--muted);
}

.kindred-field input:focus,
.kindred-field select:focus {
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 24%, transparent);

	/* Transparent outline keeps a visible ring in forced-colors mode. */
	outline: 2px solid transparent;
}

.kindred-field input:user-invalid,
.kindred-field select:user-invalid {
	border-color: var(--wp--preset--color--primary);
}

.kindred-field-row {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

/* Password reveal */

.kindred-password {
	position: relative;
}

.kindred-password input {
	padding-right: 3rem;
}

.kindred-password__toggle {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: var(--wp--custom--radius--sm);
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	display: inline-flex;
	height: 2.25rem;
	justify-content: center;
	position: absolute;
	right: 0.4rem;
	top: 50%;
	transform: translateY(-50%);
	width: 2.25rem;
}

.kindred-password__toggle:hover {
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--contrast);
}

.kindred-icon-eye__slash {
	display: none;
}

.kindred-password__toggle[aria-pressed="true"] .kindred-icon-eye__slash {
	display: inline;
}

/* Checkbox */

.kindred-check {
	align-items: flex-start;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	display: flex;
	font-size: var(--wp--preset--font-size--small);
	gap: 0.6rem;
	line-height: 1.45;
}

.kindred-check input {
	accent-color: var(--wp--preset--color--primary);
	flex: none;
	height: 1.1rem;
	margin: 0.1rem 0 0;
	width: 1.1rem;
}

.kindred-form__meta {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	font-size: var(--wp--preset--font-size--small);
	gap: 0.5rem;
	justify-content: space-between;
}

.kindred-form__meta a {
	font-weight: 700;
}

.kindred-form__meta .kindred-check {
	align-items: center;
}

.kindred-form__meta .kindred-check input {
	margin: 0;
}

/* Submit */

.kindred-submit {
	align-items: center;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	gap: 0.6rem;
	justify-content: center;
	min-height: 3.1rem;
	transition: background-color 0.2s ease, transform 0.2s ease;
	width: 100%;
}

.kindred-submit:hover {
	transform: translateY(-1px);
}

.kindred-submit.is-busy {
	cursor: progress;
	transform: none;
}

.kindred-submit.is-busy::before {
	animation: kindred-spin 0.7s linear infinite;
	border: 2px solid currentcolor;
	border-radius: 50%;
	border-right-color: transparent;
	content: "";
	height: 1rem;
	width: 1rem;
}

.kindred-secure {
	align-items: center;
	color: var(--wp--preset--color--muted);
	display: flex;
	font-size: var(--wp--preset--font-size--small);
	gap: 0.4rem;
	justify-content: center;
	margin: var(--wp--preset--spacing--30) 0 0;
}

.kindred-secure svg {
	color: var(--wp--preset--color--accent);
	flex: none;
}

/* -------------------------------------------------------------------------
 * Features
 * ---------------------------------------------------------------------- */

.kindred-feature-icon {
	align-items: center;
	background: var(--wp--preset--color--tint);
	border-radius: var(--wp--custom--radius--md);
	color: var(--wp--preset--color--primary);
	display: inline-flex;
	height: 3rem;
	justify-content: center;
	width: 3rem;
}

/* -------------------------------------------------------------------------
 * Toast
 * ---------------------------------------------------------------------- */

.kindred-toast-host {
	bottom: max(1rem, env(safe-area-inset-bottom));
	display: flex;
	justify-content: center;
	left: 0;
	padding-inline: 1rem;
	pointer-events: none;
	position: fixed;
	right: 0;
	z-index: 100000;
}

@media (min-width: 600px) {

	.kindred-toast-host {
		bottom: 1.5rem;
		justify-content: flex-end;
		padding-inline: 1.5rem;
	}
}

.kindred-toast {
	align-items: start;
	animation: kindred-toast-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
	background: var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--md);
	box-shadow: var(--wp--preset--shadow--float);
	box-sizing: border-box;
	color: var(--wp--preset--color--base);
	display: grid;
	gap: 0.85rem;
	grid-template-columns: auto 1fr auto;
	overflow: hidden;
	padding: 1rem 0.75rem 1.15rem 1rem;
	pointer-events: auto;
	position: relative;
	width: min(25rem, 100%);
}

.kindred-toast.is-leaving {
	animation: kindred-toast-out 0.25s ease forwards;
}

.kindred-toast__icon {
	background: var(--wp--preset--color--primary);
	border-radius: 50%;
	height: 2.25rem;
	position: relative;
	width: 2.25rem;
}

.kindred-toast__icon::before,
.kindred-toast__close::before {
	background: currentcolor;
	content: "";
	inset: 0;
	margin: auto;
	-webkit-mask: var(--kindred-mask) center / contain no-repeat;
	mask: var(--kindred-mask) center / contain no-repeat;
	position: absolute;
}

.kindred-toast__icon::before {
	--kindred-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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.5-3 8.3-7 10-4-1.7-7-5.5-7-10V6l7-3Z'/%3E%3Cpath d='m9.5 9.5 5 5m0-5-5 5'/%3E%3C/svg%3E");
	color: var(--wp--preset--color--on-primary);
	height: 1.2rem;
	width: 1.2rem;
}

.kindred-toast__title {
	font-weight: 800;
	line-height: 1.3;
	margin: 0.1rem 0 0;
}

.kindred-toast__message {
	color: color-mix(in srgb, var(--wp--preset--color--base) 80%, var(--wp--preset--color--contrast));
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
	margin: 0.2rem 0 0;
}

.kindred-toast__close {
	background: transparent;
	border: 0;
	border-radius: var(--wp--custom--radius--sm);
	color: inherit;
	cursor: pointer;
	height: 2rem;
	opacity: 0.75;
	position: relative;
	width: 2rem;
}

.kindred-toast__close::before {
	--kindred-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.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
	height: 1rem;
	width: 1rem;
}

.kindred-toast__close:hover {
	background: color-mix(in srgb, var(--wp--preset--color--base) 14%, transparent);
	opacity: 1;
}

.kindred-toast__close:focus-visible {
	opacity: 1;
	outline-color: var(--wp--preset--color--base);
}

.kindred-toast__progress {
	animation: kindred-toast-progress var(--kindred-toast-duration, 6s) linear forwards;
	background: var(--wp--preset--color--primary);
	bottom: 0;
	height: 3px;
	left: 0;
	position: absolute;
	transform-origin: left;
	width: 100%;
}

.kindred-toast.is-paused .kindred-toast__progress {
	animation-play-state: paused;
}

/* -------------------------------------------------------------------------
 * Motion
 * ---------------------------------------------------------------------- */

@keyframes kindred-spin {

	to {
		transform: rotate(360deg);
	}
}

@keyframes kindred-toast-in {

	from {
		opacity: 0;
		transform: translateY(1rem) scale(0.97);
	}
}

@keyframes kindred-toast-out {

	to {
		opacity: 0;
		transform: translateY(0.5rem) scale(0.98);
	}
}

@keyframes kindred-toast-progress {

	from {
		transform: scaleX(1);
	}

	to {
		transform: scaleX(0);
	}
}

@media (prefers-reduced-motion: reduce) {

	.kindred-toast,
	.kindred-toast.is-leaving {
		animation: none;
	}

	.kindred-toast__progress {
		display: none;
	}

	.kindred-submit:hover {
		transform: none;
	}
}
