/*
Theme Name: MJ Music
Theme URI: https://example.com/mj-music
Author: MJ Music
Author URI: https://example.com
Description: Premium dark navy and purple/magenta RTL music theme with hero, featured audio player, latest track cards and responsive layout. Keeps audio post rendering, player and download functionality.
Version: 2.0.2
Requires at least: 5.9
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mj-music
Tags: music, dark, rtl-language-support, custom-menu, featured-images, translation-ready
*/

:root {
  color-scheme: dark;
  --bg: #0a0618;
  --bg-2: #12082b;
  --surface: rgba(255, 255, 255, .05);
  --surface-strong: rgba(255, 255, 255, .085);
  --line: rgba(255, 255, 255, .1);
  --ink: #f5f1ff;
  --muted: #a79bc4;
  --purple: #8b3dff;
  --magenta: #ff2fb3;
  --blue: #4f7cff;
  --grad: linear-gradient(135deg, #ff2fb3 0%, #8b3dff 55%, #4f7cff 100%);
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(139, 61, 255, .38), transparent 65%),
    radial-gradient(760px 480px at 10% 8%, rgba(255, 47, 179, .22), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(79, 124, 255, .18), transparent 65%),
    var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", "IRANSans", "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--magenta); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.45; margin: 0 0 .5em; }
.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 6, 24, .72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 26px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--grad);
  box-shadow: 0 0 26px rgba(255, 47, 179, .5);
  font-size: 1.35rem; color: #fff;
}
.site-title { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: .2px; }
.site-title a { color: #fff; }
.site-description { margin: 0; color: var(--muted); font-size: .78rem; }
.main-nav { margin-inline-start: auto; }
.main-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.main-nav li a {
  display: block; padding: 9px 16px; border-radius: 999px;
  color: var(--muted); font-size: .95rem; font-weight: 600; transition: .25s;
}
.main-nav li a:hover, .main-nav .current-menu-item > a {
  color: #fff; background: rgba(139, 61, 255, .22);
  box-shadow: inset 0 0 0 1px rgba(255, 47, 179, .35);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn, .menu-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); display: grid; place-items: center;
  cursor: pointer; font-size: 1rem; transition: .25s;
}
.icon-btn:hover, .menu-toggle:hover { background: var(--grad); color: #fff; border-color: transparent; }
.menu-toggle { display: none; }
.header-search { display: none; }
.header-search.open { display: block; padding-bottom: 16px; }
.header-search input[type="search"] {
  width: 100%; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit;
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 34px; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); z-index: 0;
}
.hero::before { width: 420px; height: 420px; background: rgba(255, 47, 179, .35); top: -120px; left: -80px; }
.hero::after { width: 480px; height: 480px; background: rgba(79, 124, 255, .3); bottom: -200px; right: -120px; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  color: var(--muted); font-size: .82rem; margin-bottom: 18px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 12px var(--magenta); }
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 900; letter-spacing: -.5px; margin-bottom: 14px;
  background: linear-gradient(180deg, #fff 25%, #d9c8ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { color: var(--muted); font-size: 1.05rem; max-width: 46ch; margin: 0 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 26px;
  border-radius: 999px; font-weight: 700; border: 1px solid transparent; transition: .25s; cursor: pointer;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 12px 30px rgba(139, 61, 255, .45); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 38px rgba(255, 47, 179, .5); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-strong); color: #fff; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 300px; }
