/*
Theme Name: Nick B Media
Theme URI: https://www.nickbnation.com
Author: Nick B. Entertainment
Author URI: https://www.nickbnation.com
Description: Modern, responsive podcast theme for Nick B. Media. Clean episode layouts with an on-page branded player. Purple throughout. Click any episode to play instantly without leaving the page.
Version: 1.3.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nickb-media
Tags: podcast, audio, custom-colors, responsive-layout, featured-images
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
*/

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0f0a1e;
  color: #f3e8ff;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: #c084fc; text-decoration: none; transition: color 0.2s; }
a:hover { color: #e9d5ff; }
img { max-width: 100%; height: auto; display: block; }
button, .btn { cursor: pointer; font-family: inherit; }

/* ===== Scrolling Ticker ===== */
.nbm-ticker {
  background: #4c1d95;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  padding: 0.55rem 0;
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 1px solid #a78bfa;
}
.nbm-ticker-track {
  display: inline-block;
  animation: nbm-scroll linear infinite;
  will-change: transform;
}
.nbm-ticker-track span {
  display: inline-block;
  padding: 0 2rem;
}
@keyframes nbm-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== Layout ===== */
.site-header {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 50%, #7c3aed 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.4);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-branding {
  display: flex;
  align-items: center;
}
.custom-logo, .site-logo-img {
  display: block;
  height: auto;
  max-height: 80px;
}
.menu-toggle {
  display: none;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

/* Left vertical navigation */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: #1a1033;
  border-right: 1px solid #4c1d95;
  z-index: 90;
  padding-top: 110px;
  overflow-y: auto;
}
.vertical-nav {
  padding: 1rem 0;
}
.vertical-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vertical-menu li {
  margin: 0;
}
.vertical-menu a {
  display: block;
  padding: 0.85rem 1.5rem;
  color: #e9d5ff;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.vertical-menu a:hover,
.vertical-menu .current-menu-item > a,
.vertical-menu .current_page_item > a {
  background: rgba(109, 40, 217, 0.25);
  border-left-color: #a78bfa;
  color: #fff;
}

.site-main {
  margin-left: 220px;
  max-width: none;
  padding: 2rem 2rem 8rem;
}
.page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: 2.5rem;
  background: linear-gradient(90deg, #c084fc, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header p { margin: 0; color: #c4b5fd; font-size: 1.1rem; }

/* ===== Episode Grid ===== */
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.episode-card {
  background: #1a1033;
  border: 1px solid #4c1d95;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.episode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(109, 40, 217, 0.3);
  border-color: #a78bfa;
}
.episode-card .thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  position: relative;
}
.episode-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(76, 29, 149, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.episode-card:hover .play-overlay { opacity: 1; }
.play-icon {
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6d28d9;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.episode-card .content {
  padding: 1.25rem;
}
.episode-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.3;
  color: #f3e8ff;
}
.episode-card .meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #c4b5fd;
  margin-bottom: 0.75rem;
}
.episode-card .excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: #d8b4fe;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Single Episode ===== */
.single-episode {
  max-width: 800px;
  margin: 0 auto;
}
.single-episode .hero {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #1a1033;
  border: 1px solid #4c1d95;
}
.single-episode .hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.single-episode .entry-content {
  background: #1a1033;
  border: 1px solid #4c1d95;
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.single-episode h1 { margin-top: 0; }

/* ===== Player (Sticky Bottom) ===== */
.nb-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #4c1d95 0%, #6d28d9 100%);
  color: #fff;
  z-index: 200;
  box-shadow: 0 -4px 25px rgba(76, 29, 149, 0.5);
  border-top: 1px solid #a78bfa;
}
.player-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.player-brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  min-width: 80px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.player-brand span { font-size: 0.75rem; font-weight: 500; opacity: 0.85; }
.player-info {
  flex: 1;
  min-width: 140px;
}
.player-info .now-playing {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-info .episode-meta { font-size: 0.75rem; opacity: 0.8; }
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.player-controls button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s, transform 0.1s;
}
.player-controls button:hover { background: rgba(255,255,255,0.3); }
.player-controls button:active { transform: scale(0.95); }
.player-controls .play-pause { width: 48px; height: 48px; background: #fff; color: #6d28d9; font-size: 1.2rem; }
.player-controls .play-pause:hover { background: #f3e8ff; }
.progress-wrap {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}
.time {
  font-size: 0.75rem;
  min-width: 80px;
  text-align: right;
  opacity: 0.9;
}

/* ===== Footer ===== */
.site-footer {
  background: #0f0a1e;
  border-top: 1px solid #4c1d95;
  padding: 2rem 1.5rem 6rem;
  text-align: center;
  color: #c4b5fd;
  font-size: 0.9rem;
}
.site-footer a { color: #a78bfa; }
.site-footer a:hover { color: #e9d5ff; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .site-main { padding: 1.75rem 1.5rem 8rem; }
  .episodes-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 900px) {
  .site-nav {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    /* Clear the sticky header + logo + ticker so menu items aren't hidden */
    padding-top: 140px;
    width: 260px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.45);
    z-index: 95;
  }
  body.nav-open .site-nav {
    transform: translateX(0);
  }
  .site-main {
    margin-left: 0 !important;
    padding: 1.5rem 1.25rem 10rem;
  }
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .page-header h1 { font-size: 1.85rem; }
  .episodes-grid { grid-template-columns: 1fr; }
  .player-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }
  .player-info {
    text-align: center;
    width: 100%;
    order: 1;
  }
  .player-brand { order: 0; }
  .player-controls { order: 2; }
  .progress-wrap {
    width: 100%;
    order: 3;
    min-width: 0;
  }
  .site-header { padding: 0.75rem 1rem; }
  .custom-logo, .site-logo-img { max-height: 60px; }
}

@media (max-width: 600px) {
  .site-main { padding: 1.25rem 1rem 11rem; }
  .page-header h1 { font-size: 1.6rem; }
  .nbm-ticker { font-size: 0.85rem; }
  .player-controls button { width: 36px; height: 36px; }
  .player-controls .play-pause { width: 44px; height: 44px; }
  .custom-logo, .site-logo-img { max-width: 160px; max-height: 50px; }
  .time { min-width: 70px; font-size: 0.7rem; }
}

@media (max-width: 480px) {
  .header-inner { gap: 0.5rem; }
  .episodes-grid { gap: 1rem; }
  .episode-card .content { padding: 1rem; }
}
