/*
Theme Name: Soundloaded
Theme URI: https://example.com/soundloaded
Author: Karma
Description: A lightweight WordPress theme for music download and blog sites. Homepage sections for songs, albums, mixtapes and videos; a horizontally-scrolling artist directory pulled from post tags; and a single-post layout built for share-ability. No web fonts, no icon fonts, no jQuery on the front end.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: soundloaded
*/

/* ===================================================================
   1. Tokens
   =================================================================== */
:root {
	--bg: #ffffff;
	--bg-elevated: #f6f5f3;
	--bg-elevated-2: #efeeea;
	--border: rgba(0, 0, 0, 0.14);
	--border-soft: rgba(0, 0, 0, 0.09);
	--text: #16140f;
	--text-muted: #6c665a;
	--accent: #16140f;
	--accent-soft: rgba(0, 0, 0, 0.06);
	--on-accent: #ffffff;
	--wine: #7a2237;
	--wine-soft: rgba(122, 34, 55, 0.1);
	--radius-sm: 8px;
	--radius-md: 14px;
	--radius-lg: 20px;
	--container: 1160px;
	--font-display: ui-serif, Georgia, "Times New Roman", serif;
	--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--header-h: 60px;
}

/* ===================================================================
   2. Reset & base
   =================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

body.mh-noscroll { overflow: hidden; }

.mh-main {
	max-width: var(--container);
	margin: 0 auto;
	padding: 28px 16px 60px;
}

/* ===================================================================
   3. Header: sidebar toggle — logo — search toggle
   =================================================================== */
.mh-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: saturate(140%) blur(8px);
	border-bottom: 1px solid var(--border-soft);
}
.mh-header-inner {
	max-width: var(--container);
	margin: 0 auto;
	height: var(--header-h);
	padding: 0 12px;
	display: grid;
	grid-template-columns: 44px 1fr 44px;
	align-items: center;
	gap: 8px;
}
.mh-icon-btn {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	color: var(--text);
}
.mh-icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.mh-icon-btn svg { width: 22px; height: 22px; }

.mh-logo { text-align: center; min-width: 0; }
.mh-logo img { display: inline-block; max-height: 40px; width: auto; margin: 0 auto; }
.mh-site-name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 20px;
	letter-spacing: 0.01em;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mh-search-bar {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
	border-bottom: 1px solid transparent;
}
.mh-search-bar.is-open {
	max-height: 70px;
	border-bottom-color: var(--border-soft);
}
.mh-search-form {
	max-width: var(--container);
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
}
.mh-search-input {
	flex: 1;
	background: var(--bg-elevated);
	border: 1px solid var(--border-soft);
	border-radius: 999px;
	padding: 10px 16px;
	color: var(--text);
}
.mh-search-input::placeholder { color: var(--text-muted); }
.mh-search-submit {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent);
}
.mh-search-submit svg { width: 18px; height: 18px; }

/* ===================================================================
   4. Off-canvas sidebar
   =================================================================== */
.mh-sidebar-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	z-index: 49;
}
.mh-sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }

.mh-sidebar {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 280px;
	max-width: 82vw;
	background: var(--bg);
	border-right: 1px solid var(--border-soft);
	box-shadow: 0 0 32px rgba(0, 0, 0, 0.08);
	transform: translateX(-100%);
	transition: transform 0.28s ease;
	z-index: 50;
	padding: 20px;
	overflow-y: auto;
}
.mh-sidebar.is-open { transform: translateX(0); }
.mh-sidebar-close {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	margin-bottom: 12px;
}
.mh-sidebar-close:hover { background: var(--accent-soft); color: var(--accent); }
.mh-sidebar-close svg { width: 18px; height: 18px; }
.mh-sidebar-brand { margin-bottom: 18px; }
.mh-sidebar-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.mh-sidebar-menu li a {
	display: block;
	padding: 12px 4px;
	border-bottom: 1px solid var(--border-soft);
	font-size: 15px;
}
.mh-sidebar-menu li a:hover { color: var(--accent); }

/* ===================================================================
   5. Category slider
   =================================================================== */
.mh-cat-slider { border-bottom: 1px solid var(--border-soft); }
.mh-cat-slider-track {
	max-width: var(--container);
	margin: 0 auto;
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}
.mh-cat-slider-track::-webkit-scrollbar { display: none; }
.mh-cat-pill {
	flex-shrink: 0;
	scroll-snap-align: start;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--bg-elevated);
	border: 1px solid var(--border-soft);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	white-space: nowrap;
}
.mh-cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.mh-cat-pill--sm { padding: 5px 12px; font-size: 12px; }

