/**
 * Front-end Stylesheet for Music4U Topic Page, Sub-menu Page & Single Post Contextual Header
 * Harmonized with KBW Simple Theme & VnExpress Editorial Topic Layout
 */

:root {
	--m4u-brand-navy: #0e243a;
	--m4u-brand-navy-light: #163656;
	--m4u-brand-green: #00a972;
	--m4u-brand-mint: #00c68d;
	--m4u-brand-orange: #ff7e02;
	--m4u-text-dark: #1e293b;
	--m4u-text-body: #334155;
	--m4u-text-muted: #64748b;
	--m4u-border-color: #e2e8f0;
	--m4u-surface-soft: #f8fafc;
	--m4u-sticky-top: 0px;
}

/* ==========================================================================
   1. SINGLE POST CONTEXTUAL TOPIC HEADER (Below #site-header, Sticky CLS = 0)
   ========================================================================== */
.m4u-single-topic-sentinel {
	position: relative;
	clear: both; /* site header is floated by the theme: start below it, never overlap */
	width: 100%;
	min-height: 50px;
	z-index: 950;
}

/* Fallback (bar rendered inside article): keep a comfortable gap before the post title */
article .m4u-single-topic-sentinel {
	margin-bottom: 24px;
}

/* Normal placement (right under site header): breathing room for the content below */
#main-content .m4u-single-topic-sentinel {
	margin-bottom: 0;
}

body.single-post #page > article .single-title,
body.single-post #the-post .single-title {
	margin-top: 0;
}

.m4u-topic-ctx-bar {
	width: 100%;
	background: #f8fafc;
	border-bottom: 2px solid var(--m4u-brand-green);
	box-shadow: 0 2px 8px rgba(14, 36, 58, 0.06);
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.m4u-topic-ctx-bar.is-sticky-pinned {
	position: fixed;
	top: var(--m4u-sticky-top, 0px);
	left: 0;
	right: 0;
	z-index: 995;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(8px);
	box-shadow: 0 4px 16px rgba(14, 36, 58, 0.14);
}

.m4u-topic-ctx-inner {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 6px 10px;
	gap: 12px;
}

.m4u-topic-ctx-primary {
	flex-shrink: 0;
}

.m4u-topic-ctx-badge-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none !important;
	color: var(--m4u-brand-navy) !important;
	padding: 4px 10px 4px 6px;
	border-radius: 6px;
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	transition: all 0.18s ease;
}

.m4u-topic-ctx-badge-link:hover {
	background: var(--m4u-brand-green);
	border-color: var(--m4u-brand-green);
	color: #fff !important;
}

.m4u-ctx-tag {
	background: var(--m4u-brand-navy);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 2px 7px;
	border-radius: 4px;
	letter-spacing: 0.02em;
}

.m4u-ctx-topic-name {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
}

.m4u-topic-ctx-divider {
	color: #cbd5e1;
	font-weight: 300;
	font-size: 20px;
	line-height: 1;
	user-select: none;
	flex-shrink: 0;
}

.m4u-topic-ctx-submenus-scroll {
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.m4u-topic-ctx-submenus-scroll::-webkit-scrollbar {
	display: none;
}

.m4u-topic-ctx-submenus {
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	white-space: nowrap;
}

.m4u-topic-ctx-subitem {
	margin: 0 !important;
	padding: 0 !important;
}

.m4u-topic-ctx-sublink {
	display: inline-block;
	padding: 5px 13px;
	border-radius: 20px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--m4u-text-body) !important;
	background: #fff;
	border: 1px solid #e2e8f0;
	text-decoration: none !important;
	transition: all 0.18s ease;
}

.m4u-topic-ctx-sublink:hover,
.m4u-topic-ctx-subitem.is-active .m4u-topic-ctx-sublink {
	background: var(--m4u-brand-navy);
	color: #fff !important;
	border-color: var(--m4u-brand-navy);
}

/* ==========================================================================
   2. TOPIC PAGE HERO HEADER & STICKY SUB-MENU BAR
   ========================================================================== */
.m4u-topic-master-wrap {
	font-family: "Open Sans", sans-serif;
	color: var(--m4u-text-dark);
	background: #fff;
	padding-bottom: 50px;
}

