/* AllRock Player
   Plan : carte sombre, pochette dominante, artiste en condensé gras,
   un seul accent rouge pour le direct et le bouton lecture.
   Horizontal quand il y a de la place, vertical sous 480px de large
   (colonne latérale, mobile, page Webradio). */
.arp {
  --arp-bg: #121214;
  --arp-surface: #1d1d21;
  --arp-line: rgba(255,255,255,.09);
  --arp-text: #f3f1ee;
  --arp-soft: #cfccd3;
  --arp-muted: #8f8c95;
  --arp-accent: #e5372b;
  --arp-display: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --arp-body: "Open Sans", "Helvetica Neue", Arial, sans-serif;

  position: relative;
  box-sizing: border-box;
  container-type: inline-size;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--arp-line);
  border-radius: 14px;
  background: var(--arp-bg);
  color: var(--arp-text);
  font-family: var(--arp-body);
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}
.arp[data-layout="vertical"] { max-width: 400px; }
.arp *, .arp *::before, .arp *::after { box-sizing: border-box; }
.arp button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: normal; min-height: 0; }
.arp [hidden] { display: none !important; }
.arp img { max-width: 100%; }

.arp-inner { padding: 18px; }

/* Halo de la pochette en fond */
.arp .arp-glow {
  position: absolute; inset: -40%;
  z-index: -1;
  background-position: center; background-size: cover;
  filter: blur(60px) saturate(1.4);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.arp.has-art .arp-glow { opacity: .22; }

/* ---------- Disposition horizontale (par défaut) ---------- */
.arp .arp-main {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  grid-template-areas: "cover info controls";
  align-items: center;
  gap: 18px;
}
.arp .arp-cover { grid-area: cover; }
.arp .arp-info { grid-area: info; }
.arp .arp-controls { grid-area: controls; }

/* Pochette */
.arp .arp-cover {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--arp-surface);
  color: var(--arp-muted);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.arp .arp-cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; opacity: 0; transition: opacity .6s ease;
}
.arp.has-art .arp-cover-img { opacity: 1; }
.arp .arp-cover-fallback { position: absolute; inset: 14%; width: 72%; height: 72%; }
.arp[data-state="playing"] .arp-cover-fallback { animation: arp-spin 6s linear infinite; }

/* Textes */
.arp .arp-info { min-width: 0; display: grid; gap: 3px; }
.arp .arp-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; min-width: 0; }
.arp .arp-live {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--arp-muted);
}
.arp .arp-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.arp[data-state="playing"] .arp-live { color: var(--arp-accent); }
.arp[data-state="playing"] .arp-live i { animation: arp-pulse 1.6s ease-in-out infinite; }
.arp .arp-station {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--arp-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.arp .arp-station::before { content: "·"; margin-right: 10px; }
.arp .arp-artist {
  margin: 0;
  font-family: var(--arp-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--arp-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.arp .arp-title {
  font-size: 15px; color: var(--arp-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.arp .arp-progress {
  height: 2px; margin-top: 10px; border-radius: 2px;
  background: var(--arp-line); overflow: hidden;
}
.arp .arp-progress span { display: block; height: 100%; width: 0; background: var(--arp-text); opacity: .55; transition: width 1s linear; }

/* Contrôles */
.arp .arp-controls { display: flex; align-items: center; gap: 16px; }
.arp .arp-play {
  display: grid; place-items: center; flex: none;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--arp-accent); color: #fff;
  box-shadow: 0 6px 20px rgba(229,55,43,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.arp .arp-play:hover { transform: scale(1.05); box-shadow: 0 8px 26px rgba(229,55,43,.5); background: var(--arp-accent); }
.arp .arp-play:active { transform: scale(.97); }
.arp .arp-play svg { width: 26px; height: 26px; grid-area: 1 / 1; display: none; }
.arp[data-state="idle"] .i-play,
.arp[data-state="error"] .i-play { display: block; }
.arp[data-state="playing"] .i-pause { display: block; }
.arp[data-state="loading"] .i-load { display: block; animation: arp-spin .9s linear infinite; }

.arp .arp-vol { display: flex; align-items: center; gap: 8px; min-width: 0; }
.arp .arp-mute { width: 30px; height: 30px; display: grid; place-items: center; color: var(--arp-muted); border-radius: 6px; flex: none; }
.arp .arp-mute:hover { color: var(--arp-text); background: none; }
.arp .arp-mute svg { width: 22px; height: 22px; }
.arp .arp-mute .x { display: none; }
.arp.is-muted .arp-mute .x { display: inline; }
.arp.is-muted .arp-mute .w { display: none; }

.arp .arp-range {
  -webkit-appearance: none; appearance: none;
  width: 92px; height: 18px; background: transparent; margin: 0; padding: 0; border: 0; cursor: pointer;
  --fill: 90%;
}
.arp .arp-range::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(to right, var(--arp-text) var(--fill), rgba(255,255,255,.18) var(--fill));
}
.arp .arp-range::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255,255,255,.18); }
.arp .arp-range::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--arp-text); }
.arp .arp-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px;
  border-radius: 50%; background: var(--arp-text); border: 0;
}
.arp .arp-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--arp-text); border: 0; }

