/* Ingredients */

/* Ingredient image */
.seal {
	position: relative;
	container-type: inline-size;
	aspect-ratio: 1;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: radial-gradient(circle at 50% 36%, #fcf5e2 0%, #efe2c2 72%, #e4d3a8 100%);
	box-shadow: inset 0 0 0 1px rgba(168, 126, 48, 0.35), 0 20px 40px rgba(60, 40, 15, 0.1);
}
.seal::before {
	content: "";
	position: absolute;
	inset: 9%;
	border-radius: 50%;
	background: repeating-radial-gradient(circle at center, transparent 0 6px, rgba(168, 126, 48, 0.16) 6px 7px);
	-webkit-mask-image: radial-gradient(circle, #000 60%, transparent 78%);
	mask-image: radial-gradient(circle, #000 60%, transparent 78%);
}
.seal__ring {
	position: absolute;
	inset: 5%;
	border-radius: 50%;
	border: 1px solid rgba(168, 126, 48, 0.45);
	transition: transform 1.5s var(--ease-out);
}
.seal__photo {
	position: absolute;
	top: 6%;
	left: 6%;
	width: 88%;
	height: 88%;
	z-index: 1;
	border-radius: 50%;
	object-fit: cover;
	-webkit-mask-image: radial-gradient(circle, #000 66%, transparent 86%);
	mask-image: radial-gradient(circle, #000 66%, transparent 86%);
}
.seal__ini {
	position: relative;
	z-index: 1;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 38cqw;
	line-height: 1;
	color: var(--gold-deep);
}
.seal[data-cat="base"] { background: radial-gradient(circle at 50% 36%, #fbf0d8, #e7d2a4 100%); }
.seal[data-cat="citrus"] { background: radial-gradient(circle at 50% 36%, #fdf6d6, #ecd98e 100%); }
.seal[data-cat="fruit"] { background: radial-gradient(circle at 50% 36%, #fbeede, #e8c0a0 100%); }
.seal[data-cat="herb"] { background: radial-gradient(circle at 50% 36%, #f1f2db, #cdd6a4 100%); }
.seal[data-cat="flower"] { background: radial-gradient(circle at 50% 36%, #f6eede, #dcc6b8 100%); }
.seal[data-cat="spice"] { background: radial-gradient(circle at 50% 36%, #f8ecd4, #ddb98a 100%); }

/* Archive layout */
.atlas {
	position: relative;
	z-index: var(--z-content);
	padding-bottom: clamp(40px, 7vw, 80px);
}

/* Family mark */
.fam-mark {
	width: var(--fam-size, 20px);
	height: var(--fam-size, 20px);
	flex: none;
	color: var(--fam-ink, var(--gold-deep));
}

/*
 * Archive index — one row of families that pins to the viewport top (the nav
 * is absolute and scrolls away, so top: 0 is the only gapless anchor). At rest
 * it is bare type on the page; the wash, blur and hairline arrive with .is-stuck.
 * No frame: the container rail belongs outside anything bordered, and an auto
 * row can never leave the ruled gap a fixed column count used to.
 */
.atlas-index {
	position: sticky;
	top: 0;
	z-index: calc(var(--z-nav) - 1);
	margin-top: clamp(10px, 1.6vw, 18px);
	border-bottom: 1px solid transparent;
	transition: background 0.3s, border-color 0.3s;
}
.atlas-index.is-stuck {
	background: rgba(244, 236, 216, 0.82);
	backdrop-filter: blur(10px);
	border-bottom-color: var(--line-gold);
}

.admin-bar .atlas-index { top: var(--wp-admin--admin-bar--height, 32px); }
.admin-bar .atlas-chapter { scroll-margin-top: calc(34px + var(--wp-admin--admin-bar--height, 32px)); }

/* Below 600px the admin bar scrolls away with the page. */
@media (max-width: 600px) {
	.admin-bar .atlas-index { top: 0; }
	.admin-bar .atlas-chapter { scroll-margin-top: 34px; }
}
.atlas-index__in {
	position: relative;
	display: flex;
	flex-wrap: wrap;
}

/* Tabs tile the row edge-to-edge — every pixel of the bar is a hit area. */
.atlas-index__i {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 9px 12px;
	white-space: nowrap;
	opacity: 0.62;
	transition: opacity 0.22s;
}
.atlas-index__i:hover { opacity: 1; color: inherit; }
.atlas-index__i.is-on { opacity: 1; }

/* One gold underline the width of the active tab, slid there by atlas.js. */
.atlas-index__in::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	height: 2px;
	width: calc(var(--bar-w, 0) * 1px);
	transform: translateX(calc(var(--bar-x, 0) * 1px));
	background: var(--gold);
}
.atlas-index.is-tracked .atlas-index__in::after {
	transition: transform 0.32s var(--ease-out), width 0.32s var(--ease-out);
}
.atlas-index__t { font-family: var(--font-display); font-size: 13.5px; letter-spacing: 0.01em; color: var(--ink-soft); }
.atlas-index__i.is-on .atlas-index__t { color: var(--ink); }
.atlas-index__c {
	align-self: flex-start;
	margin-top: 2px;
	font-size: 10px;
	color: var(--gold-deep);
	font-variant-numeric: tabular-nums;
}

/* Below the comb the row would eat the viewport, so it scrolls instead. */
@media (max-width: 899px) {
	.atlas-index__in {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.atlas-index__in::-webkit-scrollbar { display: none; }
}

/* Ingredient family */
.atlas-chapter {
	margin-top: var(--section-y);

	/*
	 * Anchors tuck the ruled chapter top under the stuck comb so the heading
	 * itself lands just beneath it — comfortably past the spy line in atlas.js.
	 */
	scroll-margin-top: 34px;
}

/* The first chapter belongs to the index above it, not a full section away. */
.atlas-index + .atlas-chapter { margin-top: clamp(30px, 4vw, 48px); }

.atlas-chapter__head {
	position: relative;
	border-top: 1px solid rgba(20, 16, 11, 0.2);
	padding-top: 26px;
}

/* The family mark as a watermark on the head's empty right side. */
.atlas-chapter__ghost {
	--fam-size: 132px;
	--fam-ink: var(--ink);
	position: absolute;
	top: 4px;
	right: 0;
	opacity: 0.14;
	pointer-events: none;
}
.atlas-chapter__name { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 5vw, 44px); letter-spacing: 0.03em; color: var(--ink); }
.atlas-chapter__desc { margin: 12px 0 0; font-size: var(--fs-copy); line-height: 1.6; color: var(--ink-mute); max-width: 60ch; }

.atlas-chapter__body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	margin-top: 40px;
}
.atlas-chapter__rest {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	align-content: start;
}

/* Ingredient card */
.atlas-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 24px 18px 22px;
	border: 1px solid var(--card-line);
	border-radius: var(--card-radius);
	background: var(--card-bg);
	box-shadow: var(--card-shadow);
	transition: transform 0.3s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
}
.atlas-item:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--card-shadow-hover); color: inherit; }
.atlas-item .seal { width: 72px; flex-shrink: 0; }
.atlas-item:hover .seal__ring { transform: rotate(38deg); }
.atlas-item__body { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.atlas-item__cat { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-deep); }
.atlas-item__name { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: 0.02em; line-height: 1.2; color: var(--ink); margin-top: 14px; }
.atlas-item__benefit { font-size: 14px; line-height: 1.45; color: var(--burgundy); margin-top: 8px; }
.atlas-item__flavor { font-size: 14px; letter-spacing: 0.02em; line-height: 1.5; color: #8a7e6a; margin-top: 6px; }

.atlas-item--feature {
	padding: 40px 34px;
	border-color: rgba(168, 126, 48, 0.35);
	background: linear-gradient(180deg, #fff 0%, #faf3e3 100%);
	box-shadow: 0 20px 44px rgba(60, 40, 15, 0.07);
}
.atlas-item--feature:hover { border-color: rgba(168, 126, 48, 0.35); box-shadow: 0 34px 60px rgba(60, 40, 15, 0.13); }
.atlas-item--feature .seal { width: clamp(120px, 22vw, 148px); margin-bottom: 22px; }
.atlas-item--feature:hover .seal__ring { transform: rotate(42deg); }
.atlas-item--feature .atlas-item__body { align-items: center; }
.atlas-item--feature .atlas-item__name { font-size: clamp(26px, 4vw, 32px); margin-top: 12px; }
.atlas-item--feature .atlas-item__benefit { font-family: var(--font-slogan); font-style: italic; font-size: var(--fs-slogan-sm); line-height: 1.5; margin-top: 18px; }
.atlas-item__divider { width: 40px; height: 1px; background: rgba(168, 126, 48, 0.6); margin: 20px 0; }
.atlas-item--feature .atlas-item__flavor { font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.atlas-item__more { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep); }
.atlas-item--feature:hover .atlas-item__more { gap: 12px; }

/* Closing link */
.atlas-cta { text-align: center; padding-top: var(--section-y); }
.atlas-cta__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 5vw, 46px); letter-spacing: 0.03em; color: var(--ink); }
.atlas-cta__text { margin: 18px auto 28px; line-height: 1.55; color: var(--ink-soft); max-width: 46ch; }

/* Single ingredient */
.ingredient { position: relative; z-index: var(--z-content); }

.ing-hero {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(28px, 5vw, 56px);
	align-items: center;

	/* Clear the overlaid navigation below the hero. */
	padding-top: calc(var(--nav-height) + clamp(20px, 3vw, 36px));
	padding-bottom: clamp(48px, 8vw, 90px);
}
.ing-hero__seal { display: flex; justify-content: center; }
.ing-hero__seal .seal { width: min(64vw, 280px); }
.ing-hero__meta { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: #8a7e6a; }
.ing-hero__rule { flex: 1; height: 1px; background: rgba(20, 16, 11, 0.14); }
.ing-hero__name {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: var(--fs-page-title);
	line-height: 0.96;
	letter-spacing: 0.02em;
	color: var(--ink);
}
.ing-hero__benefit { margin: 22px 0 0; color: var(--burgundy); max-width: 40ch; }
.ing-hero__flavor { margin: 12px 0 0; font-size: 16px; line-height: 1.7; color: var(--ink-soft); max-width: 46ch; }
.ing-hero__specs { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 30px; padding-top: 24px; border-top: 1px solid rgba(20, 16, 11, 0.14); }
.ing-spec__k { display: block; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: #8a7e6a; margin-bottom: 8px; }
.ing-spec__v { font-family: var(--font-display); font-size: 19px; letter-spacing: 0.02em; color: var(--ink); }

.ing-usedin { padding-block: clamp(48px, 8vw, 100px); }
.ing-usedin__head { margin-bottom: clamp(28px, 4vw, 44px); }
.ing-usedin__head h2 { margin: 6px 0 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 5vw, 44px); letter-spacing: 0.04em; color: var(--ink); }
.ing-usedin__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.ing-prod { display: flex; flex-direction: column; border: 1px solid rgba(20, 16, 11, 0.12); background: rgba(255, 255, 255, 0.8); transition: transform 0.35s, border-color 0.25s, box-shadow 0.25s; }
.ing-prod:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 26px 44px rgba(60, 40, 15, 0.1); color: inherit; }
.ing-prod__ph { aspect-ratio: 4 / 3.4; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 50%, rgba(217, 168, 67, 0.08), transparent 65%); }
.ing-prod__ph img { height: 82%; width: auto; filter: drop-shadow(0 16px 22px rgba(60, 40, 15, 0.2)); }
.ing-prod__b { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 16px 18px 18px; border-top: 1px solid rgba(20, 16, 11, 0.1); }
.ing-prod__nm { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: 0.03em; color: var(--ink); }
.ing-prod__en { color: var(--ink-mute); text-align: right; }
.ing-usedin__none { color: #8a7e6a; }

.ing-related { padding-block: clamp(48px, 8vw, 100px); border-top: 1px solid rgba(20, 16, 11, 0.1); }
.ing-related__head { text-align: center; margin-bottom: clamp(28px, 4vw, 48px); }
.ing-related__lab { display: inline-flex; align-items: center; gap: 14px; font-family: var(--font-display); font-size: 12px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold-deep); }
.ing-related__lab::before, .ing-related__lab::after { content: ""; width: 40px; height: 1px; background: currentColor; opacity: 0.5; }
.ing-related__head h2 { margin: 12px 0 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4vw, 40px); letter-spacing: 0.04em; color: var(--ink); }
.ing-related__row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ing-rel { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 22px; border: 1px solid rgba(20, 16, 11, 0.12); background: rgba(255, 255, 255, 0.72); transition: transform 0.3s, border-color 0.25s; }
.ing-rel:hover { transform: translateY(-4px); border-color: var(--gold); color: inherit; }
.ing-rel .seal { width: 72px; margin-bottom: 16px; }
.ing-rel:hover .seal__ring { transform: rotate(38deg); }
.ing-rel__nm { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: 0.03em; color: var(--ink); }
.ing-rel__cat { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a7e6a; margin-top: 5px; }

/* Responsive layout */
@media (min-width: 560px) {
	.atlas-chapter__rest { grid-template-columns: repeat(2, 1fr); }
	.ing-usedin__grid, .ing-related__row { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
	.atlas-chapter__body { grid-template-columns: 0.95fr 2.05fr; gap: 36px; align-items: stretch; }
	.atlas-chapter__rest { grid-template-columns: repeat(3, 1fr); gap: 16px; }
	.ing-hero { grid-template-columns: 0.85fr 1.15fr; gap: 72px; }
	.ing-hero__seal .seal { width: min(80%, 340px); }
	.ing-usedin__grid { grid-template-columns: repeat(4, 1fr); }
	.ing-related__row { grid-template-columns: repeat(4, 1fr); }
}
