/* Benchnote blocks. Colours and fonts come from the theme where it offers them. */

.wp-block-benchnote-period {
	font-variant-numeric: tabular-nums;
}

/* Status badge */
.wp-block-benchnote-status,
.benchnote-status {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	width: fit-content;
	padding: 0.2em 0.75em;
	border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
	border-radius: 999px;
	font-size: 0.85em;
	line-height: 1.4;
}

.benchnote-status__dot {
	width: 0.55em;
	height: 0.55em;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}

.is-status-idea .benchnote-status__dot {
	background: transparent;
	border: 1.5px dashed currentColor;
}

.is-status-building .benchnote-status__dot {
	background: var(--wp--preset--color--primary, #c0612b);
	animation: benchnote-pulse 1.8s ease-in-out infinite;
}

.is-status-shipped .benchnote-status__dot {
	background: var(--wp--preset--color--secondary, #4f7a3a);
}

.is-status-retired {
	opacity: 0.7;
}

.is-status-retired .benchnote-status__dot {
	background: color-mix(in srgb, currentColor 40%, transparent);
}

@keyframes benchnote-pulse {
	50% {
		opacity: 0.35;
	}
}

@media (prefers-reduced-motion: reduce) {
	.is-status-building .benchnote-status__dot {
		animation: none;
	}
}

/* Facts */
.wp-block-benchnote-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: 1.25rem;
	margin-block: 2rem;
	padding-block: 1.25rem;
	border-block: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

.wp-block-benchnote-facts dt {
	margin: 0 0 0.3rem;
	font-size: 0.75em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.8;
}

.wp-block-benchnote-facts dd {
	margin: 0;
}

/* Log: a timeline */
.wp-block-benchnote-log {
	list-style: none;
	margin-block: 2rem;
	padding: 0;
}

.benchnote-log__entry {
	position: relative;
	margin: 0;
	padding: 0 0 1.5rem 1.75rem;
	border-left: 2px solid color-mix(in srgb, currentColor 15%, transparent);
}

.benchnote-log__entry:last-child {
	padding-bottom: 0.25rem;
	border-left-color: transparent;
}

.benchnote-log__entry::before {
	content: "";
	position: absolute;
	left: -0.45rem;
	top: 0.3rem;
	width: 0.8rem;
	height: 0.8rem;
	border: 2px solid var(--wp--preset--color--primary, currentColor);
	border-radius: 50%;
	background: var(--wp--preset--color--base, #fff);
	box-sizing: border-box;
}

.benchnote-log__date {
	display: block;
	font-size: 0.8em;
	opacity: 0.8;
	font-variant-numeric: tabular-nums;
}

.benchnote-log__title {
	display: block;
	margin-top: 0.15rem;
}

.benchnote-log__text {
	margin: 0.3rem 0 0;
	opacity: 0.85;
}

/* Related projects */
.wp-block-benchnote-related {
	margin-block: 3rem 1rem;
}

.benchnote-related__heading {
	margin: 0 0 1rem;
	font-size: 1.25em;
}

.benchnote-related__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.benchnote-related__link {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	color: inherit;
	text-decoration: none;
}

.benchnote-related__image {
	display: block;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 4 / 3;
	margin-bottom: 0.35rem;
}

.benchnote-related__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (prefers-reduced-motion: no-preference) {
	.benchnote-related__image img {
		transition: transform 0.4s ease;
	}

	.benchnote-related__link:hover .benchnote-related__image img {
		transform: scale(1.03);
	}
}

.benchnote-related__title {
	font-weight: 600;
}

.benchnote-related__link:hover .benchnote-related__title {
	text-decoration: underline;
}

.benchnote-related__period {
	font-size: 0.85em;
	opacity: 0.8;
}

/* Default single-project template */
.benchnote-meta {
	gap: 0.75rem;
	align-items: center;
}

.benchnote-meta > * {
	margin: 0;
}

.benchnote-lede {
	font-size: 1.2em;
	opacity: 0.85;
}

/* Editor hints */
.benchnote-hint {
	padding: 0.75rem 1rem;
	border: 1px dashed color-mix(in srgb, currentColor 30%, transparent);
	border-radius: 8px;
	font-size: 0.85em;
	opacity: 0.8;
}
