/* IHA R244 — Quran & Hadis integrated into standard internal-page shell.
   Loaded by quran-hadith.php AFTER existing feature CSS; no JS/DB changes.
   Scope: public Quran/Hadis only. All result-rendering/reader controls remain intact. */
body.qh-page { background:#fbfaf7; }
body.qh-page .qh-main.qh-r244 { display:block; max-width:none; width:100%; margin:0; padding:0 0 60px; min-width:0; }
body.qh-page .qh-r244 * { box-sizing:border-box; }
/* Use the exact shared .page-hero and .wrap cascade from public/assets/css/main.css;
   no QH-only fixed height / independent hero graphic. */
body.qh-page .qh-r244 > .qh-hero.page-hero {
  display:flex; align-items:center; position:relative; overflow:hidden;
  border:0; border-radius:0; margin:0; width:100%; max-width:none;
  padding:0!important; min-height:0!important; height:auto!important;
  color:#fff; box-shadow:none;
}
body.qh-page .qh-r244 > .qh-hero.page-hero .wrap { position:relative; z-index:1; }
body.qh-page .qh-r244 > .qh-hero.page-hero h1 { color:#fff!important; max-width:none; }
body.qh-page .qh-r244 .qh-breadcrumb { display:flex;align-items:center;flex-wrap:wrap;gap:9px;color:#e6c26c!important; }
body.qh-page .qh-r244 .qh-breadcrumb a { color:inherit!important;text-decoration:none; }
body.qh-page .qh-r244 .qh-breadcrumb a:hover { text-decoration:underline; }
/* Width/rhythm matches Referensi and Perpustakaan Digital. */
body.qh-page .qh-r244 > :not(.qh-hero):not(.qh-intro) {
  width:min(1120px,calc(100% - 48px)); max-width:1120px;
  margin-left:auto; margin-right:auto; min-width:0;
}
body.qh-page .qh-r244 > .qh-intro {
  width:min(1120px,calc(100% - 48px)); max-width:1120px;
  margin:30px auto 20px; color:#66776e; font:400 clamp(15px,1.7vw,19px)/1.7 system-ui,-apple-system,'Segoe UI',sans-serif;
}
body.qh-page .qh-r244 .qh-tabs { display:flex;gap:10px;flex-wrap:wrap;margin-top:0;margin-bottom:21px;padding:0; }
body.qh-page .qh-r244 .qh-tabs > a {
  display:inline-flex; flex:0 1 auto; align-items:center;justify-content:center;
  min-height:46px; padding:11px 23px;border:1px solid #d2ddd5;
  border-radius:999px;background:transparent;color:#245c45;
  font:700 16px/1.3 system-ui,-apple-system,'Segoe UI',sans-serif;
  text-align:center;text-decoration:none;white-space:normal; box-shadow:none;
}
body.qh-page .qh-r244 .qh-tabs > a span { display:none; }
body.qh-page .qh-r244 .qh-tabs > a[aria-current="page"] {
  background:#00613e;color:#fff;border-color:#00613e;box-shadow:0 2px 5px rgba(0,69,42,.09);
}
body.qh-page .qh-r244 .qh-tabs > a:not([aria-current]):hover {background:#edf5ee;}
body.qh-page .qh-r244 .qh-activities {
  display:flex; gap:7px; align-items:center; overflow-x:auto; scrollbar-width:thin;
  margin-top:0;margin-bottom:22px; padding:0 0 10px; border:0; border-bottom:1px solid #e0e6e0;
}
body.qh-page .qh-r244 .qh-activities > a {
  flex:0 0 auto; min-height:40px;padding:9px 16px;display:inline-flex;align-items:center;justify-content:center;
  background:#fff; color:#456554; border:1px solid #d8e2da;border-radius:999px;
  font:650 13px/1.35 system-ui,-apple-system,'Segoe UI',sans-serif;text-decoration:none;
}
body.qh-page .qh-r244 .qh-activities > a[aria-current="page"] {background:#edf5ee;border-color:#8fbba3;color:#075338;}
body.qh-page .qh-r244 .qh-search-panel {
  max-width:1120px; padding:clamp(19px,3vw,30px); margin-top:0;
  background:#fff; border:1px solid #d9e4dc; border-top:3px solid #00613e;
  border-radius:15px; box-shadow:0 8px 26px rgba(19,62,40,.04);
}
body.qh-page .qh-r244 .qh-panel-heading { margin-bottom:20px; }
body.qh-page .qh-r244 .qh-panel-heading h2 { color:#0a4933; font-family:Literata,Georgia,serif;font-weight:700; font-size:clamp(22px,2.5vw,30px); }
body.qh-page .qh-r244 .qh-form :is(input,select,textarea) {max-width:100%;}
body.qh-page .qh-r244 .qh-form :is(input,select) {min-width:0;}
body.qh-page .qh-r244 .qh-form input[type="search"] {width:100%;}
body.qh-page .qh-r244 .qh-primary {background:#00613e;}
body.qh-page .qh-r244 .qh-search-refine .qh-search-panel { width:100%; }
body.qh-page .qh-r244 .qh-results {scroll-margin-top:86px;}
body.qh-page .qh-r244 :is(a,button,input,select,summary):focus-visible {outline:3px solid #bd9b42;outline-offset:3px;}
@media (min-width:701px) and (max-width:1100px){
 body.qh-page .qh-r244 > :not(.qh-hero):not(.qh-intro),body.qh-page .qh-r244 > .qh-intro{width:calc(100% - 48px);}
}
@media (max-width:700px){
 body.qh-page .qh-r244 > :not(.qh-hero):not(.qh-intro),body.qh-page .qh-r244 > .qh-intro{width:calc(100% - 36px);}
 body.qh-page .qh-r244 > .qh-intro{margin:23px auto 19px;font-size:14px;line-height:1.65;}
 body.qh-page .qh-r244 .qh-tabs{flex-wrap:nowrap;gap:8px;margin-bottom:16px;}
 body.qh-page .qh-r244 .qh-tabs > a{flex:1 1 0;min-width:0;min-height:43px;padding:10px 8px;font-size:clamp(12px,3.45vw,15px);}
 body.qh-page .qh-r244 .qh-activities{margin-bottom:17px;}
 body.qh-page .qh-r244 .qh-activities > a{font-size:12px;padding:8px 13px;}
 body.qh-page .qh-r244 .qh-search-panel{padding:19px 16px;}
 body.qh-page .qh-r244 .qh-panel-heading{gap:10px;flex-wrap:wrap;align-items:start;}
 body.qh-page .qh-r244 .qh-panel-heading h2{font-size:clamp(21px,5.6vw,26px);}
 body.qh-page .qh-r244 .qh-form :is(input:not([type=radio]):not([type=checkbox]),select){font-size:16px;}
}
@media (max-width:360px){
 body.qh-page .qh-r244 .qh-tabs > a{font-size:12px;padding:9px 5px;}
 body.qh-page .qh-r244 .qh-panel-heading{display:block;}
 body.qh-page .qh-r244 .qh-panel-heading .qh-pill{display:inline-block;margin-top:8px;}
}
@media (prefers-reduced-motion:reduce){body.qh-page .qh-r244 *{scroll-behavior:auto!important;transition:none!important;}}

/* R365 | Unified scholarly reading and search layout. Scoped to the existing
   IHA hadith pages: the mushaf engine and its geometry remain unchanged. */
body.qh-page.qh-hadith-page .qh-main.qh-r244{
  width:100%;max-width:1510px;margin-inline:auto;
  padding-inline:clamp(14px,2.8vw,46px);box-sizing:border-box;
}
body.qh-page.qh-hadith-page .qh-r244 > :not(.qh-hero):not(.qh-intro){
  max-width:none;width:100%;box-sizing:border-box;
}
body.qh-page.qh-hadith-page .qh-r244 .qh-tabs{
  gap:9px;margin-block:16px 19px;
}
body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-family{
  max-width:none;margin-block:12px;border-radius:13px;overflow:hidden;
}
body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-family>header{
  min-height:0;padding:12px clamp(13px,2vw,24px);gap:12px;
}
body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-family>header :is(h2,p){margin-block:0}
body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-family>header .qh-source-ar{
  font-size:clamp(19px,1.6vw,24px);line-height:1.6;
}
body.qh-page.qh-hadith-page .qh-r244 .qh-compact-table,
body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-table{width:100%;table-layout:auto}
body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-table :is(th,td){vertical-align:middle}
body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-table tr>td:nth-child(2){min-width:0;width:76%}
body.qh-page.qh-hadith-page .qh-r244 .qh-compact-excerpt,
body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-table .qh-table-verse{
  line-height:1.9;overflow-wrap:anywhere;
}
body.qh-page.qh-hadith-page .qh-r244 .qh-card{
  padding:clamp(15px,2.1vw,28px);
  border-radius:14px;
}
body.qh-page.qh-hadith-page .qh-r244 .qh-card-top{margin-bottom:9px}
body.qh-page.qh-hadith-page .qh-r244 .qh-card h2{margin-block:10px 14px}
body.qh-page.qh-hadith-page .qh-r244 .qh-card .qh-source-heading{gap:6px}
body.qh-page.qh-hadith-page .qh-r244 .qh-card .qh-prose{max-width:min(100%,1000px)}
body.qh-page.qh-hadith-page .qh-r244 .qh-back,
body.qh-page.qh-hadith-page .qh-r244 > a.qh-back{
  display:inline-flex!important;width:auto!important;max-width:100%;min-height:44px;
  align-items:center;justify-content:center;vertical-align:middle;
  margin:0 12px 14px 0!important;padding:9px 16px!important;
  border:1px solid #b8cec0!important;border-radius:999px!important;
  background:#f4f8f1!important;color:#174e36!important;
  text-decoration:none!important;font:600 14px/1.5 system-ui,sans-serif!important;
  box-shadow:0 2px 8px #13462d0a!important;
  transition:background .16s ease,border-color .16s ease;
}
body.qh-page.qh-hadith-page .qh-r244 .qh-back:hover{background:#e7f1e7!important;border-color:#7da68e!important}
body.qh-page.qh-hadith-page .qh-r244 .scripture-reading-controls{
  display:inline-block;vertical-align:middle;width:min(100%,340px);max-width:100%;
  margin:0 0 14px!important;border:1px solid #d6e3d7;border-radius:10px;
  background:#fffdf7;box-sizing:border-box;
}
body.qh-page.qh-hadith-page .qh-r244 .scripture-reading-controls>summary{
  min-height:44px;display:flex;align-items:center;padding:9px 13px;
  font:600 13px/1.5 system-ui,sans-serif;cursor:pointer;
}
body.qh-page.qh-hadith-page .qh-r244 .scripture-reading-controls[open]{display:block;width:min(100%,580px)}
body.qh-page.qh-hadith-page .qh-r244 .scripture-reading-controls>div{padding:12px 14px}
.qh-page .qh-r365-verified-excerpt{display:block;font-size:clamp(17px,1.6vw,21px);line-height:1.85;text-align:right;unicode-bidi:isolate}
.qh-page .qh-r365-excerpt-kind{display:block;margin-top:4px;color:#65776b;font:11px/1.5 system-ui,sans-serif}
@media(max-width:700px){
 body.qh-page.qh-hadith-page .qh-main.qh-r244{padding-inline:12px}
 body.qh-page.qh-hadith-page .qh-r244 > :not(.qh-hero):not(.qh-intro){width:100%!important}
 body.qh-page.qh-hadith-page .qh-r244 .qh-back{margin-bottom:9px!important}
 body.qh-page.qh-hadith-page .qh-r244 .scripture-reading-controls{display:block;width:100%}
 body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-family>header{padding:12px;flex-wrap:wrap}
 body.qh-page.qh-hadith-page .qh-r244 .qh-hadith-family .qh-compact-excerpt{font-size:clamp(17px,4.3vw,21px)}
}
@media(prefers-reduced-motion:reduce){body.qh-page.qh-hadith-page .qh-r244 .qh-back{transition:none}}

/* R365 | Sharh explanations remain below the Arabic size of the matn in the
   existing source-reading dialog. The original matn size control is unchanged. */
body.qh-page .qh-reading-dialog .qh-reader-explanation :is(.qh-hadith-record-body,.qh-prose,.qh-prose-paragraph,.qh-arabic),
body.qh-page .qh-reading-dialog .qh-reader-explanations .qh-hadith-record-body :is(.qh-prose,.qh-prose-paragraph,.qh-arabic){
  font-size:clamp(16px,calc(var(--search-arabic-size,28px)*.82),25px)!important;
  line-height:2.05!important;
}

/* Dedicated Tafsir/Syarah reading-dialog views also retain the primary-text
   hierarchy when opened from a search result rather than an inline action. */
body.qh-page .qh-reading-dialog.qh-reader-commentary .qh-reader-scroll :is(.qh-prose,.qh-prose-paragraph,.qh-arabic){
 font-size:clamp(16px,calc(var(--search-arabic-size,28px)*.82),25px)!important;
 line-height:2.05!important;
}

/* Mobile width rules must not expand the Back action into a full-width bar. */
body.qh-page.qh-hadith-page .qh-main.qh-r244 > a.qh-back{
 width:fit-content!important;max-width:100%!important;
}

/* R366 — give scholarly search results the available laptop width instead of
 * trapping both the Quran and Hadith result lists in the former narrow shell.
 * The reading-mode mushaf has its own layout and is not changed here. */
@media(min-width:901px){
 body.qh-page:not(.qh-reading-mode) .qh-r244> :is(.qh-tabs,.qh-search-panel,.qh-results,.qh-search-history,.scripture-reading-controls,.qh-result-heading){
  width:min(1280px,calc(100% - 56px));max-width:1280px;
  margin-inline:auto;min-width:0;
 }
 body.qh-page:not(.qh-reading-mode) .qh-r244>.qh-results :is(.qh-hadith-family,.qh-compact-shell){
  max-width:100%; min-width:0;
 }
}
