/* Gematrixx V83 — canonical Quran Explore result layout.
   Semantic cell classes are emitted by app.js, so this does not depend on nth-child
   positions or the generic mobile table transformer. */

@media (max-width:820px){
  #pageQuran #pg-explore .tw,
  #pageQuran #pg-explore .tw.root-morph-wrap{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
  }
  #pageQuran #pg-explore .tw>table{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
  }
  #pageQuran #pg-explore .tw>table>thead{display:none!important}
  #pageQuran #pg-explore #srchBody{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  #pageQuran #pg-explore #srchBody>tr.qe-row{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 0 .78rem!important;
    padding:0!important;
    border:1px solid var(--bdr,var(--border))!important;
    border-radius:12px!important;
    overflow:hidden!important;
    background:var(--bg2,var(--bg-card))!important;
  }
  #pageQuran #pg-explore #srchBody>tr.qe-row>td{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:.75rem!important;
    order:20;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    padding:.57rem .72rem!important;
    border:0!important;
    border-bottom:1px solid var(--bdr,var(--border))!important;
    background:transparent!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    position:static!important;
    text-align:left!important;
    line-height:1.55!important;
  }
  #pageQuran #pg-explore #srchBody>tr.qe-row>td::before{
    content:attr(data-qe-label)!important;
    color:var(--gold2,var(--gold))!important;
    font-family:var(--font-main)!important;
    font-size:.72rem!important;
    font-weight:800!important;
    white-space:nowrap!important;
    flex:0 0 auto!important;
    direction:rtl!important;
    text-align:right!important;
  }
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-index,
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-surah-order{display:none!important}

  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-verse{
    display:block!important;
    order:1!important;
    direction:rtl!important;
    text-align:right!important;
    font-family:'Amiri',var(--font-main),serif!important;
    font-size:1.18rem!important;
    line-height:2.05!important;
    padding:.84rem .78rem!important;
    background:var(--bg3,var(--bg-card))!important;
  }
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-verse::before{
    display:block!important;
    margin-bottom:.24rem!important;
  }
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-surah{order:2!important}
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-ayah{order:3!important}
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-g1{order:4!important}
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-gsmall{order:5!important}
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-hijai-order{order:6!important}
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-hijai-reduced{order:7!important}
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-words{order:8!important}
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-letters{order:9!important}
  #pageQuran #pg-explore #srchBody>tr.qe-row>.qe-juz{order:10!important;border-bottom:0!important}

  #pageQuran #pg-explore #srchBody>tr.root-morph-section-row{
    display:block!important;
    width:100%!important;
    margin:.9rem 0 .55rem!important;
  }
  #pageQuran #pg-explore #srchBody>tr.root-morph-section-row>td{
    display:block!important;
    width:100%!important;
    padding:0!important;
    border:0!important;
  }
}

@media (min-width:821px){
  /* The Quran page title/description must scroll normally. The global .hdr rule is
     sticky site-wide, which previously made the wrong row remain on screen. */
  #pageQuran > .hdr{
    position:relative!important;
    top:auto!important;
    z-index:auto!important;
  }

  #pageQuran #pg-explore .tw{
    overflow:visible!important;
  }
  #pageQuran #pg-explore .tw>table{
    width:100%!important;
  }
  /* The visible sticky header is the viewport-fixed clone below. Keep the source
     header normal so there is only one fixed row and no browser-specific sticky
     table behavior. */
  #pageQuran #pg-explore .tw>table>thead th{
    position:static!important;
    top:auto!important;
    z-index:auto!important;
  }

  #quranExploreStickyHead83{
    position:fixed!important;
    display:none;
    overflow:hidden!important;
    z-index:510!important;
    pointer-events:none!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:0 8px 18px rgba(0,0,0,.22)!important;
  }
  #quranExploreStickyHead83.is-visible{display:block!important}
  #quranExploreStickyHead83 table{
    margin:0!important;
    border-collapse:collapse!important;
    table-layout:fixed!important;
    direction:rtl!important;
    background:var(--bg3,var(--bg-card))!important;
  }
  #quranExploreStickyHead83 thead{display:table-header-group!important}
  #quranExploreStickyHead83 tr{display:table-row!important}
  #quranExploreStickyHead83 th{
    box-sizing:border-box!important;
    padding:.6rem .7rem!important;
    font-size:.85rem!important;
    line-height:1.45!important;
    color:var(--gold2,var(--gold))!important;
    background:var(--bg3,var(--bg-card))!important;
    border-bottom:1px solid var(--bdr,var(--border))!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    position:static!important;
  }
}
