/* Hub de Iniciativas Digitais — mobile first */
:root {
  --red: #C3090A;
  --red-d: #A00708;
  --blue: #0270AA;
  --blue-d: #015A8A;
  --green: #087A23;
  --yellow: #FBCE02;
  --ink: #2A2A2A;
  --ink-m: #5E5E5E;
  --line: #D9D4CC;
  --line-s: #8A847B;
  --surf: #FFFFFF;
  --bg: #F3F1EE;
  --info-bg: #E1F1FA;
  --r-sm: 4px;
  --r-md: 8px;
  --r-pill: 9999px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .10); /* sombra única por card */
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
.dark :focus-visible { outline-color: var(--yellow); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 768px) { .wrap { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .wrap { padding-inline: 2rem; } }


/* Header */
.site-header { background: var(--red); color: #fff; }
.site-header .wrap { position: relative; }
.flag { display: flex; height: 6px; }
.flag span { flex: 1; }
.flag span:nth-child(1) { background: var(--blue); }
.flag span:nth-child(2) { background: var(--yellow); }
.flag span:nth-child(3) { background: var(--green); }
.flag span:nth-child(4) { background: #fff; }
.header-row {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding-block: 1.75rem; text-align: center;
}
.brand img { height: clamp(110px, 32vw, 150px); width: auto; }
.header-title .kicker {
  display: block; font-size: .8rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); margin-bottom: .25rem;
}
.header-title h1 {
  font-size: clamp(2rem, 9vw, 3rem); font-weight: 900; line-height: 1.05;
  text-transform: uppercase; letter-spacing: .01em;
}
.header-actions { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.header-row .btn-contribute {
  flex: none; width: auto; max-width: 100%;
  min-height: 52px; padding: .7rem 1.75rem; gap: .5rem;
  background: rgba(255, 255, 255, .12); color: #fff;
  border: 2px solid #fff; border-radius: var(--r-pill);
  font-size: 1rem; font-weight: 800; line-height: 1.2; white-space: nowrap;
  transition: background .15s, color .15s;
}
.header-row .btn-contribute svg { width: 18px; height: 18px; }
.header-row .btn-contribute:hover { background: #fff; color: var(--red-d); }
.header-row .btn-contribute:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.header-row .btn-submit {
  flex: none; width: auto; max-width: 100%;
  min-height: 60px; padding: .9rem 2rem; gap: .6rem;
  background: var(--yellow); color: var(--ink);
  border: 3px solid #fff; border-radius: var(--r-pill);
  font-size: 1.1rem; font-weight: 900; line-height: 1.2; letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  transition: transform .15s, background .15s;
}
.header-row .btn-submit svg { width: 20px; height: 20px; }
.header-row .btn-submit:hover { background: #fff; transform: translateY(-2px); }
.header-row .btn-submit:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

/* Web: logo, título e botão lado a lado (título sempre centralizado) */
@media (min-width: 1200px) {
  .header-row {
    display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
    align-items: center; gap: 1.5rem; padding-block: 2rem;
  }
  .brand { justify-self: start; }
  .brand img { height: 170px; }
  .header-title { justify-self: center; }
  .header-title h1 { font-size: clamp(2.75rem, 4vw, 3.25rem); max-width: 9.6em; margin-inline: auto; }
  .header-actions { justify-self: end; }
  .header-row .btn-submit { min-height: 64px; padding-inline: 2.25rem; font-size: 1.15rem; }
}

/* Contadores em destaque */
.stats { background: rgba(0, 0, 0, .3); padding-block: .85rem; }
.stats .wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2rem; }
.stats .wrap > span {
  display: inline-flex; align-items: baseline; gap: .5rem;
  font-size: 1rem; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: .06em;
}
.stats strong { color: var(--yellow); font-size: 2rem; font-weight: 900; line-height: 1; letter-spacing: 0; }
.stats .wrap > span + span { padding-left: 2rem; border-left: 2px solid rgba(255, 255, 255, .35); }
@media (max-width: 420px) {
  .stats .wrap { gap: .5rem 1.25rem; }
  .stats .wrap > span { font-size: .85rem; }
  .stats strong { font-size: 1.6rem; }
  .stats .wrap > span + span { padding-left: 1.25rem; }
}

/* Busca e filtros */
.search-area { background: var(--surf); border-bottom: 1px solid var(--line); padding-block: 1.5rem; }
.lead { color: var(--ink-m); max-width: 60ch; margin-bottom: 1.25rem; }
.search { position: relative; max-width: 680px; }
.search svg.ico { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-m); pointer-events: none; }
.search input {
  width: 100%; height: 52px; padding: 0 3.25rem;
  border: 1.5px solid var(--line-s); border-radius: var(--r-pill);
  background: var(--surf); color: var(--ink);
  font: inherit; font-size: 1rem;
}
.search input::placeholder { color: var(--ink-m); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; background: none; color: var(--ink-m);
  border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center;
}
.search .clear.on { display: inline-flex; }
.pills-label {
  margin: 1.25rem 0 .5rem; font-size: .7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-m);
}
.pills { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: 0 1rem; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-s); background: var(--surf); color: var(--ink);
  font-size: .8rem; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.pill:hover { background: var(--bg); }
.pill[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.pill .n {
  font-size: .7rem; font-weight: 900; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--bg); color: var(--ink);
}
.pill[aria-pressed="true"] .n { background: rgba(255, 255, 255, .25); color: #fff; }

/* Seções */
main { padding-block: 2rem 3rem; }
.filter-bar {
  display: none; align-items: center; justify-content: space-between; gap: .75rem;
  background: var(--info-bg); border: 1.5px solid var(--blue); color: var(--blue-d);
  border-radius: var(--r-md); padding: .25rem .5rem .25rem 1rem; margin-bottom: 1.5rem;
  font-size: .85rem; font-weight: 700;
}
.filter-bar.on { display: flex; }
.link-btn {
  min-height: 44px; padding: 0 .75rem; border: 0; background: none; cursor: pointer;
  font-weight: 800; font-size: inherit; color: var(--blue-d); text-decoration: underline; white-space: nowrap;
}
#hub { display: flex; flex-direction: column; gap: 2.5rem; }
.cat-head {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding-bottom: .75rem; margin-bottom: 1rem; border-bottom: 3px solid var(--red);
}
.cat-head h2 {
  flex: 1; font-size: clamp(1rem, 4vw, 1.3rem); font-weight: 900;
  text-transform: uppercase; letter-spacing: .04em;
}
.cat-head .count {
  font-size: .7rem; font-weight: 800; background: rgba(0, 0, 0, .07);
  padding: 4px 10px; border-radius: var(--r-pill); color: var(--ink);
}

.grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

/* Card */
.card {
  display: flex; flex-direction: column; background: var(--surf);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 1rem; box-shadow: var(--shadow);
}
.card .domain {
  font-family: 'Courier New', monospace; font-size: .7rem; font-weight: 700;
  color: var(--ink-m); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: .35rem;
}
.card h3 { font-size: 1.05rem; font-weight: 800; line-height: 1.3; margin-bottom: auto; padding-bottom: .75rem; }

.details { border-top: 1px solid var(--line); margin-bottom: .75rem; }
.details-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 44px; background: none; border: 0; cursor: pointer;
  font-size: .85rem; font-weight: 800; color: var(--blue-d); text-align: left;
}
.details-btn span { text-decoration: underline; text-underline-offset: 3px; }
.details-btn svg { width: 16px; height: 16px; transition: transform .25s; }
.details-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.details-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.details-body.open { grid-template-rows: 1fr; }
.details-body > div { overflow: hidden; }
.details-body p {
  font-size: .85rem; color: var(--ink-m); line-height: 1.6;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: .75rem; margin-bottom: .25rem;
}

.actions { display: flex; gap: .5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; min-width: 44px; padding: 0 1rem; border-radius: var(--r-pill);
  font-size: .85rem; font-weight: 800; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { flex: 1; background: var(--red); color: #fff; border: 1.5px solid var(--red); }
.btn-primary:hover { background: var(--red-d); border-color: var(--red-d); }
.btn-outline { background: var(--surf); color: var(--ink); border: 1.5px solid var(--line-s); }
.btn-outline:hover { background: var(--bg); }
.btn-outline.done { border-color: var(--green); color: var(--green); }

/* Vazio */
.empty {
  display: none; text-align: center; padding: 3rem 1rem; background: var(--surf);
  border: 1.5px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.empty.on { display: block; }
.empty h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: .5rem; }
.empty p { color: var(--ink-m); margin-bottom: 1.25rem; }

/* Toast e topo */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 50;
  transform: translate(-50%, 150%); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; border: 2px solid var(--yellow);
  padding: .7rem 1.25rem; border-radius: var(--r-pill);
  font-size: .85rem; font-weight: 800; max-width: calc(100vw - 2rem);
  transition: transform .3s, opacity .25s;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.to-top {
  position: fixed; right: 1rem; bottom: 1.5rem; z-index: 40;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.to-top.on { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }

/* Rodapé */
.site-footer { background: var(--ink); color: #fff; border-top: 4px solid var(--red); padding-block: 2rem; }
.site-footer strong { display: block; color: var(--yellow); text-transform: uppercase; letter-spacing: .04em; font-weight: 900; margin-bottom: .25rem; }
.site-footer p { font-size: .85rem; color: #E6E2DB; max-width: 48ch; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Botão "Sobre o Comitê" (terceiro botão do cabeçalho) */
.header-row .about-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.6rem; max-width: 100%; white-space: nowrap;
  background: #fff; color: var(--red-d);
  border: 3px solid var(--yellow); border-radius: var(--r-pill);
  font-family: inherit; font-size: .95rem; font-weight: 900; cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
  transition: background .15s, color .15s, transform .15s;
}
.header-row .about-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.header-row .about-btn:hover { background: var(--yellow); color: var(--ink); transform: translateY(-1px); }
.header-row .about-btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }

/* Modal "Sobre" */
html.modal-open { overflow: hidden; }
.modal {
  margin: auto; padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  width: calc(100% - 2rem); max-width: 680px; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
  background: var(--surf); color: var(--ink);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(20, 20, 20, .65); }
.modal-flag { display: flex; height: 6px; flex-shrink: 0; }
.modal-flag span { flex: 1; }
.modal-flag span:nth-child(1) { background: var(--blue); }
.modal-flag span:nth-child(2) { background: var(--yellow); }
.modal-flag span:nth-child(3) { background: var(--green); }
.modal-flag span:nth-child(4) { background: var(--red); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
  padding: 1.25rem 1rem .75rem 1.25rem; flex-shrink: 0;
}
.modal-head h2 { font-size: clamp(1.2rem, 4.5vw, 1.6rem); font-weight: 900; line-height: 1.2; color: var(--red-d); }
.modal-x {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--line-s); background: var(--surf); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.modal-x:hover { background: var(--bg); }
.modal-body { padding: .25rem 1.25rem 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-body p { font-size: .95rem; line-height: 1.7; margin-bottom: 1rem; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-foot { padding: .75rem 1.25rem 1.25rem; border-top: 1px solid var(--line); flex-shrink: 0; display: flex; justify-content: flex-end; }
.modal-foot .btn { flex: none; min-width: 140px; }
@media (min-width: 768px) {
  .modal-head { padding: 1.5rem 1.25rem .75rem 2rem; }
  .modal-body { padding-inline: 2rem; }
  .modal-body p { font-size: 1rem; }
  .modal-foot { padding-inline: 2rem; }
}
