/* =============================================
   ARTICLES PAGE — Dark Glassmorphism
   RTL | Vazirmatn / Peyda
   ============================================= */

:root {
    --bg: #0a0f2e;
    --bg-2: #0d1540;
    --blue-900: #060e2e;
    --blue-700: #112060;
    --blue-600: #1a3299;
    --blue-500: #2248cc;
    --blue-400: #3d6bff;
    --blue-300: #6b8fff;
    --blue-200: #a8c0ff;
    --blue-100: #dce8ff;
    --neon: #38eaff;
    --neon-dim: rgba(56, 234, 255, 0.15);
    --white: #ffffff;
    --glass-card: rgba(255, 255, 255, 0.07);
    --glass-card2: rgba(255, 255, 255, 0.11);
    --glass-border: rgba(150, 180, 255, 0.15);
    --glass-border2: rgba(150, 180, 255, 0.26);
    --text-white: #eef2ff;
    --text-mid: #a8bce8;
    --text-light: #5c72a8;
    --danger: #f05252;
    --star: #fbbf24;
    --shadow-card: 0 4px 28px rgba(0, 8, 50, 0.45);
    --shadow-lg: 0 16px 56px rgba(0, 8, 50, 0.6);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --transition: all 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    --font: Peyda-Bold, "Vazirmatn", sans-serif;
    --navbar-h: 60px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    direction: rtl;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

/* ── AMBIENT BG ── */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(
            ellipse 65% 55% at 8% 5%,
            rgba(34, 72, 204, 0.38) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse 55% 60% at 94% 88%,
            rgba(17, 32, 96, 0.55) 0%,
            transparent 55%
        ),
        radial-gradient(
            ellipse 80% 45% at 50% 50%,
            rgba(10, 15, 46, 0.95) 0%,
            transparent 100%
        );
    pointer-events: none;
}

/* ── GRID LINES ── */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(34, 72, 204, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 72, 204, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
}

/* ─────────────────────────────────────────────
   TOP NAV — بازگشت
───────────────────────────────────────────── */
.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 600;
    height: var(--navbar-h);
    background: rgba(8, 13, 42, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 2px 20px rgba(0, 5, 40, 0.45);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass-card);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mid);
    text-decoration: none;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}
.back-link:hover {
    background: var(--glass-card2);
    border-color: var(--blue-300);
    color: var(--text-white);
    transform: translateX(3px);
}
.back-link .arrow {
    font-size: 15px;
    transition: transform 0.2s;
}
.back-link:hover .arrow {
    transform: translateX(4px);
}

/* breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
}
.breadcrumb a {
    color: var(--blue-300);
    text-decoration: none;
    transition: var(--transition);
}
.breadcrumb a:hover {
    color: var(--neon);
}
.breadcrumb-sep {
    opacity: 0.4;
}

/* nav right slot (search or extra) */
.nav-search-wrap {
    position: relative;
    display: none; /* desktop shows, mobile hides */
}

.nav-search {
    padding: 8px 36px 8px 14px;
    border: 1.5px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-white);
    width: 220px;
    transition: var(--transition);
    direction: rtl;
}
.nav-search::placeholder {
    color: var(--text-light);
}
.nav-search:focus {
    outline: none;
    border-color: var(--blue-300);
    width: 260px;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(107, 143, 255, 0.18);
}
.nav-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
    pointer-events: none;
}

/* ─────────────────────────────────────────────
   HERO
───────────────────────────────────────────── */
.hero-paper {
    position: relative;
    padding: calc(var(--navbar-h) + 64px) 20px 64px;
    text-align: center;
    overflow: hidden;
    background:
        linear-gradient(rgba(6, 14, 46, 0.72), rgba(10, 15, 46, 0.88)),
        url("/static/custom/images/wallpaper/3.png") center/cover no-repeat;
    border-bottom: 1px solid var(--glass-border);
}

