/* Shared components for Kindred blocks: forms, notices, cards, and tags. */

.kc-form {
	display: grid;
	gap: 1.5rem;
}

.kc-form__section {
	display: grid;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	border: 0;
}

.kc-form__section > legend,
.kc-form__section-title {
	margin-bottom: 0;
	padding: 0;
	color: var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--caudex);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.25;
}

.kc-form__section > legend {
	float: left;
	width: 100%;
}

.kc-form__section + .kc-form__section {
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--line);
}

.kc-field {
	display: grid;
	gap: 0.375rem;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.kc-field__label {
	padding: 0;
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 400;
	line-height: 1.4;
}

fieldset.kc-field > .kc-field__label {
	margin-bottom: 0.25rem;
}

.kc-field__optional {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	white-space: nowrap;
}

.kc-field__hint {
	margin: 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
}

.kc-field__hint--inline {
	display: block;
	margin-top: 0.125rem;
}

.kc-field__error {
	margin: 0;
	color: #a1271a;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.45;
}

.kc-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.kc-field select,
.kc-field textarea,
.kc-input {
	box-sizing: border-box;
	width: 100%;
	min-height: 3rem;
	padding: 0.625rem 0.875rem;
	border: 1.5px solid #7c9198;
	border-radius: 10px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: 1.0625rem;
	line-height: 1.4;
}

.kc-field select,
select.kc-input {
	padding-right: 2.75rem;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23214551' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 0.75rem;
}

.kc-field textarea {
	min-height: 8rem;
	resize: vertical;
}

.kc-field input[inputmode="numeric"] {
	max-width: 8rem;
}

.kc-field--file {
	grid-template-columns: minmax(0, 1fr);
}

.kc-field input[type="file"] {
	max-width: 100%;
	color: var(--wp--preset--color--muted);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
}

.kc-field input[type="file"]::file-selector-button {
	min-height: 2.75rem;
	margin-right: 0.75rem;
	padding: 0.5rem 1.25rem;
	border: 2px solid var(--wp--preset--color--navy);
	border-radius: 50px;
	background: transparent;
	color: var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--caudex);
	font-size: 1.1875rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}

.kc-field input[type="file"]:hover::file-selector-button {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

.kc-field input:focus-visible,
.kc-field select:focus-visible,
.kc-field textarea:focus-visible,
.kc-input:focus-visible {
	outline: 3px solid var(--wp--preset--color--teal);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--navy);
}

.kc-field--invalid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.kc-field--invalid select,
.kc-field--invalid textarea {
	border-color: #a1271a;
	border-width: 2px;
}

.kc-checks {
	display: grid;
}

.kc-check {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	min-height: 2.75rem;
	padding-block: 0.625rem;
	box-sizing: border-box;
	line-height: 1.4;
}

.kc-check input {
	position: relative;
	z-index: 1;
	flex: none;
	width: 1.5rem;
	height: 1.5rem;
	margin: 0;
	accent-color: var(--wp--preset--color--teal);
}

.kc-check label {
	flex: 1;
	cursor: pointer;
}

.kc-check label::before {
	content: "";
	position: absolute;
	inset: 0;
}

.kc-check label a {
	position: relative;
	z-index: 1;
}

@media (min-width: 700px) {
	.kc-checks:has(> .kc-check:nth-child(6)) {
		display: block;
		columns: 2 16rem;
		column-gap: 1.5rem;
	}

	.kc-checks:has(> .kc-check:nth-child(6)) > .kc-check {
		break-inside: avoid;
	}
}

.kc-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
}

.kc-form__status {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
}

.kc-form__status:empty {
	position: absolute;
}

@media (max-width: 599px) {
	.kc-form__status {
		flex-basis: 100%;
	}
}

.kc-form button[aria-disabled="true"] {
	box-shadow: inset 0 0 0 100vmax rgb(0 0 0 / 0.12);
	cursor: progress;
}

.kc-form__fixed {
	margin: 0;
	color: var(--wp--preset--color--ink);
	font-size: 1.0625rem;
	line-height: 1.4;
}

