/* TruBible OS: the shared parts (buttons, fields, cards, menus, dialogs, notices) as a desktop app shapes them.
   docs/os-shell.md, "The parts inside the window". */
/* ---------- Computers: the parts inside the window are a desktop app's parts (TINL-1382) ----------
   The owner: "every single page [must] look like native app elements". On a computer (and in an app window)
   trubible.com's pages keep their markup; the shared parts take the shape a desktop app gives them: a soft
   grey pane with white group boxes, a small radius, glass menus and dialogs, and notices at the top right.
   The compact SIZES (buttons, fields, menu rows) apply only with a mouse or trackpad: a touch tablet in the
   desktop shell keeps the large touch sizes of css/style.css.
   Its own file because two sites share these parts: trubible.com's pages (with css/main-os.css) and the Meetings
   home (with css/meet-os.css). Only pages in the shell match these rules: the host console, listen, join and the
   widget do not load this file, and Connect and Worship Studio have their own parts. */
html.tbos-desktop body { --os-win-bg: var(--bg-subtle); --radius-sm: 8px; --radius: 12px; --radius-lg: 14px; }
html.tbos-desktop.tbos-framed, html.tbos-desktop.tbos-framed body { background: var(--bg-subtle) !important; }

/* buttons: a push button, not a pill */
html.tbos-desktop .btn { border-radius: 9px; letter-spacing: 0; }
html.tbos-desktop .btn-sm { border-radius: 7px; }
html.tbos-desktop .btn-lg { border-radius: 10px; }
html.tbos-desktop .btn-outline, html.tbos-desktop .btn-secondary { background: var(--bg-card); box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.08); }

/* fields */
html.tbos-desktop .form-control { border-radius: 8px; box-shadow: none; }
html.tbos-desktop .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.22); }

/* group boxes */
html.tbos-desktop .card, html.tbos-desktop .settings-section { border-radius: 12px; box-shadow: 0 0.5px 1.5px rgba(0, 0, 0, 0.05); }
html.tbos-desktop .page-header h1 { font-size: clamp(1.6rem, 1.2rem + 1vw, 2rem); }

/* menus: a glass popover whose rows light up in the accent */
html.tbos-desktop .menu, html.tbos-desktop .lang-menu {
  padding: 5px; border: 0; border-radius: 10px; background: var(--os-glass-strong); -webkit-backdrop-filter: var(--os-blur); backdrop-filter: var(--os-blur); box-shadow: var(--os-pop-shadow);
}
html.tbos-desktop .menu-item, html.tbos-desktop .lang-option { border: 0; border-radius: 6px; }
html.tbos-desktop .menu-item:hover, html.tbos-desktop .menu-item:focus-visible, html.tbos-desktop .lang-option:hover { background: var(--brand); color: var(--on-brand); }
html.tbos-desktop .menu-item:hover svg, html.tbos-desktop .menu-item:focus-visible svg { color: inherit; }
html.tbos-desktop .menu-item.danger:hover { background: var(--danger); color: #fff; }
html.tbos-desktop[data-theme="dark"] .menu-item.danger:hover { color: #1f0707; }   /* white on the Dark red is 2.8:1; this is 6.5:1 */

/* dialogs: a glass sheet in the middle of the screen, a light dim behind it */
html.tbos-desktop .modal-overlay { background: rgba(0, 0, 0, 0.22); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.tbos-desktop .modal { padding: 24px; border: 0; border-radius: 14px; background: var(--os-glass-strong); -webkit-backdrop-filter: var(--os-blur); backdrop-filter: var(--os-blur); box-shadow: var(--os-shadow); }
html.tbos-desktop .modal h2 { margin-bottom: 14px; font-size: 1.2rem; letter-spacing: -0.01em; }
html.tbos-desktop .modal-actions { margin-top: 20px; gap: 8px; }

/* notices: at the top right, under the menu bar, as on a desktop */
html.tbos-desktop .toast-stack { top: calc(var(--os-menubar-h) + 10px); right: 12px; bottom: auto; }
html.tbos-desktop.tbos-framed .toast-stack { top: 10px; }
html.tbos-desktop .toast { min-width: 300px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--os-glass-strong); color: var(--os-ink); -webkit-backdrop-filter: var(--os-blur); backdrop-filter: var(--os-blur); box-shadow: var(--os-pop-shadow); animation-name: tbos-notice; }
html.tbos-desktop .toast-success .toast-icon { color: var(--success); }
html.tbos-desktop .toast-error .toast-icon { color: var(--danger); }
html.tbos-desktop .toast-warning .toast-icon, html.tbos-desktop .toast-info .toast-icon { color: var(--os-ink-2); }
html.tbos-desktop .toast-close { color: var(--os-ink-2); }
html.tbos-desktop .toast-close:hover { color: var(--os-ink); background: rgba(127, 127, 127, 0.18); }
@keyframes tbos-notice { from { opacity: 0; transform: translateX(24px); } }
@media (prefers-reduced-motion: reduce) { html.tbos-desktop .toast { animation: none; } }

/* the compact sizes of a desktop app, for a mouse or trackpad only */
@media (hover: hover) and (pointer: fine) {
  html.tbos-desktop .btn { min-height: 32px; padding: 5px 14px; font-size: 0.84rem; }
  html.tbos-desktop .btn-sm { min-height: 26px; padding: 3px 10px; font-size: 0.78rem; }
  html.tbos-desktop .btn-lg { min-height: 40px; padding: 8px 20px; font-size: 0.92rem; }   /* a page's main action: never under 40 */
  html.tbos-desktop .btn svg { width: 15px; height: 15px; }
  html.tbos-desktop .form-control { min-height: 34px; padding: 6px 10px; font-size: 0.86rem; }
  html.tbos-desktop textarea.form-control { min-height: 72px; }
  html.tbos-desktop .menu-item, html.tbos-desktop .lang-option { min-height: 28px; padding: 4px 10px; font-size: 0.84rem; }
  html.tbos-desktop .modal-close { top: 10px; right: 10px; width: 28px; height: 28px; }
}
