/* yak-app-documents — document cards (list) and the single document view, fed by the Yak Express
   public app-documents API (inc/app-documents.php). Builds on .yak-card / .yak-tile / .yak-grid /
   .yak-note / .yak-chip / .yak-prose from theme.css; tokens from tokens.css. */

/* ---- List ---- */
.yak-docs { min-width: 0; }
.yak-docs__grid { align-items: stretch; }
.yak-docs__card { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; text-decoration: none; color: inherit; min-width: 0; }
.yak-docs__card:hover, .yak-docs__card:focus-visible { text-decoration: none; color: inherit; }
.yak-docs__card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.yak-docs__icon { flex-shrink: 0; }
.yak-docs__icon .yak-icon { color: var(--ink-primary); }
.yak-docs__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 auto; }
.yak-docs__title { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; color: var(--ink-primary); overflow-wrap: anywhere; }
.yak-docs__name { font-size: 13px; line-height: 1.4; color: var(--ink-secondary); }
.yak-docs__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--ink-secondary); }
.yak-docs__chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--surface-mist); font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--ink-primary); white-space: nowrap; }
.yak-docs__arrow { display: inline-flex; align-items: center; margin-left: auto; align-self: center; flex-shrink: 0; color: var(--ink-secondary); transition: color 140ms ease, transform 140ms ease; }
.yak-docs__card:hover .yak-docs__arrow { color: var(--ink-primary); transform: translateX(2px); }

/* Empty / error notes */
.yak-docs__empty, .yak-docs__error { margin: 0; }
.yak-docs__empty span, .yak-docs__error span:not(.yak-icon) { align-self: center; }
.yak-docs__debug { margin-top: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; color: var(--ink-secondary); overflow-wrap: anywhere; }

/* ---- Single document ---- */
.yak-doc { max-width: 860px; min-width: 0; }
.yak-doc__back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; font-size: 14px; font-weight: 500; color: var(--ink-secondary); text-decoration: none; }
.yak-doc__back:hover { color: var(--ink-primary); text-decoration: none; }
.yak-doc__back .yak-icon { font-size: 18px; }
.yak-doc__head { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid var(--border-default); }
.yak-doc__title { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; font-weight: 700; color: var(--ink-primary); overflow-wrap: anywhere; }
.yak-doc__meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 14px; line-height: 1.4; color: var(--ink-secondary); }
.yak-doc__langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.yak-doc__langs .yak-chip { padding: 8px 14px; font-size: 14px; text-decoration: none; }
.yak-doc__langs .yak-chip.is-active { background: var(--brand-yellow); border-color: var(--brand-yellow); color: var(--ink-primary); font-weight: 600; }
.yak-doc__langs a.yak-chip.is-active:hover { background: var(--brand-yellow); }
.yak-doc .yak-doc__body { max-width: none; }
.yak-doc .yak-docs { margin-top: 8px; }
.yak-doc__body h1, .yak-doc__body h2, .yak-doc__body h3, .yak-doc__body h4 { color: var(--ink-primary); }
.yak-doc__body ul, .yak-doc__body ol { padding-left: 1.4em; }
.yak-doc__body a { color: var(--link); font-weight: 600; }
.yak-doc__body a:hover { color: var(--link-hover); }

@media (max-width: 640px) {
  .yak-docs__card { padding: 18px; }
  .yak-doc__head { margin-bottom: 22px; }
}
