/* Achados Floripa — layout (topbar, hero shell, feed, footer) */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.25rem;
  padding-top: calc(0.55rem + env(safe-area-inset-top));
  color: #fff;
  transition:
    background var(--motion-med),
    color var(--motion-med),
    box-shadow var(--motion-med);
}
.topbar.solid {
  background: rgba(243, 235, 224, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--af-sea-900);
  box-shadow: 0 1px 0 rgba(10, 47, 58, 0.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 700 1.3rem var(--font-display);
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
}
.nav-actions { display: flex; gap: 0.5rem; align-items: center; }
.topbar .btn-ghost { color: inherit; border-color: currentColor; }
.topbar .btn-primary { background: var(--af-foam); color: var(--af-sea-900); }
.topbar.solid .btn-primary { background: var(--af-sea-700); color: #fff; }
@media (max-width: 520px) {
  .topbar .btn-ghost.nav-hide-sm { display: none; }
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  color: #fff;
  overflow: hidden;
  background: var(--af-sea-900);
}
.hero-media { position: absolute; inset: 0; }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 47, 58, 0.5) 0%,
    rgba(10, 47, 58, 0.2) 35%,
    rgba(10, 47, 58, 0.88) 100%
  );
}
/* Sem fotos ainda: atmosfera local (sem Unsplash / stock) */
.hero-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 70% 20%, rgba(94, 184, 199, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 70%, rgba(196, 92, 62, 0.18), transparent 50%),
    linear-gradient(145deg, #0e4a5c 0%, #0a2f3a 48%, #163a45 100%);
  animation: af-atmosphere 14s var(--ease) infinite alternate;
}
@keyframes af-atmosphere {
  from { transform: scale(1); filter: saturate(1); }
  to { transform: scale(1.06); filter: saturate(1.12); }
}
.hero-slide {
  position: absolute;
  inset: 0;
  background: var(--af-sea-700) center / cover no-repeat;
  opacity: 0;
  animation: af-fade 18s ease-in-out infinite;
}
.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 6s; }
.hero-slide:nth-child(3) { animation-delay: 12s; }
.hero-slide:only-child {
  opacity: 1;
  animation: none;
}
@keyframes af-fade {
  0%, 28% { opacity: 1; transform: scale(1.02); }
  33%, 95% { opacity: 0; transform: scale(1.09); }
  100% { opacity: 1; transform: scale(1.02); }
}
.hero-content {
  position: relative;
  z-index: 2;
  width: min(100% - 2rem, 64rem);
  margin: 0 auto;
  padding: 7rem 0 9rem;
}
.hero-content > * {
  animation: af-rise 0.9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 100ms);
}
@keyframes af-rise {
  from { opacity: 0; transform: translateY(18px); }
}
.hero-brand {
  font: 700 clamp(3.1rem, 12vw, 7rem) / 0.94 var(--font-display);
  letter-spacing: -0.045em;
  margin: 0 0 1rem;
}
.hero-lead {
  margin: 0 0 1.75rem;
  max-width: 30rem;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: rgba(255, 255, 255, 0.92);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
}
.hero-cta__ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.waves {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(64px, 11vw, 150px);
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.waves svg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200%;
  height: 100%;
  animation: af-drift 16s linear infinite;
}
.waves .back {
  height: 82%;
  fill: var(--af-foam);
  opacity: 0.6;
  animation-duration: 26s;
  animation-direction: reverse;
}
.waves .front { fill: var(--af-sand); }
@keyframes af-drift {
  to { transform: translateX(-50%); }
}

.fab {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 45;
  box-shadow: 0 12px 30px rgba(196, 92, 62, 0.45);
  transform: translateY(200%);
  transition: transform 0.4s var(--ease);
}
.fab.on { transform: none; }
@media (min-width: 900px) {
  .fab { display: none; }
}

