/* Begin horizontal attachments */
.postbody .inline-attachment {
	display: inline-block;
	vertical-align: top;
	width: calc(25% - 8px);
	margin: 4px 8px 4px 0;
	box-sizing: border-box;
	min-width: 0;
}

/* files (zip, pdf, ...) : keep spacing */
.postbody .inline-attachment dl.file {
	margin: 0;
	padding: 2px 4px;
}

/* long file names may break anywhere */
.postbody .inline-attachment dl.file dt {
	white-space: normal;
	overflow-wrap: anywhere;
}

/* size / download count : break between words only */
.postbody .inline-attachment dl.file dd {
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
}

.postbody .inline-attachment dl.file dt img {
	vertical-align: middle;
	margin-right: 4px;
}

/* images */
div.inline-attachment img {
	max-width: 100%;
	height: auto;
	display: block;
}

@media (max-width: 1400px) {
	.postbody .inline-attachment { width: calc(33.333% - 70px); }
}

@media (max-width: 1000px) {
	.postbody .inline-attachment { width: calc(50% - 8px); }
}

@media (max-width: 600px) {
	.postbody .inline-attachment { width: 100%; margin-right: 0; }
}

/* Deactivate horizontal in toggle BBCode */
.toggle_container div.inline-attachment {
	display: block !important;
	width: auto !important;
	max-width: 100% !important;
	margin: 5px 0 !important;
}



.inline-attachment dl.extra-box {
  display: flex;
  flex-direction: column;
  width: 300px;
  min-height: 60px;
  margin-bottom: 12px;  
  position: relative;
  border-radius: 7px;
  font-family: var(--font-main);
  font-weight: 600;
  color: #ffffff !important;
  box-shadow: var(--box-shadow);
  text-decoration: none !important;
  overflow: hidden;
  box-sizing: border-box;
}

.toggle_container div.inline-attachment {
	display: block !important;
	width: auto !important;
	max-width: 100% !important;
	margin: 5px 0 !important;
}

/* file box of the style : full height, no mid-word break */
.inline-attachment dl.extra-box {
	height: auto !important;
	max-height: none !important;
}

/* file name : may break anywhere, room for the download arrow */
.inline-attachment dl.extra-box dt {
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	padding-right: 30px;
}

/* size / download count : break between words only */
.inline-attachment dl.extra-box dd {
	height: auto !important;
	max-height: none !important;
	white-space: normal !important;
	word-break: normal !important;
	overflow-wrap: break-word !important;
	hyphens: none !important;
}

/* wider column for files (images keep their column) */
.postbody .inline-attachment:has(dl.extra-box) {
	width: auto;
	max-width: 100%;
}

/* wider file box */
.inline-attachment dl.extra-box {
	width: 380px;
	max-width: 100%;
}
