/**
 * Sidebar widgets — MediCenter Child production (TIN XEM NHIỀU, ẩn RSS).
 */

/* Khoảng cách giữa các widget sidebar (không cần .theme-page) */
.wpb_column .widget,
.vc_column_container .widget,
.wpb_widgetised_column .widget,
.sidebar-box .widget,
.sidebar_box .widget {
	margin-top: 28px !important;
	margin-bottom: 0;
	box-sizing: border-box;
}

.wpb_column .widget:first-child,
.vc_column_container .widget:first-child,
.wpb_widgetised_column .widget:first-child,
.sidebar-box .widget:first-child,
.sidebar_box .widget:first-child {
	margin-top: 0 !important;
}

.widget.mc-scrolling-most-viewed-widget,
.widget_medicenter_scrolling_most_viewed,
.mc-scrolling-most-viewed-widget {
	margin-bottom: 28px !important;
}

.widget.mc_contact_details_widget,
.widget_medicenter_contact_details,
.widget:has(> ul.contact-data) {
	margin-top: 28px !important;
}

/* Khung widget — viền + bóng (production không load qtsn-layout.css) */
.wpb_column .widget,
.vc_column_container .widget,
.wpb_widgetised_column .widget {
	border: 1px solid #e3eaf0;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 4px 18px rgba(0, 59, 113, 0.07);
}

.wpb_column .widget > .box-header,
.vc_column_container .widget > .box-header,
.widget.mc_contact_details_widget > .box-header,
.widget .scrolling-controls .box-header {
	display: block;
	margin: 0 !important;
	padding: 14px 18px !important;
	background: #003b71 !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	text-transform: uppercase;
	border: none !important;
}

/* Bỏ widget RSS lỗi URL */
.widget_rss,
.widget.widget_rss {
	display: none !important;
}

/* Khung widget — căn lề nội dung cách viền */
.mc-scrolling-most-viewed-widget,
.widget.mc-scrolling-most-viewed-widget,
.widget_medicenter_scrolling_most_viewed {
	box-sizing: border-box;
}

.mc-scrolling-most-viewed-widget .scrolling-controls .header-right,
.widget.mc-scrolling-most-viewed-widget .scrolling-controls .header-right {
	padding-right: 12px;
}

.mc-scrolling-most-viewed-widget .scrolling-list-wrapper,
.widget.mc-scrolling-most-viewed-widget .scrolling-list-wrapper,
.widget_medicenter_scrolling_most_viewed .scrolling-list-wrapper {
	padding: 8px 18px 18px !important;
	box-sizing: border-box;
}

/* Tin xem nhiều — tiêu đề + meta, không sát viền khung */
.mc-scrolling-most-viewed-widget .scrolling-list li.qtsn-most-viewed-item,
.widget .scrolling-list.most-viewed li.qtsn-most-viewed-item,
.widget .scrolling-list.most-viewed li {
	padding: 12px 2px;
	border-bottom: 1px solid #edf2f7;
	overflow: hidden;
}

.mc-scrolling-most-viewed-widget .scrolling-list li:last-child,
.widget .scrolling-list.most-viewed li:last-child {
	border-bottom: none;
}

.mc-scrolling-most-viewed-widget .scrolling-list li a.qtsn-most-viewed-link,
.widget .scrolling-list.most-viewed li a.qtsn-most-viewed-link {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	float: none !important;
	clear: both !important;
	width: 100%;
	max-width: 100%;
	color: #334155;
	line-height: 1.45;
	text-decoration: none;
	overflow: hidden;
	box-sizing: border-box;
}

.mc-scrolling-most-viewed-widget .scrolling-list li a.qtsn-most-viewed-link:hover .left,
.widget .scrolling-list.most-viewed li a.qtsn-most-viewed-link:hover .left {
	color: #c8102e;
}

.mc-scrolling-most-viewed-widget .scrolling-list li .left,
.mc-scrolling-most-viewed-widget .scrolling-list li .qtsn-most-viewed-title,
.widget .scrolling-list.most-viewed li .left,
.widget .scrolling-list.most-viewed li .qtsn-most-viewed-title {
	float: none !important;
	display: block;
	flex: 1 1 0;
	width: auto;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	font-size: 14px;
	font-weight: 500;
	color: #334155;
	white-space: normal !important;
	overflow-wrap: anywhere;
	word-break: break-word;
	line-height: 1.45;
}

.mc-scrolling-most-viewed-widget .scrolling-list li .qtsn-most-viewed-meta,
.widget .scrolling-list.most-viewed li .qtsn-most-viewed-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-start;
	gap: 4px;
	flex: 0 0 auto;
	min-width: 96px;
	max-width: 42%;
	flex-shrink: 0;
}

.mc-scrolling-most-viewed-widget .scrolling-list li .number,
.widget .scrolling-list.most-viewed li .number {
	float: none !important;
	display: block;
	width: auto !important;
	min-width: 0;
	max-width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 12px;
	font-weight: 600;
	color: #64748b !important;
	background: none !important;
	border: none !important;
	text-align: right;
	line-height: 1.35;
	white-space: nowrap;
}

.mc-scrolling-most-viewed-widget .scrolling-list li .number .qtsn-view-label,
.widget .scrolling-list.most-viewed li .number .qtsn-view-label {
	font-weight: 500;
	color: #94a3b8;
}

.mc-scrolling-most-viewed-widget .scrolling-list li abbr.timeago,
.widget .scrolling-list.most-viewed li abbr.timeago {
	display: block;
	float: none !important;
	margin: 0;
	padding: 0;
	font-size: 12px;
	color: #94a3b8;
	text-decoration: none;
	white-space: nowrap;
	text-align: right;
}

/* Fallback: markup cũ (link clearfix + timeago ngoài link) */
.widget .scrolling-list.most-viewed li:not(.qtsn-most-viewed-item) > a.clearfix {
	display: flex;
	flex-direction: column;
	gap: 8px;
	float: none !important;
	width: 100%;
	overflow: hidden;
}

.widget .scrolling-list.most-viewed li:not(.qtsn-most-viewed-item) > a.clearfix .left {
	float: none !important;
	width: 100%;
	white-space: normal !important;
	overflow-wrap: anywhere;
}

.widget .scrolling-list.most-viewed li:not(.qtsn-most-viewed-item) > a.clearfix .number {
	float: none !important;
	width: auto !important;
	padding: 0 !important;
	text-align: left;
}

.widget .scrolling-list.most-viewed li:not(.qtsn-most-viewed-item) > abbr.timeago {
	display: block;
	margin-top: 4px;
}
