/**
 * 14-author.css — arabdown.net Author Page
 * يستهدف القالب المخصص author.php (لا يستخدم بنية القالب الأب).
 *
 * المراجع البصرية:
 *   - Al Jazeera author page → بطاقة كاتب تُقنع الزائر بالمتابعة
 *   - The Verge author       → stats واضحة + roster مقالات نظيف
 *
 * هدف SEO: يدعم E-E-A-T (Experience, Expertise, Authoritativeness, Trust).
 *
 * بنية القالب (author.php):
 *   .adc-author-page
 *     ├── .author-hero
 *     │    └── .adc-container > .author-profile-card
 *     │         ├── .author-avatar-wrapper > img.author-avatar-img + .author-avatar-badge
 *     │         ├── h1.author-name
 *     │         ├── p.author-bio
 *     │         ├── .author-stats-row > .author-stat (× n)
 *     │         └── .author-social-row > .author-social-link.{platform}
 *     └── .author-posts-section
 *          └── .adc-container
 *               ├── .author-posts-header (heading + count)
 *               ├── .author-grid > article.author-card[.featured]
 *               └── .cat-pagination
 *
 * TODO: إضافة Schema.org Person + sameAs links via functions.php
 *       (آخر خطوة في تحسين E-E-A-T لـ Google).
 */

/* ════════════════════════════════════════════════════════════════════════
   1. Page Wrapper + Container
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page {
    background: #ffffff;
}
.adc-author-page .adc-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ════════════════════════════════════════════════════════════════════════
   2. AUTHOR HERO — Banner Strip
   ──────────────────────────────────────────────────────────────────────
   لماذا linear gradient ناعم: يميّز الرأس عن بقية الصفحة بدون ضجيج
   بصري — نفس روح Al Jazeera author header.
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .author-hero {
    position: relative;
    background: linear-gradient(135deg, #eef5e6 0%, #f8fbf5 100%);
    border-bottom: 1px solid #d4e8c0;
    padding: 48px 0 32px;
    overflow: hidden;
}
/* طبقة زخرفية اختيارية (موجودة في القالب كـ <div class="author-hero-bg">) */
.adc-author-page .author-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 85% 15%, rgba(110, 159, 68, .08) 0%, transparent 60%);
}

/* ════════════════════════════════════════════════════════════════════════
   3. PROFILE CARD — تخطيط Grid
   ──────────────────────────────────────────────────────────────────────
   جوال: عمودي بمحاذاة وسطية (text-align center).
   Desktop: avatar يسار + المعلومات في عمود واحد بمحاذاة start.
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .author-profile-card {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

@media (min-width: 768px) {
    .adc-author-page .author-profile-card {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 24px;
        row-gap: 8px;
        align-items: start;
        text-align: start;
    }
    /* avatar يأخذ صفّاً واحداً في العمود الأول */
    .adc-author-page .author-profile-card .author-avatar-wrapper {
        grid-row: 1 / span 5;
        grid-column: 1;
    }
    /* البقية في العمود الثاني */
    .adc-author-page .author-profile-card .author-name,
    .adc-author-page .author-profile-card .author-bio,
    .adc-author-page .author-profile-card .author-stats-row,
    .adc-author-page .author-profile-card .author-social-row {
        grid-column: 2;
        margin: 0;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   4. AVATAR + Verified Badge
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .author-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}
.adc-author-page .author-avatar-img,
.adc-author-page .author-avatar-wrapper img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    object-fit: cover;
    display: block;
    background: #fff;
}
@media (min-width: 768px) {
    .adc-author-page .author-avatar-img,
    .adc-author-page .author-avatar-wrapper img {
        width: 120px;
        height: 120px;
    }
}

/* "كاتب موثَّق" — badge ✓ في زاوية الـ avatar (موجود في القالب كـ SVG) */
.adc-author-page .author-avatar-badge {
    position: absolute;
    inset-block-end: 4px;
    inset-inline-end: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #6e9f44;
    color: #fff;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(110, 159, 68, .35);
    z-index: 2;
}
.adc-author-page .author-avatar-badge svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

