/* ==========================================================================
   Arch2O — Member Profile  v5
   --------------------------------------------------------------------------
   قاعدة واحدة حاكمة: كل سيليكتور هنا لازم يبدأ بـ .a2o
   مفيش ولا قاعدة عامة واحدة (لا *، لا body، لا ul/li، لا img).
   ده اللي بيضمن إن شريط الأدمن (#wpadminbar) مايتلمسش أبداً.
   ========================================================================== */

.a2o {
    /* الألوان */
    --bg:        #0d0d0f;
    --surface:   #141417;
    --surface-2: #1b1b1f;
    --line:      #26262b;
    --line-soft: #1f1f24;
    --text:      #f2f2f3;
    --muted:     #8b8b93;
    --muted-2:   #5f5f68;
    --accent:    #ffffff;

    /* المقاسات */
    --r:      14px;
    --r-sm:   9px;
    --pad:    clamp(16px, 4vw, 40px);
    --maxw:   1280px;

    /* الخطوط */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;

    box-sizing: border-box;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    min-height: 60vh;
}

/* box-sizing محصور جوه .a2o بس — مش على * */
.a2o *,
.a2o *::before,
.a2o *::after { box-sizing: border-box; }

/* الثيم بيعرّف قواعد على h1..h6 و a مباشرة، والقاعدة المباشرة
   بتغلب الوراثة — فلازم نلوّن كل عنصر نص صراحةً. ده سبب اختفاء
   عناوين الكروت (كانت بتاخد لون الثيم الغامق على خلفية غامقة). */
.a2o h1, .a2o h2, .a2o h3, .a2o h4, .a2o h5, .a2o h6,
.a2o p, .a2o span, .a2o div, .a2o label, .a2o strong {
    color: var(--text);
}
.a2o a, .a2o a:link, .a2o a:visited, .a2o a:hover, .a2o a:active { color: var(--text); }
.a2o img { max-width: 100%; height: auto; display: block; }
.a2o a   { color: inherit; text-decoration: none; }
.a2o button { font-family: inherit; cursor: pointer; }

