/* ==========================================================================
   Waynance HTML — shell layouts and HTML-only helpers
   waynance.css (compiled Tailwind + the design system) loads first.

   Every page carries the three desktop layouts; <html data-layout="…">
   (set by assets/js/prefs.js) decides which one shows:
     dock     floating glass rail + floating top bar + bottom command bar
     sidebar  classic fixed sidebar
     topnav   menus in a second row under the top bar
   Phones and tablets always use the slide-in menu.

   1. Shell spacing   2. Layout visibility   3. Top bar variants
   4. Assistant position    5. Helpers
   ========================================================================== */

/* 1. Shell spacing ------------------------------------------------------- */
.fh-shell {
  min-height: 100dvh;
  /* height of everything above the page; full-height screens subtract it */
  --shell-top: 3.5rem;
}
html.fh-role-preview .fh-shell { --shell-top: 5.5rem; }

@media (min-width: 1024px) {
  html[data-layout="dock"] .fh-shell { padding-left: 88px; --shell-top: 4.25rem; }
  html[data-layout="dock"].fh-role-preview .fh-shell { --shell-top: 6.25rem; }
  html[data-layout="sidebar"] .fh-shell { padding-left: 15rem; }
  html[data-layout="topnav"] .fh-shell { --shell-top: 6.5rem; }
  html[data-layout="topnav"].fh-role-preview .fh-shell { --shell-top: 8.5rem; }
}

/* 2. Layout visibility --------------------------------------------------- */
html:not([data-layout="dock"]) .fh-dock,
html:not([data-layout="dock"]) .fh-commandbar,
html:not([data-layout="sidebar"]) .fh-sidebar,
html:not([data-layout="topnav"]) .fh-topnav,
html:not([data-layout="topnav"]) .fh-topbar-logo {
  display: none !important;
}

/* 3. Top bar: floats as a glass pill in the dock layout ------------------ */
@media (min-width: 1024px) {
  html[data-layout="dock"] .fh-topbar {
    top: 0.75rem;
    margin: 0.75rem 0.75rem 0;
    border: 1px solid var(--glass-edge);
    border-radius: 1rem;
    padding-inline: 1rem;
    box-shadow: var(--glass-shadow);
  }
  html[data-layout="dock"] .fh-topbar::before { display: none; }
}

/* 4. Assistant: keeps clear of the dock / sidebar ------------------------------ */
@media (min-width: 1024px) {
  html[data-layout="dock"] .fh-pip[data-corner="bl"] { left: 96px; }
  html[data-layout="sidebar"] .fh-pip[data-corner="bl"] { left: 264px; }
  html[data-layout="topnav"] .fh-pip[data-corner="bl"] { left: 1.5rem; }
}
.fh-pip[data-corner="bl"] { bottom: 1.25rem; left: 1rem; }
.fh-pip[data-corner="br"] { bottom: 1.25rem; right: 1.5rem; }
.fh-pip[data-corner="tr"] { top: 5rem; right: 1.5rem; }

/* 5. Helpers ------------------------------------------------------------- */

/* Smooth page-to-page transitions between template pages (Chrome, Edge, Safari 18+) */
@view-transition {
  navigation: auto;
}

/* Elements kept in the page for scripts (menus, dialogs, alternate views) */
[hidden] { display: none !important; }

/* Lock page scroll while a dialog or drawer is open */
html.fh-lock { overflow: hidden; }

/* No transitions while the page applies saved preferences */
html.fh-preload *,
html.fh-preload *::before,
html.fh-preload *::after {
  transition: none !important;
}

/* the assistant's drawing (assets/js/waynance.js renders the SVG per mood) */
.fh-pip-stop-top { stop-color: color-mix(in srgb, var(--color-primary) 70%, white); }
.fh-pip-stop-bottom { stop-color: var(--color-primary); }
.fh-pip-shadow { fill: color-mix(in srgb, var(--color-ink) 22%, transparent); }
.fh-pip-screen { fill: color-mix(in srgb, #0b1226 86%, var(--color-primary)); }

/* ---- crm2.css ---- */
/* crm2 pages: clients, client, calls, calendar, tasks, automations, automation, reports */

/* rotating sweep of the client health map must not widen the page on phones */
.fh-clip-x { overflow-x: clip; }

/* ---- inbox.css ---- */
/* Inbox: React renders the contact context as an aside only from xl (1280px); below that it is a drawer. */
@media (max-width: 1279.98px) {
  .fh-inbox-ctx { display: none; }
}
