/* The Books shell (BooksLayout, BooksNav). Layout switches on our own hook classes only; no rule here touches a Fluent component (ADR-0065). */

/* The bar is the size container the menu measures: wide, the Books menu is a row of group menus; narrow (a phone, or a small window), one Menu button opens a drawer. */
.nas-books-bar { container: books-bar / inline-size; }
.nas-books-nav-narrow { display: none; }
@container books-bar (max-width: 1070px) {
    .nas-books-nav-wide { display: none; }
    .nas-books-nav-narrow { display: block; }
}

/* The search button's words and its Ctrl+K key cap sit on one line; on a phone the button keeps its icon and drops them. */
.nas-books-search-text { display: inline-flex; align-items: center; gap: var(--spacingHorizontalXS); }
@media (max-width: 640px) {
    .nas-books-search-text { display: none; }
}

/* The Alt hints (key caps beside a shortcut): hidden until books-shortcuts.js puts books-show-alt-hints on the body while Alt is held. */
.nas-shortcut-hint { display: none; }
body.books-show-alt-hints .nas-shortcut-hint { display: inline-flex; margin-inline-start: var(--spacingHorizontalXS); }

/* The Dashboard entry is a plain link (Fluent's anchor button is a custom element whose link is not clickable with the middle button or from the context menu); it takes the look of the group buttons beside it, from tokens. */
.nas-books-dashboard-link { display: inline-flex; align-items: center; box-sizing: border-box; min-height: 32px; padding: 0 var(--spacingHorizontalM); border: var(--strokeWidthThin) solid transparent; border-radius: var(--borderRadiusMedium); color: var(--colorNeutralForeground2); font-family: var(--fontFamilyBase); font-size: var(--fontSizeBase300); font-weight: var(--fontWeightSemibold); text-decoration: none; }
.nas-books-dashboard-link:hover { background: var(--colorSubtleBackgroundHover); color: var(--colorNeutralForeground2Hover); }
.nas-books-dashboard-link:focus-visible { outline: var(--strokeWidthThick) solid var(--colorStrokeFocus2); outline-offset: 1px; }
.nas-books-dashboard-link[aria-current="page"] { border-color: var(--colorNeutralStroke1); background: var(--colorNeutralBackground1); color: var(--colorNeutralForeground1); }

/* On the bar the key cap floats over the corner of its button, so showing it never moves the bar. */
.nas-hint-host { position: relative; display: inline-flex; }
.nas-hint-host > .nas-shortcut-hint { position: absolute; inset-block-start: -10px; inset-inline-end: -6px; margin: 0; z-index: 1; }

/* The shell hands the command palette (a design-system component that reads these two names) the brand tint and text colour of the current theme. */
.nas-books-shell { --product-primary-subtle: var(--colorBrandBackground2); --product-primary-text: var(--colorBrandForeground1); }

/* The document pages (InvoiceDocument, BillDocument) still use these; delete the block when those two pages are converted. */
.books-doc-crumbs { font-size: var(--font-size-sm); color: var(--colorNeutralForeground3); }
.books-doc-crumbs a { color: var(--colorBrandForeground1); text-decoration: none; }
.books-doc-crumbs a:hover { text-decoration: underline; }
.books-doc-back { color: var(--colorBrandForeground1); }

.books-doc-statusline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacingHorizontalS) var(--spacingHorizontalXL); margin: var(--spacingHorizontalM) 0 var(--spacingHorizontalL); }
.books-doc-fbr-line, .books-doc-ledger { display: inline-flex; align-items: center; gap: var(--spacingHorizontalS); font-size: var(--font-size-sm); color: var(--colorNeutralForeground3); }
.books-doc-fbr-tag { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; }
.books-doc-void-note { margin: 0 0 var(--spacingHorizontalL); color: var(--color-danger); }

.books-doc-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--spacingHorizontalL); margin-bottom: var(--spacingHorizontalL); }
.books-doc-facts, .books-doc-totals { margin: 0; padding: var(--spacingHorizontalL); display: grid; gap: var(--spacingHorizontalS); }
.books-doc-facts > div, .books-doc-totals > div { display: flex; justify-content: space-between; gap: var(--spacingHorizontalL); }
.books-doc-facts dt, .books-doc-totals dt { color: var(--colorNeutralForeground3); font-size: var(--font-size-sm); }
.books-doc-facts dd, .books-doc-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.books-doc-total { padding-top: var(--spacingHorizontalS); border-top: 1px solid var(--colorNeutralStroke2); font-weight: 600; }
.books-doc-overdue { color: var(--color-danger); font-weight: 600; }

.books-doc-lines-wrap { overflow-x: auto; }
.books-doc-lines { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.books-doc-lines-caption { caption-side: top; padding: var(--spacingHorizontalM) var(--spacingHorizontalL); text-align: left; font-weight: 600; color: var(--colorNeutralForeground1); }
.books-doc-lines th, .books-doc-lines td { padding: var(--spacingHorizontalS) var(--spacingHorizontalL); text-align: left; }
.books-doc-lines thead th { background: var(--colorNeutralBackground2); color: var(--colorNeutralForeground3); font-weight: 600; }
.books-doc-lines tbody tr { border-top: 1px solid var(--colorNeutralStroke2); }
.books-doc-lines .books-doc-right { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.books-doc-h2 { margin: 0 0 var(--spacingHorizontalS) 0; font-size: var(--font-size-h3); font-weight: 600; }

@media (max-width: 760px) {
    .books-doc-body { grid-template-columns: minmax(0, 1fr); }
}
