/* ---- site theme: make the app read as part of truebuddha.org.nz (P2) --------
   The static replica's own palette and font stack, copied from
   site/mirror/httpdocs/_lib/global.css so the two halves cannot drift:

     panel #FFC · band #e9f18a · band lines #CC3/#AA0 · glow #DA0
     ink #003 · muted #666 · temple red #c00/#900 · deep green #390/#690

   Font: the site's stack puts the Latin family first, so digits and English take
   Helvetica/Verdana while Han falls back to JhengHei — that is exactly the
   "numbers use the English font" rule, with no second font file.            */

:root {
  --site-panel: #ffc;
  --site-band: #e9f18a;
  --site-band-line-top: #cc3;
  --site-band-line-bottom: #aa0;
  --site-glow: #da0;
  --site-ink: #003;
  --site-ink-soft: #666;
  --site-red: #c00;
  --site-red-deep: #900;
  --site-green: #390;
  --site-green-deep: #690;
  --font-site: Helvetica, Verdana, Geneva, "Microsoft JhengHei", "LiHei Pro", sans-serif;
  --font-number: Helvetica, Arial, "Microsoft JhengHei", "LiHei Pro", sans-serif;
}

/* One font for the whole page, like the replica. */
body {
  font-family: var(--font-site);
  color: var(--site-ink);
}

/* Numbers, money, dates and quantities line up in columns and never fall back to
   a Han glyph, so a total or a phone number reads as it does on the static pages. */
table,
.amount,
.tabular,
input[type="number"],
input[type="tel"],
input[type="text"][inputmode="numeric"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* The 4 module tabs, drawn like the replica's own tab strip
   (分類輔助: 日曆轉換 / 持咒規劃 / 術語詞表 / 文檔下載) instead of dark chips.
   `switchMainTab()` also applies these two classes, so the JS and the first paint
   agree. */
.site-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #5C3A21;
  background: #FFFDF7;
  border: 1px solid #E2C792;
  border-radius: 0;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.site-tab:hover {
  color: #7A1C1C;
  background: #FDF3D7;
  border-color: #C89D54;
}

.site-tab.site-tab--active,
.site-tab.is-active {
  color: #FFF8DC;
  background: linear-gradient(135deg, #8B0000 0%, #A31515 100%);
  border-color: #D4AF37;
  box-shadow: 0 2px 6px rgba(122, 28, 28, 0.25);
}

@media (min-width: 768px) {
  body.site-rail-on #suppliesStickyBottomBar {
    left: 0;
    max-width: 1320px;
  }
}

/* [INVARIANT: KAT-PUJA-STICKY-BAR-MOBILE] Sticky bar sits flush at bottom since rail is top-right */
@media (max-width: 767px) {
  body.site-rail-on #suppliesStickyBottomBar,
  #suppliesStickyBottomBar {
    bottom: env(safe-area-inset-bottom, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    z-index: 990 !important;
    padding-bottom: 8px !important;
  }
  body.site-rail-on.has-sticky-bar,
  body.has-sticky-bar {
    padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media print {
  #mainTabBar { display: none !important; }
}
