/* 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);
}

.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[type="file"] {
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
}

.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"]),
.kc-field--invalid select,
.kc-field--invalid textarea {
	border-color: #a1271a;
	border-width: 2px;
}

.kc-field--invalid {
	padding-left: 1rem;
	border-left: 4px solid #a1271a;
}

.kc-checks {
	display: grid;
	gap: 0.5rem;
}

.kc-check {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	line-height: 1.4;
}

.kc-check input {
	flex: none;
	width: 1.375rem;
	height: 1.375rem;
	margin: 0.0625rem 0 0;
	accent-color: var(--wp--preset--color--teal);
}

.kc-check label {
	padding-block: 0.0625rem;
}

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

.kc-button,
.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,
.kc-form button[type="submit"]:hover,
.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-link-button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--teal);
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 0.18em;
	cursor: pointer;
}

.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__title {
	margin: 0 0 0.5rem;
	color: #a1271a;
	font-size: var(--wp--preset--font-size--large);
}

.kc-error-summary ul {
	margin: 0;
	padding-left: 1.25rem;
}

.kc-error-summary a {
	color: #a1271a;
	font-weight: 700;
}

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

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

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

.kc-notice--success {
	border-left: 6px solid var(--wp--preset--color--teal);
	background: var(--wp--preset--color--teal-soft);
}

.kc-notice--info {
	border-left: 6px solid var(--wp--preset--color--yellow);
	background: var(--wp--preset--color--yellow-soft);
}

.kc-notice--error {
	border-left: 6px solid #a1271a;
	background: #fbe9e7;
}

.kc-error-summary:focus,
.kc-notice:focus {
	outline: 3px solid var(--wp--preset--color--teal);
	outline-offset: 3px;
}

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

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

.kc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}

.kc-table th,
.kc-table td {
	padding: 0.75rem 0.5rem;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
	vertical-align: top;
}

.kc-table th {
	color: var(--wp--preset--color--navy);
	font-weight: 700;
}

.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;
}
