/* ==========================================================================
   MeloNote AI — Page publique de partage (lien isolé)
   ========================================================================== */

body.share-page { background: var(--bg); }

.share-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 247, .9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.share-main { padding-block: clamp(26px, 4vw, 48px) 60px; }
.share-grid {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}
@media (max-width: 960px) { .share-grid { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------- Carte chanson */
.share-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-soft);
  padding: clamp(18px, 2.6vw, 26px);
  display: grid;
  gap: 16px;
  overflow: hidden;
}
.share-card__aura {
  position: absolute;
  inset: -30% -20% auto -20%;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent, #8CE051), transparent 68%);
  opacity: .22;
  filter: blur(50px);
  pointer-events: none;
}
.share-card > * { position: relative; }

.share-hero { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; align-items: center; }
@media (max-width: 520px) { .share-hero { grid-template-columns: 88px minmax(0, 1fr); } }

.share-cover {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 42px;
  overflow: hidden;
  box-shadow: 0 18px 34px -20px rgba(17, 24, 28, .6);
  background: linear-gradient(145deg, var(--accent, #8CE051), var(--accent-2, #76C043));
}
.share-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .18) 0 1px, transparent 1px 7px);
  opacity: .55;
}
.share-cover i { position: relative; z-index: 1; text-shadow: 0 4px 14px rgba(17, 24, 28, .4); }
.share-cover__play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(17, 24, 28, .72);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  z-index: 3;
  transition: transform var(--t) var(--ease-spring), background var(--t-fast) var(--ease);
}
.share-cover__play:hover { transform: scale(1.08); background: var(--forest); }
@media (max-width: 520px) {
  .share-cover { width: 88px; height: 88px; border-radius: 18px; font-size: 32px; }
}

.share-title { font-size: clamp(1.15rem, 2.4vw, 1.4rem); letter-spacing: -.025em; line-height: 1.2; }
.share-meta { font-size: 12px; color: var(--ink-3); display: grid; gap: 4px; margin-top: 6px; }
.share-meta strong { color: var(--ink); font-weight: 800; }
.share-meta .row { gap: 6px; }
.share-meta i { font-size: 14px; color: var(--forest); }

/* Lecteur principal */
.share-player .inline-player {
  background: var(--pastel-2);
  border-color: var(--pastel-border);
  padding: 14px;
  border-radius: var(--r-lg);
  gap: 14px;
}
.share-player .inline-player__btn { width: 46px; height: 46px; font-size: 19px; }
.share-player .inline-player .wave { height: 30px; }
.share-player .inline-player__time { font-size: 11px; }

.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.share-lyrics { border-top: 1px solid var(--line); padding-top: 14px; }
.share-lyrics pre {
  margin: 0;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
}
.share-lyrics[hidden] { display: none; }

/* --------------------------------------------------------- Colonne droite -- */
.share-aside { display: grid; gap: 16px; }

.pitch-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-2xl);
  background: linear-gradient(150deg, var(--forest-500), var(--forest) 60%, #14330F);
  color: #fff;
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--sh-lift);
}
.pitch-card::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  right: -120px;
  top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 224, 81, .45), transparent 66%);
}
.pitch-card > * { position: relative; }
.pitch-card h2 { color: #fff; font-size: clamp(1.25rem, 2.4vw, 1.6rem); letter-spacing: -.028em; max-width: 22ch; }
.pitch-card p { color: rgba(255, 255, 255, .78); font-size: 13.5px; line-height: 1.65; margin-top: 10px; max-width: 46ch; }
.pitch-card__list { display: grid; gap: 8px; margin: 16px 0 20px; }
.pitch-card__list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255, 255, 255, .88); }
.pitch-card__list i { color: var(--lime); font-size: 15px; }
.pitch-card__cta { display: flex; flex-wrap: wrap; gap: 9px; }
.pitch-card .btn--ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .24); }
.pitch-card .btn--ghost:hover { background: rgba(255, 255, 255, .18); }

