/* Hadith finder (loaded only on the hadith page). */
.sq-hadith { line-height: normal; }
.sq-hadith p { margin: 0; }
.sq-hd-body { display: flex; flex-direction: column; gap: 28px; padding-top: 40px; padding-bottom: 90px; max-width: 980px; }
.sq-hd-h2 { margin: 0 0 14px; font-family: var(--sq-serif); font-size: clamp(26px, 3vw, 32px); font-weight: 700; color: var(--sq-teal); }
.sq-hd-note { font-size: 14px; line-height: 1.7; color: var(--sq-muted); }

/* Search form in the title band */
.sq-hd-search { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; max-width: 820px; margin: 22px auto 0; }
.sq-hd-search input[type="search"] { flex: 1 1 320px; min-width: 0; min-height: 52px; padding: 12px 20px; border-radius: 999px; border: 1px solid rgba(232, 211, 160, .45); background: #fff; font: inherit; font-size: 16px; color: var(--sq-ink); }
.sq-hd-search select { flex: 0 1 auto; min-height: 52px; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(232, 211, 160, .45); background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-size: 15px; }
.sq-hd-search select option { color: var(--sq-ink); }
.sq-hd-search button { min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--sq-gold); color: var(--sq-teal-deep); font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.sq-hd-search button:hover { filter: brightness(1.06); }
.sq-hd-search :focus-visible { outline: 2px solid var(--sq-gold-light); outline-offset: 2px; }

/* Collections */
.sq-hd-books { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.sq-hd-books a { display: flex; flex-direction: column; gap: 8px; height: 100%; box-sizing: border-box; padding: 26px 28px; border-radius: 24px; background: var(--sq-teal) url(../images/girih-10.svg) repeat; color: #fff; text-decoration: none; box-shadow: var(--sq-card-shadow); }
.sq-hd-books a:hover { filter: brightness(1.08); }
.sq-hd-book-ar { font-size: 34px; line-height: 1.6; color: var(--sq-gold-light); }
.sq-hd-book-name { font-family: var(--sq-serif); font-size: 32px; font-weight: 700; }
.sq-hd-book-meta { font-size: 15px; font-weight: 700; color: var(--sq-gold-light); }
.sq-hd-book-by { font-size: 14px; color: var(--sq-mist); }

.sq-hd-topics ul, .sq-hd-direct { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sq-hd-topics a, .sq-hd-direct a { display: inline-block; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--sq-line-2); background: #fff; color: var(--sq-teal); font-weight: 700; font-size: 15px; text-decoration: none; }
.sq-hd-topics a.sq-ur { font-family: var(--sq-urdu); font-weight: 400; line-height: 1.9; padding-block: 4px; }
.sq-hd-direct a { background: var(--sq-teal); border-color: var(--sq-teal); color: #fff; }
.sq-hd-topics a:hover { border-color: var(--sq-gold); background: var(--sq-cream); }

/* Books (kitab) list */
.sq-hd-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.sq-hd-sections a { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; height: 100%; box-sizing: border-box; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--sq-line); background: #fff; color: inherit; text-decoration: none; }
.sq-hd-sections a:hover { border-color: var(--sq-gold); }
.sq-hd-sections .sq-surah-n { grid-row: span 2; }
.sq-hd-sec-name { font-weight: 700; font-size: 16px; color: var(--sq-teal); line-height: 1.35; }
.sq-hd-sec-range { font-size: 13px; color: var(--sq-muted); }

/* Toolbar, cards */
.sq-hd-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; }
.sq-hd-count { font-size: 14px; font-weight: 600; color: var(--sq-muted); }
.sq-hd-list { display: flex; flex-direction: column; gap: 18px; }
.sq-hd-card { display: flex; flex-direction: column; gap: 16px; padding: 24px 26px; border-radius: 22px; background: #fff; border: 1px solid var(--sq-line); }
.sq-hd-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sq-hd-ref { margin: 0; font-family: var(--sq-sans); font-size: 15px; font-weight: 800; letter-spacing: .02em; color: var(--sq-gold-dark); }
.sq-hd-ref a { color: inherit; text-decoration: none; }
.sq-hd-ref a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sq-hd-actions { display: flex; gap: 8px; }
.sq-hd-btn { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--sq-line-2); background: #fff; color: var(--sq-teal); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.sq-hd-btn:hover { background: var(--sq-cream); }
.sq-hd-ar { font-size: calc(24px * var(--sq-ayah-scale, 1)); line-height: 2.05; color: var(--sq-teal); text-align: right; }
.sq-hd-en { font-size: 16.5px; line-height: 1.8; color: var(--sq-ink); }
.sq-hd-ur { font-family: var(--sq-urdu); font-size: 18px; line-height: 2.3; color: var(--sq-ink); text-align: right; }
.sq-hd-tr { padding-top: 14px; border-top: 1px solid var(--sq-line); }
.sq-hd-list[data-lang="en"] .sq-hd-ur, .sq-hd-list[data-lang="ur"] .sq-hd-en { display: none; }
.sq-hd-single .sq-hd-card { padding: 30px 32px; box-shadow: var(--sq-card-shadow); }
.sq-hd-day .sq-hd-card { border-color: var(--sq-gold); }
.sq-hd-empty { padding: 20px; border-radius: 16px; background: var(--sq-sand); }

/* Pager and prev/next */
.sq-hd-pager, .sq-hd-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px; font-size: 15px; }
.sq-hd-pager span { color: var(--sq-muted); font-weight: 600; }
.sq-hd-pager a, .sq-hd-nav a { display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--sq-line-2); background: #fff; color: var(--sq-teal); font-weight: 700; text-decoration: none; }
.sq-hd-pager a:hover, .sq-hd-nav a:hover { border-color: var(--sq-gold); background: var(--sq-cream); }

@media (max-width: 600px) {
	.sq-hd-card { padding: 18px 16px; }
	.sq-hd-single .sq-hd-card { padding: 22px 18px; }
	.sq-hd-search select { flex: 1 1 40%; }
	.sq-hd-search button { flex: 1 1 100%; }
	.sq-hd-ar { font-size: calc(21px * var(--sq-ayah-scale, 1)); }
}