.m4u-topic-hero-header {
	background: linear-gradient(135deg, #0e243a 0%, #163859 100%);
	color: #fff;
	padding: 26px 15px 30px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.m4u-topic-breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
	color: #cbd5e1;
	margin-bottom: 16px;
}

.m4u-topic-breadcrumb a {
	color: #e2e8f0;
	text-decoration: none;
}

.m4u-topic-breadcrumb a:hover {
	color: var(--m4u-brand-mint);
}

.m4u-bc-badge {
	background: rgba(0, 198, 141, 0.2);
	color: #34d399;
	padding: 1px 8px;
	border-radius: 4px;
	font-weight: 600;
	font-size: 12px;
}

.m4u-bc-current {
	color: #fff;
	font-weight: 600;
}

.m4u-topic-kicker {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--m4u-brand-mint);
	margin-bottom: 8px;
}

.m4u-kicker-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--m4u-brand-mint);
	box-shadow: 0 0 0 4px rgba(0, 198, 141, 0.22);
}

.m4u-topic-parent-label {
	margin-bottom: 4px;
}

.m4u-topic-parent-label a {
	color: #93c5fd;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.m4u-topic-main-title {
	font-family: "Roboto", "Open Sans", sans-serif;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.28;
	color: #fff !important;
	margin: 0 0 12px 0;
}

.m4u-topic-lead {
	max-width: 880px;
	font-size: 15.5px;
	line-height: 1.6;
	color: #e2e8f0;
}

.m4u-topic-lead p {
	margin: 0;
}

/* Sticky Sub-menu Bar on Topic Page */
.m4u-topic-nav-sentinel {
	position: relative;
	clear: both;
	width: 100%;
	min-height: 54px;
	z-index: 940;
}

.m4u-topic-sticky-nav {
	width: 100%;
	background: #fff;
	border-bottom: 2px solid #e2e8f0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.m4u-topic-sticky-nav.is-sticky-pinned {
	position: fixed;
	top: var(--m4u-sticky-top, 0px);
	left: 0;
	right: 0;
	z-index: 990;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(8px);
	border-bottom-color: var(--m4u-brand-green);
	box-shadow: 0 4px 18px rgba(14, 36, 58, 0.12);
}

.m4u-topic-nav-inner {
	display: flex;
	align-items: center;
	min-height: 52px;
	padding: 0 10px;
	gap: 14px;
}

.m4u-sticky-mini-brand {
	display: none;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	font-size: 14px;
	color: var(--m4u-brand-navy) !important;
	text-decoration: none !important;
	padding-right: 14px;
	border-right: 1px solid #cbd5e1;
	flex-shrink: 0;
	max-width: 260px;
}

.m4u-sticky-mini-brand span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.m4u-sticky-mini-brand i {
	color: var(--m4u-brand-green);
}

.m4u-topic-sticky-nav.is-sticky-pinned .m4u-sticky-mini-brand {
	display: inline-flex;
}

.m4u-topic-nav-scroll {
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.m4u-topic-nav-scroll::-webkit-scrollbar {
	display: none;
}

.m4u-topic-nav-list {
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none !important;
	margin: 0 !important;
	padding: 6px 0 !important;
	white-space: nowrap;
}

.m4u-topic-nav-item {
	margin: 0 !important;
}

.m4u-topic-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--m4u-text-body) !important;
	text-decoration: none !important;
	transition: all 0.18s ease;
}

.m4u-topic-nav-link:hover {
	background: #f1f5f9;
	color: var(--m4u-brand-green) !important;
}

.m4u-topic-nav-item.is-active .m4u-topic-nav-link {
	background: var(--m4u-brand-green);
	color: #fff !important;
}

.m4u-topic-admin-edit-pill {
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 20px;
	background: #fef3c7;
	color: #92400e !important;
	border: 1px solid #fde68a;
	text-decoration: none !important;
}

.m4u-topic-admin-edit-pill:hover {
	background: #fde68a;
}

/* ==========================================================================
   3. VNEXPRESS EDITORIAL GRID & STREAM LAYOUT
   ========================================================================== */
.m4u-topic-body-section {
	padding: 28px 15px 10px;
}

/* Consistent Aspect Ratio 16:9 Thumbnail Container */
.m4u-thumb-wrap,
.m4u-stream-thumb {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 8px;
	background: #e2e8f0;
}

.m4u-thumb-wrap img,
.m4u-stream-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.m4u-post-card:hover .m4u-thumb-wrap img,
.m4u-stream-item:hover .m4u-stream-thumb img {
	transform: scale(1.04);
}

