src/static/scripts/components/feed/feedItem/_feedItem.scss
@use '../../../../style/vars';
@use '../../../../style/shadow';

.user {
	display: flex;
	align-items: center;
	gap: .5rem;


	&.mod {
		&::after {
			content: "";
			display: inline-block;
			width: 0;
			height: 0;
			border-top: 0.6em solid vars.$user-mod-color;
			border-left: 0.3em solid transparent;
			border-right: 0.3em solid transparent;
			border-radius: 50%;
		}

		* {
			color: vars.$user-mod-color;
		}
	}

	&.admin {
		&::after {
			content: "";
			display: inline-block;
			width: .6em;
			height: .6em;
			border-radius: 50%;
			background: vars.$user-admin-color;
		}

		* {
			color: vars.$user-admin-color;
		}
	}

	&.op {
		margin-right: .75rem;
		margin-left: .75rem;
		position: relative;

		&::before {
			content: "";
			position: absolute;
			z-index: -1;
			width: 100%;
			height: 100%;
			background: vars.$primary-contrast;
			padding: .125rem 0.6rem;
			margin-left: -.6rem;
			border-radius: 1rem;
		}

		&.mod::before {
			background: vars.$user-mod-bg;
		}

		&.admin::before {
			background: vars.$user-admin-bg;
		}

		* {
			color: vars.$text-on-primary;
		}
	}

	.cakeDay {
		height: 1rem;
		margin-left: -0.3rem;
	}

	.controversial {
		height: 1.25rem;
		width: 1rem;
		margin-left: -0.5rem;
		background-image: url("/img/cross.svg");
		background-size: cover;
	}
}

.feedItem {
	display: flex;
	position: relative;

	&.isInFeed {
		background: vars.$background-el1;
		border: 1px solid vars.$border-color;
		border-radius: vars.$border-radius;
		@extend %shadow-diffuse;

		&.isHidden {
			visibility: hidden;
		}

		&.remove {
			display: none;
		}

		.backgroundLink {
			position: absolute;
			top: 0;
			left: 0;
			z-index: 0;
			width: 100%;
			height: 100%;
			transition: none;
			filter: initial;
		}

		a:not(.backgroundLink), .content > *, .time {
			position: relative;
		}

		.loadArchivedBtn {
			margin-left: 2rem;
			margin-bottom: 2rem;
		}
	}

	img.pinned {
		width: 1.25rem;
		height: 1.25rem;
		transform: translateY(0.1rem) rotate(45deg);
		--svg-fill: #88ff76;
	}

	.actions {
		display: flex;
		flex-direction: column;
		align-items: center;

		.upvotes {
			height: .6rem;
			line-height: .7rem;
		}
	}

	.header {
		.locked {
			margin-left: auto;
			margin-right: 1rem;

			> img {
				height: 1.25em;
			}
		}
	}

	.content {
		word-break: break-word;
		overflow-wrap: anywhere;
		max-width: 100%;
	}

	.loadArchivedBtn {
		height: 1.75rem;
		padding: 0 0.5rem;
		border-radius: 1rem;
		border: 2px solid #a3a3a3;
		line-height: 1.75rem;
		font-size: 0.95rem;
		display: flex;
		align-items: center;
		align-self: flex-start;
		transition: all .25s ease !important;

		&::before {
			content: "";
			display: inline-block;
			width: 1.25rem;
			height: 1.25rem;
			margin-left: -.3rem;
			margin-right: .3rem;
			background-image: url("/img/reset.svg");
			background-size: contain;
			background-repeat: no-repeat;
		}

		&.loading {
			&::before {
				width: 1.75rem;
				margin-right: 0;
				background-image: url("/img/loading3.svg");
			}
		}

		&:hover:not(:disabled) {
			color: vars.$primary-contrast;
			border-color: vars.$primary-contrast;
		}
		
		&:active:not(:disabled) {
			border-color: vars.$primary-contrast;
			background: vars.$primary-contrast;
			color: vars.$text-on-primary;
		}
	}
}
