/* Gematrixx v18 — Arabic Gematria result cards
   Visual parity with the Quran Arabic-gematria result grid.
   Scope is intentionally limited to #pageGematriaAR to avoid cross-page regressions. */

#pageGematriaAR #resultsSection{
  width:100%;
  margin-top:1rem;
}

#pageGematriaAR #resultsGrid{
  --ar-result-cols:6;
  width:100% !important;
  max-width:100% !important;
  margin:0 auto !important;
  display:grid !important;
  grid-template-columns:repeat(var(--ar-result-cols), minmax(0,1fr)) !important;
  gap:.72rem !important;
  direction:rtl !important;
  align-items:stretch !important;
}

#pageGematriaAR #resultsGrid .ar-quran-result-card{
  --ar-card-color:var(--gold2);
  width:100% !important;
  min-width:0 !important;
  min-height:106px !important;
  box-sizing:border-box !important;
  position:relative !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:.24rem !important;
  padding:.82rem .62rem .72rem !important;
  background:var(--bg3) !important;
  border:1px solid var(--bdr) !important;
  border-radius:10px !important;
  text-align:center !important;
  direction:rtl !important;
  box-shadow:none !important;
  transition:border-color .15s ease, transform .12s ease, background .15s ease !important;
}

#pageGematriaAR #resultsGrid .ar-quran-result-card::before{
  content:"";
  position:absolute;
  top:0;
  inset-inline:0;
  height:2px;
  background:var(--ar-card-color) !important;
  opacity:.95;
}

#pageGematriaAR #resultsGrid .ar-quran-result-card:hover{
  border-color:color-mix(in srgb,var(--ar-card-color) 55%,var(--bdr2)) !important;
  transform:translateY(-1px) !important;
}

#pageGematriaAR #resultsGrid .ar-quran-result-card.open{
  border-color:var(--ar-card-color) !important;
  background:color-mix(in srgb,var(--bg3) 94%,var(--ar-card-color) 6%) !important;
}

#pageGematriaAR #resultsGrid .ar-quran-result-card .rc-name{
  order:1 !important;
  min-height:2.9em !important;
  margin:0 0 .08rem !important;
  padding:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  color:var(--gold2) !important;
  font-family:var(--font-main) !important;
  font-size:.72rem !important;
  font-weight:700 !important;
  line-height:1.42 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  cursor:pointer !important;
}

#pageGematriaAR #resultsGrid .ar-quran-result-card .rc-val{
  order:2 !important;
  margin:.02rem 0 0 !important;
  padding:0 !important;
  color:var(--ar-card-color) !important;
  font-family:"Ubuntu Mono",var(--font-main),monospace !important;
  font-size:1.42rem !important;
  font-weight:800 !important;
  line-height:1.1 !important;
  direction:ltr !important;
  unicode-bidi:isolate !important;
  cursor:pointer !important;
}

#pageGematriaAR #resultsGrid .ar-quran-result-card .rc-dr{
  order:3 !important;
  margin:.12rem 0 0 !important;
  color:var(--txt3,var(--text-muted)) !important;
  font-family:var(--font-main) !important;
  font-size:.62rem !important;
  line-height:1.2 !important;
}

#pageGematriaAR #resultsGrid .ar-quran-result-card .rc-dr span{
  color:var(--gold2) !important;
  cursor:pointer !important;
}

/* Light theme: rely on canonical theme variables, with a subtle visible surface. */
html[data-theme="light"] #pageGematriaAR #resultsGrid .ar-quran-result-card{
  background:var(--bg3) !important;
  border-color:var(--bdr) !important;
}

/* Tablet/mobile are intentionally independent from the desktop column selector. */
@media(max-width:1050px){
  #pageGematriaAR #resultsGrid{grid-template-columns:repeat(4,minmax(0,1fr)) !important;gap:.6rem !important}
}
@media(max-width:720px){
  #pageGematriaAR #resultsGrid{grid-template-columns:repeat(3,minmax(0,1fr)) !important;gap:.55rem !important}
  #pageGematriaAR #resultsGrid .ar-quran-result-card{min-height:100px !important;padding:.72rem .48rem .64rem !important}
  #pageGematriaAR #resultsGrid .ar-quran-result-card .rc-name{font-size:.68rem !important}
  #pageGematriaAR #resultsGrid .ar-quran-result-card .rc-val{font-size:1.28rem !important}
}
@media(max-width:500px){
  #pageGematriaAR #resultsGrid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:.5rem !important}
  #pageGematriaAR #resultsGrid .ar-quran-result-card{min-height:96px !important}
}