.arp button:focus-visible,
.arp .arp-range:focus-visible { outline: 2px solid var(--arp-text); outline-offset: 3px; }

/* Historique */
.arp .arp-history {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--arp-line);
}
.arp .arp-history-label {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--arp-muted);
}
.arp .arp-history-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; flex: 1; min-width: 0;
}
.arp .arp-history-list li { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.arp .arp-history-list li::before { content: none; }
.arp .arp-history-list .h-art {
  flex: none; width: 34px; height: 34px; border-radius: 4px; background: var(--arp-surface) center / cover no-repeat;
}
.arp .arp-history-list .h-txt { min-width: 0; font-size: 12.5px; line-height: 1.25; }
.arp .arp-history-list .h-txt b,
.arp .arp-history-list .h-txt span {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.arp .arp-history-list .h-txt b { font-weight: 700; color: var(--arp-text); }
.arp .arp-history-list .h-txt span { color: var(--arp-muted); }

.arp .arp-msg { margin: 10px 0 0; font-size: 12.5px; color: var(--arp-muted); }
.arp .arp-msg:empty { display: none; }
.arp .arp-debug {
  margin: 12px 0 0; padding: 10px; max-height: 180px; overflow: auto;
  font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--arp-muted);
  background: rgba(0,0,0,.35); border-radius: 6px; white-space: pre-wrap;
}

/* ---------- Disposition verticale (colonne latérale, mobile, page Webradio) ---------- */
@container (max-width: 480px) {
  .arp .arp-inner { padding: 16px; }
  .arp .arp-main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "cover cover"
      "info  info"
      "controls controls";
    gap: 16px;
  }
  .arp .arp-cover { border-radius: 10px; }
  .arp .arp-artist { font-size: 25px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .arp .arp-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .arp .arp-controls { justify-content: space-between; gap: 14px; }
  .arp .arp-vol { flex: 1; justify-content: flex-end; }
  .arp .arp-range { width: 100%; max-width: 160px; }
  .arp .arp-history { flex-direction: column; align-items: stretch; gap: 10px; }
  .arp .arp-history-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@container (max-width: 260px) {
  .arp .arp-inner { padding: 12px; }
  .arp .arp-artist { font-size: 21px; }
  .arp .arp-station { display: none; }
  .arp .arp-play { width: 50px; height: 50px; }
}
@media (pointer: coarse) { .arp .arp-vol { display: none; } }

@keyframes arp-spin { to { transform: rotate(360deg); } }
@keyframes arp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .arp *, .arp *::before { animation: none !important; transition: none !important; }
}

/* Blocs du thème qui rétrécissent leur contenu (constructeur tagDiv) */
.td-fix-index:has(> .arp),
.vc_raw_html:has(.arp),
.widget:has(> .arp) { width: 100%; flex: 1 1 100%; min-width: 0; }
