:root {
  --ccm-red: #d50000;
  --ccm-green: #007a33;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #f8f9fa;
  color: #212529;
}

.btn-danger {
  background-color: var(--ccm-red);
  border-color: var(--ccm-red);
}
.btn-danger:hover {
  background-color: #b00000;
  border-color: #b00000;
}

footer a {
  color: #fff;
  text-decoration: underline;
}

/* --- Galeria --- */
.gallery-thumb {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0.6rem;
}
.gallery-item:hover img {
  transform: scale(1.03);
  transition: transform 0.25s ease;
}

/* =========================================================
   HERO SLIDER — Fundo estático + Overlay + Animações L/R
   ========================================================= */
.hero-slider {
  position: relative;
  overflow: hidden;
  min-height: 58svh;
  background: #000; /* fallback */
  /* ajuste rápido no HTML: style="--hero-darkness:.55" (ou .85) */
}
@media (min-width: 992px) {
  .hero-slider {
    min-height: 72svh;
  }
}

/* Fundo estático (sem parallax) — imagem aplicada via JS */
.hero-bg-parallax {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #000;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: scroll; /* sem parallax */
  transition: background-image 0.5s ease-in-out, filter 0.25s ease;
}

/* Compatibilidade com versões antigas (<img class="hero-bg">) */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
  z-index: 0;
}

/* Overlay com escurecimento ajustável via var */
.hero-overlay {
  position: relative;
  z-index: 2;
  min-height: 58svh;
  display: flex;
  align-items: center;
  padding-block: 3rem;
}
.hero-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transition: background 0.25s ease;
}
@media (min-width: 992px) {
  .hero-overlay {
    min-height: 72svh;
    padding-block: 5rem;
  }
}

/* Slides sobrepostos */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(0);
  transition: opacity 0.75s ease, transform 0.75s ease;
  will-change: opacity, transform;
}
.hero-slide.is-active {
  opacity: 1 !important;
  transform: translateX(0) !important;
  z-index: 1;
}

.hero-title {
  color: #fff;
  font-size: clamp(1.4rem, 2.2vw + 0.6rem, 2.8rem);
  line-height: 1.15;
}
.hero-lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 1.2vw + 0.35rem, 1.25rem);
  line-height: 1.4;
}

/* Entradas L/R — disparadas via JS (stagger) */
.anim {
  opacity: 0;
  transform: translateX(var(--tx, 0));
  transition: opacity 0.75s ease-in-out, transform 0.75s ease-in-out;
  will-change: opacity, transform;
}
.anim.in {
  opacity: 1;
  transform: translateX(0);
}
.from-left {
  --tx: -42px;
}
.from-right {
  --tx: 42px;
}

/* Controles e indicadores (uma única definição) */
.hero-controls {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  pointer-events: none; /* setas não bloqueiam cliques internos */
}
.hero-controls .hero-btn {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.2);
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.hero-controls .hero-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: auto;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
}
.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: 0;
}
.hero-dot.is-active {
  background: #fff;
}

/* Transições de troca entre slides */
.slide-enter-fade {
  opacity: 0;
}
.slide-leave-fade {
  opacity: 0;
}
.slide-enter-left {
  transform: translateX(-6%);
}
.slide-leave-left {
  transform: translateX(6%);
  opacity: 0.2;
}
.slide-enter-right {
  transform: translateX(6%);
}
.slide-leave-right {
  transform: translateX(-6%);
  opacity: 0.2;
}

/* HORIZONTAL (desktop/tablets deitados): centraliza hero-content no eixo Y */
@media (orientation: landscape) {
  .hero-overlay {
    display: flex;
    align-items: center;
  }
  .hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
  }
}

/* VERTICAL (celulares em pé): texto sobreposto à imagem com gradiente e sombra */
@media (orientation: portrait) {
  .hero-figure img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }

  .hero-overlay {
    position: relative;
  }
  .hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem 1.25rem 1.5rem;
    text-align: left;
    z-index: 2;
  }
  .hero-content::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(48svh, 55%);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
    z-index: 1000;
  }
  .hero-title,
  .hero-lead,
  .hero-kicker {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
  }

  .hero-slider {
    min-height: 100svh;
  }
  .hero-overlay {
    min-height: 100svh;
    padding-block: 2rem;
  }
}

/* Acessibilidade: reduz animações se preferido pelo usuário */
@media (prefers-reduced-motion: reduce) {
  .anim,
  .hero-slide {
    transition: none !important;
  }
}
/* ============ Ajustes finos no HERO ============ */

/* 1) O "kicker" nunca ocupa toda a largura e alinha verticalmente o conteúdo interno */
.hero-kicker {
  display: inline-block; /* ocupa só o espaço do texto */
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  color: #fff;
  font-size: clamp(0.72rem, 0.6vw + 0.55rem, 0.85rem);
  line-height: 1; /* mantém o fundo rente ao texto */
  vertical-align: middle; /* alinha bem dentro de títulos */
  white-space: nowrap; /* evita quebrar em 2 linhas */
  text-align: inherit; /* acompanha o alinhamento do container */
}

/* 2) HORIZONTAL (desktop/tablets deitados):
   - Faz as colunas do grid terem altura do hero
   - Centraliza a hero-content verticalmente (sem mexer nos elementos internos) */
