/* ==========================================================================
   NAGI — tradition pages

   Loaded only on the Tradition page template. Every selector is prefixed
   nagi-trad-*, so nothing here reaches the homepage, shop, product, cart or
   checkout.

   The page wrapper carries .nagi-hp as well as .nagi-trad. That is deliberate
   and load-bearing: the --hp-* palette and the .nagi-hp-card rules are defined
   against .nagi-hp in homepage.css, which is enqueued site-wide. Drop the class
   and every card on the page loses its border and type colours, because the
   custom properties they read stop resolving.

   --trad-accent is set inline per page from nagi_traditions().
   ========================================================================== */

.nagi-trad {
	--trad-accent: var(--hp-red);
	--trad-hero-min: clamp(23rem, 58vh, 34rem);
	background: var(--hp-ivory);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.nagi-trad-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: var(--trad-hero-min);
	padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 4rem);
	overflow: hidden;
	background: var(--hp-coal-deep);
	color: var(--hp-ivory);
	isolation: isolate;
}

.nagi-trad-hero__media {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.nagi-trad-hero__img,
.nagi-trad-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/*
 * Two stops, not one: a flat overlay at the strength the title needs turns the
 * photograph to mud. The gradient keeps the top of the image readable and puts
 * the weight where the type actually sits.
 */
.nagi-trad-hero__veil {
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(
			to bottom,
			rgba(12, 12, 12, 0.35) 0%,
			rgba(12, 12, 12, 0.55) 45%,
			rgba(12, 12, 12, 0.88) 100%
		);
}

/* No photograph: an ink field with a faint red hairline grid instead. */
.nagi-trad-hero:not(.nagi-trad-hero--image) {
	background-image:
		linear-gradient(to bottom, rgba(175, 26, 22, 0.12), transparent 60%),
		linear-gradient(to right, rgba(246, 241, 234, 0.05) 1px, transparent 1px);
	background-size: 100% 100%, 84px 100%;
}

.nagi-trad-hero__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.nagi-trad-hero__back {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin-bottom: clamp(1.25rem, 3vw, 2.25rem);
	font-family: var(--hp-sans);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(246, 241, 234, 0.72);
	border-bottom: 1px solid transparent;
	padding-bottom: 2px;
	transition: color 200ms var(--nagi-ease), border-color 200ms var(--nagi-ease);
}

.nagi-trad-hero__back:hover {
	color: var(--hp-ivory);
	border-bottom-color: rgba(246, 241, 234, 0.5);
}

.nagi-trad-hero__eyebrow {
	margin-bottom: 0.75rem;
	color: var(--hp-red-lit);
}

.nagi-trad-hero__title {
	margin: 0;
	max-width: 18ch;
	font-family: var(--hp-serif);
	font-size: clamp(2.4rem, 5.6vw, 4.4rem);
	font-weight: 300;
	line-height: 1.04;
	letter-spacing: -0.022em;
	color: var(--hp-ivory);
	text-wrap: balance;
}

/*
 * The one place the tradition's own colour is used at size. Everything else on
 * the page keeps the house red, so the accent reads as an index mark rather
 * than as a second brand.
 */
.nagi-trad-hero__rule {
	display: block;
	width: 64px;
	height: 2px;
	margin: clamp(1.1rem, 2.4vw, 1.75rem) 0 0;
	background: var(--trad-accent);
	box-shadow: 0 0 0 1px rgba(246, 241, 234, 0.18);
}

.nagi-trad-hero__lede {
	max-width: 56ch;
	margin: clamp(1.1rem, 2.4vw, 1.6rem) 0 0;
	font-family: var(--hp-sans);
	font-size: clamp(0.9375rem, 1.15vw, 1.0625rem);
	font-weight: 300;
	line-height: 1.68;
	color: rgba(246, 241, 234, 0.86);
	text-wrap: pretty;
}

.nagi-trad-hero__meta {
	margin: clamp(1.25rem, 2.6vw, 1.9rem) 0 0;
	font-family: var(--nagi-f-mono);
	font-size: 0.6875rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(246, 241, 234, 0.62);
}

.nagi-trad-hero__dot { color: var(--hp-red-lit); }

/* --------------------------------------------------------------------------
   Tradition switcher
   -------------------------------------------------------------------------- */

.nagi-trad-switch {
	background: var(--hp-cream);
	border-bottom: 1px solid var(--hp-line);
}

.nagi-trad-switch__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(0.25rem, 1.6vw, 1.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.nagi-trad-switch__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 1.05rem 0.5rem;
	font-family: var(--hp-sans);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hp-grey);
	border-bottom: 2px solid transparent;
	transition: color 200ms var(--nagi-ease), border-color 200ms var(--nagi-ease);
}

.nagi-trad-switch__link:hover { color: var(--hp-ink); }

