/**
 * Featured Music - Frontend Styles
 * Block Theme Compatible
 */

:root {
  --fm-primary-color: #3d3d3d;
  --fm-primary-dark: #2a2a2a;
  --fm-background-main: #f5f5f0;
  --fm-background-card: #ffffff;
  --fm-text-primary: #2c2c2c;
  --fm-text-secondary: #666;
  --fm-text-light: #999;
  --fm-border-light: #ddd;
  --fm-border-medium: #e0e0e0;
  --fm-accent-danger: #c74440;
  --fm-badge-bg: rgba(61, 61, 61, 0.95);
  --fm-badge-text: #ffffff;
}

/* ==========================================================================
   Block Theme Override - Force Full Width
   ========================================================================== */

body.post-type-archive-fm_artist .wp-site-blocks,
body.post-type-archive-fm_playlist .wp-site-blocks,
body.tax-fm_genre .wp-site-blocks {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.post-type-archive-fm_artist main.site-main,
body.post-type-archive-fm_playlist main.site-main,
body.tax-fm_genre main.site-main {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

.fm-wrapper {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--fm-background-main);
  color: var(--fm-text-primary);
  line-height: 1.6;
  width: 100%;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.fm-wrapper *,
.fm-wrapper *::before,
.fm-wrapper *::after {
  box-sizing: border-box;
}

.fm-hidden {
  display: none !important;
}

/* ==========================================================================
   Page Header - Force Center
   ========================================================================== */

.fm-page-header {
  background: var(--fm-background-card);
  padding: 2rem 1rem;
  text-align: center !important;
  border-bottom: 3px solid var(--fm-primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

.fm-site-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--fm-primary-color);
  margin: 0 0 0.5rem 0;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center !important;
  width: 100% !important;
  display: block !important;
}

.fm-site-tagline {
  font-size: 1rem;
  color: var(--fm-text-secondary);
  font-style: italic;
  margin: 0;
  text-align: center !important;
}

/* ==========================================================================
   Container
   ========================================================================== */

.fm-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* ==========================================================================
   Intro Section
   ========================================================================== */

.fm-intro-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
}

.fm-intro-section h2 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 2rem;
  color: var(--fm-primary-color);
  margin: 0 0 1rem 0;
}

.fm-intro-section p {
  color: var(--fm-text-secondary);
  line-height: 1.8;
  margin: 0;
}

/* ==========================================================================
   Controls: Search, Tabs, Filters
   ========================================================================== */

.fm-controls {
  margin-bottom: 2rem;
}

.fm-search-bar {
  margin-bottom: 1.5rem;
}

.fm-search-input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--fm-border-medium);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  display: block;
  margin: 0 auto;
}

.fm-search-input:focus {
  outline: none;
  border-color: var(--fm-primary-color);
}

.fm-tabs-and-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.fm-tabs {
  display: flex;
  gap: 0.5rem;
}

.fm-tab {
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--fm-primary-color);
  background: transparent;
  color: var(--fm-primary-color);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}

.fm-tab:first-child {
  border-radius: 4px 0 0 4px;
}

.fm-tab:last-child {
  border-radius: 0 4px 4px 0;
}

.fm-tab:hover,
.fm-tab.fm-active {
  background: var(--fm-primary-color);
  color: #fff;
}

.fm-genre-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.fm-genre-chip {
  padding: 0.4rem 1rem;
  background: var(--fm-background-card);
  border: 1px solid var(--fm-border-medium);
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--fm-text-primary);
}

.fm-genre-chip:hover,
.fm-genre-chip.fm-active {
  background: var(--fm-primary-color);
  color: #fff;
  border-color: var(--fm-primary-color);
}

/* ==========================================================================
   Artist Cards Grid
   ========================================================================== */

