/* =============================================
   ARTICLES PAGE — Warm Paper / Bazaar Light (v3)
   RTL | Vazirmatn / Peyda
   (reskinned from the dark navy/neon v2)
   ============================================= */

:root {
    /* Warm cream base */
    --bg: #FBF3E6;
    --bg-2: #F6E9D2;

    /* Repurposed "blue" scale → warm terracotta/saffron scale
       (kept the same variable names so nothing else in this file needs renaming) */
    --blue-900: #4A2412;
    --blue-700: #7A3B1E;
    --blue-600: #B0501F;
    --blue-500: #C1562D;
    --blue-400: #D97A3D;
    --blue-300: #C1562D;
    --blue-200: #F0C88A;
    --blue-100: #FBEBD2;

    /* Warm "glow" accent, replacing the icy neon */
    --neon: #E8951E;
    --neon-dim: rgba(232, 149, 30, 0.15);

    --white: #ffffff;
    --glass-card: rgba(255, 251, 244, 0.6);
    --glass-card2: rgba(255, 251, 244, 0.85);
    --glass-border: rgba(120, 72, 32, 0.14);
    --glass-border2: rgba(193, 86, 45, 0.32);

    --text-white: #2B1B10;
    --text-mid: #6B5847;
    --text-light: #9C8770;

    --danger: #C13B2E;
    --star: #E8A33D;

    /* Warm-tinted shadows instead of navy */
    --shadow-card: 0 4px 24px rgba(120, 72, 32, 0.12);
    --shadow-lg: 0 16px 48px rgba(120, 72, 32, 0.18);

    --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;
    --header-h: 70px;

    /* Reusable paper-grain texture */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.45  0 0 0 0 0.32  0 0 0 0 0.18  0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

/* ── AMBIENT BG — soft warm glows instead of navy vignette ── */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(
            ellipse 65% 55% at 8% 5%,
            rgba(227, 162, 61, 0.16) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse 55% 60% at 94% 88%,
            rgba(193, 86, 45, 0.12) 0%,
            transparent 55%
        );
    pointer-events: none;
}

/* ── PAPER GRAIN — replaces the technical grid-lines for a softer, handmade feel ── */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: var(--grain);
    mix-blend-mode: soft-light;
    opacity: 0.6;
    pointer-events: none;
}

/* ─────────────────────────────────────────────
   FIXED HEADER — همان الگوی صفحه‌ی «درباره ما»
───────────────────────────────────────────── */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 0;
    background: rgba(251, 243, 230, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 2px 20px rgba(120, 72, 32, 0.10);
}

.fixed-header .container-fluid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: var(--glass-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-mid);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--glass-card2);
    border-color: var(--glass-border2);
    color: var(--blue-500);
    transform: translateY(-2px);
}

.btn-icon:focus-visible,
.filter-select:focus-visible,
.page-link:focus-visible,
.more-link:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 2px;
}

.site-name {
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-400) 50%, var(--neon) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─────────────────────────────────────────────
   HERO — one warm, moody photo panel; rest of the page stays light
───────────────────────────────────────────── */
.hero-paper {
    position: relative;
    padding: calc(var(--header-h) + 56px) 20px 60px;
    text-align: center;
    overflow: hidden;
    background:
        linear-gradient(rgba(58, 32, 18, 0.62), rgba(45, 24, 13, 0.8)),
        url("/static/custom/images/wallpaper/3.png") center/cover no-repeat;
    border-bottom: 1px solid var(--glass-border);
}

/* hero ambient orb — warm amber glow */
.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(232, 149, 30, 0.28) 0%,
        transparent 70%
    );
    filter: blur(40px);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 16px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 220, 168, 0.35);
    color: #FFDCA8;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 18px;
    display: block;
}

.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%,
        #FFDCA8 45%,
        var(--neon) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    filter: drop-shadow(0 0 22px rgba(232, 149, 30, 0.28));
}

.sub-title {
    font-size: 15px;
    color: #F0DCC2;
    opacity: 0.9;
    margin-bottom: 0;
}

/* ─────────────────────────────────────────────
   FILTER BAR
───────────────────────────────────────────── */
.filter-strip {
    background: rgba(251, 243, 230, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    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.6);
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-white);
    cursor: pointer;
    transition: var(--transition);
    direction: rtl;
}
.filter-select option {
    background: #FBF3E6;
    color: var(--text-white);
}
.filter-select:hover {
    border-color: var(--glass-border2);
}
.filter-select:focus {
    outline: none;
    border-color: var(--blue-500);
}

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

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

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

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

/* ─────────────────────────────────────────────
   ARTICLE CARD — paper card with a soft grain
───────────────────────────────────────────── */
.article-item {
    background-color: var(--glass-card);
    background-image: var(--grain);
    background-blend-mode: soft-light;
    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;
    position: relative;
}

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

/* top accent line, warms up on hover */
.article-item::before {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--blue-400), transparent);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.article-item:hover {
    transform: translateY(-6px);
    border-color: var(--glass-border2);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px rgba(193, 86, 45, 0.12);
}

.article-item:hover::before {
    opacity: 0.9;
}

/* soft warm edge on hover, replacing the neon inset ring */
.article-item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 0 1px rgba(232, 149, 30, 0);
    transition: box-shadow 0.3s ease;
    pointer-events: none;
}
.article-item:hover::after {
    box-shadow: inset 0 0 0 1px rgba(232, 149, 30, 0.2);
}

/* ── THUMBNAIL ── */
.post-thumb {
    position: relative;
    overflow: hidden;
    padding-top: 56%; /* 16:9 */
    background: var(--bg-2);
    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(45, 24, 13, 0.55) 0%,
        transparent 50%
    );
    pointer-events: none;
}

/* category badge on image — stays a solid warm chip, reads fine over any photo */
.post-cat-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 11px;
    background: rgba(193, 86, 45, 0.85);
    border: 1px solid rgba(255, 220, 168, 0.4);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: var(--blue-100);
    backdrop-filter: blur(6px);
}

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

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

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

.post-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.45;
    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.8;
    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;
    color: var(--blue-500);
}

/* 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-500);
    text-decoration: none;
    padding: 6px 14px;
    border: 1.5px solid rgba(193, 86, 45, 0.3);
    border-radius: 8px;
    background: rgba(193, 86, 45, 0.10);
    transition: var(--transition);
}
.more-link:hover {
    background: rgba(193, 86, 45, 0.2);
    border-color: var(--blue-500);
    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(120, 72, 32, 0.06) 25%,
        rgba(120, 72, 32, 0.14) 50%,
        rgba(120, 72, 32, 0.06) 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-400);
    color: var(--text-white);
    background: var(--glass-card2);
}

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

.page-item.disabled .page-link {
    opacity: 0.35;
    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) {
    .fixed-header .container-fluid {
        padding: 0 14px;
    }
    .hero-paper {
        padding: calc(var(--header-h) + 36px) 16px 44px;
    }
    .newspaper-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 0 14px;
    }
    .newspaper-title {
        font-size: 2.2rem;
    }
    .filter-strip-inner {
        gap: 8px;
    }
    .results-info {
        margin-right: 0;
        width: 100%;
    }
}

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

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