/**
 * Black Friday campaign (temporary).
 *
 * Everything here is scoped to `.gg-bf` (the landing-page block) and
 * `.gg-bf-bar` (the product-page bar), so the campaign cannot leak into the
 * rest of the shop. The palette is local to the module as custom properties:
 * the campaign is deliberately dark against the site's light pages, and it
 * does not read Blocksy's palette so a theme tweak cannot wash it out.
 *
 * Delete this file together with inc/black-friday/ when the campaign ends.
 */

.gg-bf,
.gg-bf-bar {
	--gg-bf-ink: #0d0d10;
	--gg-bf-ink-soft: #191920;
	--gg-bf-line: rgba(255, 255, 255, 0.14);
	--gg-bf-text: #f5f5f7;
	--gg-bf-muted: rgba(245, 245, 247, 0.7);
	--gg-bf-accent: #ffd34d;
	--gg-bf-accent-ink: #14100a;
	--gg-bf-radius: 12px;
}

/* ── Landing block ───────────────────────────────────────────────────────── */

/*
 * Full-bleed band. The archive's content column is the containing block, so
 * `50%` is half of it: pulling the margins out to 50vw makes the background
 * span the viewport, and putting that same distance back as padding keeps the
 * content lined up with the product grid below. No radius - a band that
 * reaches the window edges should not have corners.
 *
 * 100vw includes the scrollbar, so the band overhangs by half a scrollbar on
 * each side; Blocksy's `body { overflow-x: hidden }` clips it and the result
 * is flush.
 */
