@charset "utf-8";
/*.thumbnail::before and .summary::before are for checker background
  .thumbnail::after is for r18 indicator
  .inner::before is for current file in a set
  .inner::after is for category overlay*/

/*checkers*/
.summary,
.thumbnail {
	background-attachment: fixed;
	position: relative;
	background-position: center;
	background-color: var(--checker-background);
	background-image: url('data:image/svg+xml,\
		<svg class="checker" xmlns="http://www.w3.org/2000/svg" width="48" height="48">\
			<rect x="24" width="24" height="24" />\
			<rect y="24" width="24" height="24" />\
		</svg>');
}
.summary::before,
.thumbnail::before {
	display: inline-block;
	content: "";
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	font-size: 0;
	background-color: var(--checker-foreground);
	pointer-events: none;
}
/*this puts the actual visible and interactable elements above the checkers*/
.summary .inner,
.thumbnail .inner,
.summary .inner picture,
.summary .inner img,
.summary .inner video,
.summary .inner audio {
	position: relative;
}

/*search*/
#section-search-files {
	display: block;
	width: 100%;
}

/*search field*/
#section-search-files #tags {
	width: 100%;
	border-left: 1px solid var(--form-border);
	border-top-left-radius: 0.5rem;
	border-top-right-radius: 0.5rem;
}
/*tag suggestions*/
/*to not cut off suggestions the containing form needs to not have overflow: hidden*/
#section-search-files form:first-child {
	overflow: visible;
}
/*align search tag suggestions list with upper left of wrapper*/
#section-search-files form:first-child #tag-suggestions-list {
	top: 1px;
	left: 0;
}
.tag-suggestions-list-wrapper {
	display: block;
	width: 100%;
	position: relative;
}
#tag-suggestions-list {
	display: none;
	position: absolute;
	width: auto;
	color: var(--input-foreground);
	background-color: var(--input-background);
	border: 1px solid var(--form-border);
}
#tag-suggestions-list.visible {
	display: block;
}
#tag-suggestions-list .suggestion {
	padding: 0.5rem;
	font-size: 0.8rem;
	text-align: left;
	cursor: pointer;
	white-space: nowrap;
}
#tag-suggestions-list .suggestion:hover,
#tag-suggestions-list .suggestion.highlighted {
	color: var(--submit-foreground);
	background-color: var(--submit-background);
}

/*tags this page*/
#tags-this-page {
	background-color: var(--card-background);
	border: 1px solid var(--card-border);
	border-radius: 0.5rem;
	border-bottom-left-radius: 0.25rem;
	overflow: hidden;
	font-size: 0;
	text-align: left;
	margin-bottom: 1rem;
	padding: 1px;
	padding-top: 0;
}
#tags-this-page h2 {
	background-color: var(--header-background);
	color: var(--header-foreground);
	font-size: 0.8rem;
	font-weight: normal;
	text-align: right;
	padding: 0.25rem 0.5rem;
	margin-left: -1px;
	margin-right: -1px;
}

/*file search navigation*/
#search-files-navigation {
	margin-top: 0.5rem;
}

/*thumbnails grid*/
#section-search-files #results {
	width: 100%;
	display: grid;
	grid-template-columns: repeat(var(--per-search-results-row), 1fr);
	grid-gap: 1px;
}
#section-search-files .pages {
	margin-top: 1rem;
}
/*hack for firefox search grid rendering*/
@-moz-document url-prefix() {
	#section-search-files #results {
		display: block;
		text-align: left;
		font-size: 0;
	}
	#section-search-files #results .thumbnail {
		width: calc(calc(100% - 2rem) / var(--per-search-results-row));
		margin-right: 1px;
		margin-bottom: 1px;
		overflow: hidden;
	}
	#section-search-files #results .thumbnail:nth-child(var(--per-search-results-row)) {
		margin-right: 0;
	}
}

/*thumbnails*/
.thumbnail {
	font-size: 0;
	container-type: inline-size;
	display: inline-block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	position: relative;
}
.thumbnail .inner {
	display: inline-block;
	position: relative;
	width: 100%;
	height: 0;
	max-width: 100%;
	max-height: 0;
	padding-bottom: 100%;
	overflow: hidden;
}
.thumbnail .inner a {
	display: inline-block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
.thumbnail .inner video,
.thumbnail .inner picture,
.thumbnail .inner picture img {
	display: inline-block;
	position: relative;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*hidden*/
#section-search-files .thumbnail[data-hidden] .inner {
	opacity: 0.5;
}
#section-search-files .thumbnail[data-hidden]:hover .inner {
	opacity: 1;
}
/*r18*/
.thumbnail[data-r18] picture {
    filter: blur(20px);
}
.thumbnail[data-r18]:hover picture {
	filter: initial;
}
.thumbnail[data-r18]::after {
	content: "R-18";
	display: inline-block;
	font-size: 8cqw;
	line-height: 12cqw;
	font-weight: bold;
	width: 25%;
	height: 12%;
	position: absolute;
	bottom: 2%;
	left: 2%;
	border-radius: 15%;
	color: white;
	background-color: red;
	border: 1px solid white;
	text-align: center;
	pointer-events: none;
}