/* ════════════════════════════════════════════════════════════════════════
   5. NAME + BIO
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .author-name {
    font-size: 30px;
    font-weight: 800;
    color: #111111;
    line-height: 1.25;
    margin: 0;
    letter-spacing: -0.02em;
}
@media (min-width: 768px) {
    .adc-author-page .author-name {
        font-size: 34px;
    }
}

.adc-author-page .author-bio {
    max-width: 680px;
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    margin: 4px 0 0;
    font-weight: 400;
}
@media (min-width: 768px) {
    .adc-author-page .author-bio {
        font-size: 16px;
    }
}

/* "كاتب محرّر" نصي — badge مساعد لو أُضيف عبر template لاحقاً */
.adc-author-page .author-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #6e9f44;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 6px;
}

/* ════════════════════════════════════════════════════════════════════════
   6. STATS ROW — مقالات / تعليقات / مشاهدات
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .author-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 16px;
    justify-content: center;
}
@media (min-width: 768px) {
    .adc-author-page .author-stats-row {
        justify-content: flex-start;
    }
}

.adc-author-page .author-stat {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}
.adc-author-page .author-stat-number {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    line-height: 1.1;
}
.adc-author-page .author-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    font-weight: 500;
}

/* ════════════════════════════════════════════════════════════════════════
   7. SOCIAL ROW
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .author-social-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
@media (min-width: 768px) {
    .adc-author-page .author-social-row {
        justify-content: flex-start;
    }
}

.adc-author-page .author-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #ddd;
    color: #666;
    text-decoration: none;
    font-size: 0; /* لإخفاء النص النصّي في القالب — يبقى للـ a11y */
    transition: border-color 200ms ease, color 200ms ease;
    overflow: hidden;
}
.adc-author-page .author-social-link::before {
    /* نوفّر glyph آمن لو لم يكن هناك SVG داخل الـ <a> */
    font-size: 14px;
    font-weight: 600;
}
.adc-author-page .author-social-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
.adc-author-page .author-social-link:hover {
    border-color: #6e9f44;
    color: #6e9f44;
}
/* ألوان الـ hover حسب المنصة */
.adc-author-page .author-social-link.twitter:hover    { border-color: #000; color: #000; }
.adc-author-page .author-social-link.facebook:hover   { border-color: #1877f2; color: #1877f2; }
.adc-author-page .author-social-link.instagram:hover  { border-color: #e4405f; color: #e4405f; }
.adc-author-page .author-social-link.youtube:hover    { border-color: #ff0000; color: #ff0000; }
.adc-author-page .author-social-link.website:hover    { border-color: #6e9f44; color: #6e9f44; }
/* لو القالب طبع نص المنصة (Twitter, Facebook…) داخل الـ <a>، نُظهره بحجم مرئي */
.adc-author-page .author-social-link:not(:has(svg)) {
    width: auto;
    min-width: 36px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 18px;
}

/* ════════════════════════════════════════════════════════════════════════
   8. POSTS SECTION
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .author-posts-section {
    padding: 48px 0;
    background: #ffffff;
}

.adc-author-page .author-posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid #6e9f44;
}

.adc-author-page .author-posts-heading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}
@media (min-width: 992px) {
    .adc-author-page .author-posts-heading {
        font-size: 26px;
    }
}
.adc-author-page .author-posts-heading svg {
    width: 22px;
    height: 22px;
    stroke: #6e9f44;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

.adc-author-page .author-posts-count {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 4px 12px;
}

/* ════════════════════════════════════════════════════════════════════════
   9. AUTHOR GRID — مقالات الكاتب (مطابق لكروت الأرشيف)
   ──────────────────────────────────────────────────────────────────────
   جوال: row layout (صورة 100×80 + نص).
   Tablet: 2 أعمدة.
   Desktop: 3 أعمدة.
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .author-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.adc-author-page .author-card {
    background: #fff;
    border: 0;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    overflow: hidden;
    transition: transform 200ms ease, box-shadow 200ms ease;
}
.adc-author-page .author-card:last-child {
    border-bottom: 0;
}

.adc-author-page .author-card-link {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 16px 0;
    text-decoration: none;
    color: inherit;
}

.adc-author-page .author-card-thumb {
    position: relative;
    flex: 0 0 100px;
    height: 80px;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
}
.adc-author-page .author-card-thumb img {
    width: 100px;
    height: 80px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}
.adc-author-page .author-card-thumb .cat-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #eef5e6, #d4e8c0);
}
.adc-author-page .author-card-overlay {
    display: none; /* لا overlay على البطاقات الصغيرة */
}
.adc-author-page .author-card-cat {
    display: none; /* مخفية في mobile row layout */
}

.adc-author-page .author-card-body {
    flex: 1;
    min-width: 0;
    padding: 0;
}
.adc-author-page .author-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.adc-author-page .author-card-link:hover .author-card-title {
    color: #3d6420;
}
.adc-author-page .author-card-excerpt {
    display: none; /* mobile: مخفي للحفاظ على بطاقة مدمجة */
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 8px;
}
.adc-author-page .author-card-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    gap: 6px;
}

/* Tablet — 2 أعمدة، column layout */
@media (min-width: 768px) {
    .adc-author-page .author-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .adc-author-page .author-card {
        border: 0;
        border-radius: 8px;
        overflow: hidden;
    }
    .adc-author-page .author-card:last-child {
        border-bottom: 0;
    }
    .adc-author-page .author-card-link {
        flex-direction: column;
        gap: 0;
        padding: 0;
        height: 100%;
    }
    .adc-author-page .author-card-thumb {
        position: relative;
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 16/10;
        border-radius: 0;
    }
    .adc-author-page .author-card-thumb img {
        width: 100%;
        height: 100%;
        aspect-ratio: 16/10;
        border-radius: 0;
    }
    .adc-author-page .author-card-cat {
        display: inline-block;
        position: absolute;
        bottom: 8px;
        inset-inline-start: 8px;
        background: rgba(110, 159, 68, .92);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        padding: 3px 10px;
        border-radius: 4px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        z-index: 2;
    }
    .adc-author-page .author-card-overlay {
        display: block;
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 50%);
        pointer-events: none;
    }
    .adc-author-page .author-card-body {
        padding: 14px;
    }
    .adc-author-page .author-card-title {
        font-size: 17px;
        -webkit-line-clamp: 3;
    }
}

/* Desktop — 3 أعمدة، حدود وhover */
@media (min-width: 1024px) {
    .adc-author-page .author-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    .adc-author-page .author-card {
        border: 1px solid #ebebeb;
        border-radius: 8px;
        background: #fff;
    }
    .adc-author-page .author-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
}

/* ════════════════════════════════════════════════════════════════════════
   10. FEATURED CARD — أول مقال يأخذ مساحة كاملة (الكتلة الأبرز للكاتب)
   ════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
    .adc-author-page .author-card.featured {
        grid-column: 1 / -1;
    }
    .adc-author-page .author-card.featured .author-card-link {
        flex-direction: row;
        align-items: stretch;
    }
    .adc-author-page .author-card.featured .author-card-thumb {
        flex: 0 0 50%;
        aspect-ratio: 16/10;
    }
    .adc-author-page .author-card.featured .author-card-body {
        flex: 1;
        padding: 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .adc-author-page .author-card.featured .author-card-title {
        font-size: 22px;
        -webkit-line-clamp: 3;
    }
    .adc-author-page .author-card.featured .author-card-excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}
@media (min-width: 1024px) {
    .adc-author-page .author-card.featured .author-card-title {
        font-size: 26px;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   11. PAGINATION (.cat-pagination — paginate_links type=list)
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .cat-pagination {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}
.adc-author-page .cat-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.adc-author-page .cat-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 200ms ease;
}
.adc-author-page .cat-pagination a.page-numbers:hover {
    border-color: #6e9f44;
    color: #6e9f44;
}
.adc-author-page .cat-pagination .page-numbers.current {
    background: #6e9f44;
    border-color: #6e9f44;
    color: #fff;
    font-weight: 700;
}
.adc-author-page .cat-pagination .page-numbers.prev,
.adc-author-page .cat-pagination .page-numbers.next {
    border-radius: 20px;
    padding: 0 16px;
    gap: 4px;
}

/* ════════════════════════════════════════════════════════════════════════
   12. EMPTY STATE
   ════════════════════════════════════════════════════════════════════════ */
.adc-author-page .cat-empty {
    text-align: center;
    padding: 64px 20px;
    color: #888;
}
.adc-author-page .cat-empty h3 {
    font-size: 20px;
    font-weight: 600;
    color: #555;
    margin: 0;
}
