/* TuaAxé — Terreiro de Umbanda */

:root {
  --bg: #060d0b;
  --fg: #edf2ef;
  --muted: #8a9a93;
  --brand: #3f937c;
  /* Tom claro da marca, para texto pequeno sobre o shader. */
  --brand-light: #a5dec8;
  --line: rgba(237, 242, 239, 0.12);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;

  --gutter: clamp(1.5rem, 1rem + 4vw, 6rem);
  --block-y: clamp(3.5rem, 2.5rem + 5vw, 7rem);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* O botão flutuante do WhatsApp fica por cima do fim da página; ao rolar
     um elemento focado até a borda, para antes de ficar embaixo dele. */
  scroll-padding-bottom: 5.5rem;
}

/* Trava a rolagem do fundo enquanto o lightbox (overlay próprio) está aberto. */
html.lightbox-open {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a,
button {
  touch-action: manipulation;
}

h1,
h2,
p,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 10;
  padding: 0.7rem 1.4rem;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: transform 200ms ease;
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* ------------------------------- hero ------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: calc(var(--block-y) + 2rem) var(--gutter);
  overflow: hidden;
  isolation: isolate;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  /* Enquanto o WebGL não pinta (ou se falhar), o fundo já é escuro. */
  background: radial-gradient(120% 90% at 25% 15%, #0e7c5a 0%, #041a13 55%, #030b09 100%);
}

/* Escurece só o lado do texto e o rodapé do hero. O mesh continua visível à
   direita; os valores foram medidos para o texto passar de 4.5:1 em qualquer
   quadro da animação. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
      95deg,
      rgba(4, 10, 8, 0.82) 0%,
      rgba(4, 10, 8, 0.74) 58%,
      rgba(4, 10, 8, 0.18) 100%
    ),
    linear-gradient(180deg, transparent 55%, rgba(4, 10, 8, 0.5) 100%);
}

/* Sem espaço lateral livre, o texto cobre toda a largura: escurece por igual. */
@media (max-width: 47.999rem) {
  .hero__scrim {
    background: linear-gradient(
      180deg,
      rgba(4, 10, 8, 0.78) 0%,
      rgba(4, 10, 8, 0.74) 55%,
      rgba(4, 10, 8, 0.88) 100%
    );
  }
}

.hero__inner {
  max-width: 40rem;
  animation: rise 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, 2rem + 13vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  text-wrap: balance;
}

.hero__sub {
  font-size: clamp(0.7rem, 0.66rem + 0.2vw, 0.8rem);
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brand-light);
  margin-bottom: clamp(2rem, 1.25rem + 3vw, 3.5rem);
  text-wrap: balance;
}

.hero__line {
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem);
  line-height: 1.65;
  color: #e2eae6;
  max-width: 28rem;
  margin-bottom: 1.5rem;
}

.hero__credit {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b9cac3;
}

@media (max-width: 30rem) {
  .hero__sub {
    letter-spacing: 0.18em;
  }

  .hero__credit {
    letter-spacing: 0.08em;
  }
}

.hero__cue {
  position: absolute;
  left: var(--gutter);
  bottom: max(2rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 220ms ease;
}

.hero__cue:hover {
  color: var(--fg);
}

.hero__cue svg {
  width: 15px;
  height: 15px;
  animation: nudge 2.6s ease-in-out infinite;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* --------------------------- agenda (destaque) --------------------------- */
/* A informação mais procurada — precisa se destacar visualmente das seções
   normais, sem virar um bloco de texto igual aos outros. */
.agenda {
  padding: var(--block-y) var(--gutter);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(
    120% 160% at 50% 0%,
    rgba(63, 147, 124, 0.16),
    transparent 65%
  );
  text-align: center;
}

.agenda__inner {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  max-width: 34rem;
  margin-inline: auto;
}

.agenda__eyebrow {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-light);
}

.agenda__text {
  line-height: 1.7;
  color: #d7e0dc;
  max-width: 28rem;
  text-wrap: pretty;
}

.agenda__btn {
  margin-top: 0.4rem;
}

.agenda__btn svg {
  width: 18px;
  height: 18px;
  opacity: 1;
}

/* ------------------------------ blocos ------------------------------ */
.block {
  display: grid;
  gap: 1.25rem;
  align-items: start;
  padding: var(--block-y) var(--gutter);
  border-top: 1px solid var(--line);
  max-width: 78rem;
  margin-inline: auto;
}

@media (min-width: 48rem) {
  .block {
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 3rem;
  }
}

.block__label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.4rem;
  scroll-margin-top: 1.5rem;
}

