/* Disco del Giorno - layout pulito ed essenziale, griglia ampia,
   un solo colore d'accento e monospace per i dati. Nessun font esterno. */

:root {
  /* Vibe punk / new-wave discreta: carta osso, inchiostro quasi nero caldo,
     un accento acceso usato con parsimonia. Quasi monocromo: il colore e' un
     tocco, non un tema. */
  --fg: #1a1719;
  --muted: #6f6a66;
  --line: #ddd7c9;
  --bg: #f7f4ec;          /* carta osso */
  --bg-soft: #efe9da;
  --card: #fffdf7;
  --accent: #e2384f;      /* rosso-rosa acceso: bordi, righe, hover */
  --accent-strong: #b81733; /* piu' scuro: testo che richiede contrasto */
  --link: #1a1719;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--sans);
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

code { font-family: var(--mono); font-size: 0.88em; }

/* Intestazione */
.site-header {
  border-bottom: 3px solid var(--accent);
  padding: 1.75rem 0 1.25rem;
}
.site-header h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.tagline {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 60ch;
}

/* Disco del giorno */
.daily {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
}
.daily__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
}

/* Controlli */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.controls__field { display: flex; flex-direction: column; gap: 0.25rem; }
.controls__field--grow { flex: 1 1 22rem; }
.controls label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.controls input[type="search"],
.controls select,
.controls button {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid #b9b9b4;
  background: #fff;
  border-radius: 3px;
}
.controls input[type="search"] { width: 100%; }
.controls button { cursor: pointer; align-self: flex-end; }
.controls button:hover { border-color: var(--accent); color: var(--accent-strong); }
.controls input[type="search"]:focus,
.controls select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.count {
  margin: 0 0 0 auto;
  align-self: flex-end;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Griglia delle card */
.grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.card {
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
}
.card:hover { border-color: var(--accent); }
.card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
}

.cover {
  display: block;
  width: 100%;
  height: auto;            /* lascia che sia aspect-ratio a definire l'altezza (l'attributo height dell'img la sovrascriverebbe) */
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 2rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.55;
}
.cover--daily {
  width: 56px;
  height: 56px;
  aspect-ratio: auto;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.cover--daily.cover--placeholder { font-size: 1.1rem; }
.card__artist {
  font-size: 0.8rem;
  color: var(--muted);
}
.card__album {
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
}
.card__year {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent-strong);
  padding-top: 0.3rem;
}

mark { background: var(--accent); color: #fff; padding: 0 0.1em; }

/* Pop-up "contribuisci" */
.contribute {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  width: min(320px, calc(100vw - 2rem));
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 8px 28px rgba(26, 23, 25, 0.18);
}
.contribute[hidden] { display: none; }
.contribute__close {
  position: absolute;
  top: 0.25rem;
  right: 0.4rem;
  border: 0;
  background: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  padding: 0.15rem 0.35rem;
}
.contribute__close:hover { color: var(--accent-strong); }
.contribute__title {
  margin: 0 0 0.3rem;
  font-weight: 700;
  font-size: 1rem;
}
.contribute__text {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.contribute__cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
  color: #fff;
  background: var(--accent-strong);
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
}
.contribute__cta:hover { background: var(--accent); color: #fff; }

/* Paginazione */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.pager[hidden] { display: none; }
.pager button {
  font: inherit;
  padding: 0.4rem 0.8rem;
  border: 1px solid #b9b9b4;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-strong); }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager__info {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Card e disco del giorno cliccabili aprono la vista estesa */
.is-clickable { cursor: pointer; }
.is-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Modal (vista estesa) */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(26, 23, 25, 0.55);
}
.overlay[hidden] { display: none; }
body.modal-open { overflow: hidden; }

.modal {
  position: relative;
  display: flex;
  gap: 1.25rem;
  width: 100%;
  max-width: 640px;
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(26, 23, 25, 0.25);
}
.modal__close {
  position: absolute;
  top: 0.4rem;
  right: 0.55rem;
  border: 0;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
}
.modal__close:hover { color: var(--accent-strong); }
.modal__cover { flex: 0 0 200px; }
.modal__cover .cover--modal {
  width: 200px;
  height: 200px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 3rem;
}
.modal__info { flex: 1 1 auto; min-width: 0; }
.modal__artist {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.modal__album {
  margin: 0.15rem 0 0.1rem;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.modal__year {
  margin: 0 0 1rem;
  font-family: var(--mono);
  color: var(--accent-strong);
}
.modal__links { display: flex; flex-direction: column; gap: 0.4rem; }

/* Link ai servizi con logo del brand */
.provider {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.92rem;
}
.provider:hover { border-color: var(--accent); background: var(--bg-soft); color: var(--fg); }
.provider__icon { width: 20px; height: 20px; flex: 0 0 auto; }
.provider__badge {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (max-width: 32rem) {
  .modal { flex-direction: column; }
  .modal__cover { flex-basis: auto; }
  .modal__cover .cover--modal { width: 160px; height: 160px; }
}

.empty { color: var(--muted); padding: 2rem 0; }

/* Pie' di pagina */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2.5rem;
}
.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 75ch;
}