/* ===================================================================
   6. Section pattern (Latest Songs / Albums / Mixtapes / Videos / Artists)
   =================================================================== */
.mh-section { margin-bottom: 42px; }
.mh-section--nested { margin-top: 42px; margin-bottom: 0; }
.mh-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border);
}
.mh-section-head h2 {
	font-size: 22px;
	display: flex;
	align-items: center;
}
.mh-view-all {
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--accent);
	display: inline-flex;
	align-items: center;
	gap: 2px;
}
.mh-view-all svg { width: 14px; height: 14px; }
.mh-empty { color: var(--text-muted); font-size: 14px; padding: 8px 0; }

/* Signature motif: equalizer bars */
.mh-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; margin-left: 8px; }
.mh-eq i { display: block; width: 3px; background: var(--accent); border-radius: 1px; animation: mh-eq-bounce 1s ease-in-out infinite; }
.mh-eq i:nth-child(1) { height: 40%; animation-delay: -0.9s; }
.mh-eq i:nth-child(2) { height: 100%; animation-delay: -0.6s; }
.mh-eq i:nth-child(3) { height: 60%; animation-delay: -0.3s; }
.mh-eq i:nth-child(4) { height: 80%; animation-delay: 0s; }
@keyframes mh-eq-bounce { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }

/* Post list rows (Latest Songs / Albums / Mixtapes / archives) */
.mh-post-list { display: flex; flex-direction: column; }
.mh-post-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 4px;
	border-bottom: 1px solid var(--border-soft);
}
.mh-post-row:hover .mh-post-title { color: var(--accent); text-decoration: underline; }
.mh-post-thumb {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--bg-elevated);
}
.mh-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mh-thumb-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-muted);
}
.mh-thumb-placeholder svg { width: 18px; height: 18px; }
.mh-post-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mh-post-title {
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mh-post-date { font-size: 12px; color: var(--text-muted); letter-spacing: 0.01em; }

/* Video grid (homepage — fixed 4 items, no slider) */
.mh-video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mh-video-card { display: block; }
.mh-video-thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--bg-elevated);
	border: 1px solid var(--border-soft);
}
.mh-video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.mh-video-card:hover .mh-video-thumb img { transform: scale(1.04); }
.mh-play-btn {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 42px;
	height: 42px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.85);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.mh-play-btn svg { width: 16px; height: 16px; margin-left: 2px; }
.mh-video-title {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Artist slider */
.mh-artist-slider {
	display: flex;
	gap: 18px;
	overflow-x: auto;
	padding: 6px 2px 12px;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	cursor: grab;
}
.mh-artist-slider.is-dragging { cursor: grabbing; }
.mh-artist-slider::-webkit-scrollbar { display: none; }
.mh-artist {
	flex-shrink: 0;
	width: 84px;
	text-align: center;
	scroll-snap-align: start;
}
.mh-artist-avatar {
	width: 76px;
	height: 76px;
	border-radius: 999px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg-elevated);
	border: 2px solid var(--accent);
	margin: 0 auto 8px;
}
.mh-artist-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mh-artist-initial { font-family: var(--font-display); font-size: 26px; color: var(--accent); }
.mh-artist-name {
	font-size: 12px;
	font-weight: 600;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.mh-artist:hover .mh-artist-avatar { border-color: var(--text-muted); }

/* ===================================================================
   7. Single post
   =================================================================== */
.mh-single-title {
	font-size: 30px;
	line-height: 1.2;
	font-weight: 800;
	margin-bottom: 12px;
}
.mh-single-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
	color: var(--text-muted);
	font-size: 13px;
}
.mh-single-meta .mh-post-date { letter-spacing: 0; }

.mh-author { margin-bottom: 14px; }
.mh-author-link { display: inline-flex; align-items: center; gap: 8px; }
.mh-author-avatar { width: 32px; height: 32px; border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.mh-author-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mh-author-name { font-size: 13px; font-weight: 700; }
.mh-author-link:hover .mh-author-name { color: var(--accent); text-decoration: underline; }

.mh-share { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.mh-share-btn {
	width: 40px;
	height: 40px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--bg-elevated);
	border: 1px solid var(--border-soft);
	color: var(--text-muted);
	transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mh-share-btn svg { width: 18px; height: 18px; }
.mh-share-btn:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.mh-share-copy.is-copied { color: var(--accent); border-color: var(--accent); }

.mh-single-image { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 22px; border: 1px solid var(--border-soft); }

.mh-single-content { font-size: 16px; line-height: 1.75; margin-bottom: 24px; }
.mh-single-content p { margin: 0 0 1.2em; }
.mh-single-content a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--border); }
.mh-single-content img { border-radius: var(--radius-md); margin: 1em 0; }
.mh-single-content .download-btn { margin-top: 1.5em; box-shadow: 0 6px 18px rgba(0,0,0,0.15); }