.block__lead {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.6rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.block__sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.block__note {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 32rem;
}

.filial {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.filial__eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.filial__lead {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.filial__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

/* galeria em faixas horizontais — duas trilhas que correm de borda a borda;
   altura fixa e largura automática preservam a proporção de cada imagem */
.block--wide {
  display: block;
  max-width: none;
  padding-inline: 0;
}

.block--wide .block__label {
  padding-inline: var(--gutter);
  margin-bottom: 1.5rem;
}

.gallery__wrap {
  position: relative;
}

.gallery {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: -2px;
}

.gallery__track {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: max-content;
}

.gallery__row {
  display: flex;
  gap: 0.4rem;
}

@media (min-width: 64rem) {
  .gallery__track,
  .gallery__row {
    gap: 0.55rem;
  }
}

.shot {
  --shot-h: clamp(10rem, 7rem + 12vw, 17rem);
  flex: 0 0 auto;
  height: var(--shot-h);
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #101a16;
  cursor: pointer;
}

.shot img {
  display: block;
  height: 100%;
  width: auto;
  /* As fontes vêm de origens diferentes; a dessaturação leve unifica o conjunto. */
  filter: saturate(0.84) brightness(0.9);
  transition: filter 450ms ease, transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
  .shot:hover img {
    filter: saturate(1) brightness(1.02);
    transform: scale(1.05);
  }
}

.shot:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 3px;
}

/* setas de rolagem — só onde existe ponteiro e espaço para elas */
.gallery__nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 13, 11, 0.72);
  backdrop-filter: blur(6px);
  color: var(--fg);
  cursor: pointer;
  transition: background 250ms ease, opacity 250ms ease;
}

.gallery__nav--prev {
  left: 1rem;
}

.gallery__nav--next {
  right: 1rem;
}

.gallery__nav:hover {
  background: rgba(63, 147, 124, 0.9);
}

.gallery__nav:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
}

.gallery__nav[hidden] {
  display: none;
}

@media (hover: hover) and (min-width: 48rem) {
  .gallery__nav {
    display: flex;
  }
}

.gallery__note {
  margin-top: 1.25rem;
}

.block--wide .gallery__note {
  padding-inline: var(--gutter);
}

/* galeria da Vivência — mesma faixa horizontal da Umbanda, mas com as fotos
   reais tratadas em preto e branco (unifica exposição/temperatura de cor
   entre celulares diferentes). */
.gallery--mono .shot img {
  filter: grayscale(1) contrast(1.05) brightness(0.96);
}

@media (hover: hover) {
  .gallery--mono .shot:hover img {
    filter: grayscale(1) contrast(1.1) brightness(1.02);
  }
}

/* lightbox — overlay próprio (não usa <dialog>/showModal): alguns
   navegadores móveis mais antigos e in-app browsers (Instagram/Facebook)
   não suportam showModal, o que deixava o clique sem efeito nenhum. */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overscroll-behavior: contain;
}

.lightbox:not([hidden]) {
  display: flex;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 8, 0.92);
  backdrop-filter: blur(4px);
}

.lightbox__figure {
  position: relative;
  margin: 0;
  display: grid;
  gap: 0.9rem;
  justify-items: center;
  max-width: min(100vw - 2rem, 76rem);
  max-height: calc(100dvh - 2rem);
  color: var(--fg);
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100dvh - 10rem);
  width: auto;
  height: auto;
  border-radius: 4px;
  background: #101a16;
}

