/* fawz-ipad (23 Oct 2026): iPad / wide-screen layout for the whole Al Mutawwa app.
   Linked with media="(min-width:768px) and (min-height:600px)": phones (portrait and landscape) never apply it.
   Same colours, cards, art and icons; only width, columns, the landscape side rail and a slightly larger type scale. */
:root{--j-maxw:880px;--j-gutter:32px}
:root:has(>body.j-app){font-size:118.75%} /* not the Quran reader: its fit (fawz-qfit) owns its sizes */

/* ---------- landscape: bottom tab bar becomes a side rail (RTL: right edge) ---------- */
@media (orientation:landscape) and (min-width:1024px){
  :root{--fz-rail:100px;--j-maxw:1120px}
  .j-tabbar{top:0;bottom:0;inset-inline-start:0;inset-inline-end:auto;width:var(--fz-rail);display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;gap:8px;padding:calc(var(--j-safe-t) + 22px) 0 calc(var(--j-safe-b) + 16px);box-shadow:none;border-inline-end:.5px solid var(--j-separator)}
  .j-tabbar a{flex:none;flex-direction:column;justify-content:center;align-items:center;gap:5px;height:auto;min-height:76px;margin:0 10px;padding:8px 4px;border-radius:16px;font-size:var(--j-fs-footnote);line-height:1.2;text-align:center}
  .j-tabbar a .ji{width:28px;height:28px}
  .j-tabbar a[aria-current="page"]{background:var(--j-tint-soft)}
  .j-app{padding-bottom:calc(var(--j-safe-b) + 32px)}
  /* fawzimp5: rail space only while the tab bar is really shown (Fawz hides it: home menu grid) - else every page sat 100px off-centre */
  .j-app:has(.j-tabbar:not([hidden])){padding-inline-start:var(--fz-rail)}
  .j-app:has(.j-tabbar:not([hidden])) .j-nav{inset-inline-start:var(--fz-rail)}
  .j-app .j-toast{bottom:calc(var(--j-safe-b) + 24px)}
}

/* ---------- Prayer: next-prayer hero and today's times side by side ---------- */
@media (min-width:900px){
  .p-page .j-main{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);column-gap:28px;align-items:start;grid-auto-flow:row dense}
  .p-page .j-main>*{grid-column:1/-1;min-width:0}
  .p-page .j-main>.p-hero,.p-page .j-main>.p-sound{grid-column:1}
  .p-page .j-main>.j-section:has(#times){grid-column:2;grid-row:span 4;margin-top:0}
  .p-page .j-main>.p-qibla{grid-column:1}
}

/* ---------- Adhkar: 3 columns of categories (4 in landscape); reading card text in a comfortable line ---------- */
.cats{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.ad-names{grid-template-columns:repeat(4,minmax(0,1fr))}
.akp .akp-body>*{width:100%;max-width:720px;margin-left:auto;margin-right:auto}
.akp .zx{font-size:calc(var(--zs) * 1.12 * var(--akp-k,1))}
.akp .zx.zq-only{font-size:calc(var(--zs) * 1.18 * var(--akp-k,1))}
.akp .tap{width:100%;max-width:720px;margin-left:auto;margin-right:auto}
@media (orientation:landscape) and (min-width:1024px){
  .cats{grid-template-columns:repeat(4,minmax(0,1fr))}
  .ad-names{grid-template-columns:repeat(5,minmax(0,1fr))}
}

/* ---------- Hadith: two columns of cards in landscape ---------- */
@media (orientation:landscape) and (min-width:1024px){
  .h-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:16px}
  .h-list>.h-card{display:flex;flex-direction:column}
  .h-list>.h-card>.h-acts{margin-top:auto} /* fawz500b49: side-by-side cards end on one line (a short hadith left a big empty gap under its card) */
  .h-list>:not(.h-card){grid-column:1/-1}
}

/* ---------- Tools: 3 columns (4 in landscape), bigger map card ---------- */
.j-tiles{gap:14px}
@media (orientation:landscape) and (min-width:1024px){
  .j-tiles{grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* ---------- Quran reader ---------- */
/* portrait: one full page, width + fit from fawz-qfit (unchanged) */
/* landscape spread (quran.js adds .q-spread): two pages side by side, thin centre line, right page first */
.paged.q-spread main{max-width:none;left:max(44px,env(safe-area-inset-left));right:max(44px,env(safe-area-inset-right));margin:0;padding:0}
.paged.q-spread .pages{column-rule:1px solid color-mix(in srgb,var(--ink,#3a2a1a) 16%,transparent)}
.q-spread .runhead{max-width:none;padding-left:max(44px,env(safe-area-inset-left));padding-right:max(44px,env(safe-area-inset-right))}
