/* ─── RICH TEXT EDITOR ────────────────────────── */

/* Toolbar */
.rte-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-bottom: none;
  position: sticky;
  top: 56px;
  z-index: 10;
}

.rte-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.rte-toolbar-sep {
  width: 1px;
  height: 22px;
  background: var(--border2);
  margin: 0 0.35rem;
}

.rte-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.rte-btn:hover {
  background: var(--bg2);
  border-color: var(--border2);
  color: var(--gold-light);
}

.rte-btn.active {
  background: rgba(184,134,11,0.12);
  border-color: rgba(184,134,11,0.35);
  color: var(--gold-light);
}

.rte-btn-divider {
  color: var(--gold);
  border-color: rgba(184,134,11,0.2);
}
.rte-btn-divider:hover {
  background: rgba(184,134,11,0.1);
  border-color: var(--gold);
  color: var(--gold-light);
}

.rte-btn-clear { color: var(--text3); }
.rte-btn-clear:hover { color: #e09090; border-color: rgba(180,50,50,0.3); }

/* Editable area */
.rte-editor {
  width: 100%;
  min-height: 480px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1.5rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.9;
  outline: none;
  transition: border-color 0.3s;
  position: relative;
}

.rte-editor:focus {
  border-color: var(--gold);
}

/* Placeholder */
.rte-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text3);
  pointer-events: none;
  font-style: italic;
}

/* Content styling inside editor */
.rte-editor p {
  margin-bottom: 1.25rem;
}
.rte-editor p:last-child { margin-bottom: 0; }

.rte-editor h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--white);
  margin: 1.5rem 0 0.75rem;
  letter-spacing: 0.02em;
}
.rte-editor h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--gold-light);
  margin: 1.25rem 0 0.65rem;
  letter-spacing: 0.03em;
}

.rte-editor strong, .rte-editor b {
  color: var(--white);
  font-weight: 600;
}

.rte-editor em, .rte-editor i {
  color: var(--gold-light);
  font-style: italic;
}

.rte-editor u {
  text-decoration-color: rgba(184,134,11,0.5);
}

.rte-editor blockquote {
  border-left: 2px solid var(--gold);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(184,134,11,0.04);
  font-style: italic;
  color: var(--text2);
}

.rte-editor ul {
  list-style: none;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.rte-editor ul li {
  position: relative;
  padding-left: 0.5rem;
  margin-bottom: 0.5rem;
}
.rte-editor ul li::before {
  content: '✦';
  position: absolute;
  left: -1.5rem;
  color: var(--gold);
  font-size: 0.55rem;
  top: 0.5em;
}

.rte-editor hr {
  border: none;
  height: 1px;
  background: var(--border2);
  margin: 2rem 0;
}

/* The custom gold divider */
.rte-editor .article-divider-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.5rem 0;
  color: var(--gold);
  font-size: 0.75rem;
  user-select: none;
  cursor: default;
}
.rte-editor .article-divider-inline::before,
.rte-editor .article-divider-inline::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: var(--border2);
}

/* ─── MUSIC OPTIONS ────────────────────────── */
.music-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.music-option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.music-option-label:hover {
  border-color: var(--border2);
  background: var(--bg2);
}

.music-option-label input[type="radio"] {
  accent-color: var(--gold);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.music-option-label:has(input:checked) {
  border-color: rgba(184,134,11,0.4);
  background: rgba(184,134,11,0.06);
}

.music-option-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.music-option-name {
  font-size: 0.78rem;
  color: var(--text);
  font-family: var(--sans);
}

.music-option-desc {
  font-size: 0.62rem;
  color: var(--text3);
  letter-spacing: 0.08em;
}

/* ─── ARTICLE PAGE CONTENT (rendered HTML) ── */
.article-content h2 {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--white);
  margin: 2.5rem 0 1rem;
  letter-spacing: 0.02em;
}
.article-content h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--gold-light);
  margin: 2rem 0 0.85rem;
  letter-spacing: 0.03em;
}

.article-content strong, .article-content b {
  color: var(--white);
  font-weight: 600;
}

.article-content em, .article-content i {
  color: var(--gold-light);
  font-style: italic;
}

.article-content u {
  text-decoration-color: rgba(184,134,11,0.5);
}

.article-content blockquote {
  border-left: 2px solid var(--gold);
  padding: 1rem 1.75rem;
  margin: 2rem 0;
  background: rgba(184,134,11,0.04);
  font-style: italic;
  color: var(--text2);
  font-size: 1.12rem;
  line-height: 2;
}

.article-content ul {
  list-style: none;
  padding-left: 2rem;
  margin-bottom: 1.65rem;
}
.article-content ul li {
  position: relative;
  padding-left: 0.5rem;
  margin-bottom: 0.65rem;
}
.article-content ul li::before {
  content: '✦';
  position: absolute;
  left: -2rem;
  color: var(--gold);
  font-size: 0.6rem;
  top: 0.55em;
}

.article-content hr {
  border: none;
  height: 1px;
  background: var(--border2);
  margin: 3rem 0;
}

.article-content .article-divider-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 3.5rem 0;
  color: var(--gold);
  font-size: 0.7rem;
}
.article-content .article-divider-inline::before,
.article-content .article-divider-inline::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: var(--border2);
}

/* ─── MUSIC PLAYER (Article page) ─────────── */
.article-music-player {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  background: rgba(13,12,11,0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  animation: slideInPlayer 0.6s 0.5s both;
}

@keyframes slideInPlayer {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.article-music-player:hover {
  border-color: rgba(184,134,11,0.4);
}

.music-player-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--gold);
  flex-shrink: 0;
}

.music-player-icon svg {
  animation: none;
  transition: transform 0.3s;
}

.music-player-icon.playing svg {
  animation: music-spin 3s linear infinite;
}

@keyframes music-spin {
  to { transform: rotate(360deg); }
}

/* Wave bars animation */
.music-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  margin-right: 0.25rem;
}
.music-wave-bar {
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
  transition: height 0.3s;
}
.music-wave-bar:nth-child(1) { height: 6px; }
.music-wave-bar:nth-child(2) { height: 12px; }
.music-wave-bar:nth-child(3) { height: 8px; }
.music-wave-bar:nth-child(4) { height: 14px; }
.music-wave-bar:nth-child(5) { height: 5px; }

.music-player-name {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text2);
  white-space: nowrap;
}

.music-player-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.music-player-btn:hover { color: var(--gold); }

/* Playing state */
.article-music-player.playing .music-wave-bar:nth-child(1) { animation: wave1 0.8s ease-in-out infinite alternate; }
.article-music-player.playing .music-wave-bar:nth-child(2) { animation: wave2 0.9s ease-in-out infinite alternate 0.1s; }
.article-music-player.playing .music-wave-bar:nth-child(3) { animation: wave1 1.1s ease-in-out infinite alternate 0.05s; }
.article-music-player.playing .music-wave-bar:nth-child(4) { animation: wave2 0.7s ease-in-out infinite alternate 0.15s; }
.article-music-player.playing .music-wave-bar:nth-child(5) { animation: wave1 0.95s ease-in-out infinite alternate 0.08s; }

@keyframes wave1 { from { height: 4px; } to { height: 14px; } }
@keyframes wave2 { from { height: 8px; } to { height: 16px; } }
