/* Mulke Legacy Post UI 1.0
   Recreates the missing controls and placement from the original
   phpBB 3.0 subsilver2 viewtopic while keeping phpBB 3.3 markup/events.
*/

/* ---------- old author cell / status ---------- */
.section-viewtopic .postprofile {
	position: relative !important;
	padding-top: 38px !important;
}

.section-viewtopic .postprofile dt {
	position: static !important;
}

.section-viewtopic .postprofile dt > .username,
.section-viewtopic .postprofile dt > .username-coloured,
.section-viewtopic .postprofile dt > strong:not(.mulke-keep) {
	display: none !important;
}

.section-viewtopic .postprofile .avatar-container {
	position: static !important;
}

.mulke-old-author-title {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	box-sizing: border-box;
	height: 30px;
	padding: 6px 5px 4px;
	overflow: hidden;
	border-bottom: 1px solid #A9B8C2;
	color: #006597;
	font-size: 12px;
	line-height: 18px;
	font-weight: bold;
	text-align: center;
	white-space: nowrap;
}

.mulke-old-author-title a {
	font-weight: bold;
}

.mulke-old-profile-top {
	margin: 1px 0 6px;
	text-align: left;
}

.mulke-old-profile-top > img {
	display: block;
	width: 70px;
	height: 20px;
	margin: 0 0 3px;
}

.mulke-old-mini-quote {
	display: inline-block;
	margin: 0 0 5px 2px;
	font-size: 11px;
	font-weight: normal;
}

/* ---------- old subject/date row ---------- */
.section-viewtopic .postbody > h3,
.section-viewtopic .postbody > .author,
.section-viewtopic .postbody #post_content[id^="post_content"] > h3,
.section-viewtopic .postbody #post_content[id^="post_content"] > .author {
	display: none !important;
}

.mulke-old-post-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	min-height: 30px;
	margin: -5px -8px 9px;
	padding: 5px 8px;
	border-bottom: 1px solid #A9B8C2;
	color: #323D4F;
	font-size: 11px;
	line-height: 18px;
	background: rgba(255,255,255,.08);
}

.mulke-old-post-subject {
	min-width: 0;
}

.mulke-old-post-meta {
	margin-left: auto;
	text-align: right;
	white-space: nowrap;
}

.mulke-old-post-meta img {
	vertical-align: middle;
}

/* ---------- old reputation mini-profile ---------- */
/* Hide pico/reputation's modern mini-profile widget; the data remains
   available and is rendered below in old Mulke form. */
.section-viewtopic .postprofile .rs-miniprofile-block {
	display: none !important;
}

.mulke-old-reputation {
	margin-top: 2px !important;
	font-size: 11px;
	line-height: 15px;
}

