/* ═══ التسجيل الصوتي ═══ */

.acf-voice{
  display:grid;
  gap:11px;
  padding:14px;
  border:1px solid var(--post-line, rgba(255,255,255,.105));
  border-radius:16px;
  background:var(--post-glass-2, rgba(255,255,255,.032));
}
.acf-voice.is-unsupported .acf-voice-main,
.acf-voice.is-unsupported .acf-voice-notice{ display:none; }

.acf-voice-notice{ margin:0; font-size:12px; line-height:1.8; opacity:.62; }

.acf-voice-main{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

.acf-voice-btn{
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:44px;
  padding:0 18px;
  border:1px solid var(--post-line-strong, rgba(255,255,255,.16));
  border-radius:999px;
  background:var(--post-glass, rgba(255,255,255,.055));
  color:inherit;
  font:inherit;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
}
.acf-voice-btn:hover{ border-color:var(--post-primary, #7c3aed); }
.acf-voice-btn.is-stop{ border-color:var(--post-danger, #ef4444); color:var(--post-danger, #ef4444); }

/* نبضةٌ تتبع صوت المايك: بلا إشارةٍ حيّة يسجّل الناس دقيقةً صامتة */
.acf-voice-dot{
  width:11px;
  height:11px;
  flex:none;
  border-radius:50%;
  background:var(--post-danger, #ef4444);
  transform:scale(calc(1 + var(--level, 0) * 0.9));
  transition:transform .08s linear;
}

.acf-voice-timer{ font-size:13px; font-weight:800; opacity:.6; font-variant-numeric:tabular-nums; }

/* ── إظهار ما يخصّ كلّ حالة ─────────────────────────────────────── */
.acf-voice[data-voice-state="idle"] .acf-voice-btn.is-stop,
.acf-voice[data-voice-state="idle"] .acf-voice-ready,
.acf-voice[data-voice-state="working"] .acf-voice-btn.is-start,
.acf-voice[data-voice-state="working"] .acf-voice-btn.is-stop,
.acf-voice[data-voice-state="working"] .acf-voice-ready,
.acf-voice[data-voice-state="recording"] .acf-voice-btn.is-start,
.acf-voice[data-voice-state="recording"] .acf-voice-ready,
.acf-voice[data-voice-state="ready"] .acf-voice-btn.is-start,
.acf-voice[data-voice-state="ready"] .acf-voice-btn.is-stop{ display:none; }

.acf-voice-ready{ display:grid; gap:11px; }
.acf-voice-ready audio{ width:100%; height:40px; }

.acf-voice-filters{ display:grid; gap:7px; }
.acf-voice-filters-title{ font-size:12px; font-weight:900; opacity:.7; }
.acf-voice-filters-row{ display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:7px; }

.acf-voice-filter{
  display:grid;
  gap:2px;
  padding:9px 11px;
  border:1px solid var(--post-line, rgba(255,255,255,.105));
  border-radius:12px;
  background:none;
  color:inherit;
  font:inherit;
  text-align:start;
  cursor:pointer;
}
.acf-voice-filter b{ font-size:13px; font-weight:900; }
.acf-voice-filter small{ font-size:11px; opacity:.55; line-height:1.6; }
.acf-voice-filter:hover{ border-color:var(--post-line-strong, rgba(255,255,255,.16)); }
.acf-voice-filter.is-active{
  border-color:var(--post-primary, #7c3aed);
  background:var(--post-glass, rgba(255,255,255,.055));
}

.acf-voice-ready-acts{ display:flex; gap:14px; }
.acf-voice-link{
  border:0;
  background:none;
  color:inherit;
  font:inherit;
  font-size:12px;
  font-weight:800;
  opacity:.62;
  cursor:pointer;
  padding:0;
}
.acf-voice-link:hover{ opacity:1; text-decoration:underline; text-underline-offset:3px; }
.acf-voice-link.is-danger:hover{ color:var(--post-danger, #ef4444); }

.acf-voice-status{ margin:0; font-size:12px; opacity:.7; min-height:1em; }

/* ── المُشغّل ────────────────────────────────────────────────────
   الزرّ يساراً كما في كلّ مشغّلات الصوت مهما كانت لغة الصفحة: التقديم
   والتأخير عادةٌ بصرية لا تتبع اتّجاه الكتابة. */
.acf-voice-play{
  display:grid;
  gap:5px;
  margin-top:12px;
  padding:11px 13px;
  border:1px solid var(--post-line, rgba(255,255,255,.105));
  border-radius:14px;
  background:var(--post-glass-2, rgba(255,255,255,.032));
  min-width:0;
  position:relative;
  z-index:2;
}
.acf-voice-play audio{ display:none; }

.acf-voice-row{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:0;
  /* الزرّ أوّل العناصر وأقصى اليسار: row-reverse في صفحةٍ عربية تضع
     أوّل ابنٍ يساراً. */
  flex-direction:row-reverse;
  justify-content:flex-end;
}

.acf-voice-toggle{
  position:relative;
  display:grid;
  place-items:center;
  width:var(--voice-btn, 38px);
  height:var(--voice-btn, 38px);
  flex:none;
  border:0;
  border-radius:50%;
  background:var(--post-primary, #7c3aed);
  color:#fff;
  cursor:pointer;
  padding:0;
}
.acf-voice-toggle svg{ width:15px; height:15px; fill:currentColor; }
.acf-voice-toggle .is-pause{ display:none; }
.acf-voice-play.is-playing .acf-voice-toggle .is-play{ display:none; }
.acf-voice-play.is-playing .acf-voice-toggle .is-pause{ display:block; }
.acf-voice-play.is-loading .acf-voice-toggle svg{ opacity:0; }

.acf-voice-spin{ display:none; }
.acf-voice-play.is-loading .acf-voice-spin{
  display:block;
  position:absolute;
  width:15px;
  height:15px;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  border-radius:50%;
  animation:acf-voice-spin .7s linear infinite;
}
@keyframes acf-voice-spin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce){ .acf-voice-spin{ animation-duration:2s; } }

/* الشريط نصف ارتفاع الزرّ: أنحف منه يبدو خيطاً تائهاً جنب قرصٍ ممتلئ. */
.acf-voice-bar{
  position:relative;
  flex:1;
  min-width:0;
  height:calc(var(--voice-btn, 38px) / 2);
  border-radius:999px;
  background:var(--post-line-strong, rgba(255,255,255,.16));
  cursor:pointer;
  overflow:hidden;
}
.acf-voice-bar:focus-visible{ outline:2px solid var(--post-primary, #7c3aed); outline-offset:3px; }
.acf-voice-fill{
  display:block;
  inline-size:0%;
  block-size:100%;
  border-radius:999px;
  background:var(--post-primary, #7c3aed);
}

.acf-voice-clock{
  flex:none;
  font-size:11.5px;
  opacity:.6;
  font-variant-numeric:tabular-nums;
  direction:ltr;
}

.acf-voice-note{
  font-size:11px;
  opacity:.5;
  padding-inline-start:calc(var(--voice-btn, 38px) + 11px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.acf-voice-play.is-error .acf-voice-note::after{ content:' — تعذّر التشغيل'; }

/* داخل بطاقة في قائمة: أصغر وأخفّ */
.acf-voice-play.is-compact{ --voice-btn:32px; margin-top:9px; padding:9px 11px; border-radius:12px; }
.acf-voice-play.is-compact .acf-voice-row{ gap:9px; }
.acf-voice-play.is-compact .acf-voice-clock{ font-size:11px; }
.acf-voice-play.is-compact .acf-voice-note{ font-size:10.5px; padding-inline-start:calc(var(--voice-btn) + 9px); }

@media(max-width:420px){
  .acf-voice-note{ display:none; }
}

/* الوسم كلمةٌ واحدة طويلة لا تنكسر من نفسها: «#انا_استطيع_التحدث_بحريه»
   كان يمدّ البطاقة ويدفع ما فيها خارجها. */
.acf-feed-text, .acf-search-text, .acf-my-card-text, .acf-post-content{
  overflow-wrap:anywhere;
  min-width:0;
}
.acf-hashtag, .acf-mention{ overflow-wrap:anywhere; }

/* ═══ تابا النشر ═══
   شريطٌ واحد مقسوم لا زرّان منفصلان: الاختيار بين حالتين لشيءٍ واحد يُعرض
   مجموعاً، لا مبعثراً كأنّه فعلان مختلفان. */
.acf-write-modes{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:3px;
  padding:3px;
  margin-bottom:10px;
  border:1px solid var(--post-line, rgba(255,255,255,.105));
  border-radius:999px;
  background:var(--post-glass-2, rgba(255,255,255,.032));
}
.acf-write-mode{
  min-height:34px;
  padding:0 14px;
  border:0;
  border-radius:999px;
  background:none;
  color:inherit;
  font:inherit;
  font-size:12.5px;
  font-weight:900;
  cursor:pointer;
  opacity:.6;
}
.acf-write-mode:hover{ opacity:.85; }
.acf-write-mode.is-active{
  opacity:1;
  background:var(--post-primary, #7c3aed);
  color:#fff;
}

.acf-write-title{
  width:100%;
  min-height:44px;
  padding:0 13px;
  border:1px solid var(--post-line, rgba(255,255,255,.105));
  border-radius:12px;
  background:var(--post-glass-2, rgba(255,255,255,.032));
  color:inherit;
  font:inherit;
  font-size:14.5px;
  font-weight:700;
}
.acf-write-title:focus{ outline:none; border-color:var(--post-primary, #7c3aed); }
.acf-write-title-count{ display:block; margin-top:4px; font-size:10.5px; opacity:.45; font-variant-numeric:tabular-nums; }

[data-mode-pane][hidden]{ display:none !important; }

/* أفعال التحديث: نصٌّ خافت تحت التحديث لا شريط أزرار */
.acf-update-acts{ display:flex; gap:12px; margin-top:6px; }
.acf-update-acts .acf-own-edit-btn{
  padding:0; border:0; background:none; font-size:11.5px; font-weight:800; opacity:.6;
}
.acf-update-acts .acf-own-edit-btn:hover{ opacity:1; text-decoration:underline; text-underline-offset:3px; }
.acf-update-acts .acf-own-edit-btn.is-danger:hover{ color:var(--post-danger, #ef4444); }
[data-update-form]{ margin-top:8px; }
[data-update-form] textarea{ width:100%; }
