/* Source Sans 3, latin-ext. See ../fonts/source-sans-3/ for license and provenance. */
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3/source-sans-3-latin-ext-italic.5358bd4fb16e.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Source Sans 3, latin. See ../fonts/source-sans-3/ for license and provenance. */
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3/source-sans-3-latin-italic.cd60e3b13ca1.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Sans 3, latin-ext. See ../fonts/source-sans-3/ for license and provenance. */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3/source-sans-3-latin-ext-normal.c6ba61588d7d.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Source Sans 3, latin. See ../fonts/source-sans-3/ for license and provenance. */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-sans-3/source-sans-3-latin-normal.9ef356ea553a.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Serif 4, latin-ext. See ../fonts/source-serif-4/ for license and provenance. */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4/source-serif-4-latin-ext-italic.3ff52c8f866c.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Source Serif 4, latin. See ../fonts/source-serif-4/ for license and provenance. */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4/source-serif-4-latin-italic.66c33f6b248f.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Serif 4, latin-ext. See ../fonts/source-serif-4/ for license and provenance. */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4/source-serif-4-latin-ext-normal.33ba75072ebc.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Source Serif 4, latin. See ../fonts/source-serif-4/ for license and provenance. */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4/source-serif-4-latin-normal.e9192c2fe0a3.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  /* Typography is shared by both themes, lean/legacy pages and lazy readers. */
  --font-ui: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-reading: "Source Serif 4", Georgia, "Times New Roman", serif;
  --reading-measure: 70ch;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --text-caption: .8125rem;
  --text-small: .875rem;
  --text-body: 1rem;
  --text-reading: 1.125rem;
  --text-title: 1.125rem;
  --text-section: 1.25rem;
  --text-heading: 1.5rem;
  --text-page: clamp(1.65rem, 1.25rem + 1.5vw, 2.3rem);
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --leading-heading: 1.2;
  --leading-compact: 1.35;
  --leading-ui: 1.5;
  --leading-copy: 1.65;
  --leading-reading: 1.7;
  --bg-body: #f2f2f2;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-surface-3: #f2f6fb;
  --surface-muted: #f8fafc;
  --surface-raised: #ffffff;
  --surface-accent: #edf4ff;
  --text-color: #1f2d3d;
  --text-muted: #667789;
  --text-subtle: #8a97a5;
  --border-color: #dbe2ea;
  --border-strong: #314150;
  --brand-color: #de3e80;
  --accent-color: #0d52bf;
  --accent-color-soft: #edf4ff;
  --chip-neutral-bg: #f8fafc;
  --chip-neutral-text: #425468;
  --chip-neutral-border: #dbe2ea;
  --chip-info-bg: #edf4ff;
  --chip-info-text: #2253a4;
  --chip-warning-bg: #f6ede0;
  --chip-warning-text: #7a5731;
  --chip-danger-bg: #fbf0f2;
  --chip-danger-text: #8c2f40;
  --chip-success-bg: #e8f5ee;
  --chip-success-text: #2f6845;
  --shadow-card: 0 2px 2px rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px rgba(0, 0, 0, 0.12);
  --shadow-card-hover: 0 3px 4px rgba(0, 0, 0, 0.14), 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 1px 8px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-body: #17212b;
  --bg-surface: #1f2b38;
  --bg-surface-2: #243241;
  --bg-surface-3: #20303f;
  --surface-muted: #243241;
  --surface-raised: #1f2b38;
  --surface-accent: rgba(143, 193, 255, 0.12);
  --text-color: #e6edf5;
  --text-muted: #a8b4c3;
  --text-subtle: #93a9c4;
  --border-color: #314150;
  --border-strong: #465a6f;
  --accent-color: #8fc1ff;
  --accent-color-soft: rgba(143, 193, 255, 0.12);
  --chip-neutral-bg: #243241;
  --chip-neutral-text: #e6edf5;
  --chip-neutral-border: #314150;
  --chip-info-bg: rgba(143, 193, 255, 0.12);
  --chip-info-text: #b6d5ff;
  --chip-warning-bg: #6b5130;
  --chip-warning-text: #f0cf9d;
  --chip-danger-bg: #5a2d36;
  --chip-danger-text: #f4bcc5;
  --chip-success-bg: #244738;
  --chip-success-text: #a7f3d0;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.26);
  --shadow-card-hover: 0 18px 40px rgba(0, 0, 0, 0.34);
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: var(--leading-ui);
}

