/* ========================================
   Music Coast — UI/UX Polish
   (Safe overrides; loaded after styles.css)
======================================== */

/* --------------------------------------------------------------------------
   Theme tokens / accessibility helpers
   -------------------------------------------------------------------------- */

:root{
  /* Backward-compatible aliases used by newer UI blocks */
  --font-sans: var(--font-body);
  --panel: var(--bg-card);
  --muted: var(--text-tertiary);

  /* Text color used on accent/gradient buttons (varies by palette) */
  --on-accent: #1A1A1A;

  /* More visible hover states (works in both light/dark) */
  --ui-hover-bg: rgba(var(--accent-rgb), 0.08);
  --ui-hover-border: rgba(var(--accent-rgb), 0.30);
}

/* Darker palettes need light text on accent backgrounds */
html[data-accent="ocean"],
html[data-accent="violet"],
html[data-accent="sunset"]{
  --on-accent: #FFFFFF;
}

/* Primary buttons + accent pills should always keep readable text */
.btn-primary{
  color: var(--on-accent) !important;
}

.pagination .active{
  color: var(--on-accent) !important;
}

/* Newsletter embeds inherit the site's theme; keep button text readable */
.newsletter-embed [class*="_sb_fbz_button"]{
  color: var(--on-accent) !important;
}

/* Make hover states more obvious and brand-consistent */
.btn:not(.btn-primary):hover,
.btn-ghost:hover,
.nav-main a:hover,
.theme-toggle:hover,
.theme-mode-btn:hover,
.theme-menu-close:hover{
  background: var(--ui-hover-bg) !important;
  border-color: var(--ui-hover-border) !important;
}

/* Keep close button readable in both themes */
.theme-menu-close{ color: var(--text-secondary) !important; }
.theme-menu-close:hover{ color: var(--text-primary) !important; }

/* Slightly stronger focus indication for keyboard users */
.btn:focus-visible,
.nav-main a:focus-visible,
.theme-toggle:focus-visible,
.theme-mode-btn:focus-visible,
.theme-swatch:focus-visible{
  outline: 3px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 2px;
}

/* Logo sub-tagline (desktop only) */
.logo-tagline {
  display: none;
}

@media (min-width: 1024px) {
  .logo-tagline {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding-left: var(--space-sm);
    margin-left: var(--space-sm);
    border-left: 1px solid var(--border-color);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    white-space: nowrap;
    line-height: 1;
    -webkit-text-fill-color: initial;
  }

  /* Avoid inheriting the gradient text treatment from .logo-text */
  .logo-tagline {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
  }
}

/* Make sure the tagline doesn’t squeeze nav on medium widths */
@media (max-width: 1160px) {
  .logo-tagline {
    display: none;
  }
}

/* =========================
   Policy pages
========================= */

/* Center policy titles (requested) */
.policy-page > h1,
.policy-page h1 {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Center the “On this page” card (requested) */
.policy-page .toc {
  margin-left: auto;
  margin-right: auto;
}

.policy-page .toc .card-tag {
  text-align: center;
}

/* Make long tables of contents easier to scan on desktop */
@media (min-width: 980px) {
  .policy-page .toc-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Center the policy nav pills + action buttons for a cleaner layout */
.policy-page .policy-actions,
.policy-page .policy-nav {
  justify-content: center;
}

/* Keep the policy body comfortably readable */
.policy-page .article-body {
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   General polish
========================= */

/* Strong, consistent focus outlines for keyboard users */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.55);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

/* Reduce motion for people who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .btn:hover {
    transform: none !important;
  }
}

/* Make hero CTA row wrap a bit nicer when we add “Get App Updates” */
.hero .cta-row {
  gap: var(--space-sm);
}

.hero .cta-row .btn {
  min-height: 44px;
}

/* Make the welcome card feel more “app-first” without changing layout */
.hero .card .card-tag {
  letter-spacing: 0.03em;
}

/* Streaming app feature chips (homepage hero) */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.hero-chips .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(var(--accent-rgb), 0.30);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  backdrop-filter: blur(6px);
}

html[data-theme="dark"] .hero-chips .chip {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

/* =========================
   Artist pages — About card
========================= */

.artist-bio-card {
  margin-top: var(--space-lg);
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.artist-bio-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-md);
  align-items: start;
}

.artist-bio-thumb {
  display: flex;
  justify-content: center;
}

.artist-bio-thumb img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(0,0,0,0.04);
}

