/* ============================================
   NOSSA HISTÓRIA — historia.css
   ============================================ */

/* ---- Reveal animation ---- */
.h-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.h-reveal.h-visible {
  opacity: 1;
  transform: translateY(0);
}

.h-reveal:nth-child(2) { transition-delay: 0.08s; }
.h-reveal:nth-child(3) { transition-delay: 0.16s; }
.h-reveal:nth-child(4) { transition-delay: 0.24s; }

/* ---- Section base ---- */
.historia-section {
  position: relative;
  background: linear-gradient(160deg, #1a2e52 0%, #1e3a8a 50%, #1a2e52 100%);
  overflow: hidden;
}

.historia-wave-top,
.historia-wave-bottom {
  display: block;
  line-height: 0;
}

.historia-wave-top svg,
.historia-wave-bottom svg {
  display: block;
  width: 100%;
  height: 70px;
}

/* ---- Header ---- */
.historia-header {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.historia-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #90cdf4;
  background: rgba(144, 205, 244, 0.1);
  border: 1px solid rgba(144, 205, 244, 0.22);
  padding: 0.35rem 1.1rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.historia-title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin: 0;
}

.historia-title em {
  font-style: italic;
  color: #90cdf4;
}

/* ---- Bloco principal ---- */
.historia-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  margin-bottom: 3rem;
}

.historia-main-image {
  position: relative;
  border-radius: 14px;
  overflow: visible;
}

.historia-main-image img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.38);
}

.historia-badge {
  position: absolute;
  bottom: -1.2rem;
  right: -1.2rem;
  background: var(--color-accent, #2563eb);
  color: #fff;
  border-radius: 12px;
  padding: 1rem 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.45);
  border: 2px solid rgba(255,255,255,0.12);
}

.badge-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: #90cdf4;
}

.badge-text {
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.4;
  color: rgba(255,255,255,0.8);
  margin-top: 0.2rem;
}

.historia-main-text h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  color: #fff;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 1.2rem;
}

.historia-main-text p {
  font-size: 1rem;
  color: rgba(255,255,255,0.68);
  line-height: 1.8;
  margin-bottom: 0;
}

.historia-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-item .stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: #90cdf4;
  font-weight: 500;
  line-height: 1;
}

.stat-item .stat-suffix {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: #90cdf4;
  font-weight: 500;
  line-height: 1;
}

.stat-value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-top: 0.3rem;
}

/* ---- Timeline wrapper ---- */
.historia-timeline-wrap {
  margin-bottom: 2.5rem;
  position: relative;
}

/* linha conectora horizontal (só desktop) */
.tl-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  margin-bottom: -1px;
  position: relative;
  z-index: 0;
}

.tl-track {
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, rgba(144,205,244,0.05), rgba(144,205,244,0.45), rgba(144,205,244,0.05));
  border-radius: 2px;
}

/* ---- Timeline grid (3 colunas desktop) ---- */
.historia-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

/* ---- Step card ---- */
.tl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tl-step-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e3a8a;
  border: 2px solid #90cdf4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  box-shadow: 0 0 0 6px rgba(144,205,244,0.1);
  transition: box-shadow 0.3s ease;
}

.tl-step:hover .tl-step-dot {
  box-shadow: 0 0 0 10px rgba(144,205,244,0.15);
}

.tl-step-dot span {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: #90cdf4;
  font-weight: 500;
}

.tl-step-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  padding: 0 0 1.5rem;
  overflow: hidden;
  width: 100%;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(6px);
}

.tl-step-card:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.tl-img {
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 1.25rem;
}

.tl-img img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-step-card:hover .tl-img img {
  transform: scale(1.06);
}

.tl-year {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #90cdf4;
  margin-bottom: 0.5rem;
  padding: 0 1.25rem;
}

.tl-step-card h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: #fff;
  font-weight: 400;
  margin-bottom: 0.6rem;
  padding: 0 1.25rem;
}

.tl-step-card p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin: 0;
  padding: 0 1.25rem;
}

/* ---- Dots (carrossel mobile — ocultos no desktop) ---- */
.tl-dots {
  display: none;
}

/* ---- Valores ---- */
.historia-valores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.valor-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.4rem 1.2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

.valor-card:hover {
  background: rgba(255,255,255,0.09);
  transform: translateY(-3px);
}

