/**
 * In The Kibble: recall desk (checker, alerts, recall history).
 *
 * Same constraint as the rest of this site's CSS: Tailwind runs with
 * `corePlugins.preflight = false` and Bootstrap 5's Reboot no longer ships a
 * global `img` rule, so nothing sets `max-width: 100%` on its own. Every rule
 * here is scoped to an `itk-` block so it cannot leak, and every block declares
 * its own box-sizing rather than assuming a reset ran.
 *
 * Palette is taken from assets/css/recalls.css in the theme so the desk and the
 * recall archive read as one thing.
 */

.itk-checker,
.itk-alerts,
.itk-recall-history {
	--itk-red: #f15152;
	--itk-red-deep: #a4262c;
	--itk-blue: #1c5a94;
	--itk-blue-soft: #e6f1fb;
	--itk-ink: #1c2431;
	--itk-muted: #6b7482;
	--itk-line: #e4e7ec;
	--itk-bg-soft: #f7f8fa;
	--itk-amber: #8a5a00;
	--itk-amber-soft: #fdf1dc;
	--itk-green: #1f6b45;
	--itk-green-soft: #e8f5ee;

	box-sizing: border-box;
	color: var(--itk-ink);
	font-size: 16px;
	line-height: 1.55;
}

.itk-checker *,
.itk-alerts *,
.itk-recall-history * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ checker */

.itk-checker {
	background: var(--itk-blue-soft);
	border: 1px solid #cde1f5;
	border-radius: 10px;
	margin: 0 auto 2.5rem;
	max-width: 940px;
	padding: 1.75rem 1.25rem;
}

.itk-checker-inner {
	margin: 0 auto;
	max-width: 640px;
}

.itk-checker-title {
	color: var(--itk-blue);
	font-size: 1.6rem;
	line-height: 1.2;
	margin: 0 0 0.4rem;
	text-wrap: balance;
}

.itk-checker-sub {
	color: var(--itk-muted);
	font-size: 0.95rem;
	margin: 0 0 1.1rem;
}

.itk-checker-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.itk-checker-input {
	background: #fff;
	border: 1px solid #b8d3ec;
	border-radius: 8px;
	color: var(--itk-ink);
	flex: 1 1 16rem;
	font-size: 1rem;
	min-width: 0;
	padding: 0.7rem 0.9rem;
}

.itk-checker-input:focus-visible,
.itk-alerts-input:focus-visible {
	outline: 2px solid var(--itk-blue);
	outline-offset: 1px;
}

.itk-checker-button,
.itk-alerts-button {
	background: var(--itk-blue);
	border: 0;
	border-radius: 8px;
	color: #fff;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 600;
	padding: 0.7rem 1.4rem;
}

.itk-checker-button:hover,
.itk-alerts-button:hover {
	background: #16496f;
}

.itk-alerts-button:disabled {
	cursor: default;
	opacity: 0.6;
}

/* ------------------------------------------------------------- verdict */

.itk-checker-results {
	margin-top: 1.25rem;
}

.itk-checker-note {
	color: var(--itk-muted);
	font-size: 0.95rem;
	margin: 0;
}

.itk-checker-note--error {
	color: var(--itk-red-deep);
}

.itk-checker-verdict {
	border-radius: 8px;
	padding: 1rem 1.1rem;
}

.itk-checker-verdict--clear {
	background: var(--itk-green-soft);
	border-left: 4px solid var(--itk-green);
}

.itk-checker-verdict--found {
	background: #fff6f6;
	border-left: 4px solid var(--itk-red);
}

.itk-checker-verdict-head {
	font-size: 1.12rem;
	font-weight: 650;
	margin: 0;
}

.itk-checker-verdict--clear .itk-checker-verdict-head {
	color: var(--itk-green);
}

.itk-checker-verdict--found .itk-checker-verdict-head {
	color: var(--itk-red-deep);
}

.itk-checker-verdict-body {
	margin: 0.5rem 0 0;
}

.itk-checker-brand-link {
	color: var(--itk-blue);
	font-weight: 600;
}

/*
 * The caveat is not fine print. A clear result is the most likely answer and
 * the most dangerous one to overstate, so it stays legible rather than being
 * shrunk to a disclaimer.
 */
.itk-checker-caveat {
	color: var(--itk-muted);
	font-size: 0.86rem;
	margin: 0.6rem 0 0;
}

.itk-checker-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
}

.itk-checker-item {
	background: #fff;
	border: 1px solid var(--itk-line);
	border-radius: 8px;
	padding: 0.85rem 1rem;
}

.itk-checker-item-title {
	color: var(--itk-ink);
	display: block;
	font-weight: 620;
	margin-top: 0.4rem;
	text-decoration: none;
}

