/* =========================================================
   Blog — Arabic (RTL)
   Font: IBM Plex Sans Arabic (loaded via ar/base.html)
   Icons: Phosphor Icons (loaded via extra_links in template)
   Gold: #dfac5d  |  Dark bg: #111213
   ========================================================= */

/* ---- Font override for blog pages ---- */
.blog-page {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background-color: #111213;
    color: #e6e6e6;
    min-height: 100vh;
}

/* ---- Hero banner ---- */
.blog-hero {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 0;
}

.blog-hero__img-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
}

.blog-hero__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-hero__img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(17,18,19,.8) 0%, rgba(17,18,19,.2) 50%, transparent 100%);
}

@media (min-width: 768px) {
    .blog-hero { padding-top: 40px; }
    .blog-hero__img-wrap { height: 340px; }
}

/* ---- Section header ---- */
.blog-section-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 20px 32px;
}

@media (min-width: 768px) {
    .blog-section-header { padding-top: 64px; }
}

.blog-section-header__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    border-bottom: 1px solid #dfac5d;
    padding-bottom: 20px;
}

.blog-section-header__title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}

/* ---- Category filter pills ---- */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-filter-pill {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    border-radius: 9999px;
    border: 1px solid #3f3f46;
    color: #9ca3af;
    text-decoration: none;
    transition: border-color .2s, color .2s;
}

.blog-filter-pill:hover,
.blog-filter-pill--active {
    border-color: #dfac5d;
    color: #dfac5d;
}

/* ---- Layout: grid + sidebar ---- */
.blog-body {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 80px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media (min-width: 1024px) {
    .blog-body {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* ---- Article grid ---- */
.blog-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 600px) {
    .blog-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Article card ---- */
.blog-card {
    display: flex;
    flex-direction: column;
    background: rgba(28,29,30,.6);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .4s;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    border-color: rgba(223,172,93,.4);
}

.blog-card__thumb {
    position: relative;
    height: 176px;
    overflow: hidden;
    background: #1c1d1e;
}

.blog-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s ease;
}

.blog-card:hover .blog-card__thumb img {
    transform: scale(1.05);
}

.blog-card__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    font-size: 2rem;
}

.blog-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.blog-card__cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #dfac5d;
    background: rgba(223,172,93,.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.blog-card__date {
    font-size: 11px;
    color: #6b7280;
}

.blog-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.45;
    transition: color .25s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card:hover .blog-card__title {
    color: #dfac5d;
}

.blog-card__excerpt {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.7;
    flex-grow: 1;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #dfac5d;
    margin-top: auto;
    transition: gap .3s;
}

.blog-card:hover .blog-card__read-more {
    gap: 10px;
}

/* ---- Empty state ---- */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: #6b7280;
}

.blog-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

/* ---- Sidebar ---- */
.blog-sidebar {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 1024px) {
    .blog-sidebar {
        width: 260px;
        position: sticky;
        top: 100px;
    }
}

.blog-sidebar__section {
    background: rgba(28,29,30,.8);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    overflow: hidden;
}

/* Author card */
.blog-author__banner {
    height: 80px;
    background: #111213;
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: relative;
}

.blog-author__avatar {
    position: absolute;
    left: 50%;
    bottom: -48px;
    transform: translateX(-50%);
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #1c1d1e;
    background: #1c1d1e;
}

.blog-author__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-author__info {
    padding: 60px 20px 20px;
    text-align: center;
}

.blog-author__name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.blog-author__role {
    font-size: 12px;
    color: #dfac5d;
    margin-bottom: 12px;
}

.blog-author__bio {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.65;
    margin-bottom: 16px;
}

.blog-author__socials {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.blog-author__social-link {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #27272a;
    background: #111213;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
    text-decoration: none;
    transition: color .2s, border-color .2s, background .2s;
}

.blog-author__social-link:hover {
    color: #111213;
    background: #dfac5d;
    border-color: #dfac5d;
}

/* Popular posts */
.blog-popular {
    padding: 20px;
}

.blog-popular__heading {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid #dfac5d;
}

.blog-popular__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-popular__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.blog-popular__thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #27272a;
    background: #111213;
}

.blog-popular__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.blog-popular__item:hover .blog-popular__thumb img {
    transform: scale(1.1);
}

.blog-popular__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

.blog-popular__text {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.blog-popular__title {
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
    line-height: 1.4;
    margin-bottom: 6px;
    transition: color .2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-popular__item:hover .blog-popular__title {
    color: #dfac5d;
}

.blog-popular__date {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================================
   Blog Detail page
   ========================================================= */

.blog-detail-hero {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 0;
}

@media (min-width: 768px) {
    .blog-detail-hero { padding-top: 40px; }
}

.blog-detail-hero__wrap {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 60vh;
    min-height: 420px;
    border: 1px solid rgba(255,255,255,.08);
}

.blog-detail-hero__wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .6;
}

.blog-detail-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #111213 0%, rgba(17,18,19,.4) 50%, transparent 100%);
}

.blog-detail-hero__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 0 16px 48px;
}

.blog-detail-hero__title {
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 24px;
    font-size: clamp(1.6rem, 4.5vw, 3rem);
    max-width: 900px;
}

.blog-detail-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    color: #d1d5db;
    font-size: 14px;
}