.mulke-old-reputation .rs-widget {
	display: block !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

.mulke-old-reputation .post-reputation {
	display: inline !important;
	min-width: 0 !important;
	height: auto !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	font-size: 11px !important;
	font-weight: normal !important;
	line-height: 15px !important;
}

.mulke-old-reputation-buttons {
	display: flex;
	gap: 2px;
	margin-top: 2px;
}

.mulke-old-reputation-buttons a {
	display: inline-block !important;
	width: 18px !important;
	height: 18px !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

.mulke-old-reputation-buttons img {
	display: block;
	width: 18px;
	height: 18px;
}

/* Old forum used bottom contact buttons instead of the prosilver dropdown. */
.section-viewtopic .postprofile .profile-contact {
	display: none !important;
}

/* ---------- moderation/thanks tools: move to old bottom-right position ---------- */
.section-viewtopic .postbody {
	position: relative !important;
	padding-bottom: 48px !important;
}

.section-viewtopic .post-buttons {
	top: auto !important;
	right: 7px !important;
	bottom: 34px !important;
	display: flex !important;
	gap: 3px !important;
	margin: 0 !important;
	z-index: 3;
}

/* Edit/Quote are restored as the large old buttons in the footer. */
.section-viewtopic .post-buttons li:has(.fa-pencil),
.section-viewtopic .post-buttons li:has(.fa-quote-left) {
	display: none !important;
}

/* The old reputation +/- lives in the mini-profile, not in the tool row. */
.section-viewtopic .post-buttons .rs-widget {
	display: none !important;
}

.section-viewtopic .post-buttons > li,
.section-viewtopic .post-buttons > li > a.button {
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	min-height: 20px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background-color: transparent !important;
	background-repeat: no-repeat !important;
	background-position: center center !important;
	box-shadow: none !important;
}

.section-viewtopic .post-buttons a.button i {
	visibility: hidden !important;
}

.section-viewtopic .post-buttons a:has(.fa-exclamation) {
	background-image: url("./images/icon_post_report.gif") !important;
}

.section-viewtopic .post-buttons a:has(.fa-exclamation-triangle) {
	background-image: url("./images/icon_user_warn.gif") !important;
}

.section-viewtopic .post-buttons a:has(.fa-info) {
	background-image: url("./images/icon_post_info.gif") !important;
}

.section-viewtopic .post-buttons a:has(.fa-times) {
	background-image: url("./images/icon_post_delete.gif") !important;
}

/* Thanks for posts */
.section-viewtopic .post-buttons a[id^="lnk_thanks_post"] {
	display: block !important;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent url("./images/thankposts.gif") no-repeat center center !important;
}

.section-viewtopic .post-buttons a[id^="lnk_thanks_post"]:has(.removethanks-icon) {
	background-image: url("./images/removethanks.gif") !important;
}

.section-viewtopic .post-buttons a[id^="lnk_thanks_post"] * {
	visibility: hidden !important;
}

/* ---------- old footer strip ---------- */
.mulke-old-post-footer {
	grid-column: 1 / -1 !important;
	display: grid;
	grid-template-columns: 165px minmax(0, 1fr);
	width: 100%;
	min-height: 32px;
	margin: 0;
	border-top: 1px solid #A9B8C2;
	background: inherit;
	font-size: 11px;
	line-height: 20px;
}

.mulke-old-post-footer-left {
	box-sizing: border-box;
	padding: 5px 6px;
	border-right: 1px solid #A9B8C2;
}

.mulke-old-post-footer-right {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	box-sizing: border-box;
	min-width: 0;
	padding: 5px 7px;
}

.mulke-old-contact-buttons,
.mulke-old-edit-buttons {
	display: flex;
	align-items: center;
	gap: 4px;
}

.mulke-old-post-footer img {
	display: block;
	border: 0;
}

/* The custom footer replaces the prosilver floating chevron. */
.section-viewtopic .back2top {
	display: none !important;
}

/* Fine tune the body now that the footer is a real separate row. */
.section-viewtopic .post {
	padding-bottom: 0 !important;
}

/* ---------- responsive ---------- */
@media (max-width: 700px) {
	.section-viewtopic .postprofile {
		padding-top: 34px !important;
	}

	.mulke-old-author-title {
		height: 28px;
		padding-top: 5px;
		text-align: left;
	}

	.mulke-old-post-heading {
		display: block;
		margin-left: -7px;
		margin-right: -7px;
	}

	.mulke-old-post-meta {
		margin-top: 2px;
		text-align: left;
		white-space: normal;
	}

	.section-viewtopic .post-buttons {
		position: static !important;
		justify-content: flex-end;
		margin: 8px 0 0 !important;
	}

	.mulke-old-post-footer {
		display: block;
	}

	.mulke-old-post-footer-left {
		border-right: 0;
		border-bottom: 1px solid #A9B8C2;
	}

	.mulke-old-post-footer-right {
		flex-wrap: wrap;
	}

	.mulke-old-contact-buttons,
	.mulke-old-edit-buttons {
		flex-wrap: wrap;
	}
}


/* ============================================================
   Production fallback 1.0.1
   Do not depend on body.section-viewtopic being present/cached.
   These selectors are scoped by .post and the legacy classes.
   Loaded after all extension styles on production.
   ============================================================ */

/* Author / profile */
.post .postprofile {
	position: relative !important;
	padding-top: 38px !important;
}

.post .postprofile dt > .username,
.post .postprofile dt > .username-coloured {
	display: none !important;
}

.post .postprofile .profile-contact {
	display: none !important;
}

/* Hide the stock prosilver subject/author row: our old-style heading replaces it. */
.post .postbody > h3,
.post .postbody > .author,
.post .postbody [id^="post_content"] > h3,
.post .postbody [id^="post_content"] > .author {
	display: none !important;
}

/* Keep room for the old lower-right tool row. */
.post .postbody {
	position: relative !important;
	padding-bottom: 48px !important;
}

/* Moderation/thanks row */
.post .post-buttons {
	top: auto !important;
	right: 7px !important;
	bottom: 34px !important;
	display: flex !important;
	gap: 3px !important;
	margin: 0 !important;
	z-index: 3 !important;
}

/* Edit/quote are shown as the large original buttons in our footer. */
.post .post-buttons li:has(.fa-pencil),
.post .post-buttons li:has(.fa-quote-left) {
	display: none !important;
}

/* Hide modern reputation widget inside post button row; old +/- are in profile. */
.post .post-buttons .rs-widget {
	display: none !important;
}

.post .post-buttons > li,
.post .post-buttons > li > a.button {
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	min-height: 20px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background-color: transparent !important;
	background-repeat: no-repeat !important;
	background-position: center center !important;
	box-shadow: none !important;
}

.post .post-buttons a.button i {
	visibility: hidden !important;
}

.post .post-buttons a:has(.fa-exclamation) {
	background-image: url("./images/icon_post_report.gif") !important;
}

.post .post-buttons a:has(.fa-exclamation-triangle) {
	background-image: url("./images/icon_user_warn.gif") !important;
}

.post .post-buttons a:has(.fa-info) {
	background-image: url("./images/icon_post_info.gif") !important;
}

.post .post-buttons a:has(.fa-times) {
	background-image: url("./images/icon_post_delete.gif") !important;
}

.post .post-buttons a[id^="lnk_thanks_post"] {
	display: block !important;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent url("./images/thankposts.gif") no-repeat center center !important;
}

.post .post-buttons a[id^="lnk_thanks_post"]:has(.removethanks-icon) {
	background-image: url("./images/removethanks.gif") !important;
}

.post .post-buttons a[id^="lnk_thanks_post"] * {
	visibility: hidden !important;
}

/* Hide stock floating back-to-top because old footer supplies it. */
.post .back2top {
	display: none !important;
}

/* Old reputation block */
.post .postprofile .rs-miniprofile-block {
	display: none !important;
}

.post .mulke-old-reputation {
	display: block !important;
}

/* Mobile fallback */
@media (max-width: 700px) {
	.post .postprofile {
		padding-top: 34px !important;
	}

	.post .post-buttons {
		position: static !important;
		justify-content: flex-end !important;
		margin: 8px 0 0 !important;
	}
}


/* ============================================================
   1.1.0 — old phpBB 3.0 search links in the top navbar
   Original Mulke order:
   Unanswered | Active | Unread | New | Your posts
   ============================================================ */

#nav-main > li.mulke-old-searchlinks {
	float: left !important;
	display: flex !important;
	align-items: center !important;
	gap: 5px !important;
	height: 28px !important;
	margin: 0 0 0 12px !important;
	padding: 0 !important;
	white-space: nowrap !important;
	font-size: 11px !important;
	line-height: 28px !important;
}

#nav-main > li.mulke-old-searchlinks > a {
	display: inline !important;
	padding: 0 !important;
	color: #006597 !important;
	font-size: 11px !important;
	font-weight: normal !important;
	line-height: 28px !important;
	text-decoration: none !important;
}

