/*
 * Design "Sachsen Roleplay" -- Bildhosting-Teil
 * Upload, Bilderraster, Bildansicht, Kommentare, Suche, Meldedialog.
 * Wird nach style.css geladen (SetCssDatei in MIHS.class.php).
 */

/* ------------------------------------------------------------------ *
 * 1. Upload-Schaltflaeche
 * ------------------------------------------------------------------ */
input.submit_upload {
	width: auto;
	min-width: 230px;
	height: auto;
	padding: 13px 26px;
	color: var(--bg);
	background-image: none;
	background: linear-gradient(180deg, var(--gold-hell), var(--gold));
	border: 0;
	border-radius: var(--radius-klein);
	box-shadow: 0 6px 20px rgba(242, 194, 0, 0.22);
	font-family: var(--eng);
	font-size: 18px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	cursor: pointer;
	transition: box-shadow .15s ease, transform .05s ease;
}
input.submit_upload:hover {
	filter: none;
	opacity: 1;
	box-shadow: 0 8px 26px rgba(242, 194, 0, 0.36);
}
input.submit_upload:active { transform: translateY(1px); }

/* ------------------------------------------------------------------ *
 * 2. Ladeanzeige waehrend des Uploads
 * ------------------------------------------------------------------ */
#images_upload_warten {
	float: none;
	width: 100%;
	height: auto;
	min-height: 240px;
	margin: 0;
	padding: 40px 20px;
	text-align: center;
	cursor: wait;
	display: none;
}
#images_upload_warten h2 { color: var(--gold); }

div.upload_progress { width: 100%; max-width: 420px; margin: 0 auto; }
div.upload_progress div.statusbar {
	width: 100%;
	padding: 2px;
	background-color: var(--bg);
	border: 1px solid var(--linie);
	border-radius: 999px;
	overflow: hidden;
}
div.upload_progress div.statusbar div.bar {
	height: 16px;
	background: linear-gradient(90deg, var(--gold-tief), var(--gold));
	border-radius: 999px;
	transition: width .2s ease;
}
div.upload_progress div.statusbar div.text {
	position: absolute;
	width: 100%;
	max-width: 420px;
	padding: 1px;
	text-align: center;
	font-size: 12px;
	color: var(--text);
}
div.upload_progress div.statustext {
	padding-top: 8px;
	text-align: center;
	font-size: 13px;
	color: var(--gedaempft);
}

/* ------------------------------------------------------------------ *
 * 3. Startseite: Upload-Formular und Hinweiskasten
 *    Im Original standen beide als gefloatete Kaesten mit fester Breite
 *    nebeneinander -- und liessen, sobald das Formular die volle Breite
 *    bekam, eine grosse Leerflaeche stehen. Als Raster teilen sie sich den
 *    Platz und stapeln sich auf schmalen Geraeten von selbst.
 * ------------------------------------------------------------------ */
div.start_raster {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 290px;
	gap: 18px;
	align-items: start;
}
div.start_raster > div { margin-bottom: 0; }
/* Der Hinweiskasten liest sich als Randspalte, nicht als zweites Formular */
div.start_hinweis {
	background-color: var(--flaeche-2);
	border: 1px solid var(--linie);
	font-size: 14px;
	color: var(--gedaempft);
}
div.start_hinweis ul { padding-left: 18px; margin-top: 4px; }
div.start_hinweis li { font-size: 13.5px; }