.mh-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.mh-tag-pill {
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--wine-soft);
	border: 1px solid var(--wine);
	color: var(--wine);
	font-size: 12px;
	font-weight: 600;
}
.mh-tag-pill:hover { background: var(--wine); color: #ffffff; }

/* Hottest Songs — 4-grid, slidable (2 rows × N columns) */
.mh-hot-grid {
	display: grid;
	grid-auto-flow: column;
	grid-template-rows: repeat(2, auto);
	grid-auto-columns: minmax(150px, 44%);
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 6px;
	scrollbar-width: none;
	cursor: grab;
}
.mh-hot-grid.is-dragging { cursor: grabbing; }
.mh-hot-grid::-webkit-scrollbar { display: none; }
.mh-hot-card { display: flex; align-items: center; gap: 10px; scroll-snap-align: start; }
.mh-hot-thumb { width: 52px; height: 52px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-elevated); }
.mh-hot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mh-hot-title { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.mh-artist-header { text-align: center; margin-bottom: 24px; }
.mh-artist-header-img { width: 96px; height: 96px; border-radius: 999px; object-fit: cover; border: 2px solid var(--accent); margin: 0 auto 12px; }
.mh-archive-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }

/* ===================================================================
   8. Footer (matches the reference layout: social icons, link rows,
   popular tags, divider, copyright — plus a floating back-to-top button)
   =================================================================== */
.mh-footer { border-top: 1px solid var(--border-soft); margin-top: 40px; background: var(--bg-elevated); }
.mh-footer-inner { max-width: var(--container); margin: 0 auto; padding: 40px 20px 28px; }

.mh-footer-social { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.mh-social-btn {
	width: 46px;
	height: 46px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--accent);
	color: var(--on-accent);
	transition: transform 0.15s ease, opacity 0.15s ease;
}
.mh-social-btn svg { width: 20px; height: 20px; }
.mh-social-btn:hover { transform: translateY(-2px); opacity: 0.85; }

.mh-footer-menu { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 4px; font-size: 15px; }
.mh-footer-menu a:hover { color: var(--accent); text-decoration: underline; }
.mh-footer-menu-hint { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }

.mh-footer-tags { margin-top: 36px; }
.mh-footer-tags-title {
	font-size: 15px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 14px;
}
.mh-footer-tags-list { display: flex; flex-wrap: wrap; gap: 10px; }
.mh-footer-tag {
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--bg);
	border: 1px solid var(--border);
	font-size: 13px;
	font-weight: 600;
}
.mh-footer-tag:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.mh-footer-widgets { margin-top: 28px; font-size: 13px; color: var(--text-muted); }
.widget-title { font-size: 14px; margin-bottom: 8px; }

.mh-footer-bottom {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--border-soft);
}
.mh-footer-copy { font-size: 12px; color: var(--text-muted); margin: 0; }

.mh-back-to-top {
	position: fixed;
	right: 18px;
	bottom: 18px;
	width: 48px;
	height: 48px;
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 45;
}
.mh-back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mh-back-to-top svg { width: 20px; height: 20px; }

/* ===================================================================
   9. Pagination
   =================================================================== */
.pagination, .navigation.pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 22px;
}
.pagination .page-numbers {
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-sm);
	background: var(--bg-elevated);
	border: 1px solid var(--border-soft);
	font-size: 13px;
}
.pagination .page-numbers.current { border-color: var(--accent); color: var(--accent); }

/* ===================================================================
   10. Responsive
   =================================================================== */
@media (min-width: 640px) {
	.mh-main { padding: 36px 24px 70px; }
	.mh-video-grid { grid-template-columns: repeat(4, 1fr); }
	.mh-hot-grid { grid-auto-columns: minmax(170px, 24%); }
	.mh-single-title { font-size: 38px; }
}
@media (min-width: 1024px) {
	.mh-header-inner { grid-template-columns: 200px 1fr 200px; padding: 0 24px; }
	.mh-icon-btn { justify-self: start; }
	.mh-header-inner .mh-icon-btn:last-child { justify-self: end; }
}

/* ===================================================================
   11. Accessibility
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
