/* ===== RESET E BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}

body.historia {
  font-family: 'Lato', sans-serif;
  color: #333;
  min-height: 100vh;
}

/* FUNDO PERGAMINHO FIXO */
body.historia {
  font-family: 'Lato', sans-serif;
  color: #333;
  min-height: 100vh;
}

.fundo-fixo {
  position: fixed;
  inset: 0;
  background: url('/assets/desenhoNoPergaminho.png') no-repeat center/cover;
  z-index: -1;
}

/* ===== VARIÁVEIS ===== */
:root {
  --azul-escuro: #0a2540;
  --azul-medio: #1a4a7a;
  --azul-claro: #4da6ff;
  --branco: #ffffff;
  --cinza: #666;
  --dourado: rgba(200, 169, 110, 0.8);
  --linha-cor: rgba(200, 169, 110, 0.6);
}

/* ===== SEÇÕES ===== */
section {
  background: rgba(245, 235, 210, 0.82) !important;
  backdrop-filter: blur(3px) !important;
}

a {
  margin: 0;
  padding: 0;
  display: block;
}

/* ===== NAVBAR ===== */
.navbar-historia {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 30px;
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.navbar-logo-img {
  height: 45px;
  width: auto;
  filter: brightness(0) invert(1);
}

.navbar-historia.visivel {
  opacity: 1;
  transform: translateY(0);
}

.navbar-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: white;
  letter-spacing: 2px;
}

.btn-voltar {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  text-decoration: none;
  color: white;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 30px;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  font-size: 15px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  
}

.btn-voltar.escondido {
  opacity: 0;
  transform: translateY(-15px);
  pointer-events: none;
}

/* ===== HERO ===== */
.hero-logo {
  width: 120px;
  height: auto;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSubir 1.5s ease forwards;
  animation-delay: 0s;
  filter: brightness(0) invert(1);
}

body.historia, html {
  width: 100%;
  overflow-x: hidden;
}

.hero-historia {
  background: url('/assets/fachada.jpeg') right center / cover no-repeat !important;
  background-attachment: scroll !important;
  width: 100% !important;
  max-width: 100vw !important;
  left: 0 !important;
  right: 0 !important;
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  z-index: 0;
}

.hero-historia::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 0;
}

.hero-historia::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5));
  z-index: 1;
}

.hero-historia .overlay {
  background: transparent;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* TEXTO HERO */
.hero-content {
  color: white;
  text-align: center;
  z-index: 2;
  padding: 0 20px;
}

.hero-content h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 300;
  letter-spacing: 4px;
  font-style: italic;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSubir 1.5s ease forwards;
  animation-delay: 0.3s;
}

.hero-content h1 span {
  font-weight: 600;
}

.hero-content p {
  font-family: 'Lato', sans-serif;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 2px;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSubir 1.5s ease forwards;
  animation-delay: 0.8s;
}

@keyframes fadeSubir {
  to {
    opacity: 0.9;
    transform: translateY(0);
  }
}

/* INDICADOR DE SCROLL */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
  opacity: 0.8;
}

.scroll-hint p {
  color: white;
  font-family: 'Lato', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid white;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.wheel {
  width: 4px;
  height: 8px;
  background: white;
  border-radius: 2px;
  animation: scroll-wheel 1.5s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(10px); opacity: 0; }
}

/* ===== TIMELINE HEADER ===== */
.timeline-header {
  text-align: center;
  padding: 80px 20px 60px;
  background: transparent !important;
}

.timeline-header .tag {
  font-family: 'Lato', sans-serif;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--azul-claro);
  margin-bottom: 16px;
}

.timeline-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  color: var(--azul-escuro);
  line-height: 1.2;
  margin-bottom: 16px;
}

.timeline-header h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--azul-claro);
}

.timeline-header p {
  font-size: 1rem;
  color: var(--cinza);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

.divisor {
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, var(--azul-claro), transparent);
  margin: 24px auto 0;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--linha-cor) 5%, var(--linha-cor) 95%, transparent);
  transform: translateX(-50%);
}

/* ===== ITEM ===== */
.item {
  display: flex;
  justify-content: flex-end;
  padding-right: calc(50% + 40px);
  margin-bottom: 60px;
  position: relative;
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.item.direita {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: calc(50% + 40px);
  transform: translateX(50px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.item.visivel {
  opacity: 1;
  transform: translateX(0) !important;
}

/* BOLINHA */
.item::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: var(--branco);
  border: 3px solid var(--dourado);
  border-radius: 50%;
  z-index: 2;
  transition: background 0.3s, transform 0.3s;
}

.item:hover::before {
  background: var(--dourado);
  transform: translateX(-50%) scale(1.3);
}

/* ANO */
.item .ano {
  position: absolute;
  left: 50%;
  top: -2px;
  transform: translateX(-50%);
  background: var(--azul-escuro);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 3;
}

/* CARD */
.card {
  background: rgba(250, 242, 220, 0.95);
  border-radius: 16px;
  padding: 28px 30px;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(139, 90, 43, 0.1);
  border: 1px solid rgba(200, 169, 110, 0.3);
  position: relative;
  transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: 0 8px 36px rgba(139, 90, 43, 0.2);
  transform: translateY(-3px);
}

.item:not(.direita) .card::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 28px;
  border: 10px solid transparent;
  border-left-color: rgba(250, 242, 220, 0.95);
  border-right: none;
}

.item.direita .card::after {
  content: '';
  position: absolute;
  left: -10px;
  top: 28px;
  border: 10px solid transparent;
  border-right-color: rgba(250, 242, 220, 0.95);
  border-left: none;
}

.card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #6b3f1f;
  margin-bottom: 12px;
  line-height: 1.3;
}