@media (max-width: 900px) {
	div.start_raster { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ *
 * 3b. Weitere Kaesten
 * ------------------------------------------------------------------ */
div.such_box, div.images_box, div.neue_bilder {
	width: 100%;
	padding: 20px;
	text-align: left;
	background-color: var(--flaeche);
	border: 1px solid var(--linie-weich);
	border-radius: var(--radius);
}
div.such_box { margin-bottom: 18px; }

/* ------------------------------------------------------------------ *
 * 4. Bild melden
 * ------------------------------------------------------------------ */
div.images_melden_box {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 100;
	width: min(420px, calc(100vw - 32px));
	margin: 0;
	padding: 22px;
	transform: translate(-50%, -50%);
	margin-top: 0;
	margin-left: 0;
	text-align: center;
	color: var(--text);
	background-color: var(--flaeche-2);
	border: 1px solid rgba(217, 80, 63, 0.55);
	border-radius: var(--radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
	display: none;
}
div.images_melden_box div.titel {
	padding: 0 0 8px 0;
	color: var(--rot);
	font-family: var(--kopf);
	font-size: 22px;
	font-weight: 400;
	letter-spacing: .04em;
}
div.images_melden_box div.text { color: var(--gedaempft); font-style: normal; }
div.images_melden_box table.formular { width: 100%; text-align: center; margin-top: 12px; }
div.images_melden_box table.formular .s1 {
	width: 110px;
	padding: 6px;
	text-align: right;
	font-weight: 600;
}
div.images_melden_box table.formular .s2 { padding: 6px; text-align: left; }

/* ------------------------------------------------------------------ *
 * 5. Bilderraster
 * ------------------------------------------------------------------ */
/* Wie im Mitgliederbereich kann zwischen Kasten und Kacheln ein <form>
   liegen -- beide Ebenen bekommen das Nebeneinander. */
div.images_box, div.neue_bilder,
div.images_box > form, div.neue_bilder > form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-start;
}
div.images_box > form, div.neue_bilder > form { width: 100%; }
div.images_rahmen {
	float: none;
	width: 138px;
	height: auto;
	min-height: 168px;
	margin: 0;
	padding: 8px;
	text-align: center;
	background-color: var(--flaeche-2);
	border: 1px solid var(--linie-weich);
	border-radius: var(--radius-klein);
	transition: border-color .15s ease, transform .1s ease;
}
div.images_rahmen:hover {
	border-color: var(--linie-stark);
	transform: translateY(-2px);
}
div.images_rahmen div.bild_box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 120px;
	height: 110px;
	margin: 0 auto 6px auto;
	background-color: var(--bg);
	border-radius: 4px;
	overflow: hidden;
}
div.images_rahmen div.bild_box img { max-width: 118px; max-height: 108px; }
div.images_rahmen div.info_box {
	width: 120px;
	margin: 0 auto;
	text-align: center;
	font-size: 12.5px;
	color: var(--gedaempft);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
div.images_rahmen div.info_box.basename { color: var(--text); font-weight: 600; }
div.images_rahmen div.info_box.size,
div.images_rahmen div.info_box.aufloesung { font-style: normal; }

/* ------------------------------------------------------------------ *
 * 6. Bildansicht
 * ------------------------------------------------------------------ */
div.view_images {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 50;
	width: auto;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	padding: 14px;
	transform: translate(-50%, -50%);
	background-color: var(--flaeche);
	border: 1px solid var(--linie);
	border-radius: var(--radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
	overflow: auto;
	display: none;
}
div.view_images img { max-width: 100%; height: auto; border-radius: 4px; }

/* ------------------------------------------------------------------ *
 * 7. Kurzhinweise
 * ------------------------------------------------------------------ */
a.tooltip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 17px;
	height: 17px;
	margin-left: 3px;
	color: var(--bg);
	background: var(--gedaempft);
	border-radius: 50%;
	font-size: 11px;
	font-weight: 700;
	text-decoration: none;
	vertical-align: middle;
}
a.tooltip:hover { background: var(--gold); color: var(--bg); }
a.tooltip div { display: none; text-decoration: none; }
a.tooltip:hover div { display: block; }

div.tooltip {
	position: absolute;
	left: 0;
	top: 22px;
	z-index: 60;
	width: 230px;
	padding: 10px 12px;
	color: var(--text);
	background-color: var(--flaeche-2);
	border: 1px solid var(--linie);
	border-radius: var(--radius-klein);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
	display: none;
}

/* ------------------------------------------------------------------ *
 * 8. Kommentare
 * ------------------------------------------------------------------ */
div.bild_kommentare { padding-bottom: 8px; }

div.bild_kommentar {
	width: 100%;
	margin-bottom: 14px;
	text-align: left;
	background-color: var(--flaeche);
	border: 1px solid var(--linie-weich);
	border-radius: var(--radius-klein);
	overflow: hidden;
}
div.bild_kommentar div.autor {
	padding: 9px 13px;
	background-color: var(--flaeche-2);
	border-bottom: 1px solid var(--linie-weich);
	font-family: var(--eng);
	font-size: 16px;
	font-weight: 600;
	color: var(--text);
}
div.bild_kommentar div.text { padding: 13px; }
div.bild_kommentar div.infoleiste {
	position: static;
	margin-top: 0;
	padding: 6px 13px 9px 13px;
	text-align: right;
	font-size: 13px;
	color: var(--gedaempft);
}

/* ------------------------------------------------------------------ *
 * 9. Verlinkungscodes -- der haeufigste Handgriff nach dem Upload
 * ------------------------------------------------------------------ */
div.inhalt input[type=text][readonly],
div.inhalt textarea[readonly] {
	font-family: 'Consolas', 'Menlo', monospace;
	font-size: 13px;
	color: var(--gold-hell);
	background-color: var(--bg);
}

/* ------------------------------------------------------------------ *
 * 10. Schmale Bildschirme
 * ------------------------------------------------------------------ */
@media (max-width: 620px) {
	div.images_rahmen { width: calc(50% - 5px); }
	div.images_rahmen div.bild_box,
	div.images_rahmen div.info_box { width: 100%; }
	input.submit_upload { width: 100%; min-width: 0; }
	div.tooltip { width: min(230px, calc(100vw - 60px)); }

	/* Das Upload-Formular steckt in Tabellen mit width="500"; die Felder
	   darin tragen style="width: 80%" im Template. Auf einem Telefon schiebt
	   das die ganze Seite nach rechts hinaus. Hier wird aus jeder Zeile ein
	   Block, und die Felder nehmen die volle Breite. */
	div.box_2_body table,
	div.box_2_body tbody,
	div.box_2_body tr,
	div.box_2_body td {
		display: block;
		width: 100% !important;
		height: auto !important;
	}
	div.box_2_body td { padding: 2px 0; }
	div.box_2_body input[type=text],
	div.box_2_body input[type=file],
	div.box_2_body select,
	div.box_2_body textarea { width: 100% !important; }
}
