/*
 * shell.css: the V3 site-wide shell (app bar, breadcrumb) next to legacy CSS
 * Version: 1.0.0 (2026-10-28, Docs/standards/ui-design.md §12.2 step 2)
 *
 * AtxElements/page.php links this right after atx-ui.css on every page that
 * uses the full template. <body> gets `atx-shell`, plus `atx-shell--legacy`
 * until the page calls $page->useAtxUi().
 *
 *  1. Shell: keeps legacy rules (application.css sets `a` bold and colored,
 *     body text in Trebuchet at 85%) from restyling the app bar and breadcrumb,
 *     which sit on pages that don't have the `atx-ui` class.
 *  2. Legacy page body: fits #outer / #main / #content under an in-flow app
 *     bar instead of the old fixed #menu, and lets that content scroll
 *     sideways inside #outer below lg instead of widening the page.
 *
 * Tokens only; no new colors. When a page migrates, it stops getting part 2.
 * If Atx gets the same app bar (ui-design.md §12.2 step 2, open decision),
 * move part 1 into atx-ui.css.
 */

/* ==========================================================================
   1. Shell (all pages)
   ========================================================================== */

.atx-shell .atx-appbar,
.atx-shell__context {
  font-family: var(--atx-font-sans);
  font-size: var(--atx-text-md);
  line-height: var(--atx-leading-normal);
}

/* Text logo until there's an SVG logo (DEBT-028). The old logos are GIF tabs
   drawn for the yellow menu and don't work on navy. */
.atx-shell__wordmark,
.atx-appbar a.atx-shell__wordmark:link,
.atx-appbar a.atx-shell__wordmark:visited,
.atx-appbar a.atx-shell__wordmark:hover {
  color: var(--atx-color-on-brand);
  font-size: var(--atx-text-xl);
  font-weight: var(--atx-weight-bold);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

/* Ghost buttons on navy (account menu, Log out, kiosk Cancel) */
.atx-appbar .atx-btn--ghost,
.atx-appbar .atx-btn--ghost:link,
.atx-appbar .atx-btn--ghost:visited {
  color: var(--atx-color-on-brand);
  font-weight: var(--atx-weight-semibold);
  text-decoration: none;
}
.atx-appbar .atx-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--atx-color-on-brand);
  text-decoration: none;
}
.atx-appbar .atx-btn--ghost:focus-visible { box-shadow: 0 0 0 2px var(--atx-color-on-brand); }
.atx-appbar summary.atx-btn { padding: 0 var(--atx-space-3); }

/* Legacy `a:hover` underlines and `a` bolds every link */
.atx-shell .atx-nav a,
.atx-shell .atx-nav a:hover,
.atx-shell .atx-menu__panel a,
.atx-shell .atx-menu__panel a:hover,
.atx-shell .atx-breadcrumb a { text-decoration: none; }
.atx-shell .atx-menu__panel a { font-weight: var(--atx-weight-regular); }
.atx-shell .atx-breadcrumb a { font-weight: var(--atx-weight-regular); }
.atx-shell .atx-breadcrumb a:hover { text-decoration: underline; }
.atx-shell .atx-nav :focus-visible,
.atx-shell .atx-appbar__toggle:focus-visible {
  outline: 2px solid var(--atx-color-on-brand);
  outline-offset: -2px;
}
.atx-shell .atx-menu__panel a:focus-visible { outline-color: var(--atx-color-focus); }
.atx-menu__panel .atx-badge { margin-left: auto; }
.atx-shell__name { color: var(--atx-color-on-brand-muted); }

/* Breadcrumb plus the page's own actions (addPostContextMenu) */
.atx-shell__context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--atx-space-2) var(--atx-space-4);
  margin-bottom: var(--atx-space-4);
}
.atx-shell__context .atx-breadcrumb { margin: 0; }
.atx-shell__context-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--atx-space-2); }

@media print {
  .atx-skip-link,
  .atx-shell__context { display: none !important; }
}

/* ==========================================================================
   2. Legacy page body (body.atx-shell--legacy)
   ========================================================================== */

@media screen {
  /* application.css: 10px padding and the blue background image */
  body.atx-shell--legacy {
    padding: 0;
    background: var(--atx-color-bg);
  }
  .atx-shell--legacy #outer {
    box-sizing: border-box;
    padding: var(--atx-space-4) 0;
  }
  /* The old 42px top padding cleared the fixed #menu */
  .atx-shell--legacy #main {
    padding-top: var(--atx-space-4);
    border-radius: var(--atx-radius-lg);
    box-shadow: 0 0 0 1px var(--atx-color-border), var(--atx-shadow-sm);
  }
}

/* Below lg, legacy layouts (770px and up) scroll sideways inside #outer, so
   the app bar and drawer stay usable at phone width. */
@media screen and (max-width: 991.98px) {
  .atx-shell--legacy #outer {
    min-width: 0;
    overflow-x: auto;
    padding: var(--atx-space-2) 0;
  }
  .atx-shell--legacy #main { min-width: 770px; }
}
