/* The documentation page: the search inside the page header and a grid of guides that open on the website. */

.docs-page { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Search and system type, inside the page header ---------- */
.doc-find { grid-column: 1 / -1; }
.doc-find .find-field.pick { flex: 0 1 240px; }
.doc-find .btn { height: 44px; border-radius: var(--r-l); }
.doc-find .btn[hidden] { display: none; }

/* ---------- Guides ---------- */
.doc-count { padding-left: 2px; font-size: var(--fs-s); font-weight: 600; color: var(--ink-3); }
/* Rows of --cols guides: a column per 300px of the list's own width, read by the page script so Show more adds whole
   rows. A last row that is not full (the end of the list, a search) sits in the middle. */
.doc-guides { --doc-gap: 14px; container: doc-guides / inline-size; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--doc-gap); }
.doc-guide {
  --cols: 1;
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--doc-gap)) / var(--cols)); min-width: 0;
  display: flex; flex-direction: column; gap: 14px; padding: 20px; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-2xl); background: var(--panel); box-shadow: var(--sh-card);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
@container doc-guides (min-width: 614px) { .doc-guide { --cols: 2; } }
@container doc-guides (min-width: 928px) { .doc-guide { --cols: 3; } }
@container doc-guides (min-width: 1242px) { .doc-guide { --cols: 4; } }
@container doc-guides (min-width: 1556px) { .doc-guide { --cols: 5; } }
@container doc-guides (min-width: 1870px) { .doc-guide { --cols: 6; } }
.doc-guide[hidden] { display: none; }
.doc-guide.in { animation: doc-rise .4s cubic-bezier(.2, .8, .2, 1) both; }
@media (hover: hover) and (pointer: fine) {
  .doc-guide:hover { color: var(--ink); transform: translateY(-3px); border-color: var(--brand-line); box-shadow: var(--sh-hover), 0 0 0 4px color-mix(in srgb, var(--brand-text) 8%, transparent); }
}
.doc-pair {
  display: grid; grid-template-columns: auto minmax(24px, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-l);
  background-color: var(--panel-2); background-image: radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px); background-size: 16px 16px;
}
.doc-plate { display: grid; place-items: center; height: 42px; padding: 0 8px; border-radius: var(--r-m); background: var(--paper); box-shadow: inset 0 0 0 1px var(--paper-line); }
.doc-plate .brandmark { width: 92px; background: none; box-shadow: none; }
.doc-wire { height: 3px; border-radius: var(--r-full); opacity: .6; background: repeating-linear-gradient(90deg, var(--brand-text) 0 9px, transparent 9px 18px); background-size: 36px 3px; transition: opacity .2s ease; }
.doc-guide:hover .doc-wire { opacity: 1; animation: doc-flow .9s linear infinite; }
.doc-guide:hover .doc-wire.both { animation: doc-flow-both 1.8s ease-in-out infinite alternate; }
.doc-text b { display: block; font-size: var(--fs-l); font-weight: 600; letter-spacing: var(--tr-snug); }
.doc-text small { display: block; margin-top: 3px; font-size: var(--fs-s); line-height: 1.5; color: var(--ink-3); }
.doc-types { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: var(--fs-xs); }
.doc-dir { color: var(--ink-4); }
.doc-open { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--brand-text); }
.doc-open svg { width: 14px; height: 14px; transition: transform .2s ease; }
.doc-guide:hover .doc-open svg { transform: translate(2px, -2px); }

.doc-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px; text-align: center; border-radius: var(--r-2xl); }
.doc-empty[hidden], .doc-more[hidden] { display: none; }
.doc-empty p { margin: 0; color: var(--ink-3); }
.doc-more { display: flex; justify-content: center; }
.doc-note { margin: 0; text-align: center; font-size: var(--fs-s); color: var(--ink-4); }

@keyframes doc-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes doc-flow { to { background-position: 36px 0; } }
@keyframes doc-flow-both { from { background-position: 0 0; } to { background-position: 72px 0; } }

@media (prefers-reduced-motion: reduce) {
  .doc-guide.in, .doc-guide:hover .doc-wire { animation: none; }
}

@media (max-width: 760px) {
  .doc-guide { --cols: 1; }
  .doc-find .find-field.pick { flex: 1 1 100%; }
}