.artist-bio-text {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.7;
}

.artist-bio-meta {
  margin-top: 10px;
}

@media (max-width: 640px) {
  .artist-bio-grid {
    grid-template-columns: 1fr;
  }

  .artist-bio-thumb {
    justify-content: center;
  }

  .artist-bio-thumb img {
    width: 112px;
    height: 112px;
  }
}


/* ========================================
   A–F “Apple-like” polish
   A) Layout rhythm & spacing
   B) Typography refresh (clean, modern)
   C) App-first product storytelling
   D) Subtle motion + micro-interactions
   E) Visual consistency (buttons/cards)
   F) Performance-friendly defaults
======================================== */

/* B) Use a cleaner, modern type system for headings (keeps the brand serif in the logo) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 750;
  letter-spacing: -0.02em;
}

/* Keep the Music Coast wordmark feeling premium */
.logo-text {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 800;
  letter-spacing: 0;
}

/* Slightly larger base text on desktop for readability (similar to Apple’s comfortable scale) */
@media (min-width: 1024px) {
  body { font-size: 1.0625rem; }
}

/* A) Homepage highlight grid: make each panel feel like a clean “product tile” */
.home-panel {
  overflow: hidden;
  position: relative;
}

/* Soft surface treatment */
html[data-theme="light"] .home-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
}

html[data-theme="dark"] .home-panel {
  background: linear-gradient(180deg, rgba(18,18,22,0.78), rgba(12,12,14,0.68));
}

/* Subtle “lift” on desktop hover only */
@media (hover: hover) and (pointer: fine) {
  .home-panel {
    transition: transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-out);
  }
  .home-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(var(--accent-rgb), 0.35);
  }
}

/* A) On desktop, align panel headers left for a cleaner editorial layout */
@media (min-width: 1024px) {
  .home-panel .section-head {
    text-align: left;
  }
  .home-panel .section-head .subtle {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
  }
}

/* E) Buttons: unify hover/active feel site-wide */
.btn {
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              background-color var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
  }
  .btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
  }
}

/* D) Scroll reveal (JS adds .is-visible) */
.mc-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  will-change: opacity, transform;
}

.mc-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mc-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* E) KPI row: keep nice spacing now that we have 5 stats */
.kpis {
  gap: var(--space-md);
}

.kpi {
  min-width: 120px;
}

.kpi-num {
  font-variant-numeric: tabular-nums;
}

/* C) Reinforce “app-first” storytelling in the hero */
.hero .lead strong {
  color: var(--text-primary);
}

/* Make app feature chips feel more like small product badges */
.hero-chips .chip {
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
}

html[data-theme="dark"] .hero-chips .chip {
  box-shadow: 0 10px 22px rgba(0,0,0,0.28);
}

/* Generic “active pill” state (used for directory quick filters) */
.pill.is-active {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--text-primary);
}

/* ---------------------------------------------
   Artist Index — extra polish (database feel)
   --------------------------------------------- */

.artist-hero-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  min-width: 120px;
}

.stat-pill .stat-num {
  font-weight: 750;
  font-size: 18px;
  line-height: 1.1;
}

.stat-pill .stat-label {
  font-size: 12px;
  color: var(--muted);
}

.artist-subnav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.how-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.how-step-num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  flex: 0 0 auto;
}

.how-step-title {
  font-weight: 650;
  margin-bottom: 2px;
}

@media (max-width: 560px) {
  .az-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  .az-link { flex: 0 0 auto; }
  .stat-pill { min-width: 100px; }
}


/* Translation toggle (articles/interviews) */
.translate-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 4px;
  padding:8px 10px;
  border:1px solid rgba(0,0,0,0.08);
  border-radius:12px;
  background:rgba(255,255,255,0.6);
  backdrop-filter:saturate(120%) blur(6px);
}
[data-theme="dark"] .translate-bar{
  border-color: rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
}
.translate-label{
  font-size:0.95rem;
  color: var(--text, #111);
  opacity:0.9;
}
[data-theme="dark"] .translate-label{
  color: rgba(255,255,255,0.92);
}
.translate-note{
  font-size:0.9rem;
  opacity:0.75;
  margin:0 0 12px;
}
@media (max-width: 540px){
  .translate-bar{ flex-direction:column; align-items:flex-start; }
  .translate-bar .btn{ width:100%; text-align:center; }
}
