/* ─── Blog Hub — صفحه اصلی وبلاگ ─── */
.blog-hub {
    padding: 96px 0 64px;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 160, 23, 0.08), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 20%, rgba(16, 95, 174, 0.12), transparent 50%),
        var(--bg-primary);
}

.blog-hub-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.blog-hub-kicker { font-size: 13px; padding: 6px 16px; margin-bottom: 12px; display: inline-block; }
.blog-hub-title { font-size: clamp(28px, 4vw, 42px); font-weight: 900; line-height: 1.45; margin: 0 0 10px; }
.blog-hub-sub { color: var(--text-secondary); max-width: 560px; line-height: 1.9; margin: 0; font-size: 15px; }

.blog-hub-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0 16px;
    min-width: min(100%, 320px);
    flex: 0 1 320px;
}
.blog-hub-search i { color: var(--gold); opacity: .85; }
.blog-hub-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 14px 0;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.blog-hub-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    padding-bottom: 4px;
}
.blog-hub-cat-pill {
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all .2s ease;
    white-space: nowrap;
}
.blog-hub-cat-pill:hover,
.blog-hub-cat-pill.is-active {
    background: rgba(212, 160, 23, 0.14);
    border-color: rgba(212, 160, 23, 0.45);
    color: var(--gold);
}

.blog-hub-filter-note {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}
.blog-hub-clear-filter {
    color: var(--gold);
    margin-right: 8px;
    text-decoration: none;
    font-size: 13px;
}

/* Hero */
.blog-hub-hero-wrap { margin-bottom: 36px; }
.blog-hub-hero {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    min-height: 340px;
}
@media (max-width: 900px) {
    .blog-hub-hero { grid-template-columns: 1fr; min-height: auto; }
    .blog-hub-hero-side { flex-direction: row; }
    .blog-hub-hero-side-item { flex: 1; min-height: 120px; }
}

.blog-hub-hero-main {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: #fff;
    border: 1px solid rgba(212, 160, 23, 0.25);
    min-height: 320px;
}
.blog-hub-hero-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 320px;
    transition: transform .4s ease;
}
.blog-hub-hero-main:hover img { transform: scale(1.03); }
.blog-hub-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.2) 55%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
}
.blog-hub-hero-overlay h2 {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 900;
    line-height: 1.55;
    margin: 10px 0 8px;
}
.blog-hub-hero-overlay p {
    font-size: 14px;
    opacity: .9;
    line-height: 1.8;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-hub-hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.blog-hub-hero-side-item {
    position: relative;
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    border: 1px solid var(--border-color);
    min-height: 0;
}
.blog-hub-hero-side-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 150px;
}
.blog-hub-hero-side-item span {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85), transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 16px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

/* Category icons row */
.blog-hub-icon-row-wrap { margin-bottom: 40px; overflow: hidden; }
.blog-hub-icon-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 8px 4px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.blog-hub-icon-row::-webkit-scrollbar { height: 6px; }
.blog-hub-icon-row::-webkit-scrollbar-thumb { background: rgba(212,160,23,.35); border-radius: 4px; }

.blog-hub-icon-item {
    flex: 0 0 auto;
    width: 110px;
    text-align: center;
    text-decoration: none;
    color: var(--text-secondary);
    scroll-snap-align: start;
    transition: transform .2s ease;
}
.blog-hub-icon-item:hover { transform: translateY(-4px); color: var(--gold); }
.blog-hub-icon-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(212, 160, 23, 0.35);
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.blog-hub-icon-item span { font-size: 13px; font-weight: 700; line-height: 1.5; display: block; }

/* Sections */
.blog-hub-section { margin-bottom: 48px; }
.blog-hub-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.blog-hub-section-title {
    font-size: 22px;
    font-weight: 900;
    margin: 0;
}
.blog-hub-section-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: -8px 0 16px;
    line-height: 1.8;
}
.blog-hub-more {
    color: var(--gold);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.blog-hub-more:hover { opacity: .85; }

/* Horizontal track */
.blog-hub-track-wrap {
    margin: 0 -16px;
    padding: 0 16px;
    overflow: hidden;
}
.blog-hub-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 8px 4px 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.blog-hub-track-item {
    flex: 0 0 min(300px, 85vw);
    scroll-snap-align: start;
}

/* Grid */
.blog-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.blog-hub-grid--3 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Cards */
.blog-hub-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.blog-hub-card:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 160, 23, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.blog-hub-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255,255,255,.04);
}
.blog-hub-card--sm .blog-hub-card-img { height: 140px; }
.blog-hub-card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.blog-hub-cat-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(16, 95, 174, 0.25);
    color: #7ec8ff;
    margin-bottom: 8px;
    align-self: flex-start;
}
.blog-hub-cat-badge.light {
    background: rgba(212, 160, 23, 0.25);
    color: #ffe082;
}
.blog-hub-card-title {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.65;
    margin: 0 0 8px;
}
.blog-hub-card-summary {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.85;
    margin: 0 0 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-hub-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}
.blog-hub-card-date {
    margin-right: auto;
    font-size: 12px;
    color: var(--text-muted);
}

/* Category archive header */
.blog-hub-cat-header { margin-bottom: 28px; }
.blog-hub-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
}
.blog-hub-back:hover { color: var(--gold); }
.blog-hub-cat-banner {
    border-radius: 20px;
    padding: 48px 32px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(212, 160, 23, 0.2);
}
.blog-hub-cat-banner h1 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 900;
    margin: 12px 0 8px;
    color: #fff;
}
.blog-hub-cat-banner p {
    color: rgba(255,255,255,.85);
    max-width: 640px;
    line-height: 1.9;
    margin: 0;
    font-size: 15px;
}

/* Tags footer */
.blog-hub-tags-wrap {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}
.blog-hub-tags-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 14px;
}
.blog-hub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 24px;
}

.blog-hub-latest {
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* Admin category panel */
.admin-cat-panel { margin-bottom: 24px; }
.admin-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.admin-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255,255,255,.02);
}
.admin-cat-item strong { font-size: 14px; }
.admin-cat-item small { color: var(--text-muted); display: block; font-size: 12px; margin-top: 2px; }

/* Single post */
.blog-post-page .blog-post-title {
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 900;
    line-height: 1.55;
    margin: 8px 0 12px;
    color: #fff;
}
.blog-post-page .blog-post-cover {
    width: 100%;
    height: auto;
    max-height: 480px;
    border-radius: 20px;
    margin: 0 0 28px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(212, 160, 23, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.blog-post-related {
    border-top: 1px solid var(--border-color);
    margin-top: 48px;
    padding-top: 32px;
}

/* محتوای رسپانسیو داخل مقاله */
.blog-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 14px;
    display: block;
    margin: 18px auto;
}
.blog-content .blog-source-attribution a {
    color: var(--gold);
    font-weight: 700;
}
.blog-content .blog-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 24px;
    border-radius: 14px;
}
.blog-content table {
    width: 100% !important;
    max-width: 100%;
    table-layout: auto;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.blog-content table td,
.blog-content table th {
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}
@media (max-width: 640px) {
    .blog-content { font-size: 15px; line-height: 1.95; }
    .blog-content table { font-size: 12px; min-width: 0 !important; }
    .blog-content table th,
    .blog-content table td { padding: 8px 6px; }
}
