/* ==========================================================================
   Diário Oficial Eletrônico — base compartilhada (painel e portal)
   A cor institucional vem de --brand / --accent (definidas em Configurações).
   ========================================================================== */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }

:root {
  --brand: #1f4e8c;
  --accent: #c8102e;
  --brand-ink: color-mix(in srgb, var(--brand) 82%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 22%, #fff);

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --line: #e3e6ea;
  --line-strong: #cfd4da;
  --ink: #1a1e23;
  --ink-2: #4a525c;
  --ink-3: #737b85;

  --ok: #157f3b;      --ok-soft: #e6f4ea;
  --warn: #9a5b00;    --warn-soft: #fdf3e1;
  --bad: #b42318;     --bad-soft: #fdecea;
  --info: #1d5fa8;    --info-soft: #e8f1fb;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --bs-body-font-family: var(--font);
  --bs-primary: var(--brand);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-ink);
  --bs-border-color: var(--line);
}

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 9999; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { left: 8px; }

mark { background: #fff1a8; padding: 0 2px; border-radius: 2px; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; }

/* ---------- Botões (sobre o Bootstrap) ---------- */
.btn { font-weight: 550; border-radius: 8px; display: inline-flex; align-items: center; gap: .45rem; justify-content: center; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-ink); --bs-btn-hover-border-color: var(--brand-ink); --bs-btn-active-bg: var(--brand-ink); --bs-btn-active-border-color: var(--brand-ink); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand-line); --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-color: var(--brand-ink); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-soft); --bs-btn-active-color: var(--brand-ink); }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-strong); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--line-strong); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; height: 30px; }

/* ---------- Formulários ---------- */
.form-label { font-weight: 600; font-size: .86rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-control, .form-select { border-color: var(--line-strong); border-radius: 8px; font-size: .95rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.form-text { color: var(--ink-3); font-size: .82rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.req { color: var(--bad); }

/* ---------- Status ---------- */
.badge-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.badge-status i { font-size: .62rem; }
.tone-success { background: var(--ok-soft); color: var(--ok); }
.tone-warning { background: var(--warn-soft); color: var(--warn); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-danger { background: var(--bad-soft); color: var(--bad); }
.tone-neutral { background: #eef0f2; color: var(--ink-2); }

.chip { display: inline-block; font-size: .74rem; font-weight: 600; padding: .12rem .5rem; border-radius: 5px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }

/* ---------- Paginação ---------- */
.pager { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 1.25rem 0 .25rem; }
.pager-link { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .9rem; }
.pager-link:hover { border-color: var(--brand-line); color: var(--brand); }
.pager-link.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-link.disabled { opacity: .4; pointer-events: none; }
.pager-gap { padding: 0 4px; color: var(--ink-3); align-self: center; }

/* ---------- Estados vazios ---------- */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--ink-3); }
.empty i { font-size: 2rem; color: var(--line-strong); margin-bottom: .75rem; display: block; }
.empty strong { display: block; color: var(--ink-2); font-size: 1rem; margin-bottom: .25rem; }

/* ---------- Texto oficial (matérias) ---------- */
.ato { font-family: var(--font-serif); font-size: 1.06rem; line-height: 1.7; color: #1b1b1b; }
.ato p { margin: 0 0 .8em; text-align: justify; hyphens: auto; }
.ato h2, .ato h3, .ato h4 { font-family: var(--font-serif); font-weight: 700; margin: 1.2em 0 .5em; }
.ato table { width: 100%; border-collapse: collapse; margin: .75em 0 1em; font-family: var(--font); font-size: .9rem; }
.ato th, .ato td { border: 1px solid #c9ced4; padding: .4em .55em; vertical-align: top; text-align: left; }
.ato th { background: #f1f3f5; font-weight: 650; }
.ato blockquote { border-left: 3px solid var(--line-strong); padding-left: 1em; color: var(--ink-2); margin: 1em 0; }
.ato ul, .ato ol { padding-left: 1.6em; }
.ato-cabecalho { text-align: center; margin-bottom: 1.25rem; }
.ato-titulo { font-family: var(--font-serif); font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; text-transform: uppercase; color: var(--brand-ink); margin: 0 0 .75rem; }
/* .ato .ato-ementa vence a regra genérica .ato p */
.ato .ato-ementa, .ato-ementa { font-family: var(--font-serif); font-style: italic; color: #333; margin: 0 0 1.25rem auto; max-width: 58%; text-align: justify; line-height: 1.55; }
.ato-assinatura { text-align: center; margin-top: 1.75rem; font-family: var(--font-serif); }
.ato-assinatura img { max-height: 56px; display: block; margin: 0 auto 2px; }
.ato-assinatura strong { display: block; text-transform: uppercase; letter-spacing: .02em; }
.ato-assinatura span { color: var(--ink-2); }
.ato-local { text-align: center; font-family: var(--font-serif); margin-top: 1.5rem; color: #333; }
@media (max-width: 640px) { .ato-ementa { max-width: 100%; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
