/* Gematrixx V75 — Quran root summary + Quran number results hardening. */

/* Root morphology summary: never render the entire breakdown as one long line. */
#pageQuran #pg-explore .root-breakdown{overflow:hidden}
#pageQuran #pg-explore .rb-list{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:.5rem .65rem;
  width:100%;
  max-width:100%;
  text-align:right;
}
#pageQuran #pg-explore .rb-gap{display:none!important}
#pageQuran #pg-explore .rb-line.rb-jump{
  width:100%!important;
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:.55rem!important;
  padding:.48rem .7rem!important;
  margin:0!important;
  border:1px solid var(--bdr)!important;
  border-radius:9px!important;
  background:var(--bg3)!important;
  color:var(--txt)!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  line-height:1.8!important;
  text-align:right!important;
}
#pageQuran #pg-explore .rb-line.rb-jump:hover,
#pageQuran #pg-explore .rb-line.rb-jump:focus-visible,
#pageQuran #pg-explore .rb-line.rb-jump.active{
  border-color:var(--gold-dim)!important;
  background:rgba(201,168,76,.10)!important;
  color:var(--gold2)!important;
}
#pageQuran #pg-explore .rb-jump-arrow{
  margin-inline-start:auto!important;
  flex:0 0 auto;
  color:var(--gold2)!important;
}

/* Quran number results: desktop Surah column must not squeeze names. */
#pageQuran #pg-numbers .qnum-table th:nth-child(2),
#pageQuran #pg-numbers .qnum-table td:nth-child(2),
#pageQuran #pg-numbers #fracThead th:nth-child(2),
#pageQuran #pg-numbers #fracBody td:nth-child(2){
  min-width:112px!important;
  width:118px!important;
  max-width:128px!important;
  white-space:nowrap!important;
}

@media(max-width:820px){
  #pageQuran #pg-explore .rb-list{grid-template-columns:minmax(0,1fr)!important}
  #pageQuran #pg-explore .root-breakdown{padding:1rem .8rem!important}

  #pageQuran #pg-numbers .qnum-results-panel{width:100%!important;max-width:100%!important;overflow:visible!important}
  #pageQuran #pg-numbers .qnum-mobile-wrap{overflow:visible!important;border:0!important;background:transparent!important}
  #pageQuran #pg-numbers table.qnum-mobile-cards{
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
    table-layout:auto!important;border-collapse:separate!important
  }
  #pageQuran #pg-numbers table.qnum-mobile-cards>thead{display:none!important}
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:.75rem!important;width:100%!important
  }
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;min-width:0!important;
    border:1px solid var(--bdr)!important;border-radius:13px!important;
    background:var(--bg2)!important;overflow:hidden!important
  }
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td{
    display:block!important;width:auto!important;min-width:0!important;
    padding:.58rem .65rem!important;margin:0!important;
    border:0!important;border-bottom:1px solid var(--bdr)!important;
    background:transparent!important;position:relative!important;
    white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
    word-break:normal!important;overflow-wrap:normal!important;text-align:right!important;
    line-height:1.55!important
  }
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td::before{
    content:attr(data-label)!important;display:block!important;margin:0 0 .18rem!important;
    color:var(--gold2)!important;font-family:var(--font-main)!important;font-size:.68rem!important;
    font-weight:800!important;line-height:1.4!important;text-align:right!important;direction:rtl!important
  }
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td:nth-child(odd){border-inline-end:1px solid var(--bdr)!important}
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td[colspan]{
    grid-column:1/-1!important;display:block!important;text-align:center!important;border-inline-end:0!important
  }
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td[colspan]::before{content:none!important}

  /* Verse text receives the whole row; this prevents collisions with compact metadata fields. */
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td.qnum-verse-cell,
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td.qnum-ayah-link{
    grid-column:1/-1!important;
    border-inline-end:0!important;
    padding:.75rem .8rem .85rem!important;
    font-family:"Amiri",var(--font-main),serif!important;
    font-size:1.08rem!important;line-height:2!important;
    direction:rtl!important;text-align:right!important;
    background:var(--bg3)!important;
    cursor:pointer!important
  }
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td.qnum-verse-cell::before,
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td.qnum-ayah-link::before{
    font-family:var(--font-main)!important;font-size:.7rem!important;line-height:1.4!important;
    margin-bottom:.35rem!important
  }
  #pageQuran #pg-numbers .qnum-open-ayah{
    position:absolute!important;top:.55rem!important;left:.65rem!important;
    margin:0!important;font-size:.78rem!important
  }
  #pageQuran #pg-numbers .qnum-surah-cell{
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important
  }
  #pageQuran #pg-numbers .qnum-table th:nth-child(2),
  #pageQuran #pg-numbers .qnum-table td:nth-child(2),
  #pageQuran #pg-numbers #fracThead th:nth-child(2),
  #pageQuran #pg-numbers #fracBody td:nth-child(2){min-width:0!important;width:auto!important}

  #pageQuran #pg-numbers .qnum-result-controls{
    position:sticky!important;top:6px!important;z-index:20!important;
    margin:.2rem 0 .7rem!important
  }
}

@media(max-width:430px){
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr{grid-template-columns:minmax(0,1fr)!important}
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td{border-inline-end:0!important}
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td.qnum-verse-cell,
  #pageQuran #pg-numbers table.qnum-mobile-cards>tbody>tr>td.qnum-ayah-link{grid-column:auto!important}
}


/* V217 — Quran table sequence/surah column normalization. */
#pageQuran table :is(th,td).quran-seq-col{
  box-sizing:border-box!important;
  width:56px!important;
  min-width:56px!important;
  max-width:64px!important;
  padding-inline:.45rem!important;
  white-space:nowrap!important;
  word-break:keep-all!important;
  overflow-wrap:normal!important;
  text-align:center!important;
  font-variant-numeric:tabular-nums;
}
#pageQuran table :is(th,td).quran-surah-col{
  box-sizing:border-box!important;
  width:118px!important;
  min-width:104px!important;
  max-width:128px!important;
  padding-inline:.55rem!important;
  white-space:nowrap!important;
  word-break:keep-all!important;
  overflow-wrap:normal!important;
}
@media(max-width:820px){
  #pageQuran table :is(th,td).quran-seq-col{
    width:auto!important;min-width:0!important;max-width:none!important;
  }
  #pageQuran table :is(th,td).quran-surah-col{
    width:auto!important;min-width:0!important;max-width:none!important;
  }
  #pageQuran #pg-numbers table.qnum-mobile-cards :is(th,td).quran-seq-col,
  #pageQuran #pg-numbers table.qnum-mobile-cards :is(th,td).quran-surah-col{
    white-space:normal!important;
  }
}
