/**
 * Zapisy.pro – Lekka warstwa klas pomocniczych (utility) na tokenach.
 * Ergonomia Tailwinda bez build-stepu i bez konfliktów z WP (klasy semantyczne
 * .zp-card/.zp-btn pozostają nadrzędne). Wspólne dla admina i frontendu.
 * @package ZP_Pro
 */

/* ── Layout / flex ─────────────────────────────────────────── */
.zp-flex { display: flex; }
.zp-inline-flex { display: inline-flex; }
.zp-grid { display: grid; }
.zp-row { display: flex; flex-direction: row; }
.zp-col { display: flex; flex-direction: column; }
.zp-stack { display: flex; flex-direction: column; }
.zp-wrap { flex-wrap: wrap; }
.zp-grow { flex: 1 1 auto; min-width: 0; }
.zp-shrink-0 { flex: 0 0 auto; }

.zp-items-center { align-items: center; }
.zp-items-start { align-items: flex-start; }
.zp-items-end { align-items: flex-end; }
.zp-justify-center { justify-content: center; }
.zp-justify-between { justify-content: space-between; }
.zp-justify-end { justify-content: flex-end; }
.zp-vcenter { align-items: center; }
.zp-between { display: flex; align-items: center; justify-content: space-between; }

/* ── Gap (skala odstępów) ──────────────────────────────────── */
.zp-gap-1 { gap: var(--zp-space-1); }
.zp-gap-2 { gap: var(--zp-space-2); }
.zp-gap-3 { gap: var(--zp-space-3); }
.zp-gap-4 { gap: var(--zp-space-4); }
.zp-gap-5 { gap: var(--zp-space-5); }
.zp-gap-6 { gap: var(--zp-space-6); }

/* ── Margines górny / dolny ────────────────────────────────── */
.zp-mt-0 { margin-top: 0; } .zp-mt-1 { margin-top: var(--zp-space-1); }
.zp-mt-2 { margin-top: var(--zp-space-2); } .zp-mt-3 { margin-top: var(--zp-space-3); }
.zp-mt-4 { margin-top: var(--zp-space-4); } .zp-mt-5 { margin-top: var(--zp-space-5); }
.zp-mt-6 { margin-top: var(--zp-space-6); } .zp-mt-auto { margin-top: auto; }
.zp-mb-2 { margin-bottom: var(--zp-space-2); } .zp-mb-3 { margin-bottom: var(--zp-space-3); }
.zp-mb-4 { margin-bottom: var(--zp-space-4); } .zp-mb-6 { margin-bottom: var(--zp-space-6); }

/* ── Padding ───────────────────────────────────────────────── */
.zp-p-2 { padding: var(--zp-space-2); } .zp-p-3 { padding: var(--zp-space-3); }
.zp-p-4 { padding: var(--zp-space-4); } .zp-p-5 { padding: var(--zp-space-5); }
.zp-p-6 { padding: var(--zp-space-6); }

/* ── Typografia / kolor ────────────────────────────────────── */
.zp-text-center { text-align: center; }
.zp-text-right { text-align: right; }
.zp-bold { font-weight: 700; }
.zp-semibold { font-weight: 600; }
.zp-muted { color: var(--zp-text-m); }
.zp-fs-sm { font-size: var(--zp-fs-sm); }
.zp-fs-lg { font-size: var(--zp-fs-lg); }
.zp-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Wymiary ───────────────────────────────────────────────── */
.zp-w-full { width: 100%; }

/* ── Responsywność ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .zp-hide-sm { display: none !important; }
  .zp-stack-sm { flex-direction: column !important; align-items: stretch !important; }
}
.zp-only-sm { display: none; }
@media (max-width: 600px) { .zp-only-sm { display: revert; } }

/* ── Dostępność ────────────────────────────────────────────── */
.zp-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.zp-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: var(--zp-z-modal);
  background: var(--zp-navy); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--zp-r) 0; font-weight: 600;
}
.zp-skip-link:focus { left: 0; }

/* Globalny widoczny focus dla klawiatury (zero-specyficzność → komponenty mogą nadpisać) */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--zp-focus);
}

/* ── Ikony ─────────────────────────────────────────────────── */
.zp-icon { display: inline-block; vertical-align: -0.18em; flex: 0 0 auto; }

/* ── Toasty (wspólny helper zpToast) ───────────────────────── */
.zpui-toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: var(--zp-z-toast);
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.zpui-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  background: var(--zp-surface); color: var(--zp-text);
  border: 1px solid var(--zp-border); border-left: 4px solid var(--zp-gray);
  border-radius: var(--zp-r-md); box-shadow: var(--zp-sh-lg);
  padding: 12px 12px 12px 14px; font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(10px); transition: opacity var(--zp-dur-2) var(--zp-ease), transform var(--zp-dur-2) var(--zp-ease-spring);
}
.zpui-toast.is-in { opacity: 1; transform: translateY(0); }
.zpui-toast.is-out { opacity: 0; transform: translateY(10px); }
.zpui-toast__ic { display: inline-flex; flex: none; }
.zpui-toast__msg { flex: 1; min-width: 0; line-height: 1.35; }
.zpui-toast__x { flex: none; background: none; border: none; cursor: pointer; color: var(--zp-text-m); padding: 2px; display: inline-flex; border-radius: var(--zp-r); }
.zpui-toast__x:hover { color: var(--zp-text); background: var(--zp-surface-2); }
.zpui-toast--success { border-left-color: var(--zp-green); } .zpui-toast--success .zpui-toast__ic { color: var(--zp-green); }
.zpui-toast--error   { border-left-color: var(--zp-red); }   .zpui-toast--error .zpui-toast__ic { color: var(--zp-red); }
.zpui-toast--warning { border-left-color: var(--zp-warning); } .zpui-toast--warning .zpui-toast__ic { color: var(--zp-warning); }
.zpui-toast--info    { border-left-color: var(--zp-blue); }  .zpui-toast--info .zpui-toast__ic { color: var(--zp-blue); }
@media (max-width: 600px) {
  .zpui-toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
