 :root {
      /* لوحة ألوان هادئة ومريحة للعين مع خطوط صغيرة */
      --bg-page: #f8f6f1;
      --bg-card: #ffffff;
      --primary: #8c6336;
      --primary-light: #e6dcc3;
      --text-main: #2b2520;
      --text-muted: #7a6b5e;
      --border-color: #e0d5c5;
      --shadow-sm: 0 2px 6px rgba(140, 99, 54, 0.04);
      --shadow-md: 0 6px 18px rgba(140, 99, 54, 0.06);
      --radius: 16px;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    body {
      font-family: "Cairo", sans-serif;
      background-color: var(--bg-page);
      color: var(--text-main);
      line-height: 1.5;
      font-size: 15px; /* تصغير حجم الخط الأساسي */
      padding-bottom: 40px;
    }

    /* --- الهيدر --- */
    .page-header {
      text-align: center;
      padding: 30px 15px 15px;
    }
    
    .page-title {
      font-family: "Amiri", serif;
      font-size: 1.8rem;
      color: var(--primary);
      margin-bottom: 5px;
    }

    .page-subtitle {
      color: var(--text-muted);
      font-size: 0.9rem;
    }

    /* --- شريط التنقل العلوي (Sticky) --- */
    .tabs-container {
      position: sticky;
      top: 0;
      z-index: 100;
      background: rgba(255, 255, 255, 0.98);
      border-bottom: 1px solid var(--border-color);
      box-shadow: var(--shadow-sm);
      padding: 8px 0;
      margin-bottom: 20px;
    }

    .tabs-wrapper {
      max-width: 1000px;
      margin: 0 auto;
      padding: 0 15px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    /* البحث */
    .search-box {
      position: relative;
      width: 100%;
    }

    .search-input {
      width: 100%;
      padding: 8px 15px 8px 40px;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: #fdfdfd;
      font-family: inherit;
      font-size: 0.9rem;
    }
    
    .search-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      font-size: 0.9rem;
    }

    /* التبويبات (Tabs) */
    .nav-scroll {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding: 4px 0;
      scrollbar-width: none;
    }
    .nav-scroll::-webkit-scrollbar { display: none; }

    .nav-tab {
      white-space: nowrap;
      padding: 6px 14px;
      border-radius: 6px;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-muted);
      text-decoration: none;
      border: 1px solid transparent;
      transition: all 0.2s ease;
    }

    .nav-tab:hover {
      background-color: var(--primary-light);
      color: var(--primary);
    }

    .nav-tab.active {
      background-color: var(--primary);
      color: #fff;
    }

    /* --- المحتوى --- */
    .catalog-wrap {
      max-width: 900px;
      margin: 0 auto;
      padding: 0 15px;
    }

    /* =========================
   BOOK SECTIONS CLEAN STYLE
   ========================= */

.bio-section{
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 25px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  scroll-margin-top: 100px;
}

.bio-section-header{
  padding: 10px 12px 8px;
  background: #fdfcfb;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.header-info{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bio-index{
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  font-family: "Amiri", serif;
  flex-shrink: 0;
}

.bio-title{
  margin: 0;
  font-family: "Amiri", serif;
  font-size: 16px;
  line-height: 1.2;
  color: var(--text-main);
}

.bio-count{
  font-size: 8px;
  color: var(--text-muted);
  background: #f0e6d9;
  padding: 4px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.bio-note{
  padding: 10px 12px;
  background: #fffdf5;
  color: #6d5d50;
  font-size: 12px;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.7;
}

.books-list{
  display: flex;
  flex-direction: column;
}

.book-row{
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 72px;
  align-items: start;
  gap: 5px;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #e7ddd1;
  transition: background 0.2s ease;
}

.book-row:last-child{
  border-bottom: none;
}

.book-row:hover{
  background: #faf9f6;
}

.book-no{
  font-size: 8px;
  color: #9a7b4f;
  text-align: right;
  line-height: 1;
  transform: translateX(3px);
}

.book-title{
  font-family: "Amiri", serif;
  font-size: 11px;
  font-weight: 700;
  color: #221b14;
  line-height: 1.5;
  min-width: 0;

  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.book-publisher{
  font-size: 8px;
  font-weight: 700;
  color: #9f9488;
  text-align: left;
  line-height: 1.4;
  min-width: 0;

  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* موبايل */
@media (max-width: 768px){
  .bio-section-header{
    padding: 9px 10px 8px;
    gap: 6px;
  }

  .header-info{
    gap: 8px;
  }

  .bio-index{
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .bio-title{
    font-size: 15px;
  }

  .bio-count{
    font-size: 7px;
    padding: 4px 6px;
  }

.book-row{
  grid-template-columns: 12px minmax(0, 1fr) 58px;
}
  .book-no{
    font-size: 7px;
    transform: translateX(4px);
  }

  .book-title{
    font-size: 10.5px;
  }

  .book-publisher{
    font-size: 6.8px;
  }
}

@media (min-width: 992px){

  .bio-title{
    font-size: 1.15rem;
  }

  .bio-count{
    font-size: 0.74rem;
    padding: 6px 11px;
  }

  .bio-note{
    font-size: 0.9rem;
  }

  .book-row{
    grid-template-columns: 24px minmax(0,1fr) 160px;
    gap: 12px;
    padding: 12px 20px;
  }

  .book-no{
    font-size: 0.8rem;
  }

  .book-title{
    font-size: 1rem;
    line-height: 1.45;
  }

  .book-publisher{
    font-size: 0.62rem;
    line-height: 1.35;
  }

  .books-opening-note p{
    font-size: 1.08rem;
    line-height: 1.9;
  }

  .closing-quote{
    font-size: 1.7rem;
  }
}


.books-opening-note{
  width: min(1100px, calc(100% - 32px));
  margin: 18px auto 30px;
  padding: 20px 28px;
  background: linear-gradient(180deg, #f8f3eb 0%, #f2eadf 100%);
  border: 1px solid #dccdb7;
  border-top: 4px solid #b88646;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(81, 58, 30, 0.08);
  position: relative;
  overflow: visible;
}

.books-opening-note::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(184,134,70,0.10), transparent 28%),
    radial-gradient(circle at bottom left, rgba(184,134,70,0.06), transparent 24%);
  pointer-events: none;
  border-radius: inherit;
}

.books-opening-note p{
  margin: 0;
  position: relative;
  z-index: 1;
  font-family: "Amiri", serif;
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.8;
  color: #2f2418;
  text-align: center;
}

/* ================= SEARCH ================= */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 2000;
    padding-top: 80px;
}

.search-overlay.active { display: block; }

.search-box {
    background: #fff;
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
    padding: 12px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    position: relative;
    z-index: 2001;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: "Cairo";
    background: transparent;
}

.close-search {
    cursor: pointer;
    font-size: 16px;
    color: #888;
    padding: 5px;
}



.search-results{

width:90%;
max-width:700px;

margin:10px auto;

background:white;

border-radius:12px;

box-shadow:0 10px 30px rgba(0,0,0,0.15);

overflow:hidden;

}

.result{

display:block;

padding:14px 18px;

border-bottom:1px solid #eee;

text-decoration:none;

color:#333;

}

.result h4{

margin:0 0 4px;

font-size:16px;

}

.result p{

margin:0;

font-size:13px;

color:#777;

}

.result:hover{

background:#f5f5f5;

}