.valor-icon {
  width: 44px;
  height: 44px;
  background: rgba(144,205,244,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #90cdf4;
  border: 1px solid rgba(144,205,244,0.18);
}

.valor-text h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: #fff;
  font-weight: 400;
  margin-bottom: 0.3rem;
}

.valor-text p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.55;
  margin: 0;
}

/* ============================================
   TABLET (max 1024px)
   ============================================ */
@media (max-width: 1024px) {
  .historia-main {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .historia-main-image img {
    height: 300px;
  }

  .historia-badge {
    right: 0.75rem;
    bottom: -1rem;
  }

  .historia-valores {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   MOBILE (max 768px) — carrossel na timeline
   ============================================ */
@media (max-width: 768px) {

  .historia-section .container {
    padding: 0 1rem;
  }

  .historia-header {
    padding: 1.75rem 0 1.25rem;
  }

  .historia-title {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  /* Bloco principal em coluna */
  .historia-main {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .historia-main-image img {
    height: 220px;
  }

  .historia-badge {
    right: 0.5rem;
    bottom: -0.8rem;
    padding: 0.7rem 1rem;
  }

  .badge-number { font-size: 1.6rem; }

  .historia-stats {
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }

  .stat-item .stat-number,
  .stat-item .stat-suffix {
    font-size: 1.5rem;
  }

  /* Esconde linha horizontal decorativa */
  .tl-connector { display: none; }

  /* Timeline: carrossel horizontal com scroll-snap */
  .historia-timeline-wrap {
    margin: 0 -1rem 1.5rem;
    width: calc(100% + 2rem);
    position: relative;
  }

  /* hint de deslize animado */
  .historia-timeline-wrap::after {
    content: '';
    position: absolute;
    bottom: 2.6rem;
    right: 1.25rem;
    width: 28px;
    height: 28px;
    background: rgba(144, 205, 244, 0.15);
    border: 1.5px solid rgba(144, 205, 244, 0.4);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2390cdf4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
    animation: swipeHint 1.6s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
  }

  @keyframes swipeHint {
    0%   { transform: translateX(0);    opacity: 0.9; }
    40%  { transform: translateX(6px);  opacity: 1;   }
    70%  { transform: translateX(-2px); opacity: 0.7; }
    100% { transform: translateX(0);    opacity: 0.9; }
  }

  .historia-timeline {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    /* padding-top generoso para o dot não ser cortado */
    padding: 1.6rem 1rem 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    grid-template-columns: unset;
  }

  .historia-timeline::-webkit-scrollbar {
    display: none;
  }

  .tl-step {
    flex: 0 0 calc(100vw - 3rem);
    min-width: calc(100vw - 3rem);
    max-width: calc(100vw - 3rem);
    scroll-snap-align: center;
    padding: 0 0.25rem;
    /* espaço acima para o dot "flutuar" acima do card */
    padding-top: 1.4rem;
    position: relative;
  }

  .tl-step-dot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
    z-index: 5;
  }

  .tl-step-card {
    width: 100%;
  }

  .tl-img img {
    height: 180px;
  }

  /* Dots visíveis */
  .tl-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-bottom: 0.25rem;
  }

  .tl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(144,205,244,0.3);
    cursor: pointer;
    padding: 0;
    transition: background 0.25s ease, width 0.25s ease, border-radius 0.25s ease;
  }

  .tl-dot.active {
    background: #90cdf4;
    width: 22px;
    border-radius: 4px;
  }

  /* Valores 2x2 compactos */
  .historia-valores {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 0;
  }

  .valor-card {
    padding: 0.9rem;
    gap: 0.65rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .valor-icon {
    width: 36px;
    height: 36px;
  }

  .valor-text h4 {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
  }

  .valor-text p {
    font-size: 0.76rem;
    line-height: 1.45;
  }
}

/* ============================================
   SMALL MOBILE (max 480px)
   ============================================ */
@media (max-width: 480px) {
  .tl-step {
    flex: 0 0 calc(100vw - 2.5rem);
    min-width: calc(100vw - 2.5rem);
    max-width: calc(100vw - 2.5rem);
    padding-top: 1.4rem;
  }

  .historia-main-image img {
    height: 190px;
  }

  .badge-number {
    font-size: 1.4rem;
  }
}
