/* ==========================================================================
   Portal público do Diário Oficial
   ========================================================================== */
body.portal { background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
.portal-main { flex: 1; padding: 2rem 0 3rem; }
.container { max-width: 1180px; }

/* ---------- Barra do governo ---------- */
.govbar { background: #15191e; color: #c9ced4; font-size: .8rem; }
.govbar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 34px; }
.govbar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.govbar-tools { display: flex; gap: 2px; flex-shrink: 0; }
.govbar-tools button { background: none; border: 0; color: #c9ced4; padding: 4px 8px; border-radius: 4px; font-size: .8rem; font-weight: 600; }
.govbar-tools button:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Cabeçalho ---------- */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--brand) 0 70%, var(--accent) 70% 100%); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 1.1rem; padding-bottom: 1.1rem; flex-wrap: wrap; }
.masthead-brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: inherit; min-width: 0; }
.masthead-seal { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.masthead-seal.placeholder { display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); border-radius: 12px; font-size: 1.6rem; }
.masthead-title { display: block; font-family: var(--font-serif); font-weight: 700; font-size: clamp(1.35rem, 2.6vw, 1.85rem); line-height: 1.15; color: var(--brand-ink); letter-spacing: -.005em; }
.masthead-sub { display: block; font-size: .88rem; color: var(--ink-3); margin-top: .2rem; }
.masthead-search { display: flex; flex: 0 1 380px; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.masthead-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.masthead-search input { flex: 1; border: 0; padding: .65rem .9rem; font-size: .95rem; min-width: 0; outline: none; }
.masthead-search button { border: 0; background: var(--brand); color: #fff; padding: 0 1rem; }
@media (max-width: 767.98px) { .masthead-search { flex-basis: 100%; } .masthead-seal { width: 52px; height: 52px; } }

.mainnav { background: var(--brand); }
.mainnav ul { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; overflow-x: auto; }
.mainnav a { display: flex; align-items: center; gap: .45rem; color: rgba(255, 255, 255, .88); text-decoration: none; padding: .8rem .95rem; font-weight: 550; font-size: .92rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.mainnav a i { font-size: .82rem; opacity: .8; }
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.mainnav a.active { color: #fff; border-bottom-color: #fff; }
.mainnav-toggle { background: none; border: 0; color: #fff; padding: .75rem 0; font-weight: 600; }
@media (max-width: 767.98px) {
  .mainnav ul { display: none; flex-direction: column; padding-bottom: .5rem; }
  .mainnav ul.open { display: flex; }
  .mainnav a { border-bottom: 0; border-left: 3px solid transparent; }
  .mainnav a.active { border-left-color: #fff; }
}
.notice-bar { background: var(--warn-soft); color: #5c3700; border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, #fff); padding: .65rem 0; font-size: .92rem; font-weight: 500; }

/* ---------- Blocos ---------- */
.card-x { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-x + .card-x { margin-top: 1.25rem; }
.card-x-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-x-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .55rem; }
.card-x-head h2 i { color: var(--brand); font-size: .95rem; }
.card-x-body { padding: 1.25rem; }
.section-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem; }
.page-title { font-family: var(--font-serif); font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; color: var(--ink); margin: 0 0 .35rem; letter-spacing: -.01em; }
.page-lead { color: var(--ink-2); margin-bottom: 1.5rem; max-width: 70ch; }
.crumbs-p { font-size: .85rem; color: var(--ink-3); margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.crumbs-p a { color: var(--ink-3); text-decoration: none; }
.crumbs-p a:hover { color: var(--brand); text-decoration: underline; }
.crumbs-p i { font-size: .6rem; }

/* ---------- Destaque da edição (início) ---------- */
.hero-ed { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; padding: 1.75rem; position: relative; overflow: hidden; }
.hero-ed::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--brand); }
.hero-kicker { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: .4rem; }
.hero-num { font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.05; color: var(--ink); }
.hero-date { font-size: 1.05rem; color: var(--ink-2); margin: .35rem 0 1rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .88rem; color: var(--ink-3); margin-bottom: 1.25rem; }
.hero-meta i { color: var(--brand); margin-right: .3rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-actions .btn { padding: .6rem 1.1rem; }
.hero-sumario { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1rem; }
.hero-sumario h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin-bottom: .6rem; }
.hero-sumario ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.hero-sumario li { break-inside: avoid; padding: .2rem 0; font-size: .92rem; }
.hero-sumario a { color: var(--ink); text-decoration: none; }
.hero-sumario a:hover { color: var(--brand); text-decoration: underline; }
.hero-qr { text-align: center; font-size: .75rem; color: var(--ink-3); }
.hero-qr svg { width: 112px; height: 112px; display: block; margin: 0 auto .4rem; }
@media (max-width: 767.98px) { .hero-ed { grid-template-columns: 1fr; } .hero-qr { display: none; } .hero-sumario ul { columns: 1; } }

/* ---------- Listas ---------- */
.ato-list { list-style: none; margin: 0; padding: 0; }
.ato-item { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.ato-item:last-child { border-bottom: 0; }
.ato-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-bottom: .3rem; font-size: .8rem; color: var(--ink-3); }
.ato-item h3 { font-size: 1.02rem; font-weight: 650; margin: 0 0 .25rem; line-height: 1.35; }
.ato-item h3 a { color: var(--ink); text-decoration: none; }
.ato-item h3 a:hover { color: var(--brand); text-decoration: underline; }
.ato-item p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.ato-item .snippet { font-size: .88rem; color: var(--ink-3); margin-top: .35rem; }

.ed-list { list-style: none; margin: 0; padding: 0; }
.ed-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 1rem; align-items: center; padding: .95rem 1.25rem; border-bottom: 1px solid var(--line); }
.ed-row:last-child { border-bottom: 0; }
.ed-date { text-align: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.ed-date b { display: block; font-size: 1.45rem; line-height: 1.1; padding-top: .3rem; color: var(--ink); }
.ed-date small { display: block; font-size: .7rem; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; background: var(--brand); color: #fff; padding: 2px 0; margin-top: .25rem; }
.ed-info a.ed-title { font-weight: 650; font-size: 1rem; color: var(--ink); text-decoration: none; }
.ed-info a.ed-title:hover { color: var(--brand); text-decoration: underline; }
.ed-info .ed-sub { font-size: .85rem; color: var(--ink-3); }
.ed-info .ed-resumo { font-size: .9rem; color: var(--ink-2); margin-top: .15rem; }
.ed-actions { display: flex; gap: .4rem; }
@media (max-width: 575.98px) { .ed-row { grid-template-columns: 60px 1fr; } .ed-actions { grid-column: 1 / -1; } }

/* ---------- Calendário ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.cal-head a { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.cal-head a:hover { background: var(--surface-2); color: var(--brand); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-dow { font-size: .72rem; font-weight: 700; color: var(--ink-3); padding: .25rem 0; }
.cal-day { aspect-ratio: 1; display: grid; place-items: center; font-size: .86rem; border-radius: 8px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cal-day.has-ed { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; text-decoration: none; }
.cal-day.has-ed:hover { background: var(--brand); color: #fff; }
.cal-day.is-today { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- Leitura de edição / matéria ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.doc-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 991.98px) { .doc-layout { grid-template-columns: 1fr; } .doc-side { position: static; } }
.doc-paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.25rem, 4vw, 3rem); }
.doc-paper .ato + .ato { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 2.5rem; }
.unidade-sep { font-family: var(--font); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--brand); padding: .45rem .8rem; border-radius: 4px; text-align: center; margin: 2.5rem 0 1.5rem; }
.unidade-sep:first-child { margin-top: 0; }
.ato-anexos { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin: 1.25rem 0; font-family: var(--font); font-size: .92rem; }
.ato-anexos ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.ato-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; font-family: var(--font); }
.doc-sumario { list-style: none; margin: 0; padding: 0; counter-reset: s; max-height: 60vh; overflow-y: auto; }
.doc-sumario li { counter-increment: s; font-size: .86rem; border-bottom: 1px dashed var(--line); }
.doc-sumario a { display: flex; gap: .5rem; padding: .45rem 0; color: var(--ink-2); text-decoration: none; }
.doc-sumario a::before { content: counter(s) "."; color: var(--ink-3); min-width: 1.4rem; font-variant-numeric: tabular-nums; }
.doc-sumario a:hover { color: var(--brand); }
.meta-list { margin: 0; font-size: .88rem; }
.meta-list dt { color: var(--ink-3); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.meta-list dd { margin: 0 0 .75rem; word-break: break-word; }
.meta-list dd:last-child { margin-bottom: 0; }
.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 8px; padding: .5rem .75rem; text-align: center; font-size: 1rem; }
.qr-mini svg { width: 120px; height: 120px; display: block; margin: .5rem auto; }
.banner-retif { display: flex; gap: .75rem; background: var(--warn-soft); color: #5c3700; border: 1px solid color-mix(in srgb, var(--warn) 30%, #fff); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1.25rem; font-size: .93rem; }
.banner-retif i { margin-top: 3px; }

/* ---------- Busca ---------- */
.search-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.search-big { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-big input { flex: 1; height: 50px; font-size: 1.05rem; }
.search-big .btn { height: 50px; padding: 0 1.4rem; }
.result-count { color: var(--ink-3); font-size: .92rem; margin-bottom: .75rem; }

/* ---------- Verificação ---------- */
.verify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 767.98px) { .verify-grid { grid-template-columns: 1fr; } }
.verify-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.verify-card h2 { font-size: 1.05rem; font-weight: 700; display: flex; gap: .55rem; align-items: center; }
.verify-card h2 i { color: var(--brand); }
.file-drop { display: flex; flex-direction: column; align-items: center; gap: .4rem; border: 2px dashed var(--line-strong); border-radius: 10px; padding: 1.25rem; text-align: center; cursor: pointer; color: var(--ink-3); }
.file-drop:hover { border-color: var(--brand); color: var(--brand); }
.file-drop i { font-size: 1.6rem; }
.verdict { border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start; border: 1px solid; }
.verdict-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; color: #fff; }
.verdict.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, #fff); }
.verdict.ok .verdict-icon { background: var(--ok); }
.verdict.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, #fff); }
.verdict.bad .verdict-icon { background: var(--bad); }
.verdict h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 .25rem; }
.verdict dl { display: grid; grid-template-columns: 160px 1fr; gap: .3rem 1rem; margin: 1rem 0 0; font-size: .92rem; }
.verdict dt { color: var(--ink-2); font-weight: 600; }
.verdict dd { margin: 0; word-break: break-word; }
@media (max-width: 575.98px) { .verdict { grid-template-columns: 1fr; } .verdict dl { grid-template-columns: 1fr; } }

/* ---------- Rodapé ---------- */
.site-footer { background: #15191e; color: #b9bfc6; font-size: .9rem; padding: 2.5rem 0 1.25rem; }
.site-footer a { color: #e3e6ea; }
.footer-brand { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: .5rem; }
.footer-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #8a929b; font-weight: 700; margin-bottom: .75rem; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { padding: .2rem 0; }
.footer-list i { width: 18px; color: #8a929b; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 2rem; padding-top: 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: #8a929b; }
.footer-bottom a { color: #8a929b; text-decoration: none; }

/* ---------- Alto contraste ---------- */
html.hc body, html.hc .masthead, html.hc .card-x, html.hc .doc-paper, html.hc .verify-card, html.hc .search-panel { background: #000 !important; color: #fff !important; border-color: #fff !important; }
html.hc a, html.hc .ato-item h3 a, html.hc .ed-info a.ed-title { color: #ff0 !important; }
html.hc .mainnav, html.hc .unidade-sep, html.hc .ed-date small, html.hc .btn-primary { background: #000 !important; border: 1px solid #fff !important; color: #ff0 !important; }
html.hc .ato, html.hc .masthead-title, html.hc .page-title, html.hc .hero-num, html.hc .ato-titulo, html.hc p, html.hc .ato-ementa { color: #fff !important; }
html.hc .ato th, html.hc .ato td { border-color: #fff; background: #000; }

/* ---------- Impressão ---------- */
@media print {
  .govbar, .masthead-search, .mainnav, .site-footer, .doc-side, .ato-tools, .notice-bar, [vw], .crumbs-p, .no-print { display: none !important; }
  body.portal { background: #fff; }
  .portal-main { padding: 0; }
  .doc-layout { display: block; }
  .doc-paper { border: 0; box-shadow: none; padding: 0; }
  .masthead { border: 0; }
  a { color: inherit; text-decoration: none; }
}
