/*
 Theme Name: Astra Child
 Description: Astra Child Theme for scionsofsanta.com
 Template: astra
 Version: 1.3.1
*/

/* =========================================================
   1) FONTS (LOCAL) - Static & Optimized
   ========================================================= */

@font-face {
  font-family: "IRMitra";
  src: url("assets/fonts/mitra/IRMitra.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IRMitra";
  src: url("assets/fonts/mitra/IRMitra-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LibreBaskervilleLocal";
  src: url("assets/fonts/baskerville/LibreBaskerville-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LibreBaskervilleLocal";
  src: url("assets/fonts/baskerville/LibreBaskerville-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* =========================================================
   4) BOOKS & FORMATS
   ========================================================= */

.sos-book-formats-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 18px;
}

.sos-book-formats-nav .sos-format-chip {
  padding: 6px 14px; /* کمی فضای بیشتر برای خوانایی */
  border: 1px solid #ddd;
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.2;
  font-size: 0.9em;
  color: inherit;
  transition: all 0.2s ease;
}

.sos-book-formats-nav .sos-format-chip:hover {
  background-color: #f9f9f9;
  border-color: #7a3e2e;
  color: #7a3e2e;
}

.sos-format-block {
  scroll-margin-top: 120px; /* جلوگیری از رفتن محتوا زیر هدر چسبان */
}


 /* ===== STORY Posts Index ==== */

.story-toc {
    background-color: #f9f9f9;
    border-right: 5px solid #d4af37;
    padding: 10px 20px; /* فاصله داخلی بالا و پایین */
    margin: 10px 0;    /* فاصله کل باکس از متن بالا و پایین  */
    border-radius: 8px;
    font-family: 'Tahoma', sans-serif;
    direction: rtl;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.story-toc ul {
    list-style-type: none;
    padding: 0;
    margin: 5px 0 0 0; /* فاصله لیست از تیتر "فهرست" */
}

.story-toc li {
    margin-bottom: 2px; /* فاصله بین سطرهای فهرست  */
}

.story-toc a {
    text-decoration: none;
    color: #555;
    transition: all 0.3s ease;
    display: block;
    padding: 2px 5px; /* فاصله داخلی هر لینک */
}

    .story-toc a:hover {

        color: #d4af37;

        background-color: #fff;

        padding-right: 10px;

        border-radius: 4px;

    }
    
    @media (max-width: 768px) {
    .story-toc {
        padding: 15px;
        font-size: 0.9rem;
    }
}

/* ===== حرکت آرام ===== */

html {
    scroll-behavior: smooth;
}

/* ====================================================================
    STORY ARCHIVE
    SUN ICON Effect
    CSS ID: story-sun
    ===================================================================*/

/* شعاع‌های تیز و درخشش */
#story-sun .elementor-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #fff2a6 0%, #ffd700 50%, #ff8c00 100%);
    border-radius: 50%;
    padding: 22px;
    /* زمان انیمیشن به 6 ثانیه افزایش یافت برای تپش ملایم‌تر */
    animation: sunBeamsSlow 6s ease-in-out infinite;
    box-shadow: 0 0 15px #ffd700, inset 0 0 10px #ffffff;
    transition: all 0.5s ease;
}

#story-sun .elementor-icon i {
    color: #ffffff;
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 8px #ffd700);
    font-size: 1.2em;
    z-index: 2;
    /* انیمیشن آیکون هم با بدنه هماهنگ شد */
    animation: iconPulseSlow 6s ease-in-out infinite;
}

/* حالت hover - افزایش ملایم سرعت برای بازخورد به کاربر */
#story-sun .elementor-icon:hover {
    transform: scale(1.08);
    animation-duration: 3s; 
    box-shadow: 0 0 35px #ffd700, 0 0 65px #ff8c00;
}

/* انیمیشن کُند و عمیق برای بدنه خورشید */
@keyframes sunBeamsSlow {
    0%, 100% {
        box-shadow: 0 0 15px #ffd700, 0 0 30px rgba(255, 140, 0, 0.3);
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 30px #ffd700, 0 0 60px #ff8c00, 0 0 90px rgba(255, 215, 0, 0.4);
        transform: scale(1.03);
        filter: brightness(1.15);
    }
}

/* انیمیشن کُند برای درخشش خودِ آیکون */
@keyframes iconPulseSlow {
    0%, 100% {
        opacity: 0.85;
        filter: drop-shadow(0 0 5px #ffd700);
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 15px #ffffff);
    }
}


/* =========================================================
   6) AUTHORS
   ========================================================= */

/* ===== Author links ===== */

.author-links {
  line-height: 1.7;
}

.author-links a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.author-links a:hover {
  color: #fea460;
  text-decoration: underline;
}

.author-links .sep {
  margin: 0 6px;
  opacity: 0.5;
}
/* =====================================================
   Author Profile Works Section Styles
   نمایش کتاب‌ها، داستان‌ها و یادداشت‌ها در پروفایل نویسنده
   ===================================================== */

.author-works-title,
.sos-author-works-title,
.sos-author-works strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e6ea;
    color: #2c3e50;
}

.author-works-section {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.author-work-item a {
    display: block;
    width: 100%;
    position: relative;
    /* استفاده از padding-inline-start برای سازگاری خودکار با RTL/LTR */
    padding-inline-start: 15px; 
    padding-top: 4px;
    padding-bottom: 4px;
    line-height: 1.5;
    color: #333;
    text-decoration: none;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* استفاده از منطق Logical Properties برای جایگذاری گلوله */
.author-work-item a::before {
    content: "•";
    position: absolute;
    /* inset-inline-start به صورت خودکار در انگلیسی Left و در فارسی Right می‌شود */
    inset-inline-start: 0; 
    color: #2c3e50;
    font-weight: bold;
}

.author-work-item a:hover {
    color: #0073aa;
}

/* حذف حاشیه اضافی در ابتدای لیست */
.author-works-section:first-child .author-works-title {
    margin-top: 0;
}

/* فونت ضخیم‌تر برای عناوین فارسی بدون تغییر جهت */
html[lang="fa"] .author-works-title,
html[lang="fa"] .author-work-item a {
    font-weight: 500;
}
/* =====================================================
   RTL & Persian Language Optimizations
   بهینه‌سازی برای زبان فارسی و راست‌چین
   ===================================================== */

html[lang="fa"] .author-works-title,
html[lang="fa"] .author-section-title {
    font-weight: 700;
    text-align: right;
}

html[lang="fa"] .author-work-item a {
    text-align: right;
    padding-left: 0;
    padding-right: 15px; /* جابجایی فضا به سمت راست در فارسی */
}

html[lang="fa"] .author-work-item a::before {
    left: auto;
    right: 0; /* انتقال گلوله به سمت راست در فارسی */
}
/* =========================================================
   7) Book Translator & Editor - Final Clean Version
   ========================================================= */

.meta-line {
    margin-top: 15px;
}

.meta-label {
    display: block;
    color: #777;
    margin-bottom: 4px;
    font-size: 0.9em;
}

/* ظرف اصلی نام‌ها */
.meta-names-container {
    display: flex;
    flex-direction: column; /* زیر هم قرار دادن نام‌ها */
    gap: 2px; /* فاصله دقیق و کم بین سطرها */
}

.single-name a {
    display: inline-block;
    text-decoration: none;
    transition: color .2s ease;
    color: #0094FF;
    line-height: 1.3;
}

/* استایل مخصوص زبان انگلیسی */
body:not(.rtl) .single-name a {
    font-family: 'LibreBaskerville', serif;
    font-size: 16px;
}

/* استایل مخصوص زبان فارسی */
body.rtl .single-name a {
    font-family: 'IRMitra', Tahoma, sans-serif;
    font-size: 20px;
}

/* افکت هوور */
.single-name a:hover {
    color: #FF6A00;
}

/* =========================================================
   All Nonfiction Authors List (Page Shortcode) + Back to List
   ========================================================= */

/* --- تنظیمات کلی کانتینر و فیلتر --- */
.authors-directory-wrapper { 
    width: 100%; 
    margin: 30px 0; 
}

.author-filter-section { 
    text-align: center; 
    margin-bottom: 50px; 
}

#authorSearchInput {
    width: 100%; 
    max-width: 400px; 
    padding: 10px 20px;
    border: 1.5px solid #0094FF; 
    border-radius: 25px; 
    outline: none;
    transition: all 0.3s ease;
}

/* --- شبکه نمایش نویسندگان (Grid) --- */
.authors-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 40px;
}

.author-card { 
    text-align: center; 
    transition: transform 0.3s ease; 
}

.author-card:hover { 
    transform: translateY(-8px); 
}

.author-card a { 
    text-decoration: none; 
}

.author-photo-holder img {
    width: 160px; 
    height: 160px; 
    border-radius: 50%; 
    object-fit: cover;
    border: 4px solid #f8f8f8; 
    transition: border-color 0.3s ease;
}

.author-card:hover img { 
    border-color: #0094FF; 
}

.author-display-name { 
    margin-top: 15px; 
    color: #444; 
    transition: color 0.3s ease;
}

.author-card:hover .author-display-name { 
    color: #0094FF; 
}

/* =========================================================
    Nonfction Author Profile Back to List (Shortcode Styles)
   ========================================================= */
   
.back-link-container { 
    margin: 25px 0; 
    clear: both; 
}

.back-to-authors-btn {
    display: inline-block;
    text-decoration: none;
    color: #0094FF;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* --- مدیریت فونت و جهت بر اساس زبان --- */

/* استایل‌های مشترک فارسی (RTL) */
body.rtl .author-display-name, 
body.rtl #authorSearchInput, 
body.rtl .back-to-authors-btn {
    font-family: 'IRMitra', Tahoma, sans-serif;
    font-size: 20px;
}

/* استایل‌های مشترک انگلیسی (LTR) */
body:not(.rtl) .author-display-name, 
body:not(.rtl) #authorSearchInput, 
body:not(.rtl) .back-to-authors-btn {
    font-family: 'LibreBaskerville', serif;
    font-size: 17px;
}

/* تنظیم جهت حرکت در هاور */
body.rtl .back-to-authors-btn:hover {
    transform: translateX(8px); /* حرکت به راست در فارسی */
    color: #FF6A00;
}

body:not(.rtl) .back-to-authors-btn:hover {
    transform: translateX(-8px); /* حرکت به چپ در انگلیسی */
    color: #FF6A00;
}

/* --- بهینه‌سازی برای موبایل --- */
@media (max-width: 768px) {
    .authors-grid { 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
        gap: 20px; 
    }
    .author-photo-holder img { 
        width: 130px; 
        height: 130px; 
    }
}

/* =========================================================
   All Publishers List (Page Shortcode Styles) همهٔ ناشران
   ========================================================= */

.publishers-directory-wrapper { width: 100%; margin: 30px 0; }
.publisher-filter-section { text-align: center; margin-bottom: 50px; }

#publisherSearchInput {
    width: 100%; max-width: 400px; padding: 10px 20px;
    border: 1.5px solid #0094FF; border-radius: 25px; outline: none;
    transition: all 0.3s ease;
}

/* نمایش 5 تایی برای دسکتاپ و تبلت */
.publishers-grid {
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 30px;
}

.publisher-card { text-align: center; transition: transform 0.3s ease; }
.publisher-card:hover { transform: translateY(-8px); }
.publisher-card a { text-decoration: none; }

.publisher-logo-holder img {
    width: 100%; /* تغییر به 100 درصد برای انعطاف‌پذیری */
    max-width: 160px; 
    height: auto; 
    aspect-ratio: 1/1; /* حفظ حالت مربعی */
    border-radius: 15px;
    object-fit: contain;
    background: #fff;
    border: 2px solid #f0f0f0; 
    padding: 10px;
    transition: all 0.3s ease;
}

.publisher-card:hover img { border-color: #0094FF; box-shadow: 0 5px 15px rgba(0,148,255,0.1); }
.publisher-display-name { margin-top: 15px; color: #444; transition: color 0.3s ease; }

/* مدیریت فونت بر اساس زبان */
body.rtl .publisher-display-name, body.rtl #publisherSearchInput {
    font-family: 'IRMitra', Tahoma, sans-serif;
    font-size: 20px;
}

body:not(.rtl) .publisher-display-name, body:not(.rtl) #publisherSearchInput {
    font-family: 'LibreBaskerville', serif;
    font-size: 17px;
}

/* تنظیمات مخصوص موبایل (3 تایی) */
@media (max-width: 767px) {
    .publishers-grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 15px; 
    }
    .publisher-logo-holder img { 
        max-width: 100px; 
    }
    .publisher-display-name {
        font-size: 14px !important;
    }
}