.m4u-pin-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: rgba(14, 36, 58, 0.9);
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 4px;
	border-left: 3px solid var(--m4u-brand-orange);
	z-index: 2;
}

.m4u-pin-badge-sm {
	top: 8px;
	left: 8px;
	font-size: 10.5px;
	padding: 2px 7px;
}

/* Spotlight Section (Top 5 positions) */
.m4u-spotlight-section {
	padding-bottom: 28px;
	margin-bottom: 28px;
	border-bottom: 2px solid #e2e8f0;
}

.m4u-spotlight-top-row {
	display: grid;
	grid-template-columns: 7fr 5fr;
	gap: 24px;
	align-items: start;
}

.m4u-spotlight-top-row.is-single-hero {
	grid-template-columns: 1fr;
}

.m4u-hero-main-card .m4u-card-body {
	padding-top: 16px;
}

.m4u-card-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12.5px;
	color: var(--m4u-text-muted);
	margin-bottom: 6px;
}

.m4u-card-cat {
	color: var(--m4u-brand-green);
	font-weight: 700;
	text-transform: uppercase;
	font-size: 11.5px;
}

.m4u-card-title {
	font-family: "Roboto", "Open Sans", sans-serif;
	margin: 0 0 8px 0;
	font-weight: 700;
	line-height: 1.38;
}

.m4u-card-title a {
	color: var(--m4u-brand-navy);
	text-decoration: none;
	transition: color 0.15s ease;
}

.m4u-card-title a:hover {
	color: var(--m4u-brand-green);
}

.m4u-hero-title {
	font-size: 24px;
	margin-bottom: 10px;
}

.m4u-card-excerpt {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--m4u-text-body);
}

/* Hero Right Stack (Slots #2 & #3) */
.m4u-hero-side-col {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding-left: 24px;
	border-left: 1px solid var(--m4u-border-color);
}

.m4u-hero-side-card {
	display: grid;
	grid-template-columns: 170px 1fr;
	gap: 14px;
	align-items: start;
	padding-bottom: 20px;
	border-bottom: 1px solid #f1f5f9;
}

.m4u-hero-side-card:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.m4u-hero-side-card .m4u-card-title {
	font-size: 16px;
	margin-bottom: 6px;
}

.m4u-hero-side-card .m4u-card-excerpt {
	font-size: 13.5px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Secondary Spotlight Row (Slots #4 & #5) */
.m4u-spotlight-sub-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #f1f5f9;
}

.m4u-sub-spotlight-card {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 16px;
	align-items: start;
}

.m4u-sub-spotlight-card .m4u-card-title {
	font-size: 17px;
	margin-bottom: 6px;
}

.m4u-sub-spotlight-card .m4u-card-excerpt {
	font-size: 13.5px;
}

/* Main Stream + Sidebar Row (Slots #6 -> #20) */
.m4u-editorial-main-row {
	display: grid;
	grid-template-columns: 8fr 4fr;
	gap: 32px;
	align-items: start;
}

.m4u-stream-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--m4u-brand-navy);
}

.m4u-stream-heading {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--m4u-brand-navy);
	text-transform: uppercase;
}

.m4u-stream-page-indicator {
	font-size: 13px;
	color: var(--m4u-text-muted);
	font-weight: 600;
}

.m4u-stream-list {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.m4u-stream-item {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 20px;
	align-items: start;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--m4u-border-color);
}

.m4u-stream-title {
	font-family: "Roboto", "Open Sans", sans-serif;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.38;
	margin: 0 0 8px 0;
}

.m4u-stream-title a {
	color: var(--m4u-brand-navy);
	text-decoration: none;
}

.m4u-stream-title a:hover {
	color: var(--m4u-brand-green);
}

.m4u-stream-excerpt {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--m4u-text-body);
}

/* Sidebar */
.m4u-editorial-sidebar-col {
	position: sticky;
	top: 80px;
}

.m4u-sidebar-box {
	background: var(--m4u-surface-soft);
	border: 1px solid var(--m4u-border-color);
	border-radius: 10px;
	padding: 20px;
	margin-bottom: 24px;
}

.m4u-sidebar-title {
	font-family: "Roboto", "Open Sans", sans-serif;
	font-size: 16px;
	font-weight: 700;
	color: var(--m4u-brand-navy);
	margin: 0 0 14px 0;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--m4u-brand-green);
}