.nagi-trad-switch__link.is-current {
	color: var(--hp-ink);
	border-bottom-color: var(--trad-chip, var(--hp-red));
}

.nagi-trad-switch__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--trad-chip, var(--hp-red));
	opacity: 0.4;
	transition: opacity 200ms var(--nagi-ease);
}

.nagi-trad-switch__link:hover .nagi-trad-switch__dot,
.nagi-trad-switch__link.is-current .nagi-trad-switch__dot { opacity: 1; }

/* --------------------------------------------------------------------------
   Products
   -------------------------------------------------------------------------- */

.nagi-trad-shop {
	padding-block: clamp(3rem, 6vw, 5rem) clamp(3rem, 6vw, 5.5rem);
}

.nagi-trad-shop__head {
	text-align: center;
	margin-bottom: clamp(1.75rem, 3.2vw, 2.5rem);
}

.nagi-trad-filter {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.nagi-trad-filter__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 0.95rem;
	border: 1px solid var(--hp-line);
	border-radius: 1px;
	background: transparent;
	font-family: var(--hp-sans);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--hp-grey);
	cursor: pointer;
	transition:
		color 200ms var(--nagi-ease),
		border-color 200ms var(--nagi-ease),
		background-color 200ms var(--nagi-ease);
}

.nagi-trad-filter__chip:hover {
	color: var(--hp-ink);
	border-color: rgba(175, 26, 22, 0.55);
}

.nagi-trad-filter__chip.is-active {
	color: var(--hp-ivory);
	background: var(--trad-chip, var(--trad-accent));
	border-color: var(--trad-chip, var(--trad-accent));
}

.nagi-trad-filter__chip:focus-visible {
	outline: 2px solid var(--hp-red);
	outline-offset: 2px;
}

.nagi-trad-filter__n {
	font-family: var(--nagi-f-mono);
	font-size: 0.625rem;
	font-weight: 400;
	letter-spacing: 0.06em;
	opacity: 0.7;
}

/*
 * Four across, not the homepage's six. These grids run from 2 products to 33,
 * and at six across a five-product line renders as one short row with a hole
 * in it. Four fills more honestly and gives the photography more room.
 */
.nagi-trad-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin-top: 0;
}

.nagi-trad-grid__item.is-filtered { display: none; }

/*
 * Fewer than four products. A grid track of 1fr would stretch two cards across
 * the whole shell; a four-track grid leaves half the row empty. Neither reads
 * as deliberate, so a short line becomes a centred row at the same card width
 * the four-column grid produces — 1280px shell less three 18px gaps, over four.
 */
.nagi-trad-grid--sparse {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.nagi-trad-grid--sparse .nagi-trad-grid__item { flex: 0 1 306px; }

/*
 * The branded placeholder is 4:5 and the card media is square, so `cover` — the
 * right default for a photograph — crops the panel's own border and footer mark
 * off. Contained on a field of the placeholder's own navy, the whole panel
 * shows and still reads as one solid tile rather than a letterboxed image.
 */
.nagi-trad-grid .nagi-img--placeholder {
	object-fit: contain;
	background: var(--nagi-ink);
}

.nagi-trad-shop__none {
	margin: clamp(2rem, 4vw, 3rem) 0 0;
	text-align: center;
	font-family: var(--hp-sans);
	font-size: 0.9375rem;
	color: var(--hp-grey);
}

.nagi-trad-shop__foot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.25rem;
	margin-top: clamp(2rem, 4vw, 3rem);
	text-align: center;
}

.nagi-trad-shop__gaps {
	max-width: 62ch;
	margin: 0;
	font-family: var(--hp-sans);
	font-size: 0.8125rem;
	line-height: 1.65;
	color: var(--hp-grey);
}

.nagi-trad-shop__all {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding-bottom: 3px;
	border-bottom: 1px solid rgba(175, 26, 22, 0.55);
	font-family: var(--hp-sans);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hp-ink);
	transition: color 200ms var(--nagi-ease), border-color 200ms var(--nagi-ease);
}

.nagi-trad-shop__all:hover {
	color: var(--hp-red);
	border-bottom-color: var(--hp-red);
}

/* --------------------------------------------------------------------------
   Sourcing copy
   -------------------------------------------------------------------------- */

.nagi-trad-note {
	padding-block: clamp(3rem, 6vw, 5.5rem);
	background: var(--hp-cream);
	border-top: 1px solid var(--hp-line);
}

.nagi-trad-note__shell {
	display: grid;
	grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 4.5rem);
	align-items: start;
}

.nagi-trad-note__aside { position: sticky; top: 2rem; }

.nagi-trad-note__title {
	margin: 0;
	font-family: var(--hp-serif);
	font-size: clamp(1.375rem, 2.1vw, 1.875rem);
	font-weight: 300;
	line-height: 1.22;
	letter-spacing: -0.015em;
	color: var(--hp-ink);
	text-wrap: balance;
}

