/*
 * Styles for WooYeah's signature pattern elements: the type list, the
 * marquee, numbered captions, wordmark logos and stats.
 *
 * Loaded on the front end and in the editor.
 */

/* ---------------------------------------------------------------------------
 * Type list: an oversized list of links where each row turns into an
 * inverted bar on hover or focus. Works on List and Product Categories.
 * ------------------------------------------------------------------------ */

.is-style-wooyeah-type-list,
.is-style-wooyeah-type-list ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.is-style-wooyeah-type-list li {
	position: relative;
	margin: 0;
	border-top: var(--wp--custom--hairline);
}

.is-style-wooyeah-type-list li:last-child {
	border-bottom: var(--wp--custom--hairline);
}

.is-style-wooyeah-type-list a {
	position: relative;
	z-index: 0;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.15em 0.1em;
	color: inherit;
	font-family: var(--wp--preset--font-family--bricolage-grotesque);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.05;
	text-decoration: none;
	text-transform: uppercase;
	transition: color var(--wp--custom--transition), padding var(--wp--custom--transition);
}

.is-style-wooyeah-type-list a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--contrast);
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform var(--wp--custom--transition);
}

.is-style-wooyeah-type-list a:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--base);
	padding-inline: 0.4em;
}

.is-style-wooyeah-type-list a:is(:hover, :focus-visible)::before {
	transform: scaleY(1);
}

/*
 * Product Categories prints the count after the link, so it is placed at the
 * row's right edge, over the hover bar, and follows the link colour.
 */
.is-style-wooyeah-type-list .wc-block-product-categories-list-item-count {
	position: absolute;
	inset-inline-end: 0.5em;
	top: 50%;
	z-index: 1;
	transform: translateY(-50%);
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0;
	pointer-events: none;
	transition: color var(--wp--custom--transition);
}

.is-style-wooyeah-type-list li:is(:hover, :focus-within) > .wc-block-product-categories-list-item-count {
	color: var(--wp--preset--color--base);
}

.is-style-wooyeah-type-list .wc-block-product-categories-list-item-count::before,
.is-style-wooyeah-type-list .wc-block-product-categories-list-item-count::after {
	content: none;
}

.is-style-wooyeah-type-list .wc-block-product-categories-list--depth-1 {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Marquee: a Group whose inner row scrolls sideways forever. The row holds
 * the items twice, so moving it by half its width loops seamlessly.
 * ------------------------------------------------------------------------ */

.is-style-wooyeah-marquee {
	overflow: hidden;
}

.is-style-wooyeah-marquee > .wp-block-group {
	flex-wrap: nowrap;
	width: max-content;
	animation: wooyeah-marquee 40s linear infinite;
}

.is-style-wooyeah-marquee > .wp-block-group > * {
	flex-shrink: 0;
	margin: 0;
	white-space: nowrap;
}

.is-style-wooyeah-marquee:hover > .wp-block-group,
.is-style-wooyeah-marquee:focus-within > .wp-block-group {
	animation-play-state: paused;
}

@keyframes wooyeah-marquee {

	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {

	.is-style-wooyeah-marquee > .wp-block-group {
		flex-wrap: wrap;
		width: auto;
		animation: none;
	}
}

/* Star separators between marquee items. */
.wooyeah-marquee-star {
	color: var(--wp--preset--color--accent);
}

/* ---------------------------------------------------------------------------
 * Small editorial helpers
 * ------------------------------------------------------------------------ */

/* Section index such as "03". */
.wooyeah-index {
	font-family: var(--wp--preset--font-family--instrument-serif);
	font-style: italic;
	line-height: 1;
}

/* Text wordmarks in the logo row. */
.wooyeah-wordmark {
	margin: 0;
	opacity: 0.55;
	transition: opacity var(--wp--custom--transition);
}

.wooyeah-wordmark:hover {
	opacity: 1;
}

/* Large numbers in the stats row. */
.wooyeah-stat-number {
	font-family: var(--wp--preset--font-family--bricolage-grotesque);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1;
}

/* Image tiles: caption sits on the image, slow zoom on hover. */
.wooyeah-tile {
	position: relative;
	overflow: hidden;
}

.wooyeah-tile .wp-block-cover__image-background {
	transition: transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.wooyeah-tile:is(:hover, :focus-within) .wp-block-cover__image-background {
	transform: scale(1.05);
}

.wooyeah-tile a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* Offset image in editorial splits: pushed down on wide screens. */
@media (min-width: 782px) {

	.wooyeah-offset-down {
		margin-block-start: var(--wp--preset--spacing--70);
	}
}

/* Quote marks in testimonials. */
/* Instrument Serif draws a small quote glyph, hence the large size. */
.wooyeah-quote-mark {
	font-family: var(--wp--preset--font-family--instrument-serif);
	font-size: 9rem;
	line-height: 0.75;
	height: 0.5em;
	margin-bottom: 0;
}

/* Size guide table: hairline rows, label-style header, tabular numbers. */
.wooyeah-size-table table {
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.wooyeah-size-table :is(th, td) {
	padding: 0.8em 0.75em 0.8em 0;
	border: 0;
	border-bottom: var(--wp--custom--hairline);
	text-align: start;
}

.wooyeah-size-table thead :is(th, td) {
	border-bottom: 1px solid var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wooyeah-size-table tbody td:first-child {
	font-weight: 600;
}

/* Text links inside light-on-dark covers follow the cover's text colour. */
.wp-block-cover.has-base-color a:not(.wp-element-button) {
	color: inherit;
}
