/* ─── Tipografías propias ───────────────────────────────────────────── */
@font-face {
  font-family: 'Bloque';
  src: url('../fonts/Bloque-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Tachyon';
  src: url('../fonts/Tachyon-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* ─── Variables ─────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #0a0a0a;
  --text-muted: #71717a;
  --border: #e4e4e7;
  --border-subtle: #f4f4f5;
  --badge-bg: #f4f4f5;
  --btn-bg: #0a0a0a;
  --btn-text: #ffffff;
  --btn-hover: #27272a;
  --accent: #3b2d8c;       /* violeta ARA */
  --accent-gold: #b4b130;  /* dorado ARA */
  --radius: 8px;
  --nav-h: 64px;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
}

/* ─── Nav ───────────────────────────────────────────────────────────── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--nav-h);
}

/* Logo + nombre del sitio */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.nav-site-name {
  font-family: 'Bloque', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.2;
  text-transform: uppercase;
}

/* Links de navegación */
.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--border-subtle);
}

.nav-link.active {
  color: var(--text);
  background: var(--border-subtle);
}

/* ─── Header ────────────────────────────────────────────────────────── */
header {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 0;
}

.header-inner {
  padding-bottom: 20px;
}

.header-sub {
  font-family: 'Tachyon', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-mosaic {
  display: grid;
  grid-template-columns: repeat(var(--mosaic-cols, 14), 1fr);
  gap: 6px;
  overflow: hidden;
  border-radius: var(--radius);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
}

.mosaic-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--border-subtle);
  border-radius: 4px;
  object-fit: cover;
  opacity: 0.82;
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.mosaic-thumb:hover {
  opacity: 1;
  transform: scale(1.1);
  z-index: 2;
}

/* ─── Contenedor principal ──────────────────────────────────────────── */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px;
}

/* ─── Controles ─────────────────────────────────────────────────────── */
.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.top-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-box {
  flex-grow: 1;
}

.search-box input,
.sort-select {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input {
  width: 100%;
}

.search-box input:focus,
.sort-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 45, 140, 0.08);
}

.sort-select {
  cursor: pointer;
  font-weight: 500;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
  appearance: none;
}

/* ─── Filtros ───────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-btn {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 13px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}

.filter-btn:hover {
  color: var(--text);
  border-color: #a1a1aa;
}

.filter-btn.active {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ─── Stats ─────────────────────────────────────────────────────────── */
.stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ─── Grilla de discos ──────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px 16px;
}

/* ─── Tarjeta ───────────────────────────────────────────────────────── */
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--surface);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 45, 140, 0.08);
}

.cover-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease-in;
}

.cover-container img.loaded {
  opacity: 1;
}

.cover-placeholder {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px;
  text-align: center;
  opacity: 0.6;
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.year-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--badge-bg);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  letter-spacing: 0.02em;
}

.year-badge:hover {
  background-color: var(--accent);
  color: #ffffff;
}

.album-title {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 3px;
}

.artist-links {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.artist-tag {
  cursor: pointer;
  display: inline;
  transition: color 0.15s ease;
}

.artist-tag:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ─── Botón ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn-active {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  transition: background-color 0.15s ease;
}

.btn-active:hover {
  background-color: var(--accent);
}

/* ─── Estado vacío ──────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
  font-size: 0.9rem;
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-site-name {
    display: none;
  }

  .nav-logo-img {
    height: 30px;
  }

  .top-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-select {
    width: 100%;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px 10px;
  }
}