@media (orientation: landscape) {
  .hero-overlay {
    display: block; /* deixa a .row controlar a altura */
  }
  .hero-overlay .row {
    min-height: inherit; /* herda min-height do .hero-overlay */
  }
  /* Todas as colunas do grid dentro do HERO viram flex containers,
     permitindo que o conteúdo interno (hero-content) centre verticalmente */
  .hero-overlay [class^="col-"],
  .hero-overlay [class*=" col-"] {
    display: flex;
  }
  .hero-content {
    margin: 0; /* remove margem imprevisível */
    flex: 1; /* ocupa a altura disponível da coluna */
    display: flex;
    flex-direction: column;
    justify-content: center; /* CENTRO VERTICAL */
    min-height: 100%; /* garante esticar até a altura da coluna */
  }
}

/* 3) VERTICAL (celulares em pé):
   - Texto sobreposto à imagem
   - Gradiente NÃO ocupa toda a largura (tem respiro nas laterais)
   - Sombra para legibilidade
*/
@media (orientation: portrait) {
  /* mantém imagem no tamanho natural */
  .hero-figure img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }

  .hero-overlay {
    position: relative;
  }

  .hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem 1rem 1.25rem;
    z-index: 1000;

    /* limita a largura do bloco de texto para não parecer “full-bleed” */
    max-width: 720px;
    margin-inline: auto; /* centraliza horizontalmente */
  }

  /* Gradiente apenas atrás da largura do texto (não full-width) */
  .hero-content::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: min(100%, 720px); /* casa com o max-width do texto */
    height: min(48svh, 55%);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
    z-index: -1;
    border-radius: 0.75rem 0.75rem 0 0; /* opcional: cantos suaves */
  }

  .hero-title,
  .hero-lead,
  .hero-kicker {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
  }

  /* Altura total para comportar imagem + texto sobreposto com conforto */
  .hero-slider {
    min-height: 100svh;
  }
  .hero-overlay {
    min-height: 100svh;
    padding-block: 2rem;
  }
}

/* 4) Setas sempre centralizadas verticalmente; dots no rodapé */
.hero-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center; /* centro vertical das setas */
  justify-content: space-between;
  padding: 0 0.5rem;
  z-index: 3;
  pointer-events: none;
}
.hero-controls .hero-btn {
  pointer-events: auto;
}
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: auto;
  gap: 0.4rem;
}
.hero-slider {
  position: relative;
  z-index: 1000;
}

/* === BOTÃO VOLTAR AO TOPO === */
#btn-topo {
  position: fixed;
  bottom: 1.75rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 50%;
  background-color: var(--ccm-green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
  z-index: 999;
}

#btn-topo:hover {
  background-color: #009f47; /* tom mais claro de verde */
  transform: translateY(-2px);
}

#btn-topo.show {
  opacity: 1;
  visibility: visible;
}

#btn-topo i {
  font-size: 1.2rem;
  line-height: 1;
}

/* ============================================================
   SOCIAL BAR — lateral com expansão no hover + aparição pós-HERO
   ============================================================ */
/* ===== Social Bar (tooltips no hover/foco) ===== */
nav.social-bar {
  position: fixed;
  top: 28vh;
  right: 10px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
nav.social-bar.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

nav.social-bar .social-list {
  display: grid;
  gap: 0.5rem;
}

nav.social-bar .social-link {
  --_size: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--_size);
  height: var(--_size);
  background: var(--sb-color, #6c757d);
  color: #fff;
  text-decoration: none;
  border-radius: 0.6rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, filter 0.2s ease;
  pointer-events: auto;
}
nav.social-bar .social-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
nav.social-bar .social-link i {
  font-size: 1.15rem;
  line-height: 1;
}

@media (max-width: 575.98px) {
  nav.social-bar .social-link {
    --_size: 44px;
  }
}

/* ===== Parallax CTA (fundo fixo no desktop, fallback no mobile) ===== */
.parallax-cta {
  position: relative;
  isolation: isolate;
  padding: clamp(3rem, 7vw, 6rem) 0;
  background-color: #0a0a0a; /* fallback */
  overflow: hidden;
}

/* Fundo e overlay via pseudo-elementos para evitar markup extra */
.parallax-cta::before,
.parallax-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
}

/* Fundo */
.parallax-cta::before {
  background-image: var(--pc-bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed; /* parallax desktop */
}
@media (max-width: 991.98px) {
  .parallax-cta::before {
    background-attachment: scroll;
  } /* fallback mobile */
}

/* Overlay escuro ajustável */
.parallax-cta::after {
  z-index: -1;
  transition: background 0.25s ease;
}

/* Tipografia */
.parallax-cta h2 {
  line-height: 1.15;
}
.parallax-cta p {
  line-height: 1.45;
  color: #f8f9fa !important;
}

/* Micro-interação no CTA */
.parallax-cta .btn {
  transform: translateZ(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.parallax-cta .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* === NOSSA HISTÓRIA === */
#historia {
  background-color: #fff;
}

#historia .lead {
  font-size: 1.05rem;
  line-height: 1.6;
}

#historia img {
  transition: transform 0.4s ease;
}

#historia img:hover {
  transform: scale(1.03);
}

/* Em telas menores, centraliza o texto e espaça melhor */
@media (max-width: 768px) {
  #historia .col-lg-7 {
    text-align: center;
  }
  #historia .btn {
    margin-top: 0.75rem;
  }
}