.hero-art .orb {
  width: min(340px, 80%); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from 210deg, #ff2fb3, #8b3dff, #4f7cff, #ff2fb3);
  filter: blur(2px); opacity: .85; animation: spin 18s linear infinite;
  mask: radial-gradient(circle, transparent 46%, #000 48%);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 48%);
}
.hero-art .disc {
  position: absolute; width: min(190px, 46%); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2b1650, #0b0618 70%);
  border: 1px solid rgba(255, 255, 255, .14); display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.hero-art .disc span { font-size: 2.2rem; color: var(--magenta); text-shadow: 0 0 20px var(--magenta); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Featured player ---------- */
.featured { padding: 10px 0 54px; }
.player-card {
  position: relative; display: grid; grid-template-columns: 150px 1fr auto; gap: 24px; align-items: center;
  padding: 24px; border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(139, 61, 255, .22), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 47, 179, .22);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 30px 70px rgba(0, 0, 0, .5);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.player-art {
  width: 150px; aspect-ratio: 1; border-radius: 18px; overflow: hidden; position: relative;
  background: var(--grad); display: grid; place-items: center; font-size: 2.4rem; color: #fff;
}
.player-art img { width: 100%; height: 100%; object-fit: cover; }
.player-info { min-width: 0; }
.player-label { color: var(--magenta); font-size: .78rem; font-weight: 700; letter-spacing: .5px; margin-bottom: 4px; }
.player-info h2 { font-size: clamp(1.15rem, 2.4vw, 1.55rem); margin: 0 0 4px; }
.player-info h2 a { color: #fff; }
.player-meta { color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.player-card audio { width: 100%; height: 42px; }
.player-actions { display: flex; flex-direction: column; gap: 10px; }
.download-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px; border-radius: 999px;
  background: var(--grad); color: #fff; font-weight: 700; white-space: nowrap;
  box-shadow: 0 10px 26px rgba(139, 61, 255, .4);
}
.download-link:hover { color: #fff; transform: translateY(-2px); }

/* ---------- Sections & cards ---------- */
.section-head { display: flex; align-items: center; gap: 18px; margin: 0 0 26px; }
.section-head h2 { font-size: clamp(1.2rem, 2.6vw, 1.6rem); margin: 0; white-space: nowrap; }
.category-section { margin-bottom: 46px; }
.category-view-all { color: var(--muted); font-size: .9rem; font-weight: 700; white-space: nowrap; }
.category-view-all:hover { color: var(--magenta); }
.section-head::before, .section-head::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, rgba(139, 61, 255, .7));
}
.section-head::after { background: linear-gradient(270deg, transparent, rgba(139, 61, 255, .7)); }
.content { padding-block: 20px 70px; }
.music-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.music-item {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center;
  padding: 16px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--line); backdrop-filter: blur(12px);
  transition: .3s; position: relative; overflow: hidden;
}
.music-item::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--grad);
  transform: scaleX(0); transform-origin: right; transition: .3s;
}
.music-item:hover { transform: translateY(-4px); background: var(--surface-strong); border-color: rgba(255, 47, 179, .35); box-shadow: var(--shadow); }
.music-item:hover::after { transform: scaleX(1); }
.music-cover {
  width: 92px; aspect-ratio: 1; border-radius: 14px; object-fit: cover;
  background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 1.5rem;
}
.music-body { min-width: 0; }
.music-item h2 { font-size: 1.03rem; margin: 0 0 4px; font-weight: 700; }
.music-item h2 a { color: #fff; }
.music-item .meta { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 10px; }
.music-item .excerpt { color: var(--muted); font-size: .85rem; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.music-item .excerpt p { margin: 0; }
.play-badge {
  position: absolute; inset-inline-end: 14px; bottom: 14px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); color: #fff; font-size: .8rem; border: 1px solid var(--line);
}
.music-item:hover .play-badge { background: var(--grad); border-color: transparent; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- Single ---------- */
.single-music {
  max-width: 860px; margin-inline: auto; padding: 34px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(14px);
}
.single-music .meta { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.single-music h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; }
.single-cover { width: 100%; max-width: 420px; aspect-ratio: 1; display: block; object-fit: cover; border-radius: 20px; margin: 24px auto; box-shadow: var(--shadow); }
.audio-player { width: 100%; display: block; margin: 20px 0; }
.single-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.post-content { margin-top: 24px; color: #e6dff7; }
.post-content > *:first-child { margin-top: 0; }
.post-content a { color: var(--magenta); text-decoration: underline; }
.post-content blockquote { margin: 20px 0; padding: 14px 20px; border-inline-start: 3px solid var(--purple); background: rgba(139, 61, 255, .12); border-radius: 10px; }
.post-content img { border-radius: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 26px; font-size: .9rem; }

/* ---------- Pagination / comments / footer ---------- */
.navigation { margin-top: 34px; }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers {
  min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.page-numbers.current, .page-numbers:hover { background: var(--grad); color: #fff; border-color: transparent; }
.comments-area { max-width: 860px; margin: 30px auto 0; padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.comments-area input, .comments-area textarea {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25); color: var(--ink); font: inherit;
}
.site-footer {
  border-top: 1px solid var(--line); background: rgba(10, 6, 24, .8);
  padding-block: 34px; color: var(--muted); font-size: .9rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.05rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; margin: 0; padding: 0; }
.widget-area { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 28px; }
.widget { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.widget-title { font-size: 1rem; margin-bottom: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .player-card { grid-template-columns: 110px 1fr; }
  .player-art { width: 110px; }
  .player-actions { grid-column: 1 / -1; flex-direction: row; }
  .player-actions .download-link { width: 100%; }
}
@media (max-width: 760px) {
  .menu-toggle { display: grid; margin-inline-start: auto; }
  .main-nav {
    position: absolute; inset-inline: 0; top: 100%; margin: 0;
    background: rgba(14, 8, 32, .98); border-bottom: 1px solid var(--line);
    display: none; padding: 10px 20px 18px;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav li a { border-radius: 12px; }
  .header-actions .icon-btn { display: none; }
  .hero { padding-top: 40px; }
  .music-list { grid-template-columns: 1fr; }
  .single-music { padding: 20px; }
}
@media (max-width: 520px) {
  .wrap { width: calc(100% - 28px); }
  .player-card { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .player-art { width: 140px; }
  .player-card audio { min-width: 0; }
  .music-item { grid-template-columns: 76px 1fr; }
  .music-cover { width: 76px; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art .orb { animation: none; }
  * { transition: none !important; }
}


/* Theme palette and motion refinements */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb; --bg-2: #e7edf6; --surface: rgba(28, 42, 66, .055);
  --surface-strong: rgba(28, 42, 66, .10); --line: rgba(28, 42, 66, .16);
  --ink: #172238; --muted: #5e6c82; --purple: #515fc9; --magenta: #df3c83;
  --blue: #347ab8; --grad: linear-gradient(135deg, #df3c83, #6655c8 55%, #347ab8);
  --shadow: 0 20px 48px rgba(34, 48, 72, .16);
}
:root[data-theme="teal"] {
  color-scheme: dark;
  --bg: #071a1c; --bg-2: #0c292b; --surface: rgba(235, 255, 251, .055);
  --surface-strong: rgba(235, 255, 251, .10); --line: rgba(183, 244, 232, .15);
  --ink: #eafffa; --muted: #9ec7c0; --purple: #16a89b; --magenta: #43dfbd;
  --blue: #42a9be; --grad: linear-gradient(135deg, #43dfbd, #12a99a 55%, #42a9be);
  --shadow: 0 24px 60px rgba(0, 0, 0, .38);
}
:root[data-theme="light"] body { background: radial-gradient(900px 520px at 85% -10%, rgba(102,85,200,.14), transparent 65%), radial-gradient(760px 480px at 10% 8%, rgba(223,60,131,.10), transparent 60%), var(--bg); }
:root[data-theme="light"] .site-header { background: rgba(243,246,251,.84); }
:root[data-theme="light"] .main-nav { background: rgba(243,246,251,.98); }
:root[data-theme="light"] .hero h1 { background-image: linear-gradient(180deg,#172238 25%,#6655c8 100%); }
:root[data-theme="light"] .player-info h2 a, :root[data-theme="light"] .music-item h2 a { color: var(--ink); }
:root[data-theme="teal"] body { background: radial-gradient(900px 520px at 85% -10%,rgba(22,168,155,.20),transparent 65%), radial-gradient(760px 480px at 10% 8%,rgba(66,169,190,.12),transparent 60%),var(--bg); }
:root[data-theme="teal"] .site-header { background: rgba(7,26,28,.82); }
:root[data-theme="teal"] .main-nav { background: rgba(7,26,28,.98); }
.theme-switcher { display:flex; align-items:center; gap:7px; padding:6px 9px; border:1px solid var(--line); border-radius:999px; background:var(--surface); }
.theme-swatch { width:19px; height:19px; flex:0 0 19px; border:2px solid rgba(255,255,255,.55); border-radius:50%; cursor:pointer; padding:0; transition: transform .22s ease, box-shadow .22s ease; }
.theme-swatch[data-theme-choice="midnight"] { background:linear-gradient(135deg,#100a26,#bb42df); }
.theme-swatch[data-theme-choice="light"] { background:linear-gradient(135deg,#fff,#9cadd0); }
.theme-swatch[data-theme-choice="teal"] { background:linear-gradient(135deg,#071a1c,#43dfbd); }
.theme-swatch:hover { transform:scale(1.18); }
.theme-swatch[aria-pressed="true"] { box-shadow:0 0 0 3px var(--bg),0 0 0 5px var(--magenta),0 0 16px var(--magenta); }
.icon-btn:hover, .menu-toggle:hover, .btn, .download-link { transition: transform .24s ease, box-shadow .3s ease, background-color .3s ease, color .3s ease; }
.icon-btn:hover, .menu-toggle:hover { transform:translateY(-2px) scale(1.04); box-shadow:0 0 20px rgba(139,61,255,.35); }
.brand-mark { animation: soft-glow 3.2s ease-in-out infinite alternate; }
.music-item { animation: card-enter .55s both; }
.music-item:nth-child(3n+2) { animation-delay:.08s; }
.music-item:nth-child(3n) { animation-delay:.16s; }
.music-cover { transition: transform .35s ease, filter .35s ease; }
.music-item:hover .music-cover { transform:scale(1.045) rotate(-1deg); filter:saturate(1.12); }
@keyframes soft-glow { from { filter:brightness(1); } to { filter:brightness(1.18); box-shadow:0 0 30px rgba(255,47,179,.58); } }
@keyframes card-enter { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
@media (max-width:760px) { .theme-switcher { gap:5px; padding:5px 7px; } .theme-swatch { width:17px; height:17px; flex-basis:17px; } }
@media (prefers-reduced-motion:reduce) { .brand-mark, .music-item { animation:none !important; } }