.itk-checker-item-title:hover {
	text-decoration: underline;
}

.itk-checker-item-meta {
	color: var(--itk-muted);
	font-size: 0.88rem;
	margin: 0.3rem 0 0;
}

.itk-checker-item-why {
	color: var(--itk-muted);
	font-size: 0.8rem;
	font-style: italic;
	margin: 0.25rem 0 0;
}

/* -------------------------------------------------------------- badges */

.itk-recall-badge {
	border-radius: 999px;
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 0.2rem 0.6rem;
	text-transform: uppercase;
	white-space: nowrap;
}

.itk-recall-badge--contamination {
	background: #fde8e8;
	color: var(--itk-red-deep);
}

.itk-recall-badge--foreign {
	background: var(--itk-amber-soft);
	color: var(--itk-amber);
}

.itk-recall-badge--nutrient {
	background: var(--itk-blue-soft);
	color: var(--itk-blue);
}

.itk-recall-badge--other {
	background: #eceef1;
	color: var(--itk-muted);
}

/* -------------------------------------------------------------- alerts */

.itk-alerts {
	background: var(--itk-bg-soft);
	border: 1px solid var(--itk-line);
	border-radius: 10px;
	margin: 1.75rem 0 0;
	padding: 1.4rem 1.25rem;
}

.itk-alerts-title {
	font-size: 1.2rem;
	margin: 0 0 0.35rem;
}

.itk-alerts-sub {
	color: var(--itk-muted);
	font-size: 0.92rem;
	margin: 0 0 1rem;
}

.itk-alerts-form {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
}

.itk-alerts-input {
	background: #fff;
	border: 1px solid #c9ced7;
	border-radius: 8px;
	font-size: 1rem;
	padding: 0.65rem 0.85rem;
	width: 100%;
}

.itk-alerts-scope {
	border: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.2rem;
	margin: 0;
	padding: 0;
}

.itk-alerts-scope label {
	align-items: center;
	display: flex;
	font-size: 0.93rem;
	gap: 0.35rem;
}

.itk-alerts-button {
	align-self: flex-start;
}

.itk-alerts-message {
	font-size: 0.92rem;
	margin: 0;
	min-height: 1.2em;
}

.itk-alerts-message--ok {
	color: var(--itk-green);
}

.itk-alerts-message--error {
	color: var(--itk-red-deep);
}

/* The honeypot must be reachable by a bot and invisible to everyone else. */
.itk-hp {
	height: 0;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 0;
}

/* ------------------------------------------------------- recall history */

.itk-recall-history {
	border-top: 1px solid var(--itk-line);
	margin: 2.5rem 0 0;
	padding-top: 1.5rem;
}

.itk-recall-history-title {
	font-size: 1.3rem;
	margin: 0 0 0.6rem;
}

.itk-recall-history-clear {
	background: var(--itk-green-soft);
	border-left: 4px solid var(--itk-green);
	border-radius: 6px;
	margin: 0;
	padding: 0.85rem 1rem;
}

.itk-recall-history-caveat {
	color: var(--itk-muted);
	display: block;
	font-size: 0.85rem;
	margin-top: 0.35rem;
}

.itk-recall-history-count {
	color: var(--itk-red-deep);
	font-weight: 620;
	margin: 0 0 0.75rem;
}

.itk-recall-history-list {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.itk-recall-history-item {
	align-items: baseline;
	border-bottom: 1px solid var(--itk-line);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding-bottom: 0.6rem;
}

.itk-recall-history-item:last-child {
	border-bottom: 0;
}

.itk-recall-history-item a {
	color: var(--itk-ink);
	flex: 1 1 18rem;
	font-weight: 560;
	min-width: 0;
	text-decoration: none;
}

.itk-recall-history-item a:hover {
	text-decoration: underline;
}

.itk-recall-history-item time {
	color: var(--itk-muted);
	font-size: 0.85rem;
	white-space: nowrap;
}

/* ------------------------------------------------------------- notices */

.itk-alert-notice {
	border-radius: 8px;
	margin: 0 auto 1.5rem;
	max-width: 940px;
	padding: 0.9rem 1.1rem;
}

.itk-alert-notice--ok {
	background: var(--itk-green-soft);
	border-left: 4px solid var(--itk-green);
	color: var(--itk-green);
}

.itk-alert-notice--bad {
	background: #fff6f6;
	border-left: 4px solid var(--itk-red);
	color: var(--itk-red-deep);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 640px) {
	.itk-checker {
		padding: 1.25rem 1rem;
	}

	.itk-checker-title {
		font-size: 1.35rem;
	}

	.itk-checker-button,
	.itk-alerts-button {
		width: 100%;
	}
}