.gg-bf {
	box-sizing: border-box;
	width: 100vw;
	margin-block: 0 30px;
	margin-inline: calc(50% - 50vw);
	padding-block: 24px;
	padding-inline: calc(50vw - 50%);
	background: radial-gradient(120% 160% at 15% 0%, #241f2e 0%, var(--gg-bf-ink) 55%);
	color: var(--gg-bf-text);
}

.gg-bf *,
.gg-bf-bar * {
	box-sizing: border-box;
}

/*
 * Breadcrumbs inside the band. Blocksy sizes `.ct-breadcrumbs` through its own
 * custom properties, so those are reset here as well as the plain properties,
 * and the two-class selector keeps this above the theme's inline styles.
 */
.gg-bf .ct-breadcrumbs {
	--theme-font-size: 12px;
	--theme-font-weight: 400;
	margin: 0 0 12px;
	color: var(--gg-bf-muted);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
	opacity: 0.55;
}

.gg-bf .ct-breadcrumbs a,
.gg-bf .ct-breadcrumbs span {
	color: inherit;
}

.gg-bf .ct-breadcrumbs a:hover,
.gg-bf .ct-breadcrumbs a:focus-visible {
	color: var(--gg-bf-accent);
}

.gg-bf .ct-breadcrumbs svg {
	width: 10px;
	height: 10px;
}

/*
 * One row: the title on the left, the count and the instruction stacked to
 * the right of it. Centred and stacked, this header was three lines deep
 * before the first tile; across the band it costs about one.
 */
.gg-bf__hero {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 28px;
	margin-bottom: 16px;
}

.gg-bf__title {
	margin: 0;
	color: var(--gg-bf-text);
	font-size: clamp(24px, 3.4vw, 34px);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.gg-bf__hero-aside {
	flex: 1 1 auto;
	text-align: right;
}

.gg-bf__subtitle {
	margin: 2px 0 0;
	color: var(--gg-bf-muted);
	font-size: 14px;
	line-height: 1.45;
}

.gg-bf__meta {
	margin: 0;
	color: var(--gg-bf-text);
	font-size: 14px;
}

.gg-bf__meta strong {
	color: var(--gg-bf-accent);
}

/* ── Discount brackets ───────────────────────────────────────────────────── */

/* Flex, not a 4-column grid: a bracket with nothing in it is not rendered, so
   three or two tiles must still fill the row rather than leave a hole. The cap
   stops a lone tile stretching the full width of the band. */
.gg-bf__brackets {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.gg-bf-tile {
	position: relative;
	display: flex;
	overflow: hidden;
	flex: 1 1 150px;
	max-width: 420px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 62px;
	padding: 14px 12px;
	border: 1px solid var(--gg-bf-line);
	border-radius: var(--gg-bf-radius);
	background: var(--gg-bf-ink-soft);
	color: var(--gg-bf-text);
	text-align: center;
	text-decoration: none;
	transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.gg-bf-tile:hover,
.gg-bf-tile:focus-visible {
	border-color: var(--gg-bf-accent);
	background: #22222c;
	color: var(--gg-bf-text);
	transform: translateY(-2px);
	text-decoration: none;
}

/* Empty under the current category, but still a link out of it. */
.gg-bf-tile.is-empty {
	opacity: 0.45;
}

.gg-bf-tile.is-empty:hover,
.gg-bf-tile.is-empty:focus-visible {
	opacity: 1;
}

.gg-bf-tile.is-active {
	border-color: var(--gg-bf-accent);
	background: var(--gg-bf-accent);
	color: var(--gg-bf-accent-ink);
}

.gg-bf-tile__label {
	font-size: clamp(18px, 3.4vw, 24px);
	font-weight: 800;
	line-height: 1.15;
}

/* A designed tile brings its own artwork; the label stays for screen readers. */
.gg-bf-tile.has-image {
	min-height: 104px;
}

.gg-bf-tile__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gg-bf-tile.has-image .gg-bf-tile__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ── Shop areas ──────────────────────────────────────────────────────────── */

.gg-bf__areas {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--gg-bf-line);
}

.gg-bf__areas-title {
	margin: 0 0 10px;
	color: var(--gg-bf-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.gg-bf__groups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 12px;
}

.gg-bf-group {
	padding: 12px 14px;
	border: 1px solid var(--gg-bf-line);
	border-radius: var(--gg-bf-radius);
	background: rgba(255, 255, 255, 0.035);
}

.gg-bf-group.is-active {
	border-color: var(--gg-bf-accent);
}

/*
 * The card heading is a link to the whole area, but as plain bold text it did
 * not read as one next to the chips. It now carries a faint underline at rest
 * and an accent chevron, both of which go solid on hover.
 */
.gg-bf-group__head {
	display: flex;
	align-items: baseline;
	gap: 6px;
	color: var(--gg-bf-text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.gg-bf-group__name {
	text-decoration: underline;
	text-decoration-color: rgba(245, 245, 247, 0.28);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.gg-bf-group__go {
	display: inline-flex;
	flex: 0 0 auto;
	align-self: center;
	color: var(--gg-bf-accent);
	transition: transform 0.15s ease;
}

.gg-bf-group__head:hover .gg-bf-group__name,
.gg-bf-group__head:focus-visible .gg-bf-group__name {
	color: var(--gg-bf-accent);
	text-decoration-color: currentColor;
}

.gg-bf-group__head:hover .gg-bf-group__go,
.gg-bf-group__head:focus-visible .gg-bf-group__go {
	transform: translateX(3px);
}

.gg-bf-group__children {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.gg-bf-group__children li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gg-bf-chip {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid var(--gg-bf-line);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--gg-bf-text);
	font-size: 13px;
	line-height: 1.3;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.gg-bf-chip:hover,
.gg-bf-chip:focus-visible {
	border-color: var(--gg-bf-accent);
	background: rgba(255, 211, 77, 0.12);
	color: var(--gg-bf-text);
	text-decoration: none;
}

.gg-bf-chip.is-active {
	border-color: var(--gg-bf-accent);
	background: var(--gg-bf-accent);
	color: var(--gg-bf-accent-ink);
	font-weight: 600;
}

/* ── Current selection ───────────────────────────────────────────────────── */

.gg-bf__selection {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 0 0 12px;
	color: var(--gg-bf-muted);
	font-size: 14px;
}

.gg-bf__selection strong {
	color: var(--gg-bf-text);
}

.gg-bf__selection-reset {
	color: var(--gg-bf-accent);
	font-weight: 600;
	text-decoration: underline;
}

.gg-bf__selection-reset:hover,
.gg-bf__selection-reset:focus-visible {
	color: var(--gg-bf-accent);
}

/* ── Sale terms, under the product grid ─────────────────────────────────── */

.gg-bf-terms {
	max-width: 90ch;
	margin: 26px auto 0;
	color: var(--theme-text-color, #6b7280);
	font-size: 12px;
	line-height: 1.6;
	opacity: 0.75;
	text-align: center;
}

/* ── Product-page bar ────────────────────────────────────────────────────── */

/*
 * No `width` and no `margin` shorthand here. Under Blocksy the bar also
 * carries `is-width-constrained`, which sets `width` and `margin-inline: auto`
 * to line it up with the product below; this stylesheet loads after Blocksy's,
 * so at equal specificity a `margin: 0 0 25px` here would quietly beat that
 * `margin-inline: auto` and the bar would sit left-aligned and over-wide.
 */
.gg-bf-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-block: 0 25px;
	padding: 14px 18px;
	border-radius: var(--gg-bf-radius);
	background: linear-gradient(100deg, var(--gg-bf-ink) 0%, #26202f 100%);
	color: var(--gg-bf-text);
}

.gg-bf-bar__badge {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--gg-bf-accent);
	color: var(--gg-bf-accent-ink);
}

.gg-bf-bar__message {
	flex: 1 1 auto;
	min-width: 0;
}

.gg-bf-bar__title {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.gg-bf-bar__text {
	display: block;
	margin-top: 2px;
	color: var(--gg-bf-muted);
	font-size: 13px;
	line-height: 1.4;
}

.gg-bf-bar__cta {
	flex: 0 0 auto;
	padding: 9px 16px;
	border-radius: 999px;
	background: var(--gg-bf-accent);
	color: var(--gg-bf-accent-ink);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.gg-bf-bar__cta:hover,
.gg-bf-bar__cta:focus-visible {
	color: var(--gg-bf-accent-ink);
	text-decoration: none;
	filter: brightness(1.08);
}

/* ── Narrow screens ─────────────────────────────────────────────────────── */

@media (max-width: 767px) {
	.gg-bf {
		padding-block: 18px;
	}

	.gg-bf__hero-aside {
		flex-basis: 100%;
		text-align: left;
	}

	.gg-bf-tile {
		flex-basis: calc(50% - 5px);
	}

	.gg-bf-bar {
		flex-wrap: wrap;
		padding: 14px;
	}

	.gg-bf-bar__message {
		flex: 1 1 calc(100% - 52px);
	}

	.gg-bf-bar__cta {
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gg-bf-tile,
	.gg-bf-chip,
	.gg-bf-bar__cta,
	.gg-bf-group__go {
		transition: none;
	}

	.gg-bf-group__head:hover .gg-bf-group__go {
		transform: none;
	}

	.gg-bf-tile:hover,
	.gg-bf-tile:focus-visible {
		transform: none;
	}
}