/* =========================================================
    Publisher Profile Back to List (Shortcode Styles)
   ========================================================= */

.back-link-container.publisher-back {
    margin: 40px 0;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.back-to-publishers-btn {
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    /* رنگ آبی زیبا - می‌توانید کد رنگ دقیق خود را اینجا بگذارید */
    color: #0073aa;
    font-weight: 500;
}

/* حالت هوور (نارنجی) */
.back-to-publishers-btn:hover {
    color: #ff6600;
    transform: translateX(-5px); /* یک حرکت کوچک برای جذابیت بیشتر */
}

/* تنظیمات فونت فارسی */
body.rtl .publisher-back .back-to-publishers-btn {
    font-family: "IRMitra", Tahoma, sans-serif;
    font-size: 20px;
    direction: rtl;
}

/* تنظیمات فونت انگلیسی */
body:not(.rtl) .publisher-back .back-to-publishers-btn {
    font-family: "LibreBaskervilleLocal", serif;
    font-size: 16px;
    direction: ltr;
}


/* =====================================================
   STORYWRITER BIO 4 & BOOK 3 SECTIONS
   (FA + EN) چهار بخش زندگینامه و سه بخش معرفی کتاب
   ===================================================== */
/* =====================================================
   STORYWRITER BIO 4 & BOOK 3 SECTIONS
   (FA + EN) — نسخه پایدار نهایی
   اصلاح‌شده برای:
   1) افزایش خوانایی فارسی
   2) رفع چسبیدن متن به آیکون
   3) سازگاری کامل دسکتاپ + تبلت + موبایل
   4) جلوگیری از شکستن float
   ===================================================== */

/* بخش اصلی */

.story-bio-section{
  margin-bottom: 36px;
  font-size: 1.05rem; /* پایه انگلیسی */
  line-height: 1.75;
  color: #3f4a56;
  overflow: hidden; /* نگه داشتن float */
}

/* فقط فارسی بزرگ‌تر */

html[dir="rtl"] .story-bio-section{
  font-size: 1.18rem;
  line-height: 1.9;
}

/* عنوان */

.story-bio-section h3{
  margin: 0 0 10px;
  color: #2f3e4e;
  line-height: 1.3;
  font-weight: 600;
  transition: color .2s ease;
}

.story-bio-section:hover h3{
  color: #7a4a2a;
}

/* strong title */

.story-bio-section + strong{
  display: block;
  margin: 26px 0 6px;
  font-weight: 600;
  color: #2f3e4e;
}

/* آیکون */

.story-bio-section img{
  float: left;
  width: 80px;
  height: 80px;
  margin-right: 16px;
  margin-bottom: 12px;
  margin-top: 6px;
  background: #f1f3f5;
  border-radius: 10px;
  padding: 6px;
  transition: background .25s ease;
}

.story-bio-section:hover img{
  background: #ffffff;
}

/* متن */

.story-bio-section p{
  margin: 0 0 10px;
}

/* رفع مشکل float */

.story-bio-section::after{
  content: "";
  display: block;
  clear: both;
}

/* =========================
   RTL فارسی
   ========================= */

html[dir="rtl"] .story-bio-section{
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .story-bio-section img{
  float: right;
  margin-right: 0;
  margin-left: 25px; /* فاصله اصلی رفع مشکل چسبیدن */
  margin-bottom: 12px;
}

/* =========================
   تبلت
   ========================= */

@media (max-width: 1024px){

  .story-bio-section{
    margin-bottom: 32px;
  }

  .story-bio-section img{
    width: 90px;
    height: 90px;
  }

  html[dir="rtl"] .story-bio-section img{
    margin-left: 22px;
  }
}

/* =========================
   موبایل
   ========================= */

@media (max-width: 768px){

  .story-bio-section{
    text-align: start;
    margin-bottom: 28px;
  }

  html[dir="rtl"] .story-bio-section{
    text-align: right;
  }

  .story-bio-section h3{
    text-align: center;
    margin-bottom: 14px;
  }

  .story-bio-section img{
    float: none;
    display: block;
    width: 110px;
    height: 110px;
    margin: 0 auto 14px;
  }

  html[dir="rtl"] .story-bio-section img{
    float: none;
    margin: 0 auto 14px;
  }
}

/* =====================================================
   AUTHOR QUOTE
   ===================================================== */

.author-quote{
  border-right:4px solid #999;
  padding:12px 16px;
  margin:20px 0;
  background:#f7f7f7;
  font-style:italic;
  line-height:1.8;
}

html[dir="ltr"] .author-quote{
  border-left:4px solid #999;
  border-right:none;
}

.author-quote.en{
  direction:ltr;
  text-align:left;
}


/* =========================================================
   7) SEARCH STRUCTURE (RTL READY)
   ========================================================= */

.search-results .elementor-widget-loop-grid,
.search-section {
  margin-bottom: 2rem;
}

.search-results .elementor-post {
  margin-bottom: 1.5rem;
}

.search-excerpt {
  display: block;
  margin-top: 0.5rem;
  line-height: 1.8;
}

/* RTL layout for Farsi */
html[dir="rtl"] .search-results {
  direction: rtl;
  text-align: right;
}


/* =========================================================
   ADVANCED SEARCH FORM
   ========================================================= */

.adv-search-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;

  padding: 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* inputs + select */

.adv-search-wrapper input,
.adv-search-wrapper select {
  height: 45px;
  padding: 0 10px;

  font-family: inherit;
  color: #333;

  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* search button */

.adv-search-wrapper button {
  height: 45px;
  padding: 0 25px;

  color: #fff;
  background: #d4a373;

  border: none;
  border-radius: 4px;

  font-weight: bold;
  cursor: pointer;
}

/* =========================================================
   FULLSCREEN SEARCH (TOP STRIP + GRADIENT + iOS FIX)
   ========================================================= */

#search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh; /* iOS safe */

  /* گرادیانت: تیره بالا → روشن پایین */
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.65) 25%,
    rgba(0,0,0,0.2) 60%,
    rgba(0,0,0,0) 100%
  );

  display: flex;
  align-items: flex-start;   /* همیشه بالا */
  justify-content: center;

  padding-top: 120px;         /* زیر هدر */

  opacity: 0;
  visibility: hidden;
  transition: 0.25s ease;

  z-index: 999999;
}