.blog-detail-hero__meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-detail-hero__meta-item i {
    color: #dfac5d;
    font-size: 1.1rem;
}

/* Article body */
.blog-article {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 20px 80px;
}

@media (min-width: 768px) {
    .blog-article { padding: 80px 20px; }
}

.blog-article__inner {
    max-width: 860px;
    margin: 0 auto;
}

.blog-article__content p {
    margin-bottom: 1.5rem;
    line-height: 1.9;
    color: #d1d5db;
    font-size: 1.08rem;
}

.blog-article__content h2 {
    color: #fff;
    font-weight: 700;
    font-size: 1.7rem;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
}

.blog-article__content h3 {
    color: #e5e7eb;
    font-weight: 600;
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-article__content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.blog-article__content blockquote {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    border-right: 4px solid #dfac5d;
    background: #1c1d1e;
    border-radius: 0 12px 12px 0;
    font-style: italic;
}

.blog-article__content blockquote p {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.blog-article__content ul,
.blog-article__content ol {
    padding-right: 1.5rem;
    margin-bottom: 1.5rem;
    color: #d1d5db;
    line-height: 1.9;
}

.blog-article__content a {
    color: #dfac5d;
    text-decoration: underline;
}

/* Related articles */
.blog-related {
    padding: 64px 20px 80px;
    background: rgba(28,29,30,.3);
}

@media (min-width: 768px) {
    .blog-related { padding: 80px 20px; }
}

.blog-related__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.blog-related__header {
    padding-bottom: 20px;
    margin-bottom: 48px;
    border-bottom: 1px solid #dfac5d;
}

.blog-related__heading {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}

@media (min-width: 768px) {
    .blog-related__heading { font-size: 2rem; }
}

.blog-related__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 768px) {
    .blog-related__grid { grid-template-columns: 1fr 1fr 1fr; }
}

.blog-related__card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #1c1d1e;
    border: 1px solid #27272a;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .3s;
}

.blog-related__card:hover {
    border-color: rgba(223,172,93,.3);
}

.blog-related__card-thumb {
    height: 192px;
    overflow: hidden;
    background: #111213;
}

.blog-related__card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.blog-related__card:hover .blog-related__card-thumb img {
    transform: scale(1.08);
}

.blog-related__card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    font-size: 2.5rem;
}

.blog-related__card-body {
    padding: 24px;
}

.blog-related__card-cat {
    font-size: 12px;
    font-weight: 700;
    color: #dfac5d;
    display: block;
    margin-bottom: 8px;
}

.blog-related__card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    transition: color .2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-related__card:hover .blog-related__card-title {
    color: #dfac5d;
}