#nav-main > li.mulke-old-searchlinks > a:hover {
	color: #D46400 !important;
	text-decoration: underline !important;
}

#nav-main > li.mulke-old-searchlinks .mulke-search-sep {
	color: #666 !important;
	font-size: 10px !important;
	line-height: 28px !important;
}

/* The five labels fit comfortably on normal desktop widths.
   On narrower layouts phpBB's existing "Ссылки" menu still contains them,
   so hide this duplicate legacy row rather than wrap the navbar. */
@media (max-width: 1350px) {
	#nav-main > li.mulke-old-searchlinks {
		display: none !important;
	}
}

/* ============================================================
   1.1.0 — viewforum alignment
   The index page (.forabg) is already correct. Apply the same
   deterministic header/body tracks to topic lists (.forumbg),
   so Replies / Views / Last post never drift or squeeze.
   ============================================================ */

@media (min-width: 701px) {
	.forumbg ul.topiclist li.header dl,
	.forumbg ul.topiclist li.row dl {
		display: grid !important;
		grid-template-columns:
			minmax(0, 1fr)
			72px
			96px
			255px !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		box-sizing: border-box !important;
	}

	.forumbg ul.topiclist li.header dt,
	.forumbg ul.topiclist li.header dd,
	.forumbg ul.topiclist li.row dt,
	.forumbg ul.topiclist li.row dd {
		float: none !important;
		clear: none !important;
		display: block !important;
		box-sizing: border-box !important;
		width: auto !important;
		min-width: 0 !important;
		max-width: none !important;
		margin: 0 !important;
	}

	.forumbg ul.topiclist dt,
	.forumbg ul.topiclist li.header dt {
		margin-right: 0 !important;
	}

	.forumbg ul.topiclist dt .list-inner,
	.forumbg ul.topiclist li.header dt .list-inner,
	.forumbg ul.topiclist li.row dt .list-inner {
		margin-right: 0 !important;
	}

	.forumbg ul.topiclist li.header {
		height: 34px !important;
		min-height: 34px !important;
		overflow: hidden !important;
	}

	.forumbg ul.topiclist li.header dl,
	.forumbg ul.topiclist li.header dt,
	.forumbg ul.topiclist li.header dd {
		height: 34px !important;
		min-height: 34px !important;
	}

	.forumbg ul.topiclist li.header dt .list-inner,
	.forumbg ul.topiclist li.header dd {
		display: flex !important;
		align-items: center !important;
		height: 34px !important;
		padding-top: 0 !important;
		padding-bottom: 0 !important;
		line-height: 16px !important;
	}

	.forumbg ul.topiclist li.header dt .list-inner {
		justify-content: center !important;
		padding-left: 10px !important;
		padding-right: 10px !important;
	}

	.forumbg ul.topiclist li.header dd {
		justify-content: center !important;
		white-space: nowrap !important;
	}

	.forumbg ul.topiclist li.header dd,
	.forumbg ul.topiclist li.row dd {
		border-left: 1px solid #A9B8C2 !important;
	}

	.forumbg ul.topiclist li.row dl {
		min-height: 72px !important;
	}

	.forumbg ul.topiclist li.row dt {
		min-height: 72px !important;
	}

	.forumbg ul.topiclist li.row dt .list-inner {
		padding-top: 9px !important;
		padding-bottom: 7px !important;
		padding-right: 10px !important;
	}

	.forumbg ul.topiclist li.row dd.posts,
	.forumbg ul.topiclist li.row dd.views {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		min-height: 72px !important;
		padding: 0 5px !important;
		text-align: center !important;
		line-height: 16px !important;
	}

	.forumbg ul.topiclist li.row dd.lastpost {
		display: flex !important;
		align-items: center !important;
		min-height: 72px !important;
		padding: 7px 10px 7px 16px !important;
		text-align: left !important;
		line-height: 15px !important;
	}

	.forumbg .topictitle {
		font-size: 12px !important;
		line-height: 15px !important;
	}

	.forumbg .topic-poster,
	.forumbg .topic-poster time,
	.forumbg dd.lastpost,
	.forumbg dd.lastpost span {
		font-size: 11px !important;
		line-height: 15px !important;
	}
}

