/* =================================================================
   NMEDIA ARCHIVE v1.1
   ================================================================= */

body.archive,
body.category,
body.tag,
body.author,
body.date,
body.home,
body.blog,
body.single {
    background: #1a0505 !important;
}

.nmedia-archive-wrap {
    min-height: 80vh;
    padding: 15px 0 50px;
    direction: rtl;
    background: linear-gradient(160deg, #1a0505 0%, #2a0808 60%, #1a0505 100%);
}

/* ---- کانتینر: همان عرض هدر ---- */
.nmedia-archive-wrap .nmedia-container {
    width: 60%;
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 1023px) {
    .nmedia-archive-wrap .nmedia-container { width: 80%; }
}
@media (max-width: 767px) {
    .nmedia-archive-wrap .nmedia-container { width: calc(100% - 20px); margin: 0 10px; }
    .nmedia-archive-wrap { padding: 10px 0 30px; }
}

/* ---- هدر دسته ---- */
.nmedia-archive-header {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 15px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.archive-title {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: bold;
    color: white;
    margin: 0;
}

.archive-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin: 6px 0 0;
    line-height: 1.6;
}

.archive-count {
    background: rgba(222,4,4,0.2);
    border: 1px solid rgba(222,4,4,0.35);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ================================================================
   گرید - 3 ستون در دسکتاپ، 2 در موبایل
   ================================================================ */
.nmedia-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (min-width: 900px) {
    .nmedia-posts-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {
    .nmedia-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ---- کارت ---- */
.nmedia-post-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.nmedia-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.5);
    border-color: rgba(222,4,4,0.35);
}

.card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: white;
    height: 100%;
}

/* ---- پوستر ---- */
.card-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.nmedia-post-card:hover .card-poster img { transform: scale(1.06); }

.card-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* badge */
.card-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 4px;
    color: white;
    z-index: 2;
    line-height: 1.6;
}
.card-badge.legal { background: #DE0404; }
.card-badge.free  { background: #2e7d32; }

/* اورلی هاور */
.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
}
.nmedia-post-card:hover .card-overlay { opacity: 1; }

.card-play-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-size: 13px;
    font-weight: bold;
    background: rgba(222,4,4,0.9);
    padding: 7px 14px;
    border-radius: 20px;
}

/* ---- اطلاعات زیر پوستر ---- */
.card-info {
    padding: 9px 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.card-title {
    font-size: 13px;
    font-weight: bold;
    color: white;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta { display: flex; flex-direction: column; gap: 2px; }
.card-year     { font-size: 11px; color: rgba(255,255,255,0.5); }
.card-director { font-size: 11px; color: rgba(255,255,255,0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================
   صفحه‌بندی
   ================================================================ */
.nmedia-pagination { display: flex; justify-content: center; }

.nmedia-pagination .nav-links {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: center;
}

.nmedia-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}
.nmedia-pagination .page-numbers:hover { background: rgba(255,255,255,0.16); }
.nmedia-pagination .page-numbers.current {
    background: #DE0404;
    border-color: #DE0404;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(222,4,4,0.4);
}
.nmedia-pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}

/* ================================================================
   بخش سئو - زیر گرید
   ================================================================ */
.nmedia-seo-content {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 15px;
    overflow: hidden;
}

.seo-content-inner {
    padding: 24px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    line-height: 1.9;
    text-align: justify;
}

.seo-content-inner h2 {
    font-size: 17px;
    font-weight: bold;
    color: white;
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(222,4,4,0.4);
}
.seo-content-inner h2:first-child { margin-top: 0; }

.seo-content-inner h3 {
    font-size: 15px;
    font-weight: bold;
    color: white;
    margin: 16px 0 8px;
}

.seo-content-inner p { margin: 0 0 12px; }
.seo-content-inner p:last-child { margin-bottom: 0; }

.seo-content-inner a { color: #ff9999; text-decoration: none; }
.seo-content-inner a:hover { text-decoration: underline; }

.seo-content-inner ul,
.seo-content-inner ol {
    padding-right: 20px;
    margin: 10px 0 14px;
}
.seo-content-inner li { margin-bottom: 6px; }

/* ---- هیچ پستی نیست ---- */
.nmedia-no-posts {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: rgba(255,255,255,0.6);
}