.lightbox__bar {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.lightbox__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(237, 242, 239, 0.22);
  border-radius: 999px;
  background: rgba(237, 242, 239, 0.06);
  color: var(--fg);
  transition: background-color 200ms ease, border-color 200ms ease;
}

.lightbox__btn:hover {
  background: rgba(237, 242, 239, 0.14);
  border-color: rgba(237, 242, 239, 0.4);
}

.lightbox__btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.lightbox__btn svg {
  width: 20px;
  height: 20px;
}

/* horários de visitação */
.hours {
  margin: 0 0 1.5rem;
}

.hours > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.hours > div:first-child {
  padding-top: 0;
}

.hours dt {
  font-size: 1.05rem;
}

.hours dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--brand-light);
  white-space: nowrap;
}

.hours__note {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

/* livro */
.book {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.25rem;
}

.book__cover {
  display: block;
  width: 100%;
  max-width: 15rem;
  margin-inline: auto;
  border-radius: 4px;
  overflow: hidden;
  background: #101a16;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 600ms ease;
}

@media (hover: hover) {
  .book__cover:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.6);
  }
}

.book__cover img {
  display: block;
  width: 100%;
  height: auto;
}

.book__title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.book__authors {
  margin-top: 0.6rem;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-light);
}

.book__text {
  margin-top: 1.25rem;
  margin-inline: auto;
  line-height: 1.7;
  color: #d7e0dc;
  max-width: 34rem;
  text-wrap: pretty;
}

.book__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 220ms ease, border-color 220ms ease,
    color 220ms ease;
}

.btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.btn--solid {
  background: var(--brand);
  color: #041c14;
}

.btn--solid:hover {
  background: #4fae93;
}

.btn--ghost {
  border: 1px solid var(--line);
  color: var(--fg);
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand-light);
}

.book__note {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 34rem;
}

.book__meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
  font-variant-numeric: lining-nums tabular-nums;
}

.book__isbn {
  white-space: nowrap;
}

/* links */
.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  width: fit-content;
  transition: color 220ms ease, border-color 220ms ease;
}

.link:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.link svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.link--inline {
  min-height: 0;
  font-size: inherit;
  color: var(--brand-light);
  border-bottom-color: rgba(165, 222, 200, 0.4);
}

.contacts {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

.contacts li {
  display: grid;
  gap: 0.3rem;
  justify-items: start;
}

.contacts__note {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ------------------------------ rodapé ------------------------------ */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  padding: 2.5rem var(--gutter);
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  max-width: 78rem;
  margin-inline: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer__mark {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  margin-right: auto;
}

/* --------------------------- whatsapp flutuante --------------------------- */
.wa {
  position: fixed;
  right: clamp(1rem, 0.5rem + 2vw, 2rem);
  bottom: clamp(1rem, 0.5rem + 2vw, 2rem);
  bottom: max(clamp(1rem, 0.5rem + 2vw, 2rem), env(safe-area-inset-bottom));
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 56px;
  padding: 0 1.15rem;
  border-radius: 999px;
  background: var(--brand);
  color: #041c14;
  text-decoration: none;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
  transition: background-color 220ms ease, transform 220ms ease,
    box-shadow 220ms ease;
}

.wa:hover {
  background: #4fae93;
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
}

.wa:active {
  transform: translateY(0);
}

.wa svg {
  width: 24px;
  height: 24px;
  flex: none;
}

.wa__label {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Em telas estreitas vira só o ícone, para não cobrir conteúdo. */
@media (max-width: 30rem) {
  .wa {
    width: 56px;
    padding: 0;
    justify-content: center;
  }

  .wa__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* O botão é fixo: reserva espaço para não cobrir o fim do rodapé. */
.footer {
  padding-bottom: max(6rem, calc(env(safe-area-inset-bottom) + 6rem));
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