@media (min-width: 701px) and (max-width: 1100px) {
	.forumbg ul.topiclist li.header dl,
	.forumbg ul.topiclist li.row dl {
		grid-template-columns:
			minmax(0, 1fr)
			64px
			82px
			210px !important;
	}
}

@media (max-width: 700px) {
	.forumbg ul.topiclist li.header dl,
	.forumbg ul.topiclist li.row dl {
		display: block !important;
	}
}


/* ============================================================
   1.2.0 — force the five old search links to be visible inline.
   This block overrides the earlier responsive hide rule.
   ============================================================ */
#nav-main > li.mulke-old-searchlinks {
	float: left !important;
	display: flex !important;
	align-items: center !important;
	gap: 4px !important;
	height: 28px !important;
	margin: 0 0 0 14px !important;
	padding: 0 !important;
	white-space: nowrap !important;
	font-size: 10px !important;
	line-height: 28px !important;
}

#nav-main > li.mulke-old-searchlinks > a {
	display: inline !important;
	padding: 0 !important;
	color: #006597 !important;
	font-size: 10px !important;
	font-weight: normal !important;
	line-height: 28px !important;
	text-decoration: none !important;
}

#nav-main > li.mulke-old-searchlinks > a:hover {
	color: #D46400 !important;
	text-decoration: underline !important;
}

#nav-main > li.mulke-old-searchlinks .mulke-search-sep {
	display: inline !important;
	color: #777 !important;
	font-size: 10px !important;
	line-height: 28px !important;
}

/* At smaller desktop widths, keep the navbar from colliding with
   Notifications / PM / username. The same links remain under "Ссылки". */
@media (max-width: 1220px) {
	#nav-main > li.mulke-old-searchlinks {
		display: none !important;
	}
}


/* ============================================================
   1.3.0 — viewtopic: restore the remaining old subsilver2 frame
   ============================================================ */

/* The old topic controls sat in a thin "cat" row above the posts. */
.action-bar.bar-top {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: center !important;
}