.fm-artists-grid,
.fm-playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.fm-artist-card,
.fm-playlist-card {
  background: var(--fm-background-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fm-artist-card:hover,
.fm-playlist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Artist Image
   ========================================================================== */

.fm-artist-image-wrapper,
.fm-playlist-image-wrapper {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
}

.fm-artist-image,
.fm-playlist-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fm-artist-genre-badges {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fm-artist-genre-badge {
  background: var(--fm-badge-bg);
  color: var(--fm-badge-text);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
}

/* ==========================================================================
   Artist Content
   ========================================================================== */

.fm-artist-content,
.fm-playlist-content {
  padding: 1.5rem;
}

.fm-artist-name,
.fm-playlist-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fm-primary-color);
  margin: 0 0 0.75rem 0;
}

.fm-artist-name a,
.fm-playlist-title a {
  color: inherit;
  text-decoration: none;
}

.fm-artist-name a:hover,
.fm-playlist-title a:hover {
  color: var(--fm-primary-dark);
}

.fm-artist-bio,
.fm-playlist-description {
  font-size: 0.95rem;
  color: var(--fm-text-secondary);
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

/* ==========================================================================
   Social Links
   ========================================================================== */

.fm-artist-socials {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fm-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--fm-background-main);
  color: var(--fm-text-secondary);
  transition: all 0.2s ease;
}

.fm-social-icon:hover {
  background: var(--fm-primary-color);
  color: #fff;
}

.fm-social-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
}

/* Specific icon adjustments */
.fm-social-icon svg path {
  fill: currentColor;
}

.fm-social-icon svg rect,
.fm-social-icon svg circle,
.fm-social-icon svg line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* ==========================================================================
   Streaming Links
   ========================================================================== */

.fm-artist-streaming {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fm-streaming-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  background: var(--fm-background-main);
  color: var(--fm-text-primary);
}

.fm-streaming-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.fm-streaming-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Streaming platform colors */
.fm-spotify {
  background: #1DB954;
  color: #fff;
}

.fm-apple {
  background: #fc3c44;
  color: #fff;
}

.fm-youtube {
  background: #ff0000;
  color: #fff;
}

.fm-soundcloud {
  background: #ff5500;
  color: #fff;
}

.fm-bandcamp {
  background: #629aa9;
  color: #fff;
}

/* ==========================================================================
   Playlist Specific
   ========================================================================== */

.fm-playlist-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fm-playlist-card:hover .fm-playlist-play-overlay {
  opacity: 1;
}

.fm-play-button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--fm-primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.fm-play-button:hover {
  transform: scale(1.1);
}

.fm-play-button svg {
  width: 32px;
  height: 32px;
  margin-left: 4px;
  fill: currentColor;
}

.fm-playlist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--fm-text-light);
}

.fm-playlist-genre {
  background: var(--fm-background-main);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

/* ==========================================================================
   No Results
   ========================================================================== */

.fm-no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--fm-text-secondary);
}

.fm-no-results h3 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 1.5rem;
  color: var(--fm-primary-color);
  margin: 0 0 0.5rem 0;
}

.fm-no-results p {
  margin: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.fm-page-footer {
  background: var(--fm-primary-color);
  color: #fff;
  padding: 2rem;
  text-align: center;
}

.fm-footer-text {
  font-style: italic;
  margin: 0;
  opacity: 0.9;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination,
.nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background: var(--fm-background-card);
  border: 1px solid var(--fm-border-medium);
  border-radius: 6px;
  color: var(--fm-text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.page-numbers:hover,
.page-numbers.current {
  background: var(--fm-primary-color);
  border-color: var(--fm-primary-color);
  color: #fff;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .fm-site-title {
    font-size: 2.5rem;
  }

  .fm-container {
    padding: 2rem 1rem;
  }

  .fm-artists-grid,
  .fm-playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
  }

  .fm-tabs-and-filters {
    flex-direction: column;
  }

  .fm-search-input {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .fm-site-title {
    font-size: 2rem;
  }

  .fm-artists-grid,
  .fm-playlists-grid {
    grid-template-columns: 1fr;
  }

  .fm-artist-streaming {
    flex-direction: column;
  }

  .fm-streaming-link {
    justify-content: center;
  }
}

/* ==========================================================================
   Override Block Theme Margin
   ========================================================================== */

body.post-type-archive-fm_artist .wp-site-blocks > *,
body.post-type-archive-fm_playlist .wp-site-blocks > *,
body.tax-fm_genre .wp-site-blocks > *,
body.single-fm_artist .wp-site-blocks > *,
body.single-fm_playlist .wp-site-blocks > *,
body.single-fm-artist .wp-site-blocks > * {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}