.card p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.75;
}

.card .icone {
  font-size: 1.4rem;
  margin-bottom: 10px;
  display: block;
}

/* ===== FIM DA TIMELINE ===== */
.timeline-fim {
  text-align: center;
  padding: 20px 20px 80px;
  overflow: hidden;
}

.timeline-fim .estrela {
  font-size: 2rem;
  color: var(--azul-claro);
  display: block;
  margin-bottom: 12px;
}

.timeline-fim p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--azul-medio);
}

/* ===== GALERIA ===== */
.galeria {
  padding: 80px 20px;
  text-align: center;
}

.titulo {
  color: #4da6ff;
  letter-spacing: 2px;
}

.titulo-principal {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: #0a2540;
}

.subtitulo {
  color: #666;
  margin-bottom: 20px;
}

.linha {
  width: 80px;
  height: 3px;
  background: #4da6ff;
  margin: 20px auto 40px;
}

.viewer {
  position: relative;
  max-width: 800px;
  margin: auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.viewer img {
  width: 100%;
  height: 400px;
  object-fit: contain;
  display: block;
  transition: opacity 0.8s ease;
  background: #000;
}

.viewer .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  text-align: left;
}

.viewer {
  cursor: grab;
  overflow: hidden;
}

.viewer:active {
  cursor: grabbing;
}

#imagemPrincipal {
  user-select: none;
  -webkit-user-drag: none;
  touch-action: pan-y;
  transition: opacity 0.4s ease;
}

/* DOTS */
.dots {
  margin: 20px 0;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #c8a96e;
  margin: 5px;
  border-radius: 50%;
  transition: 0.3s;
  cursor: pointer;
}

.dot.active {
  width: 25px;
  border-radius: 10px;
  background: #8b5a2b;
}

/* THUMBNAILS */
.thumbs-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbs {
  display: flex;
  gap: 10px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 10px;
  max-width: 600px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.thumbs::-webkit-scrollbar {
  display: none;
}

.thumbs img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.6;
  transition: 0.3s;
  min-width: 120px;
}

.thumbs img.active {
  border: 3px solid #4da6ff;
  opacity: 1;
}

.seta {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

.thumbs-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px;
  max-width: 600px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.thumbs::-webkit-scrollbar {
  display: none;
}

.thumbs.arrastando {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}

.thumbs.arrastando img {
  pointer-events: none;
}

/* ===== BOTÃO TOPO ===== */
.btn-topo {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: rgba(139, 90, 43, 0.6);
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s;
  backdrop-filter: blur(6px);
}

.btn-topo:hover {
  background: rgba(139, 90, 43, 0.9);
}

.btn-topo.visivel {
  opacity: 1;
  transform: translateY(0);
}

footer {
  background: transparent !important;
  color: rgb(0, 0, 0) !important;
}

/* ===== RESPONSIVO TABLET (max 768px) ===== */
@media (max-width: 768px) {
  .navbar-logo {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }

  .voltar-inicio {
    font-size: 12px;
    padding: 6px 10px;
  }

  .viewer img {
    height: 260px;
  }

  .thumbs {
    max-width: 100%;
  }

  .card {
    padding: 20px;
  }
}

/* ===== RESPONSIVO MOBILE (max 640px) ===== */
@media (max-width: 640px) {
  .navbar-historia {
    padding: 12px 16px;
  }

  .navbar-logo {
    font-size: 0.8rem;
  }

  /* Timeline vira coluna única */
  .timeline::before {
    left: 20px;
  }

  .item, .item.direita {
    justify-content: flex-start;
    padding-left: 56px;
    padding-right: 0;
    transform: translateX(-30px) !important;
  }

  .item.visivel {
    transform: translateX(0) !important;
  }

  .item::before, .item.direita::before {
    left: 20px;
  }

  .item .ano, .item.direita .ano {
    left: 20px;
    transform: translateX(-50%);
  }

  .item:not(.direita) .card::after,
  .item.direita .card::after {
    left: -10px;
    right: auto;
    border-right-color: rgba(250, 242, 220, 0.95);
    border-left: none;
    border-left-color: transparent;
  }

  .card {
    max-width: 100%;
    padding: 16px;
  }

  .viewer img {
    height: 220px;
  }

  .thumbs img {
    width: 90px;
    height: 60px;
    min-width: 90px;
  }

  .btn-topo {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .scroll-hint {
    bottom: 20px;
  }
}