/*thumbnail animated gif and video clip should be hidden by default and revealed and played on mouseover by javascript*/
.thumbnail .inner .preview {
	display: none;
}
.thumbnail:hover .inner .preview {
	display: inline-block;
}
.thumbnail:hover .inner .preview + picture {
	display: none;
}

/*type overlay*/
.thumbnail .inner::after {
	content: "";
	display: none;
	position: absolute;
	width: 32%;
	height: 32%;
	top: calc(34% - 2px);
	left: calc(34% - 2px);
	background-color: rgba(0, 0, 0, 0.6);
	border: 1px solid var(--card-border);
	border-radius: 10%;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	pointer-events: none;
}
/*show type overlay for non-images with thumbnails and gifs with duration > 1 with thumbnails*/
.thumbnail:not([data-category="image"]) .inner:not(.placeholder)::after,
.thumbnail[data-mimetype="image/gif"]:not([data-duration="0"]):not([data-duration="1"]) .inner:not(.placeholder)::after {
	display: block;
}
/*type overlay images*/
.thumbnail[data-category="application"] .inner::after {
	background-image: url(file_category_application.svg);
}
.thumbnail[data-category="archive"] .inner::after {
	background-image: url(file_category_archive.svg);
}
.thumbnail[data-category="audio"] .inner::after {
	background-image: url(file_category_audio.svg);
}
.thumbnail[data-mimetype="application/x-shockwave-flash"] .inner::after {
	background-image: url(file_category_flash.svg);
}
.thumbnail[data-category="image"] .inner::after {
	background-image: url(file_category_image.svg);
}
.thumbnail[data-category="text"] .inner::after {
	background-image: url(file_category_text.svg);
}
.thumbnail[data-category="video"] .inner::after,
.thumbnail[data-mimetype="image/gif"]:not([data-duration="0"]):not([data-duration="1"]) .inner::after,
.thumbnail[title*="embed:"] .inner::after {
	background-image: url(file_category_video.svg);
}
.thumbnail:hover .inner::after {
	visibility: hidden;
}

/*set indicators*/
.thumbnail .set-indicators {
	display: inline-block;
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	text-align: left;
	pointer-events: none;
}
.thumbnail .set-indicator {
	display: inline-block;
    width: 18%;
    height: 18%;
    background-color: rgba(0, 0, 0, 0.5);
	border: 1px solid var(--card-border);
    background-image: url(file_set.svg);
    border-radius: 15%;
    overflow: hidden;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: help;
	font-size: 0;
	text-align: center;
	margin-left: 2%;
	margin-top: 2%;
	pointer-events: auto;
}
.thumbnail .set-indicator:hover {
	font-size: 10cqw;
	line-height: 18cqw;
	background-image: none;
}

/*view file*/
.file {
	font-size: 0;
	/*sets can have varying widths so .file should be centered by horizontal margin auto*/
	margin: 0 auto;
}

.file .inner {
	border: 1px solid var(--card-border);
}
.file .inner.placeholder {
	text-align: center;
}
/*category placeholder image or audio thumbnail*/
.file .inner.placeholder img,
.file[data-category="audio"] .inner img {
	display: block;
	width: 256px;
	height: 256px;
	padding: 1rem;
	margin: 0 auto;
}
.file picture,
.file img,
.file video {
	max-width: 100%;
}

/*players*/
/*audio player*/
.file audio {
	color: var(--card-foreground);
	background-color: var(--card-background);
}
/*webkit audio player*/
.file audio::-webkit-media-controls-panel {
	color: var(--card-foreground);
	background-color: var(--card-background);
}

/*rendered text*/
.file .text {
	color: var(--card-foreground);
	background-color: var(--card-background);
	font-family: monospace;
	font-size: 0.75rem;
	text-align: left;
	margin: 1rem;
	padding: 1rem;
	unicode-bidi: embed;
	white-space: pre;
	text-decoration: none;
}
.file .html-fragment {
	font-size: 1rem;
	margin-bottom: 1rem;
}

