/* The app frame: library, Bible, reading-plan and commandments pages opened from the app (or in the installed app).
   Hand-written; see frame.js. Everything here is scoped to html.cnz-inapp, which the head script in every page
   (THEME_SCRIPT in scripts/build_site.py) sets before first paint, so pages opened from the website are unchanged. */
html.cnz-inapp{--cnz-tabs:64px;--cnz-bar:52px;scroll-padding-top:calc(var(--cnz-bar) + 16px);scroll-padding-bottom:calc(var(--cnz-tabs) + 40px)}

/* the website's own header, footer and invitation give way to the app's bars */
html.cnz-inapp .masthead,html.cnz-inapp footer,html.cnz-inapp .invitation,html.cnz-inapp .breadcrumb,
html.cnz-inapp .lh-app,html.cnz-inapp .cnz-home{display:none!important}
html.cnz-inapp body{padding-top:calc(var(--cnz-bar) + env(safe-area-inset-top,0px));padding-bottom:calc(var(--cnz-tabs) + env(safe-area-inset-bottom,0px))}
html.cnz-inapp.au-on body{padding-bottom:calc(var(--cnz-tabs) + env(safe-area-inset-bottom,0px) + var(--au-h,0px))}
/* the reading view and the Bible reader draw their own top bar */
html.cnz-inapp.lib-reading body,html.cnz-inapp.bb-on body{padding-top:0}
html.cnz-inapp.lib-reading .cnz-fbar,html.cnz-inapp.bb-on .cnz-fbar{display:none}

/* compact page tops, as in the app */
html.cnz-inapp .page-top{padding:22px 0 20px}
html.cnz-inapp .page-top h1{font-size:clamp(2rem,7vw,3.2rem);margin-bottom:.8rem}
html.cnz-inapp .page-top .intro{font-size:16px}
html.cnz-inapp .page-top .eyebrow{margin-bottom:12px}
html.cnz-inapp .lib-page-wrap{padding-top:26px}

/* the slim top bar */
.cnz-fbar{display:none}
html.cnz-inapp .cnz-fbar{position:fixed;z-index:45;top:0;left:0;right:0;display:flex;align-items:center;gap:4px;
  height:var(--cnz-bar);padding:env(safe-area-inset-top,0px) 6px 0;box-sizing:content-box;
  background:var(--paper,#fff);color:var(--ink,#122c40);border-bottom:1px solid var(--line,#d9e0e5)}
.cnz-fbar .cnz-ftitle{flex:1;min-width:0;font:400 1.05rem/1.2 var(--serif,Georgia,serif);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px}
.cnz-ficon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:none;border:0;border-radius:10px;
  background:transparent;color:inherit;cursor:pointer;padding:0;text-decoration:none}
.cnz-ficon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
@media(hover:hover){.cnz-ficon:hover{background:var(--tint,#f1f5f7)}}
.cnz-ficon:focus-visible,.cnz-ftabs a:focus-visible,.cnz-fsheet button:focus-visible{outline:3px solid var(--accent,#9c5a24);outline-offset:-3px}
/* the back button added to the reading view's bar; its own 'leave' button is not needed in the app (Leave the reading view stays in its settings) */
html.cnz-inapp .rd-bar [data-act="exit"]{display:none}
.rd-bar .cnz-rd-back{color:inherit}

/* the tab bar (the same as /app/'s, see app.css) */
.cnz-ftabs{display:none}
html.cnz-inapp .cnz-ftabs{position:fixed;z-index:44;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(5,1fr);
  height:calc(var(--cnz-tabs) + env(safe-area-inset-bottom,0px));padding:0 6px env(safe-area-inset-bottom,0px);box-sizing:border-box;
  background:var(--paper,#fff);border-top:1px solid var(--line,#d9e0e5);box-shadow:0 -4px 18px rgba(0,0,0,.05)}
html.cnz-inapp.lib-reading .cnz-ftabs,html.cnz-inapp.bb-on .cnz-ftabs{background:var(--rd-bg,var(--paper,#fff));border-color:var(--rd-line,var(--line,#d9e0e5))}
.cnz-ftabs a{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-decoration:none;
  color:var(--muted,#52616a);font:600 10.5px/1.1 var(--sans,system-ui,sans-serif);letter-spacing:.02em;min-width:0}
html.cnz-inapp.lib-reading .cnz-ftabs a,html.cnz-inapp.bb-on .cnz-ftabs a{color:var(--rd-muted,var(--muted,#52616a))}
.cnz-ftabs svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
html.cnz-inapp .cnz-ftabs a[aria-current="page"]{color:var(--ink,#122c40)}
html.cnz-inapp.lib-reading .cnz-ftabs a[aria-current="page"],html.cnz-inapp.bb-on .cnz-ftabs a[aria-current="page"]{color:var(--rd-fg,var(--ink,#122c40))}
.cnz-ftabs a[aria-current="page"] svg{stroke:var(--accent,#9c5a24)}
html.cnz-inapp.bb-on .cnz-ftabs a[aria-current="page"] svg{stroke:var(--rd-accent,var(--accent,#9c5a24))}
.cnz-ftabs a[aria-current="page"]::before{content:'';position:absolute;top:0;left:28%;right:28%;height:3px;background:var(--gold,#e9bd76);border-radius:0 0 3px 3px}

/* things that sit at the bottom of the screen move above the tab bar */
html.cnz-inapp .au-bar{bottom:calc(var(--cnz-tabs) + env(safe-area-inset-bottom,0px));padding-bottom:8px}
html.cnz-inapp .rd-pop{bottom:calc(var(--cnz-tabs) + env(safe-area-inset-bottom,0px) + 12px)}
html.cnz-inapp .bb-toast{bottom:calc(var(--cnz-tabs) + env(safe-area-inset-bottom,0px) + 12px)}
html.cnz-inapp .bb-actions{bottom:calc(var(--cnz-tabs) + env(safe-area-inset-bottom,0px))}

/* reading settings from the top bar (pages outside the reading view) */
.cnz-fscrim{position:fixed;inset:0;z-index:58;background:rgba(10,16,22,.42)}
.cnz-fsheet{position:fixed;z-index:59;top:calc(var(--cnz-bar) + env(safe-area-inset-top,0px) + 6px);right:8px;width:min(360px,calc(100% - 16px));
  max-height:calc(100vh - var(--cnz-bar) - var(--cnz-tabs) - 30px);overflow:auto;background:var(--paper,#fff);color:var(--ink,#122c40);
  border:1px solid var(--line,#d9e0e5);border-radius:14px;box-shadow:0 14px 40px rgba(0,0,0,.22);padding:12px 16px 16px}
.cnz-fsheet-head{display:flex;align-items:center;justify-content:space-between;margin:0 -6px 6px 0}
.cnz-fsheet-head strong{font:700 12px/1.4 var(--sans,system-ui,sans-serif);letter-spacing:.12em;text-transform:uppercase;color:var(--accent,#9c5a24)}
.cnz-fscrim[hidden],.cnz-fsheet[hidden]{display:none}

@media(min-width:900px){
  html.cnz-inapp .cnz-ftabs{left:50%;right:auto;transform:translateX(-50%);width:640px;bottom:14px;height:var(--cnz-tabs);padding:0 8px;
    border:1px solid var(--line,#d9e0e5);border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.12)}
  html.cnz-inapp body{padding-bottom:110px}
  html.cnz-inapp .au-bar{bottom:calc(var(--cnz-tabs) + 26px)}
}
@media print{.cnz-fbar,.cnz-ftabs{display:none!important}html.cnz-inapp body{padding:0}}
