/* =========================================================================
   Para que todo o Brasil ouça — Missionários por estado
   Design system inspirado no cartaz da campanha (Missões Nacionais)
   ========================================================================= */

:root {
  /* Paleta da campanha */
  --paper:        #f4ead1;
  --paper-2:      #eaddbe;
  --ink:          #16342a;
  --ink-soft:     #3c5a4e;
  --orange:       #e27b30;
  --orange-d:     #c65f1c;
  --teal:         #17493b;
  --teal-2:       #1f5e4a;
  --olive:        #6f8f2b;
  --olive-2:      #7fa233;
  --mustard:      #e0b12b;
  --red:          #c6462f;
  --blue:         #2f83bf;

  /* Papéis de cor (tema claro) */
  --bg:           #f4ead1;
  --bg-tex:       rgba(23,73,59,.035);
  --surface:      #fbf4e2;
  --surface-2:    #f6ecd4;
  --border:       #e0cfa8;
  --text:         #16342a;
  --text-2:       #526b5f;
  --text-inv:     #fbf4e2;
  --brand:        var(--orange);
  --brand-ink:    #fff;
  --accent:       var(--teal);
  --head:         var(--teal);          /* títulos grandes */
  --warm:         var(--orange-d);       /* destaques quentes (eyebrow, versículo) */
  --lead:         var(--ink-soft);
  --pill-bg:      color-mix(in srgb, var(--teal) 12%, transparent);
  --pill-fg:      var(--teal);
  --outline-fg:   var(--teal);
  --ring:         rgba(226,123,48,.35);
  --shadow:       0 1px 2px rgba(20,50,40,.06), 0 6px 22px rgba(20,50,40,.10);
  --shadow-lg:    0 10px 40px rgba(20,50,40,.22);

  --map-fill:     #d8c9a4;
  --map-fill-2:   #cdbd93;
  --map-stroke:   #f4ead1;
  --map-active:   var(--orange);
  --map-hover:    var(--olive);

  --r-sm: 8px; --r: 14px; --r-lg: 22px; --r-xl: 30px;
  --maxw: 1180px;
  --appbar-h: 60px;
  --font-display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg:        #0f231d;
  --bg-tex:    rgba(244,234,209,.03);
  --surface:   #16302a;
  --surface-2: #1b3a32;
  --border:    #274a40;
  --text:      #f1e7cf;
  --text-2:    #a9bfae;
  --text-inv:  #16342a;
  --brand:     #ef8a3f;
  --accent:    #8fb23c;
  --head:      #eadfc5;
  --warm:      #f2b078;
  --lead:      var(--text-2);
  --pill-bg:   color-mix(in srgb, var(--olive) 22%, transparent);
  --pill-fg:   #cfe08f;
  --outline-fg:#cfe08f;
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 8px 26px rgba(0,0,0,.4);
  --shadow-lg: 0 14px 46px rgba(0,0,0,.55);
  --map-fill:  #244a3f;
  --map-fill-2:#2b5548;
  --map-stroke:#0f231d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0f231d; --bg-tex:rgba(244,234,209,.03); --surface:#16302a; --surface-2:#1b3a32;
    --border:#274a40; --text:#f1e7cf; --text-2:#a9bfae; --text-inv:#16342a;
    --brand:#ef8a3f; --accent:#8fb23c;
    --head:#eadfc5; --warm:#f2b078; --lead:var(--text-2);
    --pill-bg:color-mix(in srgb, var(--olive) 22%, transparent); --pill-fg:#cfe08f; --outline-fg:#cfe08f;
    --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 26px rgba(0,0,0,.4); --shadow-lg:0 14px 46px rgba(0,0,0,.55);
    --map-fill:#244a3f; --map-fill-2:#2b5548; --map-stroke:#0f231d;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% -5%, rgba(226,123,48,.10), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(111,143,43,.12), transparent 38%),
    repeating-linear-gradient(135deg, var(--bg-tex) 0 2px, transparent 2px 7px);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1,h2,h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: .2px; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--orange); color: #fff; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(14px, 4vw, 32px); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* ---------------- App bar ---------------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--appbar-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.appbar .wrap { height: 100%; display: flex; align-items: center; gap: 12px; }