/* Use the browser's preferred root size; never lock the page to a pixel size. */
button, input, select, textarea { font-family: inherit; }
code, pre, kbd, samp { font-family: var(--font-mono); }
small, .small { font-size: var(--text-caption); }
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
}
h1 { font-size: var(--text-page); }
h2 { font-size: var(--text-heading); }
h3 { font-size: var(--text-section); }

/* The shared theme owns toast colors, including the legacy bundle loaded later. */
.mley-toast-region .mley-toast {
  --toast-accent: var(--chip-info-text);
  color: var(--text-color);
}

.mley-toast-region .mley-toast[data-kind="success"] {
  --toast-accent: var(--chip-success-text);
}

.mley-toast-region .mley-toast[data-kind="warning"] {
  --toast-accent: var(--chip-warning-text);
}

.mley-toast-region .mley-toast[data-kind="error"] {
  --toast-accent: var(--chip-danger-text);
}

.mley-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  padding: 0.22rem 0.62rem;
  border: 1px solid var(--chip-neutral-border);
  border-radius: 999px;
  background: var(--chip-neutral-bg);
  color: var(--chip-neutral-text);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

.mley-chip--neutral {
  border-color: var(--chip-neutral-border);
  background: var(--chip-neutral-bg);
  color: var(--chip-neutral-text);
}

.mley-chip--info {
  border-color: var(--chip-info-bg);
  background: var(--chip-info-bg);
  color: var(--chip-info-text);
}

.mley-chip--warning {
  border-color: var(--chip-warning-bg);
  background: var(--chip-warning-bg);
  color: var(--chip-warning-text);
}

.mley-chip--danger {
  border-color: var(--chip-danger-bg);
  background: var(--chip-danger-bg);
  color: var(--chip-danger-text);
}

.mley-chip--success {
  border-color: var(--chip-success-bg);
  background: var(--chip-success-bg);
  color: var(--chip-success-text);
}

.badge-light,
html body[data-page-kind] .badge-light,
.badge-secondary,
html body[data-page-kind] .badge-secondary,
.btn-light,
html body[data-page-kind] .btn-light,
.list-group-item,
html body[data-page-kind] .list-group-item,
.page-link,
html body[data-page-kind] .page-link {
  border-color: var(--chip-neutral-border);
  background: var(--chip-neutral-bg);
  color: var(--chip-neutral-text);
}

.badge-warning,
html body[data-page-kind] .badge-warning {
  background: var(--chip-warning-bg);
  color: var(--chip-warning-text);
}

.badge-danger,
html body[data-page-kind] .badge-danger,
.alert-danger,
html body[data-page-kind] .alert-danger {
  border-color: var(--chip-danger-bg);
  background: var(--chip-danger-bg);
  color: var(--chip-danger-text);
}

.alert-light,
html body[data-page-kind] .alert-light {
  background: var(--surface-muted);
  border-color: var(--chip-neutral-border);
  color: var(--text-muted);
}

.badge-light[href]:hover,
.badge-light[href]:focus,
.btn-light:hover,
.btn-light:focus,
.btn-light:active,
html body[data-page-kind] .badge-light[href]:hover,
html body[data-page-kind] .badge-light[href]:focus,
html body[data-page-kind] .btn-light:hover,
html body[data-page-kind] .btn-light:focus,
html body[data-page-kind] .btn-light:active {
  border-color: var(--border-strong);
  background: var(--surface-accent);
  color: var(--chip-neutral-text);
}

/* HTML reading surfaces only: never target PDF text layers or official facsimiles. */
.mley-reading-text,
.sjf-document [data-official-html] {
  font-family: var(--font-reading);
  font-size: var(--text-reading);
  font-optical-sizing: auto;
  line-height: var(--leading-reading);
  text-align: left;
  max-width: var(--reading-measure);
  margin-inline: auto;
  overflow-wrap: anywhere;
}
.mley-reading-text :is(p, li, blockquote),
.sjf-document [data-official-html] :is(p, li, blockquote) { font-size: inherit; line-height: inherit; }
.mley-reading-text :is(.p-reformado, .badge, .mley-article-card-footer) { font-family: var(--font-ui); }
.mley-reading-text :is(button, input, select, textarea):not(.mley-inline-trigger) { font-family: var(--font-ui); }
