:root {
  --blue: #1d55ad;
  --light-blue: #2aa8d2;
  --gold: #ffc400;
  --green: #1d55ad;
  --dark-green: #1d55ad;
  --ink: #17231d;
  --muted: #5d6c64;
  --line: #dbe5de;
  --bg: #f7faf8;
  --surface: #ffffff;
  --font-scale: 1;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(16px * var(--font-scale));
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--green); }
.skip-link, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip-link:focus {
  width: auto;
  height: auto;
  clip: auto;
  z-index: 10;
  padding: .75rem;
  background: #fff;
}
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: .45rem 1rem;
  background: var(--blue);
  color: #fff;
  font-size: .9rem;
}
.brand-row {
  max-width: 1180px;
  margin: auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 1rem;
  position: relative;
  min-height: 136px;
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 126px; height: 126px; object-fit: contain; }
.brand strong {
  display: block;
  font-size: 3.45rem;
  color: var(--blue);
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: 0;
}
.brand strong::before {
  content: "Prefeitura Municipal de";
  display: block;
  font-size: .9rem;
  line-height: 1.2;
  letter-spacing: .12em;
}
.brand small {
  display: block;
  color: var(--blue);
  font-weight: 800;
  letter-spacing: .28em;
  text-transform: uppercase;
}
.brand-row::after {
  content: "";
  align-self: stretch;
  flex: 1 1 420px;
  min-width: 260px;
  max-width: 690px;
  background:
    radial-gradient(circle at 20px 20px, transparent 27px, var(--blue) 28px 29px, transparent 30px),
    radial-gradient(circle at 64px 22px, var(--light-blue) 0 27px, transparent 28px),
    radial-gradient(circle at 104px 23px, var(--gold) 0 27px, transparent 28px),
    radial-gradient(circle at 145px 21px, var(--blue) 0 28px, transparent 29px);
  background-size: 170px 68px;
  background-repeat: repeat;
}
.site-search {
  position: relative;
  display: flex;
  width: min(330px, 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.site-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: .8rem;
  font-size: 1rem;
}
.site-search button {
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--gold);
  color: #161616;
  padding: 0 1rem;
  cursor: pointer;
  font-size: 1.35rem;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(520px, 92vw);
  max-height: 360px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .15);
  display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.search-results span { display: block; color: var(--muted); font-size: .9rem; }
