/* Por Onde Andei V3.8.8 — uniformização visual e experiência pública */
:root {
  --poa-shell: min(1480px, calc(100% - 48px));
  --poa-header-height: 76px;
  --poa-radius-sm: 10px;
  --poa-radius-md: 18px;
  --poa-focus: color-mix(in srgb, var(--forest-600) 72%, white);
}

html { scroll-padding-top: calc(var(--poa-header-height) + 20px); }
body { text-rendering: optimizeLegibility; }

.poa-skip-link {
  position: fixed;
  top: 10px;
  left: 14px;
  z-index: 12000;
  padding: 11px 15px;
  border-radius: 999px;
  color: var(--white);
  background: var(--forest-800);
  font-size: .75rem;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform .2s ease;
}
.poa-skip-link:focus { transform: none; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--poa-focus);
  outline-offset: 3px;
}

/* Cabeçalho comum */
.unified-header {
  z-index: 5000;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(170px, 1fr);
  align-items: center;
  min-height: var(--poa-header-height);
  padding: 0 max(3.2vw, 24px);
  gap: 24px;
  font-family: var(--sans);
}
.site-header.unified-header { min-height: var(--poa-header-height); }
.site-header.unified-header.scrolled { min-height: 66px; }
.simple-header.unified-header {
  position: sticky;
  top: 0;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper-light) 94%, transparent);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(20, 35, 27, .02);
  backdrop-filter: blur(18px);
}
.unified-header .site-brand { gap: 11px; }
.unified-header .site-brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  font-size: 1.28rem;
}
.unified-header .site-brand strong { font-size: .88rem; }
.unified-header .site-brand small { font-size: .61rem; }
.unified-header .site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(11px, 1.25vw, 21px);
  flex-wrap: nowrap;
}
.unified-header .site-nav a {
  letter-spacing: .035em;
  text-transform: none;
  white-space: nowrap;
}
.unified-header .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.unified-header .header-tools { min-width: 150px; }
.unified-header .header-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}
.unified-header .mobile-menu { cursor: pointer; }

/* Títulos e ritmo das páginas */
:where(.explore-hero, .map330-intro, .chronology-hero-copy, .photos-v383-hero-copy, .stats387-hero-copy, .search386-hero > div:first-child) h1 {
  max-width: 980px;
  font-size: clamp(3.2rem, 6.2vw, 6.4rem) !important;
  line-height: .91 !important;
  letter-spacing: -.06em !important;
}
:where(.map330-intro, .chronology-hero, .photos-v383-hero, .stats387-hero, .search386-hero) {
  padding-top: clamp(52px, 6vw, 88px);
}
:where(.map330-intro, .chronology-hero-copy, .photos-v383-hero-copy, .stats387-hero-copy, .search386-hero > div:first-child) > p:last-child {
  max-width: 720px;
  font-size: clamp(.9rem, 1.1vw, 1.03rem);
  line-height: 1.65;
}

/* Elementos interativos consistentes */
:where(.header-action, .home-button, .search386-primary-button, .search386-secondary-button, .stats387-filters button, .map330-intro-actions button, .map330-intro-actions a) {
  border-radius: 999px !important;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
:where(.header-action, .home-button, .search386-primary-button, .search386-secondary-button, .stats387-filters button, .map330-intro-actions button, .map330-intro-actions a):hover {
  transform: translateY(-1px);
}

/* Estados de carregamento e erro */
:where(.premium-loading, .timeline-loading, .chronology-loading, .stats340-status, .stats387-status, .public-photo-loading, .local-v380-loading) {
  font-family: var(--sans);
}
:where(.premium-loading, .timeline-loading, .chronology-loading, .public-photo-loading) p {
  color: var(--muted);
  font-size: .78rem;
}

/* Rodapé comum */
.site-footer.unified-footer,
.simple-footer.unified-footer {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(44px, 5vw, 72px) max(4.4vw, 26px);
  color: rgba(255,255,255,.72) !important;
  background: var(--forest-950);
  border-top: 1px solid rgba(255,255,255,.09);
  font-size: .72rem;
}
.unified-footer .site-brand { color: #fff; }
.unified-footer .site-brand small { color: rgba(255,255,255,.48); }
.unified-footer p {
  max-width: 430px;
  margin: 16px 0 0;
  color: rgba(255,255,255,.47) !important;
}
.unified-footer .footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.unified-footer .footer-links a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
}
.unified-footer .footer-links a:hover { color: #fff; }
.unified-footer > span { color: rgba(255,255,255,.43); white-space: nowrap; }

/* Voltar ao topo */
.poa-back-to-top {
  position: fixed;
  right: clamp(16px, 2.4vw, 34px);
  bottom: clamp(16px, 2.4vw, 32px);
  z-index: 4800;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 50%;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper-light) 94%, transparent);
  box-shadow: 0 10px 30px rgba(13, 27, 19, .14);
  backdrop-filter: blur(14px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease, background-color .2s ease;
}
.poa-back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.poa-back-to-top:hover { color: #fff; background: var(--forest-800); }

@media (max-width: 1260px) {
  :root { --poa-header-height: 70px; }
  .unified-header { grid-template-columns: 1fr auto; padding-inline: 20px; }
  .unified-header .header-tools { min-width: 0; }
  .unified-header .mobile-menu { display: block; }
  .unified-header > .site-nav {
    position: fixed;
    inset: var(--poa-header-height) 0 auto;
    z-index: 4999;
    display: none;
    align-items: stretch;
    padding: 26px max(5vw, 22px) 30px;
    gap: 0;
    color: var(--ink);
    background: color-mix(in srgb, var(--paper-light) 98%, transparent);
    border-top: 1px solid var(--line);
    box-shadow: 0 24px 40px rgba(10, 25, 17, .14);
    backdrop-filter: blur(18px);
  }
  .unified-header > .site-nav a {
    display: flex;
    min-height: 46px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    font-size: .8rem;
  }
  .unified-header > .site-nav a::after { display: none; }
  body.menu-open .simple-header.unified-header > .site-nav,
  .site-header.unified-header.menu-open > .site-nav,
  body.menu-open .site-header.unified-header > .site-nav { display: grid; }
  .unified-header .header-action { display: none; }
}

@media (max-width: 720px) {
  :root { --poa-shell: calc(100% - 32px); }
  .unified-header .site-brand small { display: none; }
  .unified-header .site-brand-mark { width: 38px; height: 38px; }
  :where(.explore-hero, .map330-intro, .chronology-hero-copy, .photos-v383-hero-copy, .stats387-hero-copy, .search386-hero > div:first-child) h1 {
    font-size: clamp(2.75rem, 13vw, 4.6rem) !important;
  }
  .site-footer.unified-footer,
  .simple-footer.unified-footer {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 48px 22px;
    gap: 26px;
  }
  .unified-footer .footer-links { gap: 16px 20px; }
  .poa-back-to-top { width: 43px; height: 43px; }
}
