/* =============================================
   CONTENT.CSS — تنسيقات المحتوى
   (Single Post, Archive, Sidebar, Comments)
   ============================================= */

/* ═══════════════════════════════════════════════
   10. SIDEBAR & WIDGETS
═══════════════════════════════════════════════ */
.sidebar-widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.widget-head {
    background: var(--ink);
    color: var(--white);
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--ff-title);
    display: flex;
    align-items: center;
    gap: 10px;
}
body.dark-mode .widget-head { background: #060d14; }
.widget-head::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}
.widget-list { padding: 0; }
.widget-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.widget-item:last-child { border-bottom: none; }
.widget-item:hover { background: var(--light); }
body.dark-mode .widget-item:hover { background: var(--ink-mid); }
.widget-item .wi-thumb {
    width: 72px;
    height: 58px;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
}
.widget-item .wi-title {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--ff-title);
    line-height: 1.5;
    color: var(--text);
}
.widget-item .wi-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.widget { margin-bottom: 28px; color: var(--text); }
.widget-title {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--ff-title);
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}
.widget ul li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.widget ul li a { color: var(--text); }
.widget ul li a:hover { color: var(--primary); }
.swt-tabs-widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}
.swt-tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--light);
}
.swt-tab-btn {
    flex: 1;
    padding: 12px 10px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.swt-tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -1px;
}
.swt-tabs-content { padding: 8px 0; }
.swt-tab-pane { display: none; }
.swt-tab-pane.active { display: block; }
.swt-tabs-list { list-style: none; margin: 0; padding: 0; }
.swt-tabs-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.swt-tabs-item:last-child { border-bottom: none; }
.swt-tabs-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
}
.swt-tabs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.swt-tabs-info { flex: 1; }
.swt-tabs-info h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px;
}
.swt-tabs-info h4 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}
.swt-tabs-info h4 a:hover { color: var(--primary); }
.swt-tabs-meta { font-size: 11px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════
   11. SINGLE POST
═══════════════════════════════════════════════ */
.single-layout {
    display: grid;
    gap: 36px;
    margin: 32px 0;
}
.single-layout:not([data-sidebar-pos]) {
    grid-template-columns: 1fr 340px;
}
.single-layout[data-sidebar-pos="left"] {
    grid-template-columns: 340px 1fr;
}
.single-layout[data-sidebar-pos="none"] {
    grid-template-columns: 1fr;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.single-layout[data-sidebar-pos="right"] {
    grid-template-columns: 1fr 340px;
}
@media (max-width: 820px) {
    .single-layout[data-sidebar-hide-mobile="true"] {
        grid-template-columns: 1fr;
    }
    .single-layout[data-sidebar-hide-mobile="true"] .single-sidebar {
        display: none;
    }
}
.post-header { margin-bottom: 30px; }
.post-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.post-cats a {
    background: var(--primary);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    transition: all var(--transition);
}
.post-cats a:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}
.post-header h1 {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 900;
    font-family: var(--ff-title);
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 20px;
}
.post-meta-full {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.meta-item .svg-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    fill: currentColor;
}
.meta-item a {
    color: inherit;
    transition: color var(--transition);
}
.meta-item a:hover { color: var(--primary); }
.post-featured-img {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
}
.post-featured-img.align-center { text-align: center; }
.post-featured-img.align-wide {
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0;
}
@media (min-width: 1300px) {
    .post-featured-img.align-wide {
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        border-radius: 0;
    }
}
.post-featured-img.align-left {
    float: left;
    margin-right: 24px;
    margin-bottom: 16px;
    max-width: 50%;
}
.post-featured-img.align-right {
    float: right;
    margin-left: 24px;
    margin-bottom: 16px;
    max-width: 50%;
}
.post-featured-img img {
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: cover;
}
.post-featured-img figcaption {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
    background: var(--light);
    margin-top: -4px;
}
.post-content {
    font-size: var(--single-font-size, 16.5px);
    line-height: var(--single-line-height, 1.9);
    color: var(--text);
    max-width: var(--single-content-width, 760px);
    margin-left: auto;
    margin-right: auto;
    font-family: var(--single-body-font, var(--ff-body));
}
.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: var(--ff-title);
    margin: 1.8em 0 0.8em;
    color: var(--text);
    font-weight: 800;
}
.post-content p { margin-bottom: 1.5em; }
.post-content blockquote {
    border-right: 4px solid var(--primary);
    background: var(--light);
    padding: 1.2em 1.8em;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 2em 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.05em;
}
.post-content img {
    border-radius: var(--radius);
    margin: 1.5em 0;
    max-width: 100%;
    height: auto;
}
.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.share-btns {
    display: flex;
    gap: 12px;
    margin: 32px 0 16px;
    align-items: center;
    flex-wrap: wrap;
}
.share-btns span {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s;
    color: #fff;
    border: none;
    cursor: pointer;
}
.share-btn:hover { transform: scale(1.1); }
.share-btn.tw { background: #1da1f2; }
.share-btn.fb { background: #1877f2; }
.share-btn.wa { background: #25d366; }
.share-btn.tg { background: #0088cc; }
.share-btn.mail { background: #6c757d; }
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0 24px;
}
.post-tags a {
    background: var(--light);
    color: var(--text-muted);
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px solid var(--border);
    transition: all var(--transition);
    text-decoration: none;
}
.post-tags a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.author-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: 40px 0 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.author-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--primary);
}
.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.author-info { flex: 1; }
.author-name {
    font-size: 1.3rem;
    font-weight: 800;
    font-family: var(--ff-title);
    color: var(--text);
    margin-bottom: 8px;
}
.author-bio {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.author-socials {
    display: flex;
    gap: 12px;
}
.author-socials a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
}
.author-socials a:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}
.related-posts {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.related-posts .sec-head { margin-top: 0; }
.related-grid {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}
.related-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.related-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.related-grid[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }
.related-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}
.related-card .thumb { overflow: hidden; }
.related-card .thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.related-card:hover .thumb img { transform: scale(1.05); }
.related-card .body { padding: 16px; }
.related-card h4 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
}
.related-card h4 a {
    color: var(--text);
    text-decoration: none;
}
.related-card h4 a:hover { color: var(--primary); }
.related-card .date {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.comments-area {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   12. ARCHIVE & PAGINATION
═══════════════════════════════════════════════ */
.archive-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--blue-dark) 100%);
    padding: 44px 0;
    margin-bottom: 36px;
    border-radius: 0 0 18px 18px;
}
.archive-header h1 {
    font-size: 30px;
    font-weight: 900;
    font-family: var(--ff-title);
    color: var(--white);
    margin-bottom: 10px;
}
.archive-header .arc-meta { font-size: 14px; color: rgba(255, 255, 255, .7); }
.archive-grid { display: grid; grid-template-columns: 1fr 340px; gap: 32px; }
.posts-list { display: flex; flex-direction: column; gap: 22px; }
.list-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    transition: transform var(--transition), box-shadow var(--transition);
}
.list-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.list-card .thumb { width: 220px; flex-shrink: 0; overflow: hidden; }
.list-card .thumb img { height: 100%; min-height: 160px; transition: transform .4s; }
.list-card:hover .thumb img { transform: scale(1.06); }
.list-card .body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.list-card h3 {
    font-size: 17px;
    font-weight: 700;
    font-family: var(--ff-title);
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 10px;
    flex: 1;
}
.list-card:hover h3 { color: var(--primary); }
.list-card .excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pagination a,
.pagination span {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    color: var(--text);
    transition: all var(--transition);
}
.pagination a:hover,
.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ========== RESPONSIVE للمحتوى ========== */
@media (max-width: 820px) {
    .single-layout {
        grid-template-columns: 1fr !important;
    }
    .single-sidebar {
        margin-top: 40px;
    }
    .post-header h1 {
        font-size: 28px;
    }
    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .author-socials {
        justify-content: center;
    }
    .related-grid[data-columns="3"],
    .related-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
    .post-featured-img.align-left,
    .post-featured-img.align-right {
        float: none;
        max-width: 100%;
        margin: 0 0 20px 0;
    }
    .archive-grid { grid-template-columns: 1fr; }
    .list-card { flex-direction: column; }
    .list-card .thumb { width: 100%; }
    .list-card .thumb img { height: 200px; }
}
@media (max-width: 560px) {
    .post-meta-full {
        gap: 12px;
        font-size: 12px;
    }
    .related-grid[data-columns="2"],
    .related-grid[data-columns="3"],
    .related-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }
    .share-btns {
        justify-content: center;
    }
    .post-content {
        font-size: 16px;
        line-height: 1.75;
    }
    .author-avatar {
        width: 80px;
        height: 80px;
    }
}