.main-nav {
  max-width: none;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .7rem 1rem;
  border-top: 0;
  background: var(--gold);
  justify-content: center;
}
.main-nav a {
  text-decoration: none;
  color: #06142d;
  padding: .55rem .5rem;
  border-radius: 6px;
  font-size: .94rem;
  font-weight: 700;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  background: transparent;
  color: #fff;
  border-bottom: 3px solid #fff;
}
.accessibility-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1rem;
  border-top: 1px solid rgba(29, 85, 173, .15);
}
.accessibility-bar button, .button {
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green);
  border-radius: 6px;
  padding: .65rem .85rem;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.button.primary { background: var(--green); color: #fff; }
.access-symbol { font-size: 1.2rem; }
.breadcrumb, .page {
  max-width: 1180px;
  margin: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.breadcrumb {
  padding-top: 1rem;
  color: var(--muted);
  font-size: .92rem;
}
.breadcrumb a, .breadcrumb span { margin-right: .45rem; }
.breadcrumb a::after { content: "/"; margin-left: .45rem; color: var(--muted); }
.home-news {
  background: #fff;
  padding: 1rem 0 0;
}
.home-news > div, .useful-links > div {
  max-width: 1180px;
  margin: auto;
  padding: 0 1rem;
}
.home-news h2, .useful-links h2 {
  color: var(--blue);
  font-size: 1.65rem;
  margin: 1rem 0;
  text-transform: uppercase;
}
.quick-grid, .news-list, .acts-grid {
  max-width: 1180px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.quick-grid a, .news-list article, .acts-grid section, .info-panel, .declaration, details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}
.quick-grid a { text-decoration: none; color: var(--ink); }
.quick-grid span, .news-list span { display: block; color: var(--muted); margin-top: .35rem; }
.news-list { grid-template-columns: repeat(3, 1fr); padding: 0; }
.news-list article { padding: 0; overflow: hidden; border-radius: 0; }
.news-list img {
  width: 100%;
  height: 210px;
  display: block;
  object-fit: cover;
}
.news-list h3 {
  padding: .9rem 1rem 1.2rem;
  margin: 0;
  color: var(--green);
  font-size: 1rem;
}
.useful-links {
  background: var(--gold);
  padding: 2rem 0 3rem;
}
.useful-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.useful-grid a {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: .35rem;
  padding: 1.35rem 1rem;
  background: var(--gold);
  border: 3px solid var(--blue);
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  min-height: 235px;
  align-content: center;
}
.useful-grid img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: saturate(0) brightness(0) invert(31%) sepia(72%) saturate(1735%) hue-rotate(202deg) brightness(89%) contrast(94%);
  margin-bottom: 1rem;
}
.useful-grid strong {
  color: #fff;
  font-size: 1.75rem;
  line-height: 1.18;
}
.useful-grid span { color: #fff; font-size: 1.65rem; font-weight: 800; line-height: 1.18; }
.content-band { background: #edf5f0; padding: 2rem 0; }
.content-band > div { max-width: 1180px; margin: auto; padding: 0 1rem; }
.page { padding-top: 1.5rem; padding-bottom: 3rem; }
.page h1 { font-size: 2.25rem; line-height: 1.15; }
.lead { color: var(--muted); max-width: 850px; }
.org-chart { margin: 2rem 0; }
.org-node {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: .85rem;
  text-align: center;
  font-weight: 700;
}
.org-node.mayor { width: min(420px, 100%); margin: auto; background: var(--green); color: #fff; border-color: var(--green); }
.org-level, .org-grid {
  display: grid;
  gap: .85rem;
  margin-top: 1rem;
}
.org-level { grid-template-columns: repeat(3, 1fr); }
.org-grid { grid-template-columns: repeat(4, 1fr); }
.directory ul { columns: 2; padding-left: 1.2rem; }
.faq-page details { margin-bottom: .75rem; }
summary { cursor: pointer; font-weight: 800; }
.notice { border-left: 4px solid var(--gold); padding: .8rem 1rem; background: #fff9df; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem max(1rem, calc((100vw - 1180px) / 2));
  background: var(--blue);
  color: #fff;
}
.footer-crest {
  width: 72px;
  height: 72px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: .75rem;
}
.site-footer a { color: #fff; margin-left: .75rem; }
.contrast {
  --green: #ffff00;
  --blue: #ffff00;
  --light-blue: #ffffff;
  --gold: #ffffff;
  --ink: #ffffff;
  --muted: #e6e6e6;
  --line: #ffffff;
  --bg: #000000;
  --surface: #000000;
}
.contrast .site-header, .contrast .quick-grid a, .contrast article, .contrast section, .contrast details {
  border-color: #fff;
}
.contrast .hero { background: #000; border-bottom: 2px solid #fff; }
@media (max-width: 900px) {
  .site-header { position: static; }
  .topbar {
    justify-content: center;
    text-align: center;
    gap: .35rem .75rem;
    font-size: .82rem;
  }
  .brand-row {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    gap: .75rem;
  }
  .brand-row::after {
    order: 2;
    min-width: 0;
    width: 100%;
    height: 58px;
    flex: 0 0 58px;
    max-width: none;
    background-size: 145px 58px;
  }
  .brand {
    justify-content: center;
    text-align: left;
  }
  .brand img {
    width: 92px;
    height: 92px;
  }
  .brand strong { font-size: 2.45rem; }
  .brand strong::before {
    font-size: .72rem;
    letter-spacing: .08em;
  }
  .brand small {
    font-size: .72rem;
    letter-spacing: .16em;
  }
  .site-search {
    order: 3;
    width: 100%;
  }
  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: .6rem .75rem;
    scroll-snap-type: x proximity;
  }
  .main-nav a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }
  .accessibility-bar {
    flex-wrap: wrap;
    gap: .35rem;
  }
  .quick-grid, .news-list, .acts-grid, .org-level, .org-grid, .useful-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .topbar span { width: 100%; }
  .brand {
    gap: .45rem;
    justify-content: flex-start;
  }
  .brand img {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
  }
  .brand strong { font-size: 1.78rem; }
  .brand strong::before { font-size: .58rem; }
  .brand small {
    font-size: .58rem;
    letter-spacing: .08em;
  }
  .brand-row::after {
    height: 46px;
    flex-basis: 46px;
    background-size: 112px 46px;
  }
  .site-search input {
    padding: .7rem;
    font-size: .95rem;
  }
  .search-results {
    left: 0;
    right: auto;
    width: 100%;
    max-height: 300px;
  }
  .main-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    white-space: normal;
  }
  .main-nav a {
    text-align: center;
    white-space: normal;
    line-height: 1.25;
    padding: .7rem .35rem;
  }
  .accessibility-bar button {
    flex: 1 1 42%;
    min-width: 0;
  }
  .breadcrumb {
    font-size: .85rem;
    padding-top: .75rem;
  }
  .home-news h2,
  .useful-links h2 {
    text-align: center;
    font-size: 1.45rem;
  }
  .news-list img { height: 190px; }
  .quick-grid, .news-list, .acts-grid, .org-level, .org-grid, .useful-grid { grid-template-columns: 1fr; }
  .quick-grid, .news-list, .acts-grid { margin: 1rem auto; }
  .useful-grid a {
    min-height: 155px;
    padding: 1rem .75rem;
  }
  .useful-grid img {
    width: 34px;
    height: 34px;
    margin-bottom: .4rem;
  }
  .useful-grid strong,
  .useful-grid span {
    font-size: 1.35rem;
  }
  .page h1 { font-size: 1.8rem; }
  .directory ul { columns: 1; }
  .site-footer {
    display: block;
    text-align: center;
  }
  .footer-crest {
    display: block;
    margin: 0 auto .5rem;
  }
  .site-footer a {
    display: inline-block;
    margin: .75rem .35rem 0;
  }
}