/* Ajuda — canto oposto ao FAB, discreto */
.help-fab {
  position: fixed;
  left: 0.85rem;
  bottom: calc(0.85rem + env(safe-area-inset-bottom));
  z-index: 44;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 1.5px solid rgba(14, 74, 92, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: var(--af-sea-700);
  font: 700 1.05rem / 1 var(--font-body);
  box-shadow: 0 6px 18px rgba(10, 47, 58, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--ease), background var(--motion-fast);
}
.help-fab:hover {
  background: #fff;
  color: var(--af-sea-900);
}
.help-fab:active { transform: scale(0.96); }
.help-steps {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}
.help-steps li { margin-bottom: 0.4rem; }
.help-doc ol.help-steps { line-height: 1.5; }

/* Convite PWA — faixa discreta acima dos FABs */
.install-bar {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(3.6rem + env(safe-area-inset-bottom));
  z-index: 46;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid rgba(14, 74, 92, 0.12);
  box-shadow: 0 12px 36px rgba(10, 47, 58, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.4s var(--ease),
    opacity 0.35s var(--ease);
}
.install-bar.on {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}
.install-bar__icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}
.install-bar__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.install-bar__text strong {
  font-size: 0.9rem;
  color: var(--af-sea-900);
  font-weight: 700;
}
.install-bar__hint {
  font-size: 0.78rem;
  color: var(--af-muted);
  line-height: 1.35;
}
.install-bar__actions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
@media (min-width: 520px) {
  .install-bar {
    left: auto;
    right: 1rem;
    width: min(22rem, calc(100% - 2rem));
    bottom: calc(1.1rem + env(safe-area-inset-bottom));
  }
  .install-bar__actions {
    flex-direction: row;
    align-items: center;
  }
}
@media (min-width: 900px) {
  /* Desktop: menos prioridade — sobe um pouco do canto */
  .install-bar {
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-atmosphere,
  .hero-slide,
  .hero-content > *,
  .waves svg,
  .fab {
    animation: none !important;
    transition: none !important;
  }
  .fab { transform: none; }
}

.sec {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 2.5rem 0 3.5rem;
}
.section-head { margin-bottom: 1.4rem; }
.section-head h2 {
  font: 700 clamp(1.7rem, 4.5vw, 2.5rem) / 1.1 var(--font-display);
  margin: 0;
  letter-spacing: -0.025em;
  color: var(--af-sea-900);
}
.section-head p {
  margin: 0.5rem 0 0;
  color: var(--af-muted);
  max-width: 32rem;
}

.feed {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .feed { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .feed { grid-template-columns: repeat(3, 1fr); }
}

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
  transition: transform var(--motion-med) var(--ease), box-shadow var(--motion-med);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(10, 47, 58, 0.18);
}
.card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--af-sea-700);
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.card:hover .card-img img { transform: scale(1.06); }
.tile-perdido { background: linear-gradient(135deg, #f3cdb8, var(--af-coral)); }
.tile-achado { background: linear-gradient(135deg, #b4e0cb, var(--af-leaf)); }
.card-body { padding: 1rem 1.15rem 1.25rem; }
.badge-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.card-title {
  font: 700 1.2rem / 1.25 var(--font-display);
  margin: 0 0 0.35rem;
  letter-spacing: -0.015em;
}
.card-meta {
  display: flex;
  gap: 1rem;
  margin: 0;
  color: var(--af-muted);
  font-size: 0.9rem;
}

.site-footer {
  background: var(--af-sea-900);
  color: rgba(232, 246, 248, 0.85);
  padding: 2.5rem 1.25rem calc(2.5rem + env(safe-area-inset-bottom));
  text-align: center;
}
.site-footer__brand {
  font: 700 1.15rem var(--font-display);
  color: #fff;
  margin: 0 0 0.5rem;
}
.site-footer__free { margin: 0 0 1rem; font-size: 0.95rem; }
.site-footer__credit { margin: 0; font-size: 0.9rem; }
.site-footer a {
  color: var(--af-sea-300);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-flex; }
