/**
 *                          ___                   _       _         _ 
 *                         / __)                 | |     | |       | |
 *     _ _ _ _ _ _ _ _ _ _| |__ _____  ____ _   _| |  _  | |__   __| |
 *    | | | | | | | | | (_   __|____ |/ ___) | | | |_/ ) |  _ \ / _  |
 *    | | | | | | | | | | | |  / ___ | |   | |_| |  _ ( _| |_) | (_| |
 *     \___/ \___/ \___(_)|_|  \_____|_|   |____/|_| \_|_)____/ \____|
 *                                                                    
 *
 * 	Author: MD OMAR FARUK
 * 	Author URI: www.faruk.bd
 * 	Author Contact: https://faruk.bd/#contact
 * 	Author Email: info@faruk.bd | farukmr@gmail.com
 * 	Copyright © 2026
 *                          ___                   _       _         _ 
 *                         / __)                 | |     | |       | |
 *     _ _ _ _ _ _ _ _ _ _| |__ _____  ____ _   _| |  _  | |__   __| |
 *    | | | | | | | | | (_   __|____ |/ ___) | | | |_/ ) |  _ \ / _  |
 *    | | | | | | | | | | | |  / ___ | |   | |_| |  _ ( _| |_) | (_| |
 *     \___/ \___/ \___(_)|_|  \_____|_|   |____/|_| \_|_)____/ \____|
 *                                                                    
 */
/* Quran CMS - hadith collection */
.hd-head .hd-kicker { color: var(--gold); font-weight: 700; margin: 0 0 .2rem; letter-spacing: .3px; }
.hd-head .hd-kicker[lang="ar"], .hd-ar-title { font-family: var(--font-ar); font-size: 1.5rem; font-weight: 400; direction: rtl; line-height: 1.8; text-align: left; }
.hd-ar-title { color: var(--brand); margin: .2rem 0; }
.hd-head p { color: var(--muted); max-width: 72ch; }
.hd-head-sm h1 { font-size: clamp(1.4rem, 3vw, 2rem); }
.hd-author { display: flex; align-items: center; gap: .4rem; color: var(--ink-2) !important; font-weight: 600; }
.hd-stats { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; margin-top: .9rem; color: var(--ink-2); }
.hd-stats strong { color: var(--brand); font-size: 1.2rem; }
.hd-search { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .4rem .45rem .4rem 1rem; max-width: 780px; margin-top: 1.1rem; box-shadow: 0 6px 20px rgba(11,107,85,.06); }
.hd-search > .ic { color: var(--muted); flex: 0 0 auto; }
.hd-search input[type="search"] { flex: 1 1 220px; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); padding: .45rem 0; }
.hd-search input:focus { outline: none; }
.hd-search select { flex: 0 1 190px; min-width: 0; border: 1px solid var(--line); background: var(--bg-2, var(--surface)); color: var(--ink); border-radius: 10px; padding: .45rem .6rem; font: inherit; font-size: .9rem; }
.hd-wrap { padding-bottom: 3rem; }
.hd-sec-h { margin: 2.2rem 0 1rem; }
.hd-count { margin: 1.4rem 0 0; color: var(--ink-2); }

/* the books */
.hd-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.hd-bookcard { position: relative; display: flex; flex-direction: column; gap: .25rem; padding: 1.3rem 1.2rem 1rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; overflow: hidden; min-height: 200px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.hd-bookcard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--brand), var(--gold)); }
.hd-bookcard::after { content: ''; position: absolute; right: -34px; bottom: -34px; width: 120px; height: 120px; opacity: .07; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%230b6b55' stroke-width='3'%3E%3Cpath d='M50 6l12 29 29 12-29 12-12 29-12-29-29-12 29-12z'/%3E%3Crect x='22' y='22' width='56' height='56' transform='rotate(45 50 50)'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain; }
.hd-bookcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(11,107,85,.12); border-color: var(--brand-2, var(--brand)); color: var(--ink); }
.hd-bk-ar { font-family: var(--font-ar); font-size: 1.55rem; color: var(--brand); line-height: 1.7; direction: rtl; text-align: right; }
.hd-bookcard strong { font-size: 1.12rem; line-height: 1.35; }
.hd-bookcard small { color: var(--muted); font-size: .82rem; }
.hd-bk-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: .8rem; border-top: 1px solid var(--line-2); color: var(--brand); font-weight: 700; font-size: .9rem; }

