src/static/scripts/components/comment/_comment.scss
@use '../../../style/vars';
@use '../../../style/shadow';

.comment {
	padding: .5rem 0;

	&.highlight {
		border: 1px solid rgba(vars.$primary-var, 0.49);
		border-radius: 0.5rem;
	}

	&.new {
		background-color: vars.$background-el2;
		
		&:first-of-type {
			border-top-left-radius: 0.5rem;
			border-top-right-radius: 0.5rem;
		}

		&:last-child, &.lastNew {
			border-bottom-left-radius: 0.5rem;
			border-bottom-right-radius: 0.5rem;
		}
	}

	&:not(.new) + .new {
		border-top-left-radius: 0.5rem;
		border-top-right-radius: 0.5rem;
	}

	&.rootComment {
		padding: 0.5rem 0 0.5rem 1rem;

		> div > .replies {
			position: relative;
			z-index: 1;
		}
	}

	&.isCollapsed {

		.actions > :not(.commentCollapser) {
			display: none;
		}

		.replies, .content {
			display: none;
		}

		.loadArchivedBtn {
			display: none;
		}
	}

	&:not(.isCollapsed) {
		> div >.header > .upvotesCollapsedOnly {
			display: none;
		}
	}

	&.isEditing {
		> div {
			>.content {
				display: none;
			}

			> .editForm {
				display: inherit;
			}
		}
	}

	&.isReplying {
		 > * > .replies > .replyForm {
			display: inherit;
		}
	}

	.markdownForm {
		display: none;
		margin-left: .2rem;
		margin-right: 1rem;
	}

	.header {
		flex-wrap: wrap;
		margin-bottom: .25rem;
		align-items: center;

		> * {
			margin: 0 .125rem;
		}

		> span {
			font-size: .8em;
			margin: 0 0.1rem;
		}
	}

	.actions {
		width: 2rem;

		.upvotes {
			&.medium {
				font-size: .9em;
			}

			&.small {
				font-size: .75em;
			}
		}

		.voteButton, .voteButton > button {
			width: 2.3rem;
			height: 2.3rem;
		}

		.dropDownButton {
			background-image: url("/img/kebab.svg");
			background-size: contain;
			border: none;
			padding: 0;
			margin-bottom: 0.35rem;
			margin-top: -0.35rem;
			width: 2.3rem;
			height: 2.3rem;
		}

		.dropDownArea {
			margin: 0 0 0 .5rem;
		}
	}

	.commentCollapser {
		width: 100%;
		height: calc(100% - 1rem);
		min-height: 1.5rem;
		cursor: pointer;
		margin: auto;
		display: flex;
		justify-content: center;

		> div {
			width: .2rem;
			background-color: vars.$comment-collapser-bg;
			height: 100%;
			transition: all .25s ease;
		}

		&:hover > div {
			width: .3rem;
			background-color: vars.$comment-collapser-hover-bg;

		}
	}

	.content {
		margin-right: 2rem;
		margin-left: .2rem;

		> .md {
			> p:first-child {
				margin-block-start: 0.5em;
			}
			> p:last-child {
				margin-block-end: 0.5em;
			}
		}
	}

	.replies {
		transform: translateX(-0.2rem);
		margin-right: -.2rem;
	}

	.loadMoreButton {
		padding: .3rem .75rem;
		display: flex;
		align-items: center;

		img {
			height: calc(1em + 0.3rem);
			transform: scale(1.7);
			margin: 0 1.5rem;
		}
	}
}
