/* ==========================================================================
   Block: Breadcrumbs (acf/breadcrumbs)

   Values come in as CSS vars from breadcrumbs.php:
     --bc-fs-d / --bc-fs-m            font size (desktop / mobile)
     --bc-gap                         space on each side of the separator
     --bc-weight / --bc-transform     font weight / text-transform
     --bc-justify-d / --bc-justify-m  alignment (flex-start | center | flex-end)
     --bc-max                         desktop max width of the text area
                                      (unset = full width; mobile = full)
     --bc-mt-* / --bc-mb-*            top / bottom margin
     --bc-p{t,r,b,l}-d / -m           padding per side (any unit). Desktop
                                      left / right only apply while the
                                      container is narrower than max width +
                                      both; wider = centred at max width
                                      without them (as in the Hero Banner)
     --bc-bg / --bc-radius            background colour / corner radius
     --bc-link, --bc-link-hover,
     --bc-current, --bc-sep-color     colours (unset = theme defaults below)
     --bc-sep-size                    separator size (unset = text size)
   ========================================================================== */

.reelzappy-breadcrumbs {
	--bc-fs: var(--bc-fs-d, 14px);
	--bc-justify: var(--bc-justify-d, flex-start);
	--bc-pt: var(--bc-pt-d, 0px);
	--bc-pr: var(--bc-pr-d, 0px);
	--bc-pb: var(--bc-pb-d, 0px);
	--bc-pl: var(--bc-pl-d, 0px);
	--bc-maxw: var(--bc-max, 100%);

	/*
	 * Left / right padding is "all or nothing": the full value while the
	 * container (100% = its width, in both padding and max-width) is narrower
	 * than max width + left + right padding, 0 once it's wider. The difference
	 * is multiplied by 1000 so clamp() snaps between the two ends. With no max
	 * width (100%) the padding always applies.
	 */
	--bc-pl-eff: clamp(0px, (var(--bc-maxw) + var(--bc-pl) + var(--bc-pr) - 100%) * 1000, var(--bc-pl));
	--bc-pr-eff: clamp(0px, (var(--bc-maxw) + var(--bc-pl) + var(--bc-pr) - 100%) * 1000, var(--bc-pr));

	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--bc-maxw) + var(--bc-pl-eff) + var(--bc-pr-eff));
	margin-inline: auto;
	margin-block: var(--bc-mt-d, 16px) var(--bc-mb-d, 16px);
	padding: var(--bc-pt) var(--bc-pr-eff) var(--bc-pb) var(--bc-pl-eff);
	background-color: var(--bc-bg, transparent);
	border-radius: var(--bc-radius, 0);
	font-family: var(--font-family-subheading, 'Archivo', sans-serif);
	font-size: var(--bc-fs);
	font-weight: var(--bc-weight, 400);
	line-height: 1.4;
	text-transform: var(--bc-transform, none);
	color: var(--bc-link, var(--color-text, #F5F5FA));
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: var(--bc-justify);
	row-gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__item {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__item::before,
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__item::marker {
	content: none;
}

/* Separator */
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__sep {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-inline: var(--bc-gap, 8px);
	font-size: var(--bc-sep-size, 1em);
	line-height: 1;
	color: var(--bc-sep-color, currentColor);
	opacity: 0.5;
}

.reelzappy-breadcrumbs[style*="--bc-sep-color"] .reelzappy-breadcrumbs__sep {
	opacity: 1;
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__sep svg {
	display: block;
	width: 1em;
	height: 1em;
}

/* Links */
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__link,
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__text {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	min-width: 0;
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__link {
	color: var(--bc-link, var(--color-text, #F5F5FA));
	text-decoration: none;
	transition: color 0.15s ease;
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__link:hover,
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__link:focus-visible {
	color: var(--bc-link-hover, var(--color-link-hover, #F8F503));
}

.reelzappy-breadcrumbs--underline .reelzappy-breadcrumbs__link:hover .reelzappy-breadcrumbs__label,
.reelzappy-breadcrumbs--underline .reelzappy-breadcrumbs__link:focus-visible .reelzappy-breadcrumbs__label {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

/* Current page */
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__item--current .reelzappy-breadcrumbs__text {
	color: var(--bc-current, var(--color-page-title, #F8F503));
}

/* Home icon */
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__icon {
	display: inline-flex;
	font-size: 1.15em;
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__icon svg {
	display: block;
	width: 1em;
	height: 1em;
}

.reelzappy-breadcrumbs .reelzappy-breadcrumbs__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Collapse mode: the "…" item only shows on mobile. */
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__item--ellipsis {
	display: none;
}

/* Mobile.
 *
 * Default breakpoint: mobile up to 768px, desktop from 769px. A block with a
 * custom "Desktop Starts At" value gets data-bc-bp="N", and block.php copies
 * the block between the mobile:start / mobile:end markers for it, with
 * :not([data-bc-bp]) -> [data-bc-bp="N"] and 768px -> N-1. Keep the markers,
 * the "(max-width: 768px)" query and the :not([data-bc-bp]) scopes exactly.
 * The scopes sit inside :where() so specificity is unchanged.
 */
/* mobile:start */
@media (max-width: 768px) {
	.reelzappy-breadcrumbs:where(:not([data-bc-bp])) {
		--bc-fs: var(--bc-fs-m, 12px);
		--bc-justify: var(--bc-justify-m, flex-start);
		--bc-pt: var(--bc-pt-m, 0px);
		--bc-pr: var(--bc-pr-m, 0px);
		--bc-pb: var(--bc-pb-m, 0px);
		--bc-pl: var(--bc-pl-m, 0px);

		max-width: 100%; /* Full width on mobile. */
		margin-block: var(--bc-mt-m, 12px) var(--bc-mb-m, 12px);
		padding: var(--bc-pt) var(--bc-pr) var(--bc-pb) var(--bc-pl); /* Mobile padding always applies. */
	}

	/* Scroll: one line, swipe sideways. */
	.reelzappy-breadcrumbs--scroll:where(:not([data-bc-bp])) .reelzappy-breadcrumbs__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		white-space: nowrap;
	}

	.reelzappy-breadcrumbs--scroll:where(:not([data-bc-bp])) .reelzappy-breadcrumbs__list::-webkit-scrollbar {
		display: none;
	}

	.reelzappy-breadcrumbs--scroll:where(:not([data-bc-bp])) .reelzappy-breadcrumbs__item {
		flex-shrink: 0;
	}

	/* Collapse: hide middle items, show "…". */
	.reelzappy-breadcrumbs--collapse:where(:not([data-bc-bp])) .reelzappy-breadcrumbs__item--collapsible {
		display: none;
	}

	.reelzappy-breadcrumbs--collapse:where(:not([data-bc-bp])) .reelzappy-breadcrumbs__item--ellipsis {
		display: inline-flex;
	}
}
/* mobile:end */

/* Editor-only empty state. */
.reelzappy-breadcrumbs .reelzappy-breadcrumbs__placeholder {
	padding: 12px 16px;
	border: 1px dashed currentColor;
	border-radius: 8px;
	text-align: center;
	opacity: 0.7;
}
