/* H&G Brands. Colours reference the site's Beaver Builder globals; headings use the theme's global scale. */

.hg-brands {
	--hgb-accent: var(--fl-global-logo-oat, #e2d3c0);
	--hgb-soft: var(--fl-global-light-cafe, #f5f4f2);
	--hgb-ink: #333;
	--hgb-line: rgba(0, 0, 0, 0.12);
	--hgb-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	color: var(--hgb-ink);
}

.hg-brands__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.hg-brands__title { margin: 0; }

/* ---------- Featured row ---------- */

.hg-brands__featured { margin: 0 0 64px; }
.hg-brands__featured .hg-brands__title { margin-bottom: 24px; }

.hg-brands__cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.hg-brands .hg-brands__card {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--hgb-accent);
	color: #fff;
	text-decoration: none;
}
.hg-brands__card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.6s ease;
}
.hg-brands__card::after {
	content: "";
	position: absolute;
	inset: 50% 0 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.45));
	pointer-events: none;
}
.hg-brands__card-name {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 1;
	font-family: var(--hgb-serif);
	font-size: 26px;
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}
@media (hover: hover) {
	.hg-brands__card:hover .hg-brands__card-img { transform: scale(1.04); }
}
.hg-brands__card:focus-visible { outline: 2px solid var(--hgb-ink); outline-offset: 3px; }

/* ---------- Directory ---------- */

.hg-brands__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 16px;
	margin: 0 0 20px;
}
.hg-brands__meta {
	margin: 0;
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.7;
}

.hg-brands__search { display: block; max-width: 420px; margin: 0 0 20px; }
.hg-brands__search input {
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 11px 18px;
	border: 1px solid var(--hgb-line);
	border-radius: 100px;
	background: #fff;
	color: var(--hgb-ink);
	font: inherit;
	font-size: 16px;
	height: auto;
}

.hg-brands__az {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin: 0 0 32px;
	padding: 10px 0;
	border-top: 1px solid var(--hgb-line);
	border-bottom: 1px solid var(--hgb-line);
}
.hg-brands__az a,
.hg-brands__az span {
	display: inline-grid;
	place-items: center;
	min-width: 30px;
	height: 30px;
	border-radius: 100px;
	font-family: var(--hgb-serif);
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
}
.hg-brands__az a { color: var(--hgb-ink); transition: background 0.15s ease; }
.hg-brands__az a:hover,
.hg-brands__az a:focus-visible { background: var(--hgb-accent); color: var(--hgb-ink); outline: none; }
.hg-brands__az span,
.hg-brands__az a.is-off { opacity: 0.25; pointer-events: none; }

.hg-brands__groups {
	column-width: 190px;
	column-gap: 32px;
}
.hg-brands__group {
	break-inside: avoid;
	page-break-inside: avoid;
	margin: 0 0 28px;
	scroll-margin-top: 140px;
}
.hg-brands__group[hidden] { display: none; }
.hg-brands__letter {
	margin: 0 0 8px;
	padding: 0 0 6px;
	border-bottom: 1px solid var(--hgb-accent);
	font-family: var(--hgb-serif);
	font-size: 24px;
	font-weight: 600;
	line-height: 1;
}
.hg-brands__group ul { margin: 0; padding: 0; list-style: none; }
.hg-brands__group li { margin: 0; padding: 0; }
.hg-brands__group li[hidden] { display: none; }
.hg-brands .hg-brands__group a {
	display: inline-block;
	padding: 4px 0;
	color: var(--hgb-ink);
	font-family: var(--hgb-serif);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0 1px;
	background-position: 0 92%;
	background-repeat: no-repeat;
	transition: background-size 0.25s ease;
}
.hg-brands .hg-brands__group a:hover,
.hg-brands .hg-brands__group a:focus-visible { background-size: 100% 1px; outline: none; }

.hg-brands__none { margin: 0; padding: 24px 0; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.hg-brands__card-name { font-size: 22px; }
}
@media (max-width: 768px) {
	.hg-brands__featured { margin-bottom: 48px; }
	.hg-brands__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.hg-brands__card-name { font-size: 18px; left: 10px; right: 10px; bottom: 12px; }
	.hg-brands__groups { column-width: 140px; column-gap: 20px; }
	.hg-brands .hg-brands__group a { font-size: 16px; padding: 6px 0; }
	.hg-brands__az a, .hg-brands__az span { min-width: 26px; height: 32px; font-size: 17px; }
}
