/* ==========================================================================
   Peoplyra — Base
   Element defaults layered on top of Bootstrap 5.3.
   ========================================================================== */

:root {
  --bs-font-sans-serif: var(--ppl-font-sans);
  --bs-body-font-family: var(--ppl-font-sans);
  --bs-body-font-size: .9375rem;
  --bs-body-line-height: 1.55;
  --bs-border-radius: var(--ppl-radius-md);
  --bs-border-radius-sm: var(--ppl-radius-sm);
  --bs-border-radius-lg: var(--ppl-radius-lg);
  --bs-border-radius-xl: var(--ppl-radius-xl);
  --bs-border-radius-pill: var(--ppl-radius-pill);
  --bs-code-color: var(--ppl-primary-text);
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--ppl-topbar-height) + 1rem); }

body {
  font-family: var(--ppl-font-sans);
  background: var(--ppl-bg);
  color: var(--ppl-text);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--ppl-text);
  font-weight: 650;
  letter-spacing: -.011em;
  line-height: 1.25;
}
h1, .h1 { font-size: 1.75rem; letter-spacing: -.02em; }
h2, .h2 { font-size: 1.375rem; letter-spacing: -.016em; }
h3, .h3 { font-size: 1.125rem; }
h4, .h4 { font-size: 1rem; }
h5, .h5 { font-size: .9375rem; }
h6, .h6 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

p { margin-bottom: 1rem; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
small, .small { font-size: .8125rem; }
code, kbd, pre, samp { font-family: var(--ppl-font-mono); }
code { font-size: .85em; padding: .1em .35em; background: var(--ppl-surface-2); border: 1px solid var(--ppl-border); border-radius: var(--ppl-radius-xs); }
kbd {
  font-size: .72rem; padding: .1rem .4rem; background: var(--ppl-surface-2); color: var(--ppl-text-muted);
  border: 1px solid var(--ppl-border-strong); border-bottom-width: 2px; border-radius: var(--ppl-radius-xs);
}
hr { border-color: var(--ppl-border); opacity: 1; }
::selection { background: var(--ppl-primary-soft-hover); color: var(--ppl-text); }

.text-muted, .text-body-secondary { color: var(--ppl-text-muted) !important; }
.text-subtle { color: var(--ppl-text-subtle) !important; }
.text-primary { color: var(--ppl-primary-text) !important; }
.text-success { color: var(--ppl-success-text) !important; }
.text-warning { color: var(--ppl-warning-text) !important; }
.text-danger  { color: var(--ppl-danger-text) !important; }
.text-info    { color: var(--ppl-info-text) !important; }
.tabular { font-variant-numeric: tabular-nums; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Focus — always visible for keyboard users */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ppl-primary);
  outline-offset: 2px;
  border-radius: var(--ppl-radius-xs);
}
[data-bs-theme="dark"] :focus-visible { outline-color: var(--ppl-primary-text); }

/* Skip link */
.skip-link {
  position: fixed; inset-block-start: .5rem; inset-inline-start: .5rem; z-index: 2000;
  padding: .5rem .875rem; background: var(--ppl-primary); color: var(--ppl-text-on-primary);
  border-radius: var(--ppl-radius-md); font-weight: 600; transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--ppl-text-on-primary); }

/* Icons (Lucide) */
svg.lucide, .ppl-icon {
  width: 1.125rem; height: 1.125rem; flex-shrink: 0; stroke-width: 1.75;
  vertical-align: -.2em;
}
.icon-xs svg.lucide, svg.lucide.icon-xs { width: .875rem; height: .875rem; }
.icon-sm svg.lucide, svg.lucide.icon-sm { width: 1rem; height: 1rem; }
.icon-lg svg.lucide, svg.lucide.icon-lg { width: 1.375rem; height: 1.375rem; }
.icon-xl svg.lucide, svg.lucide.icon-xl { width: 1.75rem; height: 1.75rem; }
i[data-lucide] { display: inline-block; width: 1.125rem; height: 1.125rem; } /* reserve space before hydration */

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--ppl-border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ppl-border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; }

/* Print */
@media print {
  .no-print, .app-sidebar, .app-topbar, .page-header .page-actions, .toast-region { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .app-main { margin: 0 !important; }
  .app-content { padding: 0 !important; }
}

/* Links inside running text are underlined so they never rely on colour alone (WCAG 1.4.1) */
p a:not(.btn), .t-sample a, .form-text a, .alert a { text-decoration: underline; text-underline-offset: 2px; }