.m4u-sidebar-submenu-list,
.m4u-sidebar-other-topics {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.m4u-sidebar-submenu-list li {
	margin-bottom: 6px;
}

.m4u-sidebar-submenu-list li a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 9px 12px;
	border-radius: 6px;
	background: #fff;
	border: 1px solid #e2e8f0;
	color: var(--m4u-text-dark);
	font-weight: 600;
	font-size: 13.5px;
	text-decoration: none;
	transition: all 0.15s ease;
}

.m4u-sidebar-submenu-list li a:hover,
.m4u-sidebar-submenu-list li.is-active a {
	background: var(--m4u-brand-navy);
	color: #fff;
	border-color: var(--m4u-brand-navy);
}

.m4u-sidebar-other-topics li {
	margin-bottom: 10px;
}

.m4u-sidebar-other-topics li a {
	display: block;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	text-decoration: none;
}

.m4u-sidebar-other-topics li a strong {
	display: block;
	color: var(--m4u-brand-navy);
	font-size: 14px;
	margin-bottom: 3px;
}

.m4u-sidebar-other-topics li a:hover strong {
	color: var(--m4u-brand-green);
}

.m4u-sidebar-other-topics li a span {
	font-size: 12px;
	color: var(--m4u-text-muted);
}

.m4u-sidebar-post-item {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: 10px;
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid #e2e8f0;
}

.m4u-sidebar-post-item:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.m4u-sidebar-post-thumb img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 5px;
}

.m4u-sidebar-post-info h4 {
	margin: 0 0 4px 0;
	font-size: 13.5px;
	line-height: 1.35;
}

.m4u-sidebar-post-info h4 a {
	color: var(--m4u-brand-navy);
	text-decoration: none;
}

.m4u-meta-date {
	font-size: 11.5px;
	color: var(--m4u-text-muted);
}

/* Submenu Single Post Mode Article */
.m4u-sub-single-article {
	background: #fff;
	border: 1px solid var(--m4u-border-color);
	border-radius: 10px;
	padding: 28px;
}

.m4u-sub-single-header {
	margin-bottom: 22px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--m4u-border-color);
}

.m4u-sub-single-title {
	font-family: "Roboto", "Open Sans", sans-serif;
	font-size: 26px;
	font-weight: 700;
	color: var(--m4u-brand-navy);
	margin: 0 0 10px 0;
}

.m4u-sub-single-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 13px;
	color: var(--m4u-text-muted);
}

.m4u-permalink-badge {
	margin-left: auto;
	background: #f1f5f9;
	padding: 3px 10px;
	border-radius: 4px;
	color: var(--m4u-brand-navy);
	text-decoration: none;
	font-weight: 600;
}

/* Pagination */
.m4u-topic-pagination {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--m4u-border-color);
}

.m4u-page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.m4u-page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border-radius: 6px;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: var(--m4u-brand-navy) !important;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none !important;
	transition: all 0.15s ease;
}

.m4u-page-link:hover {
	border-color: var(--m4u-brand-green);
	color: var(--m4u-brand-green) !important;
	background: #f0fdf4;
}

.m4u-page-link.is-current {
	background: var(--m4u-brand-navy);
	border-color: var(--m4u-brand-navy);
	color: #fff !important;
}

.m4u-empty-topic-box {
	text-align: center;
	padding: 50px 20px;
	background: var(--m4u-surface-soft);
	border: 1px dashed #cbd5e1;
	border-radius: 10px;
}

.m4u-empty-topic-box i {
	font-size: 40px;
	color: #94a3b8;
	margin-bottom: 12px;
}

/* ==========================================================================
   4. RESPONSIVE MOBILE & TABLET
   ========================================================================== */
@media (max-width: 991px) {
	.m4u-spotlight-top-row,
	.m4u-spotlight-sub-row,
	.m4u-editorial-main-row {
		grid-template-columns: 1fr;
	}

	.m4u-hero-side-col {
		padding-left: 0;
		border-left: none;
		border-top: 1px solid var(--m4u-border-color);
		padding-top: 20px;
	}

	.m4u-topic-main-title {
		font-size: 24px;
	}

	.m4u-sticky-mini-brand {
		display: none !important;
	}
}

@media (max-width: 640px) {
	.m4u-hero-side-card,
	.m4u-sub-spotlight-card,
	.m4u-stream-item {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.m4u-ctx-tag {
		display: none;
	}

	.m4u-ctx-topic-name {
		font-size: 13px;
		max-width: 140px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.m4u-sub-single-article {
		padding: 16px;
	}
}
