@import 'mediawiki.mixins';
@import '../flow.colors';

.flow-timestamp {
	box-sizing: border-box;
	padding-right: 0.5em;

	span {
		// Prevent the user name from appearing in the middle of the timestamp if it has a different directionality (T94403)
		unicode-bidi: embed;
		// Force the interface direction to prevent the month name from appearing in the wrong place (T177455)
		direction: ltr;
	}

	.flow-timestamp-user-formatted {
		display: none;
	}

	.flow-timestamp-ago {
		display: inline;
		// This should flip with interface language
		direction: ltr;
	}

	&:hover {
		.flow-timestamp-user-formatted {
			display: inline;
		}

		.flow-timestamp-ago {
			display: none;
		}
	}
}

.flow-post-timestamp {
	// Prevent the user name from displaying on the wrong side of "Edited by" (T177455)
	unicode-bidi: embed;
	direction: ltr;
}

.flow-timestamp-ago,
.flow-timestamp-user-formatted {
	display: block;
	position: relative;
}

.flow-timestamp-ago {
	margin-top: -1em;
}

a.flow-timestamp-anchor {
	&,
	&:visited {
		color: inherit;
	}
}

// Colors are from mediawiki.skinning/elements.css
// FIXME: Could use a.flow-timestamp-anchor:not( :hover ) to set color to gray
// only when *not* hovering (and avoid the copied colors).
a.flow-timestamp-anchor:hover {
	color: #0645ad;

	&:visited {
		color: #0b0080;
	}

	&:active {
		color: #faa700;
	}
}