/* chapters */
.hd-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .6rem; margin-top: 1.4rem; }
.hd-chap { display: flex; align-items: center; gap: .8rem; padding: .75rem .95rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.hd-chap:hover { border-color: var(--brand-2, var(--brand)); background: var(--brand-soft); color: var(--ink); }
.hd-chap-n { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.hd-chap-t { flex: 1; min-width: 0; }
.hd-chap-t strong { display: block; line-height: 1.4; }
.hd-chap-t small { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-chap-t small.ar { font-family: var(--font-ar); font-size: .95rem; direction: rtl; text-align: right; }
.hd-chap-r { text-align: right; flex: 0 0 auto; }
.hd-chap-r small { display: block; color: var(--muted); font-size: .75rem; }
.hd-chap-r b { color: var(--brand); }

/* the language and size bar */
.hd-tools { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; padding: .5rem .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 1.3rem 0 1rem; }
.hd-tools-l { display: inline-flex; gap: .35rem; align-items: center; color: var(--muted); font-size: .85rem; font-weight: 600; margin-right: .2rem; }
.hd-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: .3rem .85rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.hd-chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.hd-chip.sm { padding: .3rem .65rem; }

/* one hadith */
.hd-list { display: grid; gap: 1rem; }
.hd-card { --s: var(--hd-scale, 1); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.3rem 1rem; scroll-margin-top: 90px; }
.hd-card:target { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.hd-card.is-featured { border-color: rgba(192,138,35,.45); }
.hd-top { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .7rem; }
.hd-no { display: inline-flex; gap: .35rem; align-items: center; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: .28rem .8rem; font-size: .85rem; font-weight: 600; text-decoration: none; }
.hd-no strong { font-weight: 800; }
.hd-grade { display: inline-flex; font-size: .74rem; font-weight: 700; padding: .2rem .62rem; border-radius: 999px; line-height: 1.4; }
.g-sahih { background: #e3f6ec; color: #12784a; }
.g-hasan { background: #e6f0fb; color: #1f5fa8; }
.g-daif  { background: #fdf0df; color: #a8560f; }
.g-mawdu { background: #fde8e8; color: #b42318; }
.hd-star { color: var(--gold); display: inline-flex; }
.hd-acts { margin-left: auto; display: flex; gap: .15rem; }
.hd-ar { font-family: var(--font-ar); font-size: calc(1.5rem * var(--s)); line-height: 2.1; text-align: right; direction: rtl; color: var(--ink); margin: .1rem 0 .4rem; }
.hd-tr { border-top: 1px dashed var(--line); padding-top: .75rem; margin-top: .75rem; }
.hd-ar + .hd-tr { margin-top: .4rem; }
.hd-top + .hd-tr { border-top: 0; padding-top: 0; margin-top: 0; }
.hd-narr { margin: 0 0 .35rem; color: var(--brand); font-weight: 700; font-size: calc(.95rem * var(--s)); display: flex; gap: .35rem; align-items: center; }
.hd-text { color: var(--ink-2); line-height: 1.9; font-size: calc(1.04rem * var(--s)); overflow-wrap: anywhere; }
.hd-en .hd-text { line-height: 1.75; }
.hd-card mark { background: #ffec99; color: inherit; border-radius: 3px; padding: 0 .12em; }
.hd-foot { display: flex; gap: .5rem .8rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--line-2); font-size: .82rem; color: var(--muted); }
.hd-ref { font-weight: 700; color: var(--ink-2); }
.hd-note { font-size: .78rem; }
.hd-open { margin-left: auto; font-weight: 700; display: inline-flex; gap: .25rem; align-items: center; }
.hd-card.is-big { padding: 1.5rem 1.7rem 1.2rem; border-radius: 22px; box-shadow: 0 10px 30px rgba(11,107,85,.07); }
.hd-card.is-big .hd-ar { font-size: calc(1.85rem * var(--s)); line-height: 2.2; }
.hd-card.is-big .hd-text { font-size: calc(1.14rem * var(--s)); }
/* the reader chooses the languages */
.hd-page.hide-ar .hd-ar, .hd-page.hide-bn .hd-bn, .hd-page.hide-en .hd-en { display: none; }
.hd-page.hide-en .hd-card.no-bn .hd-en, .hd-page.hide-bn .hd-card.no-en .hd-bn { display: block; }
.hd-page.hide-ar .hd-top + .hd-tr { border-top: 0; padding-top: 0; margin-top: 0; }

/* hadith of the day */
.hd-day { margin-top: 1.8rem; }
.hd-day-h { display: flex; gap: .7rem; align-items: center; margin-bottom: .8rem; }
.hd-day-h h2 { margin: 0; font-size: 1.25rem; }
.hd-day-h small { color: var(--muted); }
.hd-day-i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: 0 0 auto; }
.hd-day .hd-card { border-color: rgba(192,138,35,.5); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 160px); }

/* single page */
.hd-single .hd-tools { margin-top: 1.2rem; }
.hd-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.hd-pn { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 0; }
.hd-pn a { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; max-width: 48%; min-width: 0; }
.hd-pn a:hover { border-color: var(--brand-2, var(--brand)); }
.hd-pn a.nx { margin-left: auto; text-align: right; }
.hd-pn small { display: block; color: var(--muted); font-size: .78rem; }
.hd-pn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* the home page */
.hd-home-card { position: relative; background: linear-gradient(135deg, var(--surface), var(--brand-soft)); border: 1px solid var(--line); border-radius: 24px; padding: 1.7rem 1.9rem 1.2rem; overflow: hidden; }
.hd-home-card::before { content: '\201C'; position: absolute; top: -.6rem; right: 1.2rem; font-size: 8rem; line-height: 1; color: var(--gold); opacity: .18; font-family: Georgia, serif; pointer-events: none; }
.hd-home-card .hd-ar { font-size: 1.55rem; margin-bottom: .6rem; }
.hd-home-card .hd-narr { font-size: .95rem; }
.hd-home-text { font-size: 1.1rem; line-height: 1.9; color: var(--ink); }
.hd-home-card footer { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.hd-home-ref { font-weight: 700; display: inline-flex; gap: .35rem; align-items: center; }
.hd-home-card .spacer { flex: 1; }

:root[data-theme="dark"] .g-sahih { background: rgba(18,120,74,.22); color: #7fdcae; }
:root[data-theme="dark"] .g-hasan { background: rgba(31,95,168,.25); color: #9cc6f5; }
:root[data-theme="dark"] .g-daif  { background: rgba(168,86,15,.25); color: #f3bd82; }
:root[data-theme="dark"] .g-mawdu { background: rgba(180,35,24,.25); color: #f5a39b; }
:root[data-theme="dark"] .hd-card mark { background: rgba(232,185,73,.35); }

@media (max-width: 720px) {
  .hd-card { padding: .95rem 1rem .85rem; border-radius: 16px; }
  .hd-card.is-big { padding: 1.1rem 1.1rem 1rem; }
  .hd-ar { font-size: calc(1.32rem * var(--s)); }
  .hd-card.is-big .hd-ar { font-size: calc(1.55rem * var(--s)); }
  .hd-chapters { grid-template-columns: minmax(0, 1fr); }
  .hd-search { border-radius: 14px; padding-left: .8rem; }
  .hd-search select { flex: 1 1 140px; }
  .hd-home-card { padding: 1.2rem 1.1rem 1rem; }
  .hd-pn a { max-width: none; flex: 1 1 0; }
}