/* Aperçu Open Graph */
.og-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 16px;
  box-shadow: var(--sh-card);
}
.og-card__label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.og-preview {
  position: relative;
  aspect-ratio: 1200 / 630;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #16351A, #0E1A10 70%);
  display: grid;
  grid-template-columns: 40% 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: #fff;
}
.og-preview__cover {
  height: 100%;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent, #8CE051), var(--accent-2, #76C043));
}
.og-preview__body { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.og-preview__brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lime);
}
.og-preview__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(.8rem, 1.7vw, 1.05rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.og-preview__meta { font-size: 8.5px; color: rgba(255, 255, 255, .62); }
.og-preview__badge {
  font-size: 8px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.og-preview__made {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255, 255, 255, .55);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.og-card__note { font-size: 10.5px; color: var(--ink-4); margin-top: 10px; line-height: 1.5; }

/* --------------------------------------------------- Mode bibliothèque ----- */
.lib-share-head {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.lib-share-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.03em; }
.lib-share-list { display: grid; gap: 10px; margin-top: 14px; }
.lib-share-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--sh-xs);
}
.lib-share-row .song-thumb { width: 56px; height: 56px; border-radius: 15px; font-size: 21px; }
.lib-share-row .song-expand { grid-column: 1 / -1; }

.share-footer {
  border-top: 1px solid var(--line);
  padding-block: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-4);
}
.share-footer a { font-weight: 700; color: var(--forest); }

/* --------------------------------- Composants partagés (lecteur inline) --- */
.inline-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.inline-player__btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex: 0 0 auto;
  transition: background var(--t-fast) var(--ease), transform var(--t) var(--ease-spring);
}
.inline-player__btn:hover { background: var(--forest-700); transform: scale(1.05); }
.inline-player__body { flex: 1; display: grid; gap: 3px; min-width: 0; }
.inline-player__time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.inline-player__time .range { --range-fill: var(--accent, var(--lime)); }
.inline-player .wave { height: 20px; }
.inline-player .wave__bar { opacity: .3; }
.inline-player.is-playing .wave__bar {
  opacity: 1;
  animation: waveBar 1s var(--ease) infinite alternate;
  animation-delay: var(--d, 0ms);
}

.song-thumb {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 23px;
  overflow: hidden;
  box-shadow: 0 10px 20px -12px rgba(17, 24, 28, .5);
}
.song-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .18) 0 1px, transparent 1px 6px);
  opacity: .5;
}
.song-thumb i { position: relative; z-index: 1; text-shadow: 0 3px 10px rgba(17, 24, 28, .35); }

.song-main { min-width: 0; display: grid; gap: 4px; }
.song-title { font-size: 13.5px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.song-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.song-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; }
.song-meta .tiny { color: var(--ink-4); font-weight: 600; }
.song-expand { grid-column: 1 / -1; margin-top: 4px; }



/* Pochettes generees (Leonardo / repli local) */
.song-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.song-thumb:has(img)::after { display: none; }
.inline-player__cover { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: 0 6px 16px rgba(17, 24, 28, .18); }

/* ============================================================
   RESPONSIVE PARTAGE (mobile) - ajoute en fin de fichier
   ============================================================ */
@media (max-width: 560px) {
  .share-topbar .btn--quiet { display: none; }
  .share-topbar .logo__word { font-size: .95rem; }
  .share-topbar .container { gap: 10px; }
  .share-topbar .btn--primary { padding-inline: 14px; font-size: .82rem; }
  .share-main { padding-top: 12px; }
  .share-grid { gap: 14px; }
  .share-card, .share-aside { padding: 16px; border-radius: 22px; }
  .share-actions .btn { flex: 1 1 auto; justify-content: center; }
  .share-lyrics pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .share-hero { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .share-cover { width: 72px; height: 72px; border-radius: 16px; font-size: 26px; }
  .share-topbar .btn--primary .orb { display: none; }
}