.nagi-trad-note__rule {
	display: block;
	width: 48px;
	height: 1px;
	margin-top: 1.25rem;
	background: var(--trad-accent);
}

/*
 * The body is the page's original editorial content, so it arrives as
 * arbitrary wp_editor markup — headings, paragraphs and lists. Sized down from
 * the prose default because it is now supporting material under the grid
 * rather than the subject of the page.
 */
.nagi-trad-note__body {
	max-width: 68ch;
	font-family: var(--hp-sans);
	font-size: 0.9375rem;
	line-height: 1.75;
	color: var(--hp-ink);
}

.nagi-trad-note__body > :first-child { margin-top: 0; }
.nagi-trad-note__body > :last-child { margin-bottom: 0; }

.nagi-trad-note__body h2 {
	margin: 2.25rem 0 0.75rem;
	font-family: var(--hp-serif);
	font-size: 1.0625rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--hp-ink);
}

.nagi-trad-note__body h2:first-child { margin-top: 0; }

.nagi-trad-note__body p { margin: 0 0 1.05rem; }

.nagi-trad-note__body a {
	color: var(--hp-ink);
	border-bottom: 1px solid rgba(175, 26, 22, 0.6);
}

.nagi-trad-note__body a:hover { color: var(--hp-red); }

.nagi-trad-note__body ul {
	margin: 0 0 1.05rem;
	padding-left: 1.1rem;
	list-style: none;
}

.nagi-trad-note__body ul li {
	position: relative;
	margin-bottom: 0.5rem;
}

.nagi-trad-note__body ul li::before {
	content: "";
	position: absolute;
	left: -1.1rem;
	top: 0.6em;
	width: 4px;
	height: 4px;
	background: var(--trad-accent);
}

/* --------------------------------------------------------------------------
   Breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.nagi-trad-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

	.nagi-trad-note__shell { grid-template-columns: minmax(0, 1fr); }
	.nagi-trad-note__aside { position: static; }
}

@media (max-width: 760px) {
	.nagi-trad { --trad-hero-min: clamp(19rem, 52vh, 26rem); }

	.nagi-trad-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	/*
	 * The switcher is the one row that may not wrap into a stack — five
	 * centred faiths become five lines and push the products off the screen.
	 * It scrolls sideways instead.
	 */
	.nagi-trad-switch__list {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		scrollbar-width: none;
		gap: 1.25rem;
	}

	.nagi-trad-switch__list::-webkit-scrollbar { display: none; }

	.nagi-trad-switch__link { white-space: nowrap; }

	.nagi-trad-filter {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		scrollbar-width: none;
		padding-bottom: 0.25rem;
	}

	.nagi-trad-filter::-webkit-scrollbar { display: none; }

	.nagi-trad-filter__chip { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
	.nagi-trad-hero__back,
	.nagi-trad-switch__link,
	.nagi-trad-switch__dot,
	.nagi-trad-filter__chip,
	.nagi-trad-shop__all { transition: none; }
}

@media (max-width: 760px) {
	.nagi-trad-grid--sparse .nagi-trad-grid__item { flex: 0 1 calc(50% - 6px); }
}

/*
 * homepage.css left-aligns .nagi-hp-heading--center and pulls .nagi-hp-flourish
 * to the left margin at its mobile breakpoint. That is right for the homepage
 * bands, which go full-bleed and left-aligned there, but this section head stays
 * centred at every width — without these the eyebrow sat centred over a
 * left-aligned heading and a left-hanging flourish. Not scoped to a media query
 * on purpose: it should hold whatever homepage.css does next.
 */
.nagi-trad-shop__head .nagi-hp-heading--center { text-align: center; }
.nagi-trad-shop__head .nagi-hp-flourish { margin-inline: auto; }

/* --------------------------------------------------------------------------
   Sub-line lockup
   -------------------------------------------------------------------------- */

/*
 * NAGI set small and letterspaced above the word it qualifies — the same
 * relationship nagi_brand_mark() uses in the header, so five sub-lines read as
 * one house rather than as five separate brands. The word carries the display
 * size; the prefix is fixed and must not scale with it.
 */
.nagi-trad-hero__prefix {
	display: block;
	margin-bottom: clamp(0.4rem, 1vw, 0.7rem);
	font-family: var(--hp-sans);
	font-size: clamp(0.6875rem, 0.9vw, 0.8125rem);
	font-weight: 600;
	letter-spacing: 0.42em;
	/* Letter-spacing hangs a gap off the last glyph, which drags centred text
	   left by half of it. The indent puts it back. */
	text-indent: 0.42em;
	text-transform: uppercase;
	color: var(--hp-red-lit);
}

.nagi-trad-hero__word { display: block; }