.brandmark { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.brandmark .globe {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--olive-2), var(--teal) 75%);
  display: grid; place-items: center; color: #fff; box-shadow: var(--shadow);
}
.brandmark .globe svg { width: 20px; height: 20px; }
.brandmark .t { min-width: 0; }
.brandmark .t b { font-family: var(--font-display); font-size: 15px; color: var(--text); display: block; line-height: 1; white-space: nowrap; }
.brandmark .t span { font-size: 11px; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }
.appbar .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center;
  transition: transform .15s, background .2s;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------------- Hero ---------------- */
.hero { position: relative; padding: clamp(26px, 5vw, 54px) 0 8px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--warm);
  background: color-mix(in srgb, var(--orange) 16%, transparent); padding: 6px 14px; border-radius: 999px;
}
.hero h1 { font-size: clamp(38px, 9vw, 92px); margin: 14px 0 2px; color: var(--head); letter-spacing: -.5px; }
.hero h1 .br { color: var(--orange); }
.hero h1 .ou {
  display: inline-block; color: var(--olive-2);
  transform: rotate(-3deg);
}
.hero .lead { max-width: 640px; margin: 10px auto 0; color: var(--lead); font-size: clamp(15px, 2.4vw, 19px); }
.verse { max-width: 560px; margin: 18px auto 0; font-style: italic; color: var(--text-2); font-size: 14.5px; }
.verse b { color: var(--warm); font-style: normal; }
.verse cite { display: block; font-style: normal; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 11px; margin-top: 4px; color: var(--olive-2); }

.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow); display: flex; align-items: baseline; gap: 7px; }
.stat b { font-family: var(--font-display); font-size: 20px; color: var(--orange); }
.stat span { font-size: 12.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }

/* ---------------- Search ---------------- */
.searchwrap { position: relative; max-width: 620px; margin: 26px auto 0; }
.searchbox { position: relative; display: flex; align-items: center; }
.searchbox svg.ic { position: absolute; left: 16px; width: 22px; height: 22px; color: var(--text-2); pointer-events: none; }
#q {
  width: 100%; font-size: 17px; font-family: inherit; color: var(--text);
  padding: 16px 46px 16px 48px; border-radius: 999px;
  border: 2px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s;
}
#q::placeholder { color: var(--text-2); }
#q:focus { border-color: var(--orange); box-shadow: 0 0 0 4px var(--ring); outline: none; }
#q::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.searchbox .clear { position: absolute; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--text-2); display: none; place-items: center; }
.searchbox .clear.show { display: grid; }

/* Sticky mini-search (aparece ao rolar / em detalhe) */
.result-panel { max-width: 720px; margin: 14px auto 0; }
.result-meta { font-size: 13px; color: var(--text-2); padding: 4px 6px; }
.result-list { display: grid; gap: 8px; margin-top: 6px; }
.result {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 11px 14px; box-shadow: var(--shadow); transition: transform .12s, border-color .2s;
}
.result:hover { transform: translateY(-1px); border-color: var(--orange); }
.result .nm { font-weight: 600; font-size: 15.5px; }
.result .nm mark { background: color-mix(in srgb, var(--mustard) 55%, transparent); color: inherit; padding: 0 2px; border-radius: 4px; }
.result .uf-pill { margin-left: auto; flex: none; }
.uf-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  background: var(--pill-bg); color: var(--pill-fg);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.uf-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; justify-content: center; gap: 6px; margin: 30px auto 0; }
.tabbar {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px; box-shadow: var(--shadow); gap: 3px;
}
.tab {
  border: none; background: transparent; color: var(--text-2); font-weight: 700; font-size: 14px;
  padding: 9px 18px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; transition: color .2s;
}
.tab svg { width: 17px; height: 17px; }
.tab[aria-selected="true"] { background: var(--orange); color: #fff; box-shadow: 0 4px 14px rgba(226,123,48,.4); }

/* ---------------- Sections ---------------- */
.view { padding: 26px 0 40px; }
.view[hidden] { display: none; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-title h2 { font-size: clamp(22px, 4vw, 30px); color: var(--head); }
.section-title .hint { font-size: 13px; color: var(--text-2); margin-left: auto; }

/* ---------------- Mapa ---------------- */
.map-layout { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 900px) { .map-layout { grid-template-columns: 1.35fr .9fr; align-items: start; } }
.map-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px; box-shadow: var(--shadow); position: relative;
}
.geo-map { display: block; width: 100%; height: auto; }
.geo-map path {
  fill: var(--map-fill); stroke: var(--map-stroke); stroke-width: 1.4; stroke-linejoin: round;
  cursor: pointer; transition: fill .18s, transform .18s; transform-box: fill-box; transform-origin: center;
}
.geo-map path:hover { fill: var(--map-hover); }
.geo-map path.active { fill: var(--map-active); }
.geo-map .uf-label { font-family: var(--font-display); font-size: 15px; fill: #fff; pointer-events: none; text-anchor: middle; opacity: .0; transition: opacity .2s; }
.geo-map.show-labels .uf-label { opacity: .9; }
.map-tooltip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--teal); color: #fff;
  padding: 6px 11px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  transform: translate(-50%, -130%); white-space: nowrap; opacity: 0; transition: opacity .12s;
}
.map-tooltip b { color: var(--mustard); }
.map-tooltip.show { opacity: 1; }