.a2o__wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* ── الغلاف ───────────────────────────────────────────────── */
.a2o__cover {
    position: relative;
    height: clamp(180px, 30vw, 340px);
    background: linear-gradient(135deg, #1a1a1f 0%, #0d0d0f 100%);
    overflow: hidden;
}
.a2o__cover-img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: .55;
}
.a2o__cover::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(13,13,15,0) 35%, var(--bg) 100%);
    pointer-events: none;
}
.a2o__watermark {
    position: absolute;
    right: var(--pad); bottom: 14px;
    font-size: clamp(28px, 7vw, 64px);
    font-weight: 800;
    letter-spacing: .12em;
    color: rgba(255,255,255,.05);
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

/* ── الهيدر ───────────────────────────────────────────────── */
.a2o__head {
    display: flex;
    gap: clamp(16px, 3vw, 30px);
    align-items: flex-end;
    margin-top: clamp(-70px, -9vw, -50px);
    position: relative;
    z-index: 2;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line-soft);
}
.a2o__avatar {
    width:  clamp(90px, 15vw, 148px);
    height: clamp(90px, 15vw, 148px);
    border-radius: 14px; /* v6: مربع بحواف ناعمة بدل دائرة */
    border: 3px solid var(--bg);
    background: var(--surface-2);
    object-fit: cover;
    flex: 0 0 auto;
    box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.a2o__id { flex: 1 1 auto; min-width: 0; padding-bottom: 4px; }
.a2o__avatar--empty {
    background: linear-gradient(135deg, var(--surface-2), var(--surface));
    border: 1px dashed var(--line);
}
.a2o__name { color: var(--text);
    font-size: clamp(22px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 5px;
    line-height: 1.15;
}
.a2o__tagline { color: var(--muted) !important; font-size: 15px; margin: 0 0 11px; }
.a2o__badge {
    color: var(--muted) !important;
    display: inline-block;
    padding: 3px 11px;
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}
.a2o__meta {
    display: flex; flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 13.5px;
}
.a2o__meta, .a2o__meta a, .a2o__meta span { color: var(--muted) !important; }
.a2o__meta a:hover { color: var(--text) !important; }
.a2o__meta a:hover { color: var(--text); }
.a2o__meta span { display: inline-flex; align-items: center; gap: 6px; }

.a2o__actions { display: flex; gap: 9px; flex-shrink: 0; padding-bottom: 4px; }
.a2o__btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--r-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: background .16s ease, border-color .16s ease;
}
.a2o__btn:hover { background: var(--surface-2); border-color: #35353c; }
.a2o__btn--solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.a2o__btn--solid:hover { background: #d9d9dc; border-color: #d9d9dc; }

/* ── السوشيال ─────────────────────────────────────────────── */
.a2o__socials { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.a2o__social {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    font-size: 12px;
    transition: color .16s ease, border-color .16s ease;
}
.a2o__social:hover { color: var(--text); border-color: var(--text); }

/* ── النبذة ───────────────────────────────────────────────── */
.a2o__bio {
    padding: 26px 0;
    border-bottom: 1px solid var(--line-soft);
    max-width: 780px;
    color: #c9c9cf !important;
    font-size: 15.5px;
    white-space: pre-line;
}

/* ── شريط الإحصائيات ──────────────────────────────────────── */
.a2o__stats {
    display: flex; gap: clamp(24px, 6vw, 60px);
    padding: 22px 0;
    border-bottom: 1px solid var(--line-soft);
}
.a2o__stat-n { color: var(--text); font-size: 25px; font-weight: 700; line-height: 1.1; }
.a2o__stat-l {
    font-size: 11px; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted-2) !important; margin-top: 3px;
}

/* ── شبكة المشاريع ────────────────────────────────────────── */
.a2o__section-t {
    font-size: 12px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--muted-2) !important;
    margin: 34px 0 18px;
}
.a2o__grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
    gap: clamp(12px, 2vw, 22px);
}
.a2o__card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease;
}
.a2o__card:hover { transform: translateY(-3px); border-color: var(--line); }
.a2o__card-media {
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    overflow: hidden;
}
.a2o__card-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.a2o__card:hover .a2o__card-media img { transform: scale(1.045); }
.a2o__card-body { padding: 13px 15px 15px; }
.a2o__card-title { color: var(--text);
    font-size: 14.5px; font-weight: 600;
    line-height: 1.35; margin: 0 0 5px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.a2o__card-year { font-size: 12px; color: var(--muted-2) !important; }

/* هيكل التحميل */
.a2o__skel {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    overflow: hidden;
}
.a2o__skel-media { aspect-ratio: 4/3; background: var(--surface-2); }
.a2o__skel-line {
    height: 11px; margin: 13px 15px;
    background: var(--surface-2); border-radius: 4px;
}
.a2o__skel-line:last-child { width: 45%; margin-bottom: 17px; }
@media (prefers-reduced-motion: no-preference) {
    .a2o__skel-media, .a2o__skel-line { animation: a2oPulse 1.4s ease-in-out infinite; }
}
@keyframes a2oPulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

.a2o__more { text-align: center; padding: 32px 0 60px; }
.a2o__empty {
    padding: 56px 20px; text-align: center;
    color: var(--muted-2); font-size: 14px;
}

/* ── لوحة التعديل ─────────────────────────────────────────── */
.a2o__modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.72);
    display: none; place-items: center;
    padding: 20px;
    /* أقل من شريط الأدمن (99999) عشان مايغطيهوش */
    z-index: 9990;
}
.a2o__modal.is-open { display: grid; }
.a2o__modal-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    width: min(560px, 100%);
    max-height: 86vh; overflow-y: auto;
    padding: 26px;
}
.a2o__modal-t { color: var(--text); font-size: 17px; font-weight: 700; margin: 0 0 20px; }
.a2o__field { margin-bottom: 15px; }
.a2o__label {
    display: block; font-size: 11px;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted-2); margin-bottom: 6px;
}
.a2o__input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
}
.a2o__input:focus { outline: none; border-color: #4a4a55; }
textarea.a2o__input { min-height: 92px; resize: vertical; }
.a2o__modal-foot {
    display: flex; gap: 9px; justify-content: flex-end;
    margin-top: 22px; padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

/* ── الموبايل ─────────────────────────────────────────────── */
@media (max-width: 860px) {
    .a2o__grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .a2o__head { flex-wrap: wrap; align-items: flex-start; }
    .a2o__actions { width: 100%; }
}
@media (max-width: 520px) {
    .a2o__grid  { grid-template-columns: 1fr; }
    .a2o__stats { gap: 26px; }
}

/* الطباعة */
@media print {
    .a2o__actions, .a2o__modal, .a2o__more { display: none !important; }
}

/* ==========================================================================
   v7 — تنظيف
   --------------------------------------------------------------------------
   كل قواعد إخفاء BuddyPress و #main_header القديمة اتشالت من هنا.
   السبب: في v7 المحتوى بيتستبدل ويتحذف *في السيرفر* قبل الإرسال،
   فمفيش حاجة نخفيها بالـ CSS. ده اللي بيمنع الوميض ويمنع كسر
   شريط الأدمن اللي كان بيحصل من قواعد الإخفاء العامة.
   ========================================================================== */

/* الصفحة تبدأ تحت شريط الأدمن مباشرة — بدون شريط أبيض */
body.a2o-server-rendered .site-content,
body.a2o-server-rendered #content,
body.a2o-server-rendered .content-area,
body.a2o-server-rendered #primary,
body.a2o-server-rendered #main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
body.a2o-server-rendered .a2o-mount { margin-top: 0; }

/* ==========================================================================
   دليل الأعضاء (/members) — نفس لغة تصميم البروفايل
   ========================================================================== */
.a2o__toolbar { display:flex; gap:10px; flex-wrap:wrap; margin:26px 0 22px; }
.a2o__search  { flex:1 1 260px; }
.a2o__select  { min-width:150px; }
.a2o__input {
    background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm);
    color:var(--text); padding:11px 14px; font-size:14px; font-family:inherit;
}
.a2o__input:focus { outline:none; border-color:#4a4a55; }

.a2o__grid--members { grid-template-columns:repeat(3, minmax(0,1fr)); }

.a2o__mcard {
    background:var(--surface); border:1px solid var(--line-soft); border-radius:var(--r);
    overflow:hidden; transition:transform .22s ease, border-color .22s ease;
}
.a2o__mcard:hover { transform:translateY(-4px); border-color:var(--line); }
.a2o__mcard-top { display:flex; align-items:center; gap:13px; padding:16px; }
.a2o__mcard-avatar {
    width:60px; height:60px; border-radius:12px;
    object-fit:cover; flex:0 0 auto; border:2px solid var(--line);
}
.a2o__mcard-info { min-width:0; }
.a2o__mcard-name {
    font-size:16px; font-weight:700; margin:0 0 3px; line-height:1.2; color:var(--text);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.a2o__mcard-type  { font-size:12px; color:var(--muted) !important; }
.a2o__mcard-count { font-size:12px; color:var(--muted-2) !important; margin-top:2px; }
.a2o__mcard-sum {
    padding:0 16px; margin:0 0 14px; color:#c9c9cf !important; font-size:13.5px;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.a2o__mcard-thumbs { display:grid; grid-template-columns:repeat(3,1fr); gap:2px; }
.a2o__mcard-thumbs img { width:100%; aspect-ratio:1; object-fit:cover; }

@media (max-width:860px){ .a2o__grid--members{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:520px){ .a2o__grid--members{ grid-template-columns:1fr; } }
