/* ==========================================================================
   css/styles.css - Dani Núñez Portfolio
   ========================================================================== */

@import url('typography.css');

:root {
  --bg-color: #032d68;
  --text-white: #ffffff;
  --border-white: rgba(255, 255, 255, 0.5);
  --border-strong: #ffffff;
  --max-width: 1440px;
  
  --hero-gap: clamp(44px, 5vw, 72px);
  --section-spacing: clamp(50px, 6vw, 90px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Navegación Superior (Escritorio)
   ========================================================================== */
.top-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 32px 48px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.nav-left, .nav-right {
  display: flex;
  gap: 36px;
}

.nav-left { justify-content: flex-start; }
.nav-right { justify-content: flex-end; }

.nav-left a, .nav-right a {
  color: var(--text-white);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-left a:hover, .nav-right a:hover {
  opacity: 0.7;
}

.nav-brand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.brand-logo {
  height: 90px;
  width: auto;
  display: block;
  transition: height 0.3s ease;
}

@media (min-width: 1024px) {
  .brand-logo {
    height: 135px;
  }
}

/* ==========================================================================
   Hero Principal (Escritorio)
   ========================================================================== */
.hero-section {
  width: 100%;
  text-align: center;
  padding: 0 24px;
  margin-top: var(--hero-gap);
  margin-bottom: var(--hero-gap);
}

h1.hero-title,
.hero-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.28em;
  font-size: clamp(56px, 11vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  margin: 0;
  user-select: none;
}

.hero-word {
  display: inline-block;
}

/* ==========================================================================
   Estadísticas y Métricas (Escritorio)
   ========================================================================== */
.stats-section {
  width: 100%;
  padding-bottom: var(--section-spacing);
}

.stats-container {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 48px;
  align-items: stretch;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

.stats-left {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.stats-image {
  height: clamp(380px, 35vw, 460px);
  width: auto;
  max-width: 100%;
  object-fit: cover;
  display: block;
}

.stats-divider {
  width: 1px;
  background-color: var(--border-white);
}

.stats-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  gap: 14px;
}

.stat-item {
  font-size: clamp(28px, 2.7vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.stat-footnote {
  font-size: 14px;
  line-height: 1.3;
  opacity: 0.85;
  margin-top: 8px;
}

.stat-footnote a,
.muso-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s ease;
}

.stat-footnote a:hover,
.muso-link:hover {
  opacity: 0.7;
}

/* ==========================================================================
   Controles del Catálogo / CMS
   ========================================================================== */
.credits-section {
  width: 100%;
  padding-bottom: 60px;
}

.section-title {
  text-align: center;
  font-size: clamp(26px, 3.2vw, 38px);
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.db-debug-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.db-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
  transition: all 0.3s ease;
}

.db-source-badge.cloud {
  color: #79f7a4;
  background: rgba(121, 247, 164, 0.08);
  border-color: rgba(121, 247, 164, 0.3);
}

.db-source-badge.local {
  color: #ffb86c;
  background: rgba(255, 184, 108, 0.08);
  border-color: rgba(255, 184, 108, 0.3);
}

.credits-header-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

.cms-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
}

.credits-filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-white);
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 20px;
  cursor: pointer;
  letter-spacing: -0.13px;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--text-white);
  color: var(--bg-color);
  font-weight: 700;
}

.search-sort-bar {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 600px;
}

.credit-search-input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-white);
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 18px;
  outline: none;
  text-transform: uppercase;
  transition: border-color 0.2s;
  text-align: center;
}

.credit-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.credit-search-input:focus {
  border-color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Estructura de Dos Columnas Paralelas (Split Credits - Escritorio)
   ========================================================================== */
.split-credits-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  width: 100%;
}

.credits-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.credits-column.col-streams {
  border-right: 1px solid var(--border-strong);
}

.column-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-strong);
  text-align: center;
  background-color: rgba(255, 255, 255, 0.03);
}

.column-title {
  font-family: var(--font-saa-a);
  font-size: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-white);
}

.column-cards {
  display: flex;
  flex-direction: column;
}

.credit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px 40px;
  border-bottom: 1px solid var(--border-strong);
  text-decoration: none;
  color: var(--text-white);
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.credit-card:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.credit-cover-box {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  margin-bottom: 24px;
}

.credit-cover-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.credit-card:hover .credit-cover-box img {
  transform: scale(1.04);
}

