/* css/19-kb-capture.css — Angel Hub
   Knowledge Base "Capture" composer (modules/kb-capture.js).

   A full-screen, camera-first capture sheet. Buttons reuse .tasks-btn*; only
   the composer's own surfaces are styled here. Works in dark + light themes
   (uses theme vars, no hardcoded surface colours) and sits below the
   impersonation banner via top:var(--banner-h). The class ends in "-overlay"
   so ui/modal-stack.js stacks it.

   Phase 1 styles. Phases 2–4 add .kbcap-deck* (the photo→description slides)
   reusing the .photo-hero* carousel mechanics from css/14. */

.kbcap-overlay {
  position: fixed;
  inset: 0;
  /* Transient full-screen modal (like the Tasks create/detail modal): cover the
     whole viewport and push the sheet below the iOS status bar / notch at the
     OVERLAY level — more reliable than env() inside a nested header calc().
     Matches css/05 .tasks-modal-overlay.is-fullscreen-overlay so the Save button
     never hides behind the iPhone battery/status bar. */
  padding-top: env(safe-area-inset-top, 0px);
  z-index: 4000;
  display: flex;
  background: color-mix(in srgb, #000 40%, transparent);
  animation: kbcapIn 0.18s ease;
}
@keyframes kbcapIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.kbcap-sheet {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-surface);
}
@media (min-width: 768px) {
  .kbcap-sheet { box-shadow: 0 0 0 1px var(--border), 0 24px 60px rgba(0, 0, 0, 0.35); }
}

/* ── Header ───────────────────────────────────────────────────────── */
.kbcap-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.kbcap-head-title { flex: 1; min-width: 0; }
.kbcap-head-h {
  font-family: var(--font-display, inherit);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: 1.1;
}
.kbcap-head-sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kbcap-head-sub strong { color: var(--text-primary); font-weight: 600; }

.kbcap-close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.kbcap-close:hover { color: var(--text-primary); border-color: var(--text-muted); }
.kbcap-close svg { width: 20px; height: 20px; }
.kbcap-save { flex-shrink: 0; }

/* ── Body ─────────────────────────────────────────────────────────── */
.kbcap-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom, 0px));
}

.kbcap-title {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 6px 2px;
  font-family: var(--font-display, inherit);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}
.kbcap-title::placeholder { color: var(--text-muted); font-weight: 600; }
.kbcap-title:focus { outline: none; border-bottom-color: var(--accent); }

.kbcap-note-wrap { position: relative; }
.kbcap-note {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 50px 12px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-md);
  line-height: 1.5;
}
.kbcap-note::placeholder { color: var(--text-muted); }
.kbcap-note:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* Compact one-row variant (New-task sheet, Radek 2026-07-03): starts a single
   line tall — rows="1" sets the natural height — and auto-grows with input via
   JS in tasks.js. Manual resize off: growth is automatic, and the handle
   collides with the mic corner at one-row height. KB Capture keeps the roomy
   88px default above. */
.kbcap-note.kbcap-note-compact {
  min-height: 0;
  resize: none;
  overflow-y: auto;
}

.kbcap-mic {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.kbcap-mic svg { width: 18px; height: 18px; }
.kbcap-mic:hover { color: var(--text-primary); }
.kbcap-mic.recording {
  background: var(--danger, #ef4444);
  border-color: var(--danger, #ef4444);
  color: #fff;
  animation: kbcapPulse 1.3s ease-in-out infinite;
}
@keyframes kbcapPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger, #ef4444) 55%, transparent); }
  50%      { box-shadow: 0 0 0 7px transparent; }
}

/* Photo capture is the shared AngelHubUI.photoCapture control
   (ui/photo-capture.js), which reuses the .tasks-photo-capture* styles from
   css/05 — so the camera card, the shrink-on-photos behaviour and the
   thumbnail strip are identical to the New Task form. No styles needed here. */

/* ── "Capture" button in the KB action strip (icon + label pill) ──── */
.kb-capture-btn { gap: 8px; }
.kb-capture-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Mobile width pass (2026-06-25): tighten horizontal padding on mobile so content
   uses the screen width. Appended at end-of-file so it beats the base rules AND any
   wider-breakpoint (600/640/767px) blocks at equal specificity (later source wins).
   Desktop (>=600px) untouched. */
@media (max-width: 599px) {
  .kbcap-head { padding: 12px 10px; gap: 8px; }
  .kbcap-body { padding: 14px 10px calc(28px + env(safe-area-inset-bottom, 0px)); }
}