/* Tile grid (mobile) */
.tilemap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tile {
  aspect-ratio: 1 / 1; border: none; border-radius: 12px; color: #fff; position: relative;
  background: var(--teal-2); display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: transform .12s, filter .2s; padding: 2px;
}
.tile:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.06); }
.tile .uf { font-family: var(--font-display); font-size: clamp(11px, 3.2vw, 16px); line-height: 1; }
.tile .n { font-size: clamp(9px, 2.4vw, 12px); font-weight: 700; opacity: .92; }

/* Side panel: lista de estados por região */
.region-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.region { margin-bottom: 14px; }
.region:last-child { margin-bottom: 0; }
.region h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--olive-2); margin: 0 0 8px; font-family: var(--font-body); font-weight: 800; }
.region .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center;
  transition: background .18s, border-color .18s, transform .12s;
}
.chip:hover { background: var(--orange); color: #fff; border-color: var(--orange); transform: translateY(-1px); }
.chip .c { font-size: 11px; font-weight: 800; opacity: .7; }
.chip:hover .c { opacity: 1; }

/* ---------------- Estados (grid de cards) ---------------- */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.state-card {
  text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .14s, border-color .2s, box-shadow .2s;
}
.state-card::before { content:""; position:absolute; inset:0 auto 0 0; width:5px; background: var(--accent); }
.state-card:hover { transform: translateY(-3px); border-color: var(--orange); box-shadow: var(--shadow-lg); }
.state-card .uf-badge {
  font-family: var(--font-display); font-size: 13px; color: #fff; background: var(--teal);
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px;
}
.state-card h3 { font-size: 19px; color: var(--text); }
.state-card .count { margin-top: 6px; color: var(--text-2); font-size: 13.5px; }
.state-card .count b { color: var(--orange); font-family: var(--font-display); font-size: 16px; }
.state-card .go { position: absolute; right: 14px; bottom: 14px; color: var(--text-2); transition: transform .15s, color .15s; }
.state-card:hover .go { color: var(--orange); transform: translateX(3px); }

/* ---------------- Detalhe de estado ---------------- */
.detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.detail-head { padding: clamp(18px, 4vw, 28px); background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; position: relative; }
.detail-head .back { position: absolute; top: 16px; left: 16px; background: rgba(255,255,255,.16); border: none; color: #fff; border-radius: 999px; padding: 8px 14px 8px 10px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.detail-head .back:hover { background: rgba(255,255,255,.28); }
.detail-head .uf-big { font-family: var(--font-display); font-size: 13px; letter-spacing: .1em; opacity: .85; margin-top: 26px; }
.detail-head h2 { font-size: clamp(30px, 7vw, 52px); margin-top: 2px; }
.detail-head .sub { margin-top: 6px; font-size: 15px; opacity: .92; }
.detail-head .sub b { color: var(--mustard); font-family: var(--font-display); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  border: none; border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; transition: transform .12s, filter .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn.primary { background: var(--orange); color: #fff; }
.btn.ghost { background: rgba(255,255,255,.16); color: #fff; }
.btn.outline { background: transparent; color: var(--outline-fg); border: 1.6px solid color-mix(in srgb, var(--outline-fg) 42%, transparent); }
.detail-body { padding: clamp(16px, 4vw, 26px); }
.mini-filter { position: relative; margin-bottom: 16px; }
.mini-filter input { width: 100%; padding: 12px 14px 12px 42px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 15px; font-family: inherit; }
.mini-filter input:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px var(--ring); }
.mini-filter svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-2); }

.names {
  columns: 260px; column-gap: 26px;
}
.name-item {
  break-inside: avoid; display: flex; align-items: baseline; gap: 9px; padding: 7px 4px; border-bottom: 1px dashed var(--border);
}
.name-item .idx { font-family: var(--font-display); font-size: 12px; color: var(--text-2); min-width: 26px; }
.name-item .nm { font-size: 15.5px; }
.name-item .nm mark { background: color-mix(in srgb, var(--mustard) 55%, transparent); color: inherit; border-radius: 4px; }
.name-item.hidden { display: none; }
.alpha-sep { break-inside: avoid; font-family: var(--font-display); color: var(--orange); font-size: 15px; margin: 12px 0 2px; }

/* ---------------- Modo Oração ---------------- */
.pray-card {
  max-width: 560px; margin: 0 auto; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden;
}
.pray-top { background: linear-gradient(135deg, var(--olive), var(--olive-2)); color: #fff; padding: 26px 22px; }
.pray-top .lbl { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; opacity: .9; }
.pray-top .who { font-family: var(--font-display); font-size: clamp(30px, 7vw, 46px); margin: 8px 0 4px; }
.pray-top .where { font-size: 15px; opacity: .95; }
.pray-body { padding: 22px; }
.pray-body p { color: var(--text-2); font-style: italic; margin: 0 0 18px; }
.pray-body .btn.primary { font-size: 15px; padding: 13px 22px; }

/* ---------------- Legenda ---------------- */
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 30px; }
.legend .li { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.legend .pin { width: 26px; height: 26px; flex: none; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: inset 0 0 0 4px rgba(255,255,255,.85); }
.legend .li span { font-size: 13.5px; font-weight: 600; }

/* ---------------- Footer ---------------- */
.foot { border-top: 1px solid var(--border); margin-top: 30px; padding: 26px 0 60px; text-align: center; color: var(--text-2); font-size: 13px; }
.foot a { color: var(--warm); font-weight: 600; text-decoration: none; }

/* Empty state */
.empty { text-align: center; padding: 40px 16px; color: var(--text-2); }
.empty svg { width: 46px; height: 46px; opacity: .5; margin-bottom: 8px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--teal); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Responsivo ---------------- */
.only-desktop { display: none; }
@media (min-width: 760px) { .only-desktop { display: block; } .only-mobile { display: none; } }

@media (max-width: 759px) {
  .tabbar { width: 100%; justify-content: space-between; }
  .tab { flex: 1; justify-content: center; padding: 10px 6px; font-size: 13px; }
  .tab span.t { display: none; }
  .tab svg { width: 20px; height: 20px; }
  .names { columns: 1; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------------- Print ---------------- */
@media print {
  .appbar, .tabs, .searchwrap, .hero .stats, .detail-actions, .mini-filter, .back, .foot, .icon-btn, .map-layout, .pray-card, .legend, .tabbar { display: none !important; }
  body { background: #fff; color: #000; }
  .view[hidden] { display: block !important; }
  .detail, .detail-body, .state-card { box-shadow: none; border: none; }
  .detail-head { background: #fff !important; color: #000 !important; padding: 0 0 8px; border-bottom: 2px solid #000; }
  .detail-head .uf-big, .detail-head h2 { color: #000 !important; }
  .names { columns: 3; }
  .name-item { border-bottom: 1px solid #ddd; }
  #print-only { display: block !important; }
}
#print-only { display: none; }