.mulke-old-topic-tools {
	order: -100 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	flex: 0 0 100% !important;
	box-sizing: border-box !important;
	width: 100% !important;
	min-height: 27px !important;
	margin: 0 0 5px !important;
	padding: 4px 7px !important;
	border: 1px solid #A9B8C2 !important;
	background: #ECECEC !important;
	font-size: 10px !important;
	line-height: 17px !important;
}

.mulke-old-topic-tools-left,
.mulke-old-topic-tools-right {
	display: flex !important;
	align-items: center !important;
	gap: 5px !important;
	white-space: nowrap !important;
}

.mulke-old-topic-tools a {
	color: #006597 !important;
	font-size: 10px !important;
	font-weight: normal !important;
	text-decoration: none !important;
}

.mulke-old-topic-tools a:hover {
	color: #D46400 !important;
	text-decoration: underline !important;
}

.mulke-old-topic-tools span {
	color: #777 !important;
}

/* Old Author / Message header above the first post on a page. */
.mulke-old-post-columns-head {
	display: grid !important;
	grid-template-columns: 165px minmax(0, 1fr) !important;
	box-sizing: border-box !important;
	width: 100% !important;
	height: 27px !important;
	margin: 0 !important;
	border: 1px solid #A9B8C2 !important;
	border-bottom: 0 !important;
	background-color: #006699 !important;
	background-image: url("../../../../../styles/mulke_legacy/theme/images/cellpic3.gif") !important;
	background-repeat: repeat-x !important;
	color: #FFA34F !important;
	font-size: 10px !important;
	font-weight: bold !important;
	line-height: 26px !important;
}

.mulke-old-post-columns-author,
.mulke-old-post-columns-message {
	box-sizing: border-box !important;
	height: 26px !important;
	padding: 0 7px !important;
	overflow: hidden !important;
	white-space: nowrap !important;
}

.mulke-old-post-columns-author {
	text-align: center !important;
}

.mulke-old-post-columns-message {
	border-left: 1px solid #A9B8C2 !important;
	text-align: left !important;
}

/* When the old table header is present, remove the gap before the first post. */
.mulke-old-post-columns-head + .post {
	margin-top: 0 !important;
}

/* Match the old subsilver2 profile field order:
   Joined -> Posts -> custom profile fields -> reputation. */
.post .postprofile {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
}

.post .postprofile > dt {
	order: 10 !important;
}

.post .postprofile > .profile-rank {
	order: 20 !important;
}

.post .postprofile > .profile-joined {
	order: 30 !important;
}

.post .postprofile > .profile-posts {
	order: 40 !important;
}

.post .postprofile > .profile-warnings {
	order: 45 !important;
}

.post .postprofile > .profile-custom-field {
	order: 50 !important;
}

.post .postprofile > .mulke-old-reputation {
	order: 70 !important;
}

.post .postprofile > .profile-contact {
	order: 80 !important;
}

/* Keep the original compact left-column typography. */
.post .postprofile dd,
.post .postprofile dt {
	font-size: 10px !important;
	line-height: 14px !important;
}

.post .postprofile .avatar img {
	max-width: 130px !important;
	height: auto !important;
}

/* The old message cell began almost flush with the table frame. */
.post .postbody {
	padding-left: 8px !important;
	padding-right: 8px !important;
}

/* Old subject/date strip: lighter and slightly more compact. */
.mulke-old-post-heading {
	min-height: 27px !important;
	margin-top: -5px !important;
	margin-bottom: 7px !important;
	padding-top: 4px !important;
	padding-bottom: 4px !important;
	font-size: 10px !important;
	line-height: 17px !important;
}

/* Old bottom strip was only about one button high. */
.mulke-old-post-footer {
	min-height: 29px !important;
}

.mulke-old-post-footer-left,
.mulke-old-post-footer-right {
	padding-top: 4px !important;
	padding-bottom: 4px !important;
}

/* Make consecutive posts read as a table rather than separate modern cards. */
.post {
	margin-bottom: 2px !important;
}

/* Old signature used a simple narrow separator. */
.post .signature {
	margin-top: 8px !important;
	padding-top: 5px !important;
	border-top: 1px solid #A9B8C2 !important;
	font-size: 10px !important;
	line-height: 14px !important;
}

@media (max-width: 900px) {
	.mulke-old-topic-tools {
		display: none !important;
	}
}

@media (max-width: 700px) {
	.mulke-old-post-columns-head {
		display: none !important;
	}

	.post .postprofile {
		display: block !important;
	}

	.post .postprofile .avatar img {
		max-width: 80px !important;
	}
}
