/* ==========================================================================
   BRAND ARCHIVE — /bränd/<brand>/
   --------------------------------------------------------------------------
   The brand's logo as the title, the producer's introduction under it, then
   the brand's products. Loaded only on product_brand archives
   (inc/brand-archive.php).

   Title (client 18.11): the H1 is the brand's logo — one logo, where the
   name stood — or the name in text when there is no usable logo. Every logo
   gets the same AREA rather than the same height, so a 3.6:1 wordmark
   (CocoCoast) and a 0.8:1 crest (Maison Castel) weigh the same; the drawn box
   is the logo's ink, its file's empty margins cut away, so each mark starts
   on the text's left edge. Never drawn larger than the ink is in the file.

   Story (client 02.12.2026, supersedes the 18.11 two-column sections): ONE
   text block from top to bottom under the logo, at every width, across the
   full width of the content container (client 02.12: no 66-character cap),
   ragged right, 16px/1.75 on phones, 17px from 768, 18px from 1280; one
   paragraph gap (1.15em) throughout and a clearly larger space above the
   editor's heading lines, which stand closer to the text they open.
   ========================================================================== */

/* The trail: the product page's look (single-product.css is not loaded here). */
.tax-product_brand .woocommerce-breadcrumb {
	margin: var(--space-md) 0 var(--space-sm);
	font-family: var(--font-ui);
	font-weight: 500;
	font-size: 12px;
	line-height: 16px;
	color: var(--color-text-secondary);
}

.tax-product_brand .woocommerce-breadcrumb a {
	color: inherit;
	text-decoration: none;
	transition: color var(--transition-base);
}

.tax-product_brand .woocommerce-breadcrumb a:hover {
	color: var(--color-primary);
}

.tax-product_brand .woocommerce-breadcrumb__sep {
	padding-inline: var(--space-xs);
	opacity: 0.6;
}

.tax-product_brand .woocommerce-products-header {
	margin-bottom: var(--space-lg);
	padding-bottom: var(--space-lg);
	border-bottom: 1px solid var(--color-border);
}

.tax-product_brand .woocommerce-products-header__title {
	margin: 0 0 var(--space-md);
	overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   TITLE — the logo
   -------------------------------------------------------------------------- */

/*
 * Sizes: the side of the square each logo's area equals, and the caps for very
 * tall and very wide marks (inc/brand-archive.php avallone_brand_logo_sizes()
 * carries the desktop values). Fluid between a phone and 1280px.
 */
.woocommerce-products-header .brand-title--logo {
	--brand-logo-area: clamp(96px, 4.4vw + 76px, 132px);
	--brand-logo-hmax: var(--brand-logo-area);
	--brand-logo-wmax: calc(var(--brand-logo-area) * 2.58);

	/* A text H1's line box leaves air above its letters; a logo has none. */
	margin-block-start: var(--space-xs);
	line-height: 0;
}

/*
 * The mark is the logo's ink box (--r = its width / height); the image inside
 * is the whole file, scaled and shifted so its ink fills the mark
 * (--iw/--ix/--iy from the PHP). Width is the smallest of: equal area, the
 * height cap, the width cap, the ink's own pixel width (never upscaled) and
 * the column.
 */
.brand-title__mark {
	position: relative;
	display: block;
	width: min(
		calc(var(--brand-logo-area) * var(--rs)),
		calc(var(--brand-logo-hmax) * var(--r)),
		var(--brand-logo-wmax),
		var(--nw),
		100%
	);
	aspect-ratio: var(--r);
	overflow: hidden;
}

/*
 * A logo delivered on a white plate (JPEG, some PNGs) multiplies into the
 * page colour instead of standing as a white box on the cream.
 *
 * Through the mark (0,2,0): WooCommerce's `.woocommerce-page img
 * { max-width: 100% }` (0,1,1) otherwise held the image to the mark's width,
 * so a file with margins (--iw over 100%) was drawn too small and its shift
 * pushed the ink out of the clip — Masi and Moët blank, "ASTEL", "RRES"
 * (QA 18.11, D1).
 */
.brand-title__mark .brand-title__logo {
	position: absolute;
	top: var(--iy);
	left: var(--ix);
	width: var(--iw);
	max-width: none;
	height: auto;
	mix-blend-mode: multiply;
}

/* --------------------------------------------------------------------------
   INTRO — the producer's story: one block, top to bottom
   -------------------------------------------------------------------------- */

.brand-intro__text {
	max-width: none;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.75;
	color: var(--color-text);
	text-wrap: pretty;
	overflow-wrap: break-word;
}

.brand-intro__text > p {
	margin: 0 0 1.15em;
}

.brand-intro__text > :last-child {
	margin-bottom: 0;
}

/* The first paragraph opens the story: a step larger, in the ink colour. */
.brand-intro__text > p:first-child {
	font-size: 1.0625em;
	color: var(--color-ink);
}

.brand-intro__text strong,
.brand-intro__text b {
	font-weight: 600;
	color: var(--color-ink);
}

.brand-intro__text a {
	color: var(--color-primary);
}

/* An editor's heading line: a section break above, close to its own text. */
.brand-intro__subhead {
	margin: 1.75em 0 0.5em;
	font-family: var(--font-heading);
	font-style: normal;
	font-weight: 400;
	font-size: 21px;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	text-wrap: balance;
	color: var(--color-ink);
}

.brand-intro__text > .brand-intro__subhead:first-child {
	margin-top: 0;
}

@media (min-width: 768px) {

	.brand-intro__text {
		font-size: 17px;
	}

	.brand-intro__subhead {
		font-size: 23px;
	}
}

@media (min-width: 1280px) {

	.brand-intro__text {
		font-size: 18px;
		line-height: 1.7;
	}

	.brand-intro__subhead {
		font-size: 25px;
	}
}

/* --------------------------------------------------------------------------
   THE BRAND'S PRODUCTS — the catalogue's grid and cards (catalog.css, loaded
   with this file), under a count-and-sort bar (QA 17.11).
   -------------------------------------------------------------------------- */

/* The trail sits where the WooCommerce wrapper had it, not 48px lower. */
.catalog--brand {
	padding-block-start: 0;
}

.brand-catalog__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-xs) var(--space-md);
	margin-bottom: var(--space-md);
}

.brand-catalog__count {
	margin: 0;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--color-text);
}

.brand-catalog .catalog-filters__sort-submit[hidden] {
	display: none;
}

/* The header's divider already separates story and products. */
.brand-catalog .woocommerce-products-header {
	margin-bottom: var(--space-md);
}