/*file info*/
.file .file-info,
.file .tags {
	max-width: 100%;
	color: var(--card-foreground);
	border: 1px solid var(--card-border);
	background-color: var(--card-background);
	padding: 0 2px 1px 2px;
	text-align: left;
	font-size: 0;
}
.file .file-info {
	padding-left: 0.5rem;
	padding-right: calc(1rem + 0.5rem);
	padding-top: 1px;
	border-top: none;
	position: relative;
}
.file .file-info .direct-link {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	background-color: var(--background);
	position: absolute;
	top: 1px;
	right: 1px;
	border-radius: 0.25rem;
	opacity: 0.5;
}
.file .file-info .direct-link:hover {
	opacity: 1;
}
.file .file-info .direct-link picture,
.file .file-info .direct-link img {
	width: 100%;
	height: 100%;
}
.file .file-info>span {
	font-size: 0.8rem;
	line-height: 1rem;
}
.file .time,
.file .file-size,
.file .dimensions {
	margin-right: 0.75rem;
}
.file .time {
	cursor: help;
}
/*last item in view file card gets rounded bottom corners*/
.file .file-info:last-child,
.file .file-info:has(+ .description),
.file .file-info:has(+ .set),
.file .tags {
	border-bottom-left-radius: 0.25rem;
	border-bottom-right-radius: 0.25rem;
}
.file .tags {
	margin-top: 1px;
}

/*descriptions*/
.description {
	max-width: 100%;
	padding: 1rem;
	padding-bottom: 0.5rem;
	text-align: left;
	font-size: 1rem;
}

/*sets*/
#section-view-file .set {
	max-width: 100%;
	margin-top: 1rem;
	background-color: var(--card-background);
	border: 1px solid var(--card-border);
	text-align: left;
	border-radius: 0.25rem;
	padding: 1px;
	font-size: 0;
}
/*no set indicators on view file page*/
#section-view-file .set-indicator {
	display: none;
}
#section-view-file .set .thumbnail {
	width: var(--set-thumbnail-edge);
	border-radius: 0.25rem;
	border: 1px solid var(--card-foreground);
	overflow: hidden;
	margin: 1px;
}
#section-view-file .set .thumbnail .inner {
	border: none;
}
/*current file in set*/
#section-view-file .set .thumbnail.current::before {
	content: "";
	display: block;
	width: var(--set-thumbnail-edge);
	height: var(--set-thumbnail-edge);
	background-image: url(location_pin.svg);
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	pointer-events: none;
	background-color: var(--header-background);
	opacity: 0.75;
	z-index: 10;
}
/*no inner thumbnail elements*/
#section-view-file .set .thumbnail.current .inner a {
	cursor: default;
	pointer-events: none;
}
/*no overlays*/
#section-view-file .set .thumbnail[data-category].current .inner::after {
	display: none;
}
/*no r18 indicator*/
#section-view-file .set .thumbnail.current[data-r18]::after {
	display: none;
}

/*edit*/
.scripts-enabled #section-edit-file {
	margin-top: 2rem;
}
.scripts-enabled #section-edit-file h2 {
	display: none;
}
.scripts-enabled #section-edit-file form {
	overflow: visible;
}
.scripts-enabled #section-edit-file .tag-field {
	width: 100%;
	border: none;
}
.scripts-enabled #section-edit-file #tag-suggestions-list-wrapper {
	position: relative;
}
.scripts-enabled #section-edit-file #tag-suggestions-list {
	bottom: calc(1px);
	left: 0px;
}
.scripts-enabled #section-edit-file #tag-suggestions-list:empty {
	display: none;
}
.scripts-enabled #section-edit-file .tags-preview-wrapper.empty {
    display: none;
}


/*store files*/
#section-store-files script + .stored-file {
	margin-top: 1rem;
}
#section-store-files .stored-file {
	width: 400px;
	height: 128px;
	overflow: hidden;
	border-radius: 0.5rem;
	margin-bottom: 0.5rem;
	border: 1px solid var(--card-border);
}
/*this doesn't work for some reason* /
#section-store-files .stored-file .inner img {
	object-position: center center;
}/**/
#section-store-files .stored-file .thumbnail .inner video,
#section-store-files .stored-file .thumbnail .inner picture,
#section-store-files .stored-file .thumbnail .inner picture img {
	top: -64px;
}
#section-store-files .stored-file .file-store-error {
	color: var(--danger-foreground);
	background-color: var(--danger-background);
	padding: 0.25rem;
}
#section-store-files .stored-file:has(.file-store-error) {
	border: 1px solid var(--danger-border);
}

/*narrower screens*/
@media only screen and (max-width: 1024px) {
	:root {
		--per-search-results-row: 4;
	}
}
@media only screen and (max-width: 600px) {
	:root {
		--per-search-results-row: 2;
	}
}

/*feed*/
.feed .thumbnail::before {
	background-color: black;
}