/**
 * In The Kibble — homepage facelift
 *
 * Tailwind runs with `corePlugins.preflight = false` (see assets/js/tailwind-config.js)
 * and Bootstrap 5's Reboot no longer ships a global `img` rule, so nothing on the page
 * applies `max-width: 100%` / `height: auto`. That is why images render at their raw
 * attribute size and stretch. Everything below is scoped to `.itk-home` so the rest of
 * the site keeps its current behaviour.
 */

/* ---------------------------------------------------------------- base reset */

.itk-home img,
.itk-home svg,
.itk-home video {
	max-width: 100%;
	height: auto;
}

.itk-home a {
	text-decoration: none;
	color: inherit;
}

.itk-home a:hover {
	text-decoration: none;
}

/* ---------------------------------------------------------------- cards */

/* Vertical card: the packaging shot is the hero, text is the caption. */
.itk-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid rgb(226 232 240 / 0.9);
	border-radius: 1rem;
	box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.itk-card:hover {
	transform: translateY(-3px);
	border-color: rgb(251 191 36 / 0.8);
	box-shadow: 0 14px 30px -10px rgb(120 53 15 / 0.22);
}

.itk-card:focus-visible {
	outline: 2px solid #ea580c;
	outline-offset: 2px;
}

/* Square well, object-fit: contain — keeps tall bags and wide cans uncropped while
   they still occupy the same footprint in the grid.
   The well stays white on purpose: the supplier product shots have white backgrounds
   baked into the JPEG, so any tint here would show as a hard white rectangle behind
   the packaging. The warm tint lives on the card's hover state instead. */
.itk-card-media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: #fff;
	overflow: hidden;
}

.itk-home .itk-card-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 1.125rem;
	object-fit: contain;
	transition: transform 0.28s ease;
}

.itk-card:hover .itk-card-media img {
	transform: scale(1.06);
}

.itk-card-body {
	display: block;
	padding: 0.875rem 1rem 1.125rem;
	border-top: 1px solid #f5f5f4;
}

.itk-card-brand {
	display: block;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #b45309;
	margin: 0 0 0.25rem;
}

.itk-card-title {
	display: -webkit-box;
	font-size: 0.9375rem;
	line-height: 1.4;
	color: #1f2937;
	margin: 0;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.itk-card:hover .itk-card-title {
	color: #9a3412;
}

/* ---------------------------------------------------------------- section headings */

.itk-eyebrow {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #b45309;
	margin: 0 0 0.25rem;
}

.itk-section-title {
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	line-height: 1.15;
	color: #1c1917;
	margin: 0;
}

/* ---------------------------------------------------------------- category tiles */

/* The illustrations deliberately overhang the top of their tile. Reserve the space on
   the tile itself so the negative margin never collides with the section above. */
.itk-cat-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 0 1.5rem 1.75rem;
	margin-top: 4.5rem;
	background: #ffedd5;
	border-radius: 1.25rem;
	transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.itk-cat-tile:hover {
	transform: translateY(-4px);
	background: #fff7ed;
	box-shadow: 0 16px 32px -12px rgb(124 45 18 / 0.28);
}

.itk-cat-tile img {
	width: 190px;
	margin-top: -4rem;
	filter: drop-shadow(0 10px 18px rgb(124 45 18 / 0.22));
}

.itk-cat-tile h3 {
	font-family: "Luckiest Guy", cursive;
	font-size: 1.5rem;
	letter-spacing: 0.01em;
	color: #1c1917;
	margin: 0.75rem 0 0.375rem;
}

.itk-cat-tile p {
	font-size: 0.9375rem;
	line-height: 1.5;
	color: #57534e;
	margin: 0;
	max-width: 24ch;
}

/* ---------------------------------------------------------------- recalls table */

.itk-recalls {
	width: 100%;
	border-collapse: collapse;
}

.itk-recalls th {
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #78716c;
	text-align: left;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #e7e5e4;
}

.itk-recalls td {
	padding: 0.875rem 1rem;
	font-size: 0.875rem;
	color: #44403c;
	border-bottom: 1px solid #f5f5f4;
	vertical-align: top;
}

.itk-recalls tbody tr:last-child td {
	border-bottom: 0;
}

.itk-recalls tbody tr {
	transition: background-color 0.15s ease;
}

.itk-recalls tbody tr:hover {
	background: #fffbeb;
}

.itk-recalls .itk-recall-date {
	white-space: nowrap;
	font-weight: 600;
	color: #1c1917;
}

.itk-recalls .itk-recall-reason {
	color: #c2410c;
	font-weight: 500;
}

.itk-recalls tbody tr:hover .itk-recall-reason {
	text-decoration: underline;
}

/* ---------------------------------------------------------------- hero */

.itk-hero-title {
	font-family: "Luckiest Guy", cursive;
	text-transform: uppercase;
	line-height: 0.95;
	letter-spacing: 0.005em;
	color: #1c1917;
	font-size: clamp(2.5rem, 6.5vw, 4.5rem);
	margin: 0 0 1.25rem;
}

.itk-hero-title .itk-hero-accent {
	color: #f97316;
}

.itk-hero-sub {
	font-size: clamp(1rem, 1.4vw, 1.125rem);
	line-height: 1.6;
	color: #57534e;
	max-width: 44ch;
	margin: 0 auto;
}

/* The AJAX search plugin renders its own fixed-width shell; let it fill the hero slot. */
.itk-hero-search {
	max-width: 36rem;
	margin: 2rem auto 0;
}

.itk-hero-search #search-bar,
.itk-hero-search .asp_w_container,
.itk-hero-search .asp_w {
	width: 100% !important;
	max-width: 100% !important;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 767.98px) {
	.itk-cat-tile {
		margin-top: 4rem;
	}

	.itk-cat-tile img {
		width: 150px;
		margin-top: -3.25rem;
	}

	.itk-home .itk-card-media img {
		padding: 0.875rem;
	}

	/* Cards are ~150px wide two-up, so shrink the type and allow an extra line
	   rather than truncating most product names to three words. */
	.itk-card-body {
		padding: 0.75rem 0.75rem 0.875rem;
	}

	.itk-card-title {
		font-size: 0.8125rem;
		line-height: 1.35;
		-webkit-line-clamp: 4;
	}
}