.credit-details {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.credit-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.credit-streams {
  opacity: 0.8;
  white-space: nowrap;
}

.credit-artist-album {
  opacity: 0.9;
}

.credit-roles-tag {
  opacity: 0.65;
  margin-top: 4px;
  line-height: 1.4;
}

/* ==========================================================================
   Paginación y Estados
   ========================================================================== */
.load-more-container {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.load-more-btn {
  background: transparent;
  border: 1px solid var(--border-white);
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 14px 32px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.load-more-btn:hover {
  background-color: var(--text-white);
  color: var(--bg-color);
}

.no-results {
  padding: 60px 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 15px;
  opacity: 0.7;
}

/* ==========================================================================
   10. ADAPTABILIDAD MÓVIL (Pantallas ≤ 860px)
   ========================================================================== */
@media (max-width: 860px) {
  .top-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px 0;
  }

  .nav-left, .nav-right {
    gap: 20px;
    justify-content: center;
  }

  /* 1. Titular DANI NÚÑEZ */
  .hero-section {
    margin-top: 28px;
    margin-bottom: 28px;
    padding: 0 16px;
  }

  h1.hero-title,
  .hero-title,
  .hero-section h1 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    font-size: clamp(48px, 13vw, 64px) !important;
    line-height: 1 !important;
    letter-spacing: -0.04em !important;
    width: 100% !important;
    text-align: center !important;
  }

  .hero-word {
    display: block !important;
    text-align: center !important;
    max-width: 100% !important;
  }

  /* 2. Sección de estadísticas y fotografía centradas */
  .stats-section {
    padding-bottom: 36px;
  }

  .stats-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 0 16px;
    width: 100%;
  }
  
  .stats-left {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .stats-image {
    height: auto;
    width: 100%;
    max-width: 290px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0 auto;
  }

  .stats-divider {
    width: 100%;
    max-width: 290px;
    height: 1px;
    background-color: var(--border-white);
    margin: 0 auto;
    opacity: 0.5;
  }

  /* 3. Textos y pie centrados */
  .stats-right {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 0 10px;
  }

  .stat-item {
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: -0.01em;
    text-align: center;
    width: 100%;
  }

  .stat-footnote {
    width: 100%;
    max-width: 100%;
    display: block;
    font-size: 10px;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    opacity: 0.75;
    margin: 4px auto 0;
  }

  /* 4. Controles CMS */
  .credits-header-wrapper {
    padding: 0 14px;
  }

  .cms-controls {
    gap: 14px;
    margin-bottom: 32px;
  }

  .credits-filter-bar {
    gap: 8px;
  }

  .filter-btn {
    font-size: 11px;
    padding: 8px 12px;
  }

  .credit-search-input {
    font-size: 11px;
    padding: 10px 14px;
  }

  /* 5. DOS COLUMNAS ALINEADAS CON ALTURA UNIFORME EN MÓVIL */
  .split-credits-wrapper {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100%;
  }

  .credits-column {
    min-width: 0;
  }

  .credits-column.col-streams {
    border-right: 1px solid var(--border-strong) !important;
    border-bottom: none !important;
  }

  /* Cabeceras de columnas a la misma altura exacta */
  .column-header {
    height: 52px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
  }

  .column-title {
    font-size: clamp(12px, 3.2vw, 15px);
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0;
  }

  /* Tarjeta de crédito en móvil */
  .credit-card {
    padding: 18px 10px 14px;
    border-bottom: 1px solid var(--border-strong);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
  }

  .credit-cover-box {
    width: 100%;
    max-width: 100%;
    margin-bottom: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  /* Altura fija estandarizada para que todas las tarjetas midan exactamente lo mismo */
  .credit-details {
    width: 100%;
    max-width: 100%;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
  }

  /* Reserva fija de 32px para que la ausencia de plays no desalinee la tarjeta */
  .credit-title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 32px;
    max-height: 32px;
    overflow: hidden;
    gap: 1px;
    width: 100%;
  }

  .credit-track-title {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
  }

  .credit-streams {
    font-size: 10px;
    line-height: 1.2;
    opacity: 0.75;
    height: 14px;
    display: block;
    white-space: nowrap;
  }

  .credit-artist-album {
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
    margin-top: 2px;
  }

  .credit-roles-tag {
    font-size: 9px;
    line-height: 1.3;
    margin-top: 3px;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
  }
}