/* Stuff common to both Display.template.php and Post.template.php */
.attachments {
	background: var(--attachments-bg);
	border-color: var(--attachments-border-color);
	border-radius: var(--attachments-border-radius);
	border-style: var(--attachments-border-style);
	border-width: var(--attachments-border-width);
	box-shadow: var(--attachments-box-shadow);
	display: grid;
	font-size: var(--attachments-font-size);
	gap: .75em .5em;
	grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
	line-height: var(--attachments-line-height);
	padding-block: 1em .25em;
	padding-inline: .25em;
}
.attached {
	align-items: flex-end;
	align-self: flex-end;
	display: grid;
	grid-template-rows: auto 1fr;
	padding: .25em .5em;
	position: relative;
}
.attachments_top {
	align-items: flex-end;
	display: flex;
	margin-inline: auto;
	height: 125px;
	justify-content: center;
	overflow: hidden;
	padding-block: 0 .5em;
	width: 100%;
}
.attachments_top :is(a, img) {
	height: 100%;
	width: 100%;
}
.attachments_top img {
	object-fit: contain;
}
.attachments_bot {
	overflow: hidden;
	text-overflow: ellipsis;
}
.attachments_bot a,
.attachments_bot .name,
.attachments_info .name {
	white-space: nowrap;
}
.attachments hr {
	clear: both;
	margin: 12px 0;
}

/* Stuff unique to Post.template.php */
div#post_attachments_area.roundframe {
	--roundframe-border-width: 0 1px 1px;
	--roundframe-border-color: var(--input-border-color);
	overflow: visible;
	padding: 0;
}
#post_attachments_area #postAttachment,
#post_attachments_area #postAttachment2,
#post_attachments_area #attachment_previews {
	padding: initial;
}
#post_attachments_area #postAttachment input {
	line-height: initial;
}
#post_attachments_area #postAttachment .attached input[type="checkbox"] {
	position: absolute;
	inset-inline-end: 0;
	top: 0;
}
#post_attachments_area .attachment_spacer {
	display: flex;
	flex: 1 1 200px;
	flex-flow: column;
	min-width: 200px;
	order: 9999;
}
#post_attachments_area .attach_drop_zone_label {
	font-weight: bold;
	margin: auto;
	width: 100%;
}
#post_attachments_area .attachment_restrictions {
	flex: 0 0 auto;
	display: flex;
	flex-flow: row wrap;
	justify-content: center;
}
#post_attachments_area .attachment_restrictions > * {
	margin: 0 2ch;
}
#post_attachments_area .dz-image-preview {
	align-items: center;
	flex: 1 0 auto;
	display: flex;
	flex-flow: column;
	justify-content: center;
	margin: 0;
	position: relative;
}
#post_attachments_area .dz-image-preview .attachment_preview_wrapper {
	align-items: center;
	display: flex;
	flex: 1 0 auto;
	flex-flow: column;
	justify-content: center;
	padding: 5px;
	width: 200px;
}
#post_attachments_area .dz-image-preview:not(.errorbox) .attachment_preview_wrapper {
	position: relative;
}
#post_attachments_area #attachment_previews {
	background: var(--attachments-bg);
	border-color: var(--attachments-border-color);
	border-radius: var(--attachments-border-radius);
	border-style: var(--attachments-border-style);
	border-width: var(--attachments-border-width);
	box-shadow: var(--attachments-box-shadow);
	display: none;
	flex-flow: row wrap;
	justify-content: space-evenly;
}
#post_attachments_area #attachment_previews .descbox .attachment_preview_wrapper,
#post_attachments_area #attachment_previews .errorbox .attachment_preview_wrapper,
#post_attachments_area #attachment_previews .infobox .attachment_preview_wrapper {
	padding: initial;
	width: 155px;
}
#post_attachments_area #attachment_previews .descbox .attach-preview,
#post_attachments_area #attachment_previews .errorbox .attach-preview,
#post_attachments_area #attachment_previews .infobox .attach-preview {
	display: none;
}
#post_attachments_area #attachment_previews .attach-preview {
	display: flex;
	flex: 1 1 auto;
	justify-content: center;
	margin: 0.5em 0;
	max-height: 200px;
	min-height: 75px;
	width: auto;
}
#post_attachments_area #attachment_previews .attach-preview img {
	object-fit: contain;
}
#post_attachments_area #attachment_previews .attachment_info {
	flex: initial;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	width: auto;
}
#post_attachments_area #attachment_previews .attachment_info span:not(:first-child)::before {
	content: "";
	display: block;
}
#post_attachments_area #attachment_previews .attach-ui {
	border-radius: 4px;
	box-shadow: none;
	inset-inline-end: 5px;
	margin: 0;
	min-height: initial;
	padding: 0.5ch;
	position: absolute;
	top: 5px;
	z-index: 2;
}
#post_attachments_area #attachment_previews .attach-ui a {
	font-weight: 700;
	margin-inline: .25em;
	text-decoration: none;
}
#post_attachments_area .attached_BBC_width_height {
	clear: both;
	display: none;
}
#post_attachments_area .attached_BBC_width,
#post_attachments_area .attached_BBC_height {
	display: block;
	margin: 0;
	padding: 5px 0;
}
#post_attachments_area #attachment_upload {
	border: 2px dashed transparent;
	border-radius: 5px;
	min-height: initial;
}
#post_attachments_area #attachment_upload.dz-drag-hover {
	border-color: var(--input-border-color);
}
#post_attachments_area .dz-clickable {
	cursor: pointer;
}
#post_attachments_area #drop_zone_ui {
	display: none;
	min-width: 100%;
	flex-flow: row wrap;
	padding: .75em .5em;
}
#post_attachments_area #max_files_progress {
	display: none;
	border-radius: var(--roundframe-border-radius);
	border-start-end-radius: 0;
	border-start-start-radius: 0;
	border-width: 1px 0 0;
}
#post_attachments_area #max_files_progress_text {
	display: none;
	position: relative;
	z-index: 1;
}
#post_attachments_area #max_files_progress,
#post_attachments_area .progress_bar .bar {
	z-index: initial;
}