/* =========================================================
   articles.css — صفحه مقالات (رویایی رسا) — نسخه اصلاح‌شده و بهینه
   ========================================================= */

   body{
    background:var(--c-mist) !important;
    color:var(--c-ink);
  }
  #bg-canvas{ display:none; }
  
  .articles-page{
    position:relative; z-index:5;
    max-width:1160px;
    margin:0 auto;
    padding:6.5rem 6vw 4rem;
  }
  @media (min-width:900px){ .articles-page{ padding-top:7.5rem; } }
  
  /* -----------------------------------------------------------
     ۱) اصلاح کامل فوتر به رنگ مشکی خالص و سفید شدن متن برند
  ----------------------------------------------------------- */
  .site-footer {
    position: relative;
    background: #000000 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10;
  }
  .site-footer::before,
  .site-footer::after {
    display: none !important;
  }
  .footer-brand h3 {
    color: #ffffff !important;
  }
  .footer-brand p {
    color: rgba(255, 255, 255, 0.85) !important;
  }
  
  /* -----------------------------------------------------------
     توکن‌های محلی این صفحه
  ----------------------------------------------------------- */
  .articles-page{
    --cat-a:#0c8d8d;   /* رسا — محتوای داخلی */
    --cat-b:#e2394a;   /* رساباز — بازی‌های ویدیویی */
    --cat-c:#7c4dff;   /* رساینس — علم */
    --cat-d:#f2994a;   
    --r-xl:28px;
    --r-lg:22px;
    --r-md:16px;
  }
  
  /* ---------------------------------------------------------
     هیرو — حذف فیلتر سبز و نمایش رنگ واقعی عکس
  --------------------------------------------------------- */
  .blog-hero{ margin-bottom:2.2rem; }
  .blog-hero-frame{
    position:relative;
    border-radius:var(--r-xl);
    overflow:hidden;
    height:clamp(260px, 34vw, 440px);
    background: #111; 
    box-shadow:0 28px 60px -26px rgba(0,0,0,.15);
  }
  .blog-hero-img{
    position:absolute; inset:0; width:100%; height:100%;
    object-fit:cover; 
    opacity: 0.9; 
    filter: none; 
  }
  .blog-hero-frame::after{
    content:""; position:absolute; inset:0;
    background:linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 60%);
  }
  .blog-hero-title{
    position:absolute; z-index:2; bottom:1.8rem; right:2.2rem;
    margin:0; text-align:right; color:#fff;
    font-family:var(--font-display); font-weight:900;
    font-size:clamp(2.1rem, 4.2vw, 3.4rem); line-height:1.18;
  }
  .blog-hero-title span{
    background:linear-gradient(95deg, var(--c-cyan) 0%, var(--c-cyan-2) 100%);
    -webkit-background-clip:text; background-clip:text; color:transparent;
  }
  
  /* ---------------------------------------------------------
     جستجو
  --------------------------------------------------------- */
  .search-header{
    position:fixed; top:0; inset-inline:0; z-index:60;
    display:flex; justify-content:center;
    padding:1.1rem 6vw;
    transition:transform .38s var(--ease-signature), opacity .3s ease;
  }
  .search-header.is-hidden{ transform:translateY(-115%); }
  
  .search-header-inner{
    display:flex; align-items:center; gap:.7rem;
    width:100%; max-width:480px;
    background:rgba(255,255,255,.62); border:1.5px solid rgba(26,26,26,.16);
    border-radius:999px; padding:.85rem 1.4rem;
    box-shadow:0 14px 34px -16px rgba(26,26,26,.28);
    backdrop-filter:blur(14px) saturate(140%);
    -webkit-backdrop-filter:blur(14px) saturate(140%);
    transition:border-color .25s ease, box-shadow .25s ease, background .25s ease;
  }
  .search-header-inner:focus-within{
    background:rgba(255,255,255,.82);
    border-color:#1a1a1a; box-shadow:0 14px 34px -14px rgba(26,26,26,.4), 0 0 0 4px rgba(26,26,26,.12);
  }
  .search-header-inner svg{ width:19px; height:19px; color:#1a1a1a; flex-shrink:0; opacity:.8; }
  .search-header-inner input{
    flex:1; background:transparent; border:0; outline:none; color:var(--c-ink);
    font-family:inherit; font-size:.94rem;
  }
  .search-header-inner input::placeholder{ color:rgba(26,26,26,.4); }
  
  /* ---------------------------------------------------------
     دسته‌بندی‌ها و متون بخش‌ها
  --------------------------------------------------------- */
  .cat-section{ margin-bottom:2.8rem; width:100%; text-align: right; }
  .cat-head{ display:flex; justify-content:flex-end; margin-bottom:1.2rem; }
  
  .cat-head h2,
  .stack-head h2,
  .blog-list-head h2 {
    font-family:var(--font-display);
    font-size: 1.85rem;
    font-weight: 850;
    margin: 0;
    color: #000;
    text-align: right;
    width: 100%;
  }
  
  .cat-scroller{
    display:flex; 
    gap:1rem; 
    overflow-x:auto; 
    padding:1.2rem 1.1rem 1.4rem;
    scroll-snap-type:x proximity;
    direction: rtl;
    justify-content: flex-start; 
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .cat-scroller::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  
  .cat-card{
    flex:0 0 auto; display:flex; align-items:center; gap:.9rem;
    min-width:228px; background:#fff; border:1.5px solid rgba(12,141,141,.14);
    border-radius:var(--r-lg); padding:.85rem 1.25rem; cursor:pointer;
    scroll-snap-align:center; position:relative;
  }
  .cat-card:hover{ border-color:rgba(12,141,141,.4); }
  .cat-card.is-selected{
    transform:scale(1.08); z-index:2; border-color:transparent;
  }
  .cat-card.is-selected::before{
    content:""; position:absolute; inset:-2px; border-radius:calc(var(--r-lg) + 2px); padding:2px;
    background:conic-gradient(from var(--aurora-angle,0deg), var(--cat-color, var(--c-teal)), var(--c-cyan), var(--c-teal), var(--cat-color, var(--c-teal)));
    -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite:xor; mask-composite:exclude;
    animation:auroraSpin 7s linear infinite; pointer-events:none;
  }
  .cat-card-icon{
    order:1; flex-shrink:0; width:44px; height:44px; border-radius:13px;
    display:flex; align-items:center; justify-content:center;
    background:var(--cat-color, var(--c-teal)); color:#fff;
    box-shadow:0 8px 16px -8px rgba(0,0,0,.35);
  }
  .cat-card-icon svg{ width:22px; height:22px; }
  
  .cat-card-text{
    order:2; display:flex; flex-direction:column; gap:.15rem; min-width:0;
    text-align: right; width: 100%;
  }
  .cat-card-text strong{ font-size:.92rem; color:var(--c-ink); font-weight:800; white-space:nowrap; }
  .cat-card-text small{ font-size:.74rem; color:var(--c-deep); opacity:.68; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  
  .cat-skel{ flex:0 0 auto; width:228px; height:74px; border-radius:var(--r-lg); background:linear-gradient(100deg, rgba(12,141,141,.06) 30%, rgba(12,141,141,.13) 50%, rgba(12,141,141,.06) 70%); background-size:200% 100%; animation:shimmer 1.6s ease-in-out infinite; }
  .cat-error{ font-size:.85rem; color:var(--c-deep); opacity:.7; padding:.6rem .2rem; }
  
  @keyframes auroraSpin{ to{ --aurora-angle:360deg; } }
  @property --aurora-angle{ syntax:'<angle>'; inherits:false; initial-value:0deg; }
  
  /* ---------------------------------------------------------
     کارت مقاله مشترک (rasa-card)
  --------------------------------------------------------- */
  .rasa-card{
    display:flex; 
    flex-direction: row-reverse;
    background:#fff; border-radius:var(--r-xl);
    border:1px solid rgba(12,141,141,.12);
    box-shadow:0 20px 46px -22px rgba(18,84,84,.28);
    overflow:hidden; text-decoration:none; color:inherit;
    height:100%;
    transition:box-shadow .3s ease, transform .3s ease;
  }
  a.rasa-card:hover{ box-shadow:0 26px 56px -22px rgba(12,141,141,.35); }
  
  .rasa-card-media{
    position:relative; 
    flex:0 0 35%;
    background:var(--c-mist); overflow:hidden;
  }
  .rasa-card-media img{ width:100%; height:100%; object-fit:cover; display:block; }
  
  /* ---------------------------------------------------------
     طراحی نوین کپسول نویسنده (تراز قطعی عکس در سمت راست)
  --------------------------------------------------------- */
  .rasa-card-author {
    position: absolute;
    z-index: 2;
    bottom: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
    width: 88%;
    height: 42px; 
    
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-end;
    
    background: rgba(40, 40, 40, 0.65); 
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    
    border-radius: 12px; 
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
  
  .rasa-card-author img {
    order: 2 !important; /* تضمین چینش عکس در بیرونی‌ترین سمت راست کپسول */
    width: 42px; 
    height: 42px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 0 11px 11px 0; 
  }
  
  .rasa-card-author span {
    order: 1 !important; /* قرارگیری متن نویسنده در سمت چپ عکس */
    flex: 1;
    text-align: right;
    color: #ffffff;
    font-weight: 500;
    padding-right: 0.75rem;
    padding-left: 0.5rem;
    line-height: 42px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.68rem, 2.2vw, 0.8rem); 
  }
  
  .rasa-card-body{
    flex:1; min-width:0;
    padding:1.6rem 1.8rem; display:flex; flex-direction:column; gap:.7rem;
  }
  
  .rasa-card-cat{
    display:flex; align-items:center; gap:.8rem; justify-content: flex-start;
  }
  .rasa-card-cat-icon{
    flex-shrink:0; width:52px; height:52px; border-radius:18px;
    display:flex; align-items:center; justify-content:center;
    background:var(--cat-color, var(--c-teal)); color:#fff;
    box-shadow: 0 8px 16px -6px var(--cat-color);
  }
  .rasa-card-cat-icon svg{ width:26px; height:26px; }
  .rasa-card-cat-text{
    display:flex; flex-direction:column; gap:.1rem; text-align: right;
  }
  .rasa-card-cat-text strong{ font-size:1.15rem; font-weight:800; color:var(--c-ink); }
  .rasa-card-cat-text small{ font-size:.78rem; color:var(--c-deep); opacity:.65; }
  
  .rasa-card-title{
    font-family:var(--font-display); font-weight:800; margin:0; color:var(--c-ink);
    font-size:1.32rem; line-height:1.6; text-align:right; margin-top: 0.3rem;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  }
  a.rasa-card:hover .rasa-card-title{ color:var(--c-teal); }
  
  .rasa-card-excerpt{
    margin:0; color:var(--c-deep); opacity:.75; font-size:.9rem; line-height:1.85; text-align:right;
    display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
  }
  
  /* ---------------------------------------------------------
     جدیدترین‌ها — چیدمان پشته‌ای صعودی زنده و هماهنگ دسکتاپ و موبایل
  --------------------------------------------------------- */
  .stack-section{ margin-bottom:4.5rem; }
  .stack-head{ 
    text-align:right; 
    margin-bottom: 4.5rem !important; /* فاصله زیاد ایمن دسکتاپ برای باز کردن جا لایه‌های بالارونده */
  }
  .stack-head p{ margin:0; color:var(--c-deep); opacity:.65; font-size:.88rem; }
  
  .stack-wrap{
    position:relative;
    height: 265px !important;
    max-width:760px;
    margin:0 auto;
  }
  .stack-card2{
    position:absolute; inset:0;
    display:block; will-change:transform, opacity;
    transition:transform .65s cubic-bezier(.22,.85,.32,1), opacity .5s ease;
  }
  .stack-card2 .rasa-card-excerpt{ -webkit-line-clamp:2; }
  .stack-skel{ height:100%; border-radius:var(--r-xl); background:linear-gradient(100deg, rgba(12,141,141,.06) 30%, rgba(12,141,141,.13) 50%, rgba(12,141,141,.06) 70%); background-size:200% 100%; animation:shimmer 1.6s ease-in-out infinite; }
  
  /* ---------------------------------------------------------
     وبلاگ — ساختار لیستی
  --------------------------------------------------------- */
  .blog-list-section{ position:relative; }
  .blog-list-head{ margin-bottom:1.4rem; }
  
  .blog-list{ display:flex; flex-direction:column; gap:1.6rem; }
  .blog-list .rasa-card{ min-height:250px; height:auto; }

  .list-skel{ height:250px; border-radius:var(--r-xl); background:linear-gradient(100deg, rgba(12,141,141,.06) 30%, rgba(12,141,141,.13) 50%, rgba(12,141,141,.06) 70%); background-size:200% 100%; animation:shimmer 1.6s ease-in-out infinite; }
  
  /* ---------------------------------------------------------
     حالت خالی / صفحه‌بندی
  --------------------------------------------------------- */
  .articles-empty{ text-align:center; padding:4rem 1rem; color:var(--c-deep); }
  .articles-empty svg{ width:56px; height:56px; opacity:.4; margin-bottom:1rem; }
  .articles-empty p{ margin:0 0 1.2rem; font-size:.95rem; }
  
  .pagination{ display:flex; justify-content:center; gap:.5rem; margin-top:2.6rem; flex-wrap:wrap; }
  .pagination-btn{
    min-width:40px; height:40px; padding:0 .9rem; border-radius:999px; border:1.5px solid rgba(12,141,141,.18);
    background:#fff; color:var(--c-deep); font-family:inherit; font-size:.85rem; cursor:pointer;
    transition:background .2s ease, color .2s ease, border-color .2s ease;
  }
  .pagination-btn:hover:not(:disabled){ border-color:var(--c-teal); color:var(--c-ink); }
  .pagination-btn.is-active{ background:var(--c-teal); border-color:var(--c-teal); color:#fff; font-weight:700; }
  .pagination-btn:disabled{ opacity:.35; cursor:not-allowed; }
  
  /* ---------------------------------------------------------
     ریسبانسیو فشرده و متوازن سازی فواصل جدیدترین‌ها
  --------------------------------------------------------- */
  @media (max-width:768px){
    .blog-list .rasa-card { 
      height: auto !important; 
      min-height: 175px; 
    }
    .stack-card2 .rasa-card {
      height: 100% !important;
    }
    
    .rasa-card-body { 
      padding: 0.9rem 1.1rem; 
      gap: 0.35rem;
    }
    
    .rasa-card-title { 
      font-size: 1.05rem !important; 
      -webkit-line-clamp: 2; 
      line-height: 1.5;
    }
    
    .rasa-card-excerpt { 
      display: -webkit-box !important;
      font-size: 0.8rem !important; 
      -webkit-line-clamp: 2; 
      line-height: 1.6;
      opacity: 0.7;
    }
    
    .rasa-card-cat-icon { 
      width: 36px !important; 
      height: 36px !important; 
      border-radius: 11px; 
    }
    .rasa-card-cat-icon svg { 
      width: 18px !important; 
      height: 18px !important; 
    }
    .rasa-card-cat-text strong { font-size: 0.9rem !important; }
    .rasa-card-cat-text small { display: none; }
    
    /* بالا بردن چندپیکسلی متن بخش جدیدترین‌ها جهت جلوگیری از تداخل پشته صعودی در تبلت */
    .stack-head { margin-bottom: 3.8rem !important; }
    .stack-wrap { height: 175px !important; }
  }
  
  @media (max-width:480px) {
    .articles-page { padding-inline: 4vw; }
    .blog-hero-title { font-size: 1.75rem; }
    .cat-card { min-width: 185px; padding: 0.65rem 0.9rem; }
    
    .rasa-card-media { flex-basis: 38%; } 
    .rasa-card-body { padding: 0.75rem 0.9rem; gap: 0.25rem; }
    .rasa-card-title { font-size: 0.95rem !important; -webkit-line-clamp: 2; }
    .rasa-card-excerpt { -webkit-line-clamp: 2; font-size: 0.75rem !important; }
    
    /* کپسول نویسنده در موبایل‌های بسیار کوچک */
    .rasa-card-author { height: 34px; bottom: 0.4rem; width: 92%; }
    .rasa-card-author img { width: 34px; height: 34px; border-radius: 0 9px 9px 0; }
    .rasa-card-author span { line-height: 34px; padding-right: 0.5rem; font-size: 0.65rem; }
    
    /* تعادل فاصله نهایی متن جدیدترین‌ها در موبایل */
    .stack-head { margin-bottom: 3.2rem !important; }
    .stack-wrap { height: 165px !important; margin-bottom: 2rem; }
  }