/*
 * Catalogue chrome. The pages themselves are built from the site's own components (site-catalogue.css);
 * this file only adds what a documentation page needs: example frames, the code block, swatches.
 */
.cat-ex { margin: 8px 0 40px; }
.cat-ex > figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; margin-bottom: 12px; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.cat-grid { display: grid; gap: 16px; }
.cat-cell { min-width: 0; }
.cat-cell > p { margin-bottom: 6px; font-size: 13px; line-height: 20px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* A frame renders the example at its real width (a .page container) and scales it to the cell. */
:root { color-scheme: light; }
.cat-cell { max-width: calc(var(--cell-max, 100%)); }
.cat-frame { position: relative; overflow: hidden; container-type: inline-size; max-width: var(--w); height: 420px; border: 1px solid var(--hair); background: #f5f3ef; }
/* Each example is an iframe at its real width, scaled to the cell (catalogue.js sets the height). */
.cat-scale { display: block; border: 0; transform-origin: 0 0; transform: scale(tan(atan2(100cqw, var(--w)))); }
@container page (min-width: 1024px) {
    .cat-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); }
}
/* On a phone, a 1440 frame would be too small to read: show the narrower frame only. */
@container page (max-width: 767px) {
    .cat-grid-2 > .cat-cell[data-w="1440"] { display: none; }
}
.cat-open { font-size: 15px; }

/* Code */
.cat-code { margin: 8px 0 32px; }
.cat-code pre { margin: 0; padding: 16px 18px; overflow: auto; max-height: 420px; background: var(--tile); border: 1px solid var(--hair); font: 13px/20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); white-space: pre; tab-size: 4; }
.cat-code button { margin-top: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.cat-code button[hidden] { display: none; }

/* Swatches */
.cat-sw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 8px 0 40px; }
@container page (min-width: 768px) { .cat-sw { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat-sw div { border-top: 1px solid var(--ink); padding-top: 12px; }
.cat-sw i { display: block; height: 64px; margin-bottom: 10px; border: 1px solid var(--hair); }
.cat-sw b { display: block; font-weight: 500; }
.cat-sw span { display: block; font-size: 15px; line-height: 22px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Index of the catalogue */
.cat-list { border-top: 1px solid var(--ink); margin-bottom: 40px; }
.cat-list a { display: grid; grid-template-columns: minmax(0, 1fr); padding: 14px 0 16px; border-bottom: 1px solid var(--hair); color: var(--ink); text-decoration: none; }
.cat-list a:hover b { color: var(--link); }
.cat-list b { font-size: 19px; line-height: 26px; font-weight: 500; }
.cat-list span { font-family: var(--font-read); font-size: 17px; line-height: 27px; color: var(--ink-2); }
@container page (min-width: 1024px) { .cat-list a { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; } }

.cat-video { margin: 8px 0 32px; }
.cat-video video { display: block; width: 100%; height: auto; border: 1px solid var(--hair); background: var(--tile); }
.cat-video figcaption { margin-top: 10px; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.cat-note { margin: 0 0 24px; padding: 14px 16px; border-left: 2px solid var(--mark); background: var(--tile); font-size: 16px; line-height: 24px; }

/* Template specimens: a fixed window onto the top of the live page. */
.cat-frame-fixed { height: auto; }

/* Tables in the documentation */
.cat-table { width: 100%; margin: 8px 0 32px; border-collapse: collapse; font-size: 15px; line-height: 22px; font-variant-numeric: tabular-nums; }
.cat-table th, .cat-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; }
.cat-table thead th { border-bottom: 1px solid var(--ink); color: var(--ink-2); font-weight: 400; }
.cat-table tbody th { font-weight: 500; }
@container page (max-width: 767px) { .cat-table { display: block; overflow-x: auto; } }
