/* base.css - the reset, the element defaults, the page frame's layout and
   the few utilities every page shares. Values come from theme.css. */

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  button:disabled { cursor: default; }
  [hidden] { display: none !important; }
  dialog { padding: 0; border: 0; color: inherit; }
}

@layer defaults {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-line) transparent;
  }
  body {
    min-height: 100vh;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading);
    -webkit-font-smoothing: antialiased;
  }
  a { color: var(--accent); }
  :focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
  }
  svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

@layer layouts {
  /* The page frame: the side panel, the page, and the right panel when a
     tab is open in it. The frame is the window; each region scrolls
     inside itself and nothing scrolls the page sideways. */
  .frame {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
  }
  .frame-page {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: var(--space-8) var(--space-11) var(--space-10) var(--space-11);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
  /* With the side panel folded away, the page keeps a lane on its left
     for the open control and the mark. */
  .frame[data-side-panel-state="closed"] .frame-page {
    padding-left: var(--side-rail-lane);
  }
}

@layer utils {
  .visually-hidden {
    position: absolute;
    width: var(--hairline);
    height: var(--hairline);
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
