/* The style guide site, styled with its own tokens (dist/tokens/msrvs.css). */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--msrvs-page);
  color: var(--msrvs-text);
  font: 400 16px/1.6 var(--msrvs-font-sans);
}

.wrap { max-width: var(--msrvs-content-width); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 var(--msrvs-gutter); } }

a { color: var(--msrvs-link); text-decoration-color: var(--msrvs-lining-outer); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }

/* Header: blue in both schemes, as on the forum */
.top { background: var(--msrvs-header); color: var(--msrvs-header-text); border-bottom: 1px solid var(--msrvs-rule); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { display: block; height: 36px; width: auto; }
.brand span {
  font: var(--msrvs-type-eyebrow-weight) var(--msrvs-type-eyebrow-size)/1 var(--msrvs-font-sans);
  letter-spacing: var(--msrvs-type-eyebrow-tracking);
  text-transform: uppercase;
  color: var(--msrvs-brass-light);
}
.top nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-left: auto; }
.top nav a { color: rgb(255 255 255 / 0.85); font-weight: 500; font-size: 15px; text-decoration: none; padding: 6px 0; }
.top nav a:hover { color: #fff; }
.top nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--msrvs-brass); }

/* Contents beside the page on wide screens */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 72px; }
.toc { display: none; }
@media (min-width: 1000px) {
  .layout.has-toc { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: block; position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; font-size: 14px; }
}
.toc-title {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 12px;
  font: var(--msrvs-type-eyebrow-weight) var(--msrvs-type-eyebrow-size)/1 var(--msrvs-font-sans);
  letter-spacing: var(--msrvs-type-eyebrow-tracking);
  text-transform: uppercase;
  color: var(--msrvs-accent-text);
}
.toc-title::before { content: ""; width: 20px; height: 1px; background: currentColor; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; margin-bottom: 6px; }
.toc a { display: block; padding: 3px 0; color: var(--msrvs-muted); text-decoration: none; }
.toc a:hover { color: var(--msrvs-text); }

main { min-width: 0; max-width: 820px; }

h1, h2, h3 { font-family: var(--msrvs-font-serif); line-height: 1.2; letter-spacing: -0.005em; color: var(--msrvs-text); }
h1 { font-size: clamp(30px, 2.4vw + 18px, 44px); font-weight: 700; margin: 0 0 16px; }
h2 { font-size: 28px; font-weight: 700; margin: 56px 0 16px; padding-top: 24px; border-top: 1px solid var(--msrvs-control); }
h3 { font-size: 20px; font-weight: 600; margin: 32px 0 8px; }
.headerlink { margin-left: 0.3em; color: var(--msrvs-subtle); text-decoration: none; opacity: 0; }
h2:hover .headerlink, h3:hover .headerlink, .headerlink:focus { opacity: 1; }

.table-scroll { overflow-x: auto; margin: 16px 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--msrvs-control); text-align: left; vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--msrvs-muted); }
td img { vertical-align: middle; }
td code { white-space: nowrap; }

code { font-size: 0.88em; background: var(--msrvs-code); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--msrvs-code); padding: 16px; border-radius: var(--msrvs-radius-card); overflow-x: auto; font-size: 13.5px; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: inherit; }

main > p > img { border-radius: var(--msrvs-radius-card); }

/* Download previews: artwork with light lettering sits on blue */
.thumb { display: block; width: 88px; height: 52px; object-fit: contain; padding: 4px; background: var(--msrvs-surface); border: 1px solid var(--msrvs-control); border-radius: var(--msrvs-radius-control); }
.thumb.on-dark { background: var(--msrvs-deep-blue); border-color: var(--msrvs-deep-blue); }

footer { border-top: 1px solid var(--msrvs-control); color: var(--msrvs-muted); font-size: 14px; padding: 24px 0 40px; }

@media (max-width: 600px) {
  .top nav { gap: 4px 16px; margin-left: 0; }
  .top nav .for-agents { display: none; } /* it's in the footer too */

  /* Tables that lead with a picture become one card per row: the picture, then the rest stacked */
  .cards thead { display: none; }
  .cards tr { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--msrvs-control); }
  .cards td { padding: 0; border: 0; }
  .cards td:first-child { grid-row: span 6; }
  .cards td:not(:first-child):empty { display: none; }
  .cards td:nth-child(3) { color: var(--msrvs-muted); font-size: 13px; }
  .cards td code { white-space: normal; overflow-wrap: anywhere; }
  .cards .thumb { width: 64px; height: 44px; }
}
