/*
###############################################################################
# Modern PMB tokens
# FR: Definit les jetons visuels communs du theme clair/sombre modern-pmb.
#     Les fontes sont embarquees pour garantir un rendu stable.
# EN: Defines shared light/dark visual tokens for the modern-pmb theme.
#     Fonts are bundled to keep rendering stable.
# Called by: opac/styles/opac.css, management/styles/management.css
# Calls: optional local font assets
###############################################################################
*/

@font-face {
  font-family: "IdentitySans";
  src: url("../assets/fonts/DejaVuSans.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IdentitySans";
  src: url("../assets/fonts/DejaVuSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IdentityMono";
  src: url("../assets/fonts/DejaVuSansMono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ModernPmbHangul";
  src: url("../assets/fonts/SourceHanSansKR-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ModernPmbHangul";
  src: url("../assets/fonts/SourceHanSansKR-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --pmb-font-ui: "IdentitySans", "ModernPmbHangul", sans-serif;
  --pmb-font-mono: "IdentityMono", monospace;
  --pmb-radius: 7px;
  --pmb-space-1: 4px;
  --pmb-space-2: 8px;
  --pmb-space-3: 12px;
  --pmb-space-4: 16px;
  --pmb-space-5: 24px;
  --pmb-space-6: 32px;
  --pmb-focus: #7c3aed;
  --pmb-danger: #b42318;
  --pmb-warning: #b54708;
  --pmb-success: #047857;
  --pmb-control-height: 40px;
  --pmb-transition: 140ms ease;
}

:root,
[data-pmb-theme-mode="light"] {
  --pmb-bg: #f6f7f9;
  --pmb-surface: #ffffff;
  --pmb-surface-raised: #fbfcfd;
  --pmb-surface-muted: #eef2f6;
  --pmb-text: #172033;
  --pmb-text-muted: #5d6677;
  --pmb-line: #d9e0e8;
  --pmb-accent: #005f73;
  --pmb-accent-strong: #0a3f4b;
  --pmb-accent-soft: #d8f1f1;
  --pmb-signal: #c2410c;
  --pmb-signal-soft: #fff1e8;
  --pmb-shadow: 0 14px 28px rgba(23, 32, 51, 0.08);
  color-scheme: light;
}

[data-pmb-theme-mode="dark"] {
  --pmb-bg: #0d1117;
  --pmb-surface: #151b23;
  --pmb-surface-raised: #1d2630;
  --pmb-surface-muted: #26313d;
  --pmb-text: #f3f7fb;
  --pmb-text-muted: #c6d0dc;
  --pmb-line: #465464;
  --pmb-accent: #8bd8d5;
  --pmb-accent-strong: #b8f0ee;
  --pmb-accent-soft: #173f45;
  --pmb-signal: #ffc078;
  --pmb-signal-soft: #4a321e;
  --pmb-shadow: 0 18px 32px rgba(0, 0, 0, 0.48);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--pmb-bg);
}

body {
  margin: 0;
  color: var(--pmb-text);
  background: var(--pmb-bg);
  font-family: var(--pmb-font-ui);
  font-size: 15px;
  line-height: 1.5;
}

:where(a) {
  color: var(--pmb-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--pmb-focus);
  outline-offset: 3px;
}

:where(button, input, select, textarea) {
  font: inherit;
}

:where(button, input, select, textarea):disabled,
:where([aria-disabled="true"]) {
  cursor: not-allowed;
  opacity: 0.58;
}

@media (prefers-color-scheme: dark) {
  [data-pmb-theme-mode="system"] {
    --pmb-bg: #0d1117;
    --pmb-surface: #151b23;
    --pmb-surface-raised: #1d2630;
    --pmb-surface-muted: #26313d;
    --pmb-text: #f3f7fb;
    --pmb-text-muted: #c6d0dc;
    --pmb-line: #465464;
    --pmb-accent: #8bd8d5;
    --pmb-accent-strong: #b8f0ee;
    --pmb-accent-soft: #173f45;
    --pmb-signal: #ffc078;
    --pmb-signal-soft: #4a321e;
    --pmb-shadow: 0 18px 32px rgba(0, 0, 0, 0.48);
    color-scheme: dark;
  }
}