.kc-button,
:where(.kc-form button[type="submit"]) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 3rem;
	padding: 0.5rem 1.75rem;
	border: 0;
	border-radius: 50px;
	background: var(--wp--preset--color--orange);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--caudex);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.kc-button:hover,
.kc-button:focus-visible,
:where(.kc-form button[type="submit"]):hover,
:where(.kc-form button[type="submit"]):focus-visible {
	background: #b4631f;
	color: var(--wp--preset--color--white);
}

.kc-button--navy {
	background: var(--wp--preset--color--navy);
}

.kc-button--navy:hover,
.kc-button--navy:focus-visible {
	background: var(--wp--preset--color--navy-deep);
}

.kc-button--outline {
	border: 2px solid var(--wp--preset--color--navy);
	background: transparent;
	color: var(--wp--preset--color--navy);
}

.kc-button--outline:hover,
.kc-button--outline:focus-visible {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

.kc-button--small {
	min-height: 2.75rem;
	padding-inline: 1.25rem;
	font-size: 1.1875rem;
}

.kc-button:focus-visible,
.kc-form button:focus-visible {
	outline: 3px solid var(--wp--preset--color--teal);
	outline-offset: 3px;
}

.kc-error-summary,
.kc-notice {
	padding: 1.25rem 1.5rem;
	border-radius: 10px;
	background: var(--wp--preset--color--white);
}

.kc-error-summary {
	border: 3px solid #a1271a;
}

.kc-error-summary .kc-error-summary__title {
	margin: 0 0 0.5rem;
	color: #a1271a;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 400;
	line-height: 1.25;
}

.kc-error-summary ul {
	margin: 0;
	padding-left: 1.25rem;
	color: #a1271a;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
}

.kc-error-summary ul > li + li {
	margin-top: 0.25rem;
}

.kc-error-summary a {
	color: #a1271a;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.kc-notice > :first-child {
	margin-top: 0;
}

.kc-notice > :last-child {
	margin-bottom: 0;
}

.kc-notice > * + * {
	margin-top: 0.75rem;
}

.kc-notice :is(h2, h3, h4) {
	margin-bottom: 0.5rem;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.25;
}

.kc-notice--success {
	border: 3px solid var(--wp--preset--color--teal);
}

.kc-notice--info {
	box-shadow: var(--wp--preset--shadow--soft);
}

.kc-notice--error {
	border: 3px solid #a1271a;
}

[data-kc-focus] {
	scroll-margin-top: 6rem;
}

.kc-error-summary:focus,
.kc-notice:focus {
	outline: none;
}

.kc-donate__frame {
	display: block;
	width: 100%;
	height: 50rem;
	border: 0;
}

.kc-donate__fallback {
	margin: 0.75rem 0 0;
	font-size: var(--wp--preset--font-size--small);
}

.kc-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.kc-card,
.kc-form-wrap > .kc-form,
.kc-join-form {
	padding: clamp(1.25rem, 3vw, 1.75rem);
	border-radius: 10px;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--soft);
}

:is(.kc-card, .kc-panel, .kc-callout, .kc-account__panel) :is(.kc-form-wrap > .kc-form, .kc-join-form) {
	padding: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

.kc-tag {
	display: inline-flex;
	align-items: center;
	padding: 0.125rem 0.625rem;
	border-radius: 50px;
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--navy);
	font-size: 0.875rem;
	font-style: normal;
	line-height: 1.5;
}

.kc-tag--teal { background: var(--wp--preset--color--teal-soft); }
.kc-tag--new { background: var(--wp--preset--color--yellow-soft); }
.kc-tag--closed { background: var(--wp--preset--color--orange-soft); color: #7a3f10; }
.kc-tag--open {
	gap: 0.375rem;
	padding-left: 0;
	background: none;
	color: var(--wp--preset--color--teal);
	font-weight: 700;
}
.kc-tag--open::before {
	content: "";
	flex-shrink: 0;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: currentColor;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