#search-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* box */
#search-overlay .search-box {
  position: relative;
  width: 60%;
  max-width: 600px;
}

/* input */
#search-overlay input {
  width: 100%;
  font-size: 28px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  text-align: center;
  padding: 12px 45px;

  outline: none;
}

/* فونت‌ها */
html[lang*="fa"] #search-overlay input {
  font-family: IRMitra, sans-serif;
  direction: rtl;
}

html[lang*="en"] #search-overlay input {
  font-family: "Libre Baskerville", serif;
  direction: ltr;
}

/* دکمه × */
#search-overlay .search-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  padding: 5px 10px;
  opacity: 0.8;
}

#search-overlay .search-close:hover {
  opacity: 1;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

  #search-overlay {
    padding-top: 70px;
  }

  #search-overlay .search-box {
    width: 90%;
  }

  #search-overlay input {
    font-size: 20px;
  }

}


/* =========================================================
   8) CTA CARDS ICON COLOR - PAGE: your-word
   ========================================================= */

/* ایجاد تم زغالی/خاکستری ملایم برای آیکون‌های CTA */
.cta-cards .elementor-widget-image img {
  filter: brightness(0) saturate(100%) opacity(0.65) !important;
  transition: opacity 0.3s ease;
}

.cta-cards .elementor-widget-image img:hover {
  opacity: 0.9 !important;
}