/* hero ambient orbs */
.hero-paper::before {
    content: "";
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(
        ellipse,
        rgba(34, 72, 204, 0.25) 0%,
        transparent 70%
    );
    filter: blur(40px);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.newspaper-title {
    font-family: var(--font);
    font-size: clamp(2.2rem, 7vw, 4rem);
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 12px;
    display: inline-block;

    background: linear-gradient(
        135deg,
        #fff 0%,
        var(--blue-200) 40%,
        var(--neon) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    filter: drop-shadow(0 0 28px rgba(56, 234, 255, 0.3));
}

.sub-title {
    font-size: 15px;
    color: var(--blue-200);
    opacity: 0.85;
    margin-bottom: 28px;
}

/* hero search */
.search-box {
    display: flex;
    justify-content: center;
}

.search-box form {
    display: inline-flex;
    overflow: hidden;
    border: 1.5px solid var(--glass-border2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 5, 40, 0.3);
    transition: var(--transition);
}
.search-box form:focus-within {
    border-color: var(--blue-300);
    box-shadow:
        0 0 0 3px rgba(107, 143, 255, 0.2),
        0 4px 24px rgba(0, 5, 40, 0.3);
}

.search-box input {
    border: none;
    outline: none;
    padding: 12px 18px;
    width: clamp(220px, 40vw, 320px);
    background: transparent;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-white);
    direction: rtl;
}
.search-box input::placeholder {
    color: var(--text-light);
}

.search-box button {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
    color: #fff;
    border: none;
    padding: 12px 22px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.search-box button:hover {
    filter: brightness(1.15);
}

/* hero stats row */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    font-size: 12px;
    color: var(--text-mid);
    backdrop-filter: blur(6px);
}
.hero-stat strong {
    color: var(--blue-300);
    font-weight: 800;
}

/* ─────────────────────────────────────────────
   FILTER BAR
───────────────────────────────────────────── */
.filter-strip {
    background: rgba(8, 13, 42, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 20px;
    position: sticky;
    top: var(--navbar-h);
    z-index: 400;
}

.filter-strip-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
}

.filter-select {
    padding: 7px 12px;
    border: 1.5px solid var(--glass-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-white);
    cursor: pointer;
    transition: var(--transition);
    direction: rtl;
}
.filter-select option {
    background: #0d1540;
}
.filter-select:focus {
    outline: none;
    border-color: var(--blue-300);
}

.results-info {
    margin-right: auto;
    font-size: 12px;
    color: var(--text-light);
}
.results-info strong {
    color: var(--blue-300);
}

/* ─────────────────────────────────────────────
   MAIN CONTAINER
───────────────────────────────────────────── */
.main-container {
    min-height: 100vh;
}

/* ─────────────────────────────────────────────
   ARTICLES GRID
───────────────────────────────────────────── */
.newspaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 36px auto;
    padding: 0 20px;
    position: relative;
}

/* empty state */
.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}
.empty-state-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-mid);
}

/* ─────────────────────────────────────────────
   ARTICLE CARD
───────────────────────────────────────────── */
.article-item {
    background: var(--glass-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    animation: cardIn 0.4s ease both;
    display: flex;
    flex-direction: column;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* top highlight line */
.article-item::before {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
}

.article-item:hover {
    transform: translateY(-6px);
    border-color: var(--glass-border2);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px rgba(107, 143, 255, 0.15);
}

/* neon edge on hover */
.article-item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 0 1px rgba(56, 234, 255, 0);
    transition: box-shadow 0.3s ease;
    pointer-events: none;
}
.article-item:hover::after {
    box-shadow: inset 0 0 0 1px rgba(56, 234, 255, 0.15);
}

/* ── THUMBNAIL ── */
.post-thumb {
    position: relative;
    overflow: hidden;
    padding-top: 56%; /* 16:9 */
    background: rgba(17, 32, 96, 0.5);
    flex-shrink: 0;
}

.post-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.article-item:hover .post-thumb img {
    transform: scale(1.06);
}

.post-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(6, 14, 46, 0.7) 0%,
        transparent 50%
    );
    pointer-events: none;
}

/* category badge on image */
.post-cat-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 11px;
    background: rgba(34, 72, 204, 0.75);
    border: 1px solid rgba(107, 143, 255, 0.35);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: var(--blue-100);
    backdrop-filter: blur(6px);
}

/* ── BODY ── */
.post-body {
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    margin-bottom: 8px;
    color: var(--text-light);
}

.post-cat {
    font-weight: 700;
    color: var(--blue-300);
}
.post-author {
    opacity: 0.8;
}

.post-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-excerpt {
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* stats */
.post-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-light);
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
}

.post-stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.post-stats i {
    font-size: 13px;
}

/* footer */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
    font-size: 12px;
}

.post-date {
    color: var(--text-light);
}

.more-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 12px;
    color: var(--blue-300);
    text-decoration: none;
    padding: 6px 14px;
    border: 1.5px solid rgba(107, 143, 255, 0.3);
    border-radius: 8px;
    background: rgba(34, 72, 204, 0.12);
    transition: var(--transition);
}
.more-link:hover {
    background: rgba(34, 72, 204, 0.25);
    border-color: var(--blue-300);
    color: var(--text-white);
    transform: translateX(-2px);
}

/* ─────────────────────────────────────────────
   SKELETON LOADER
───────────────────────────────────────────── */
.skeleton-card {
    background: var(--glass-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.skeleton-img {
    width: 100%;
    padding-top: 56%;
    background: var(--glass-card2);
    position: relative;
}
.skeleton-body {
    padding: 18px 20px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.skeleton-line.title {
    height: 16px;
    width: 85%;
}
.skeleton-line.short {
    width: 55%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ─────────────────────────────────────────────
   PAGINATION
───────────────────────────────────────────── */
.classic-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 20px 56px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: var(--glass-card);
    border: 1.5px solid var(--glass-border);
    border-radius: 10px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}
.page-link:hover {
    border-color: var(--blue-300);
    color: var(--text-white);
    background: var(--glass-card2);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
    border-color: transparent;
    color: #fff;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(34, 72, 204, 0.5);
}

.page-item.disabled .page-link {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

#paginationInfo {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 10px;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-inner {
        padding: 0 14px;
    }
    .breadcrumb {
        display: none;
    }
    .nav-search-wrap {
        display: none !important;
    }
    .newspaper-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 0 14px;
    }
    .newspaper-title {
        font-size: 2.2rem;
    }
    .filter-strip-inner {
        gap: 8px;
    }
    .hero-stats {
        gap: 12px;
    }
}

@media (min-width: 769px) {
    .nav-search-wrap {
        display: block;
    }
    .newspaper-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .newspaper-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