/* =========================================================
   -)  ترکیب کادر و دکمهٔ ریویوی زیر کتاب‌ها
   ========================================================= */
.sos-discussion-box {
    margin-top: 40px;
}

.sos-discussion-box textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
}

.sos-discussion-button {
    margin-top: 12px;
}

.sos-discussion-preview {
    margin-top: 30px;
}

.sos-discussion-reply {
    margin-bottom: 15px;
}




   
/* ================================
   Reflection
   نوار رنگی برای جملهٔ توضیحی اول یادداشت هایی که ترجمه کرده ایم
   ================================ */
/* Reflection note */
.reflection-note{
background:#f3f6f8;
border-left:4px solid #6aa3b8;
padding:12px 16px;
margin:20px 0;
font-size:0.95rem;
line-height:1.6;
}


/* =========================================================
   Select2 + Filter Forms (Books / Stories / Reflections)
   یکپارچه‌سازی کامل فیلترها
   ========================================================= */

/* ===== 1. SELECT2 TRIGGER BOX ===== */

.select2-container--default .select2-selection--single {
  height: 40px;
  border: 1px solid #d6d1c9;
  border-radius: 6px;
  background: #f8f6f2;
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.select2-selection__rendered {
  line-height: 38px;
  padding-left: 4px;
  padding-right: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select2-selection__arrow {
  height: 40px;
}

/* ===== 2. SELECT2 DROPDOWN PANEL ===== */

.select2-dropdown {
  border: 1px solid #d6d1c9;
  border-radius: 6px;
  /* عرض حداقل برای نمایش دو ستونه */
  min-width: 380px;
}

/* لیست نتایج — اسکرول عمودی */
.select2-results__options {
  max-height: 240px;
  overflow-y: auto;
}

/* نویسنده: دو ستونه هنگام باز بودن */
.select2-container--open .select2-results__options {
  column-count: 2;
  column-gap: 8px;
}

.select2-results__option {
  white-space: normal;
  break-inside: avoid;
  padding: 6px 10px;
}

/* ژانر/گونه: تک‌ستون با اسکرول (کلاس اختصاصی) */
.select2-container.genre-select .select2-dropdown,
.select2-container.type-select .select2-dropdown {
  min-width: 160px;
}

.select2-container.genre-select .select2-results__options,
.select2-container.type-select .select2-results__options {
  column-count: 1;
}

/* ===== 3. FILTER LAYOUT — DESKTOP ===== */

.book-filter-form,
.story-filter-form,
.reflection-filter-form,
.storywriter-filter-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* فیلد جستجوی عنوان — انعطاف‌پذیر تا دکمه‌ها در همان ردیف بمانند */
.book-filter-form input[type="text"],
.story-filter-form input[type="text"],
.reflection-filter-form input[type="text"],
.storywriter-filter-form input[type="text"] {
  height: 40px;
  padding: 0 12px;
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 260px;
  border: 1px solid #d6d1c9;
  border-radius: 6px;
  background: #f8f6f2;
  font-family: inherit;
  color: #333;
  box-sizing: border-box;
}

/* کانتینر select2 نویسنده */
.book-filter-form .select2-container,
.story-filter-form .select2-container,
.reflection-filter-form .select2-container,
.storywriter-filter-form .select2-container {
  width: 200px !important;
  flex: 0 0 auto;
}

/* داستان‌ها: container کمی تنگ‌تر است — عرض‌ها کوچک‌تر */
.story-filter-form .select2-container {
  width: 160px !important;
}
.story-filter-form select {
  width: 130px;
}
.story-filter-form input[type="text"] {
  min-width: 90px;
}

/* سلکت بومی ژانر/گونه */
.book-filter-form select,
.story-filter-form select,
.reflection-filter-form select,
.storywriter-filter-form select {
  height: 40px;
  padding: 0 10px;
  width: 150px;
  border: 1px solid #d6d1c9;
  border-radius: 6px;
  background: #f8f6f2;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  box-sizing: border-box;
}

/* دکمه‌ها — گروه بیاب + ⟳ */
.filter-btn-group {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex: 0 0 auto;
  align-items: center;
}

.book-filter-form button,
.story-filter-form button,
.reflection-filter-form button,
.storywriter-filter-form button {
  height: 40px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid #d6d1c9;
  background: linear-gradient(to bottom, #f2f2f2, #d9d9d9);
  color: #333;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex: 0 0 auto;
}

.book-filter-form button:hover,
.story-filter-form button:hover,
.reflection-filter-form button:hover,
.storywriter-filter-form button:hover {
  background: linear-gradient(to bottom, #f7d98c, #e0b85c);
  border-color: #d1a94c;
  color: #222;
}

/* دکمهٔ ریست — همرنگ با دکمهٔ بیاب */
.filter-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #d6d1c9;
  background: linear-gradient(to bottom, #f2f2f2, #d9d9d9);
  color: #333;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex: 0 0 auto;
  text-decoration: none;
}

.filter-reset-btn:hover {
  background: linear-gradient(to bottom, #f7d98c, #e0b85c);
  border-color: #d1a94c;
  color: #222;
  text-decoration: none;
}

/* ===== 4. MOBILE === بخشی نیز در کاستوم سی.اس.اس ویجت‌ها گذاشته شد == */
@media (max-width: 768px) {

  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .book-filter-form.book-filter-form,
  .story-filter-form.story-filter-form,
  .reflection-filter-form.reflection-filter-form,
  .storywriter-filter-form.storywriter-filter-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .book-filter-form > *,
  .story-filter-form > *,
  .reflection-filter-form > *,
  .storywriter-filter-form > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: none;
    box-sizing: border-box;
  }

  /* گروه دکمه‌ها: بیاب و ⟳ در یک ردیف، هم‌سایز */
  .filter-btn-group {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 6px;
  }

  .filter-btn-group button,
  .filter-btn-group .filter-reset-btn {
    flex: 1;
    width: auto;
    height: 44px;
    padding: 0;
    box-sizing: border-box;
  }

  /* ارتفاع یکسان برای تمام فیلدها */
  .book-filter-form input[type="text"],
  .story-filter-form input[type="text"],
  .reflection-filter-form input[type="text"],
  .storywriter-filter-form input[type="text"] {
    height: 44px !important;
    min-height: unset !important;
    max-height: 44px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    max-width: 100%;
  }

  .book-filter-form select,
  .story-filter-form select,
  .reflection-filter-form select,
  .storywriter-filter-form select {
    height: 44px;
    width: 100%;
  }

  .book-filter-form .select2-container,
  .story-filter-form .select2-container,
  .reflection-filter-form .select2-container,
  .storywriter-filter-form .select2-container {
    width: 100% !important;
  }

  .select2-container .select2-selection--single {
    height: 44px !important;
    line-height: 44px !important;
  }

  .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px !important;
  }

  .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px !important;
  }

  .select2-container--open .select2-results__options {
    column-count: 1;
  }

  .select2-dropdown {
    min-width: unset;
    max-width: 100vw;
    box-sizing: border-box;
  }

}

