/* ============================
   BASE
============================ */

body.without-banner {
  font-family: 'Roboto', sans-serif;
  background-color: #f9f9f9;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

/* ============================
   HERO
============================ */

.hero {
  top: 50px;
  position: relative;
  color: #f9f9f9;
  text-align: center;
  padding: 100px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.hero img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
  z-index: 0;
}

.hero-text {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  color: #fff;
}

.hero h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2em;
}

/* ============================
   HISTÓRIA
============================ */

.historia-container {
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
  justify-content: center;
}

.historia {
  padding: 30px;
  border-radius: 12px;
}

/* ============================
   PROJETOS
============================ */

.section-projetos {
  text-align: center;
  margin: 50px 0 20px 0;
  font-size: 2em;
  color: #222;
  padding: 0 1rem;
  word-wrap: break-word;
}

/* Container grid dos cards de projetos */
.projetos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto 50px auto;
  padding: 20px;
  justify-items: center;
}

/* Cada card de projeto */
.projeto {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  width: 300px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, width 0.4s ease;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.projeto:hover {
  width: 3500px; /* Parece um typo: 3500px é exagerado, talvez 350px? */
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.projeto img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
  transition: height 0.4s ease;
}

.projeto:hover img {
  height: 260px;
}

.projeto p {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.projeto:hover p {
  opacity: 1;
  visibility: visible;
  height: auto;
  margin-top: 10px;
}

.projeto h1 {
  font-size: 60px;
  margin-bottom: 10px;
  color: inherit;
}

.projeto p {
  font-size: 0.95em;
  color: inherit;
}

/* ============================
   MEDIDOR
============================ */

.medidor-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 250px;
  transition: height 0.5s ease;
  overflow: hidden;
}

.medidor-banner:hover {
  height: 600px;
}

#medidor-fluxo {
  width: 100%;
  position: relative;
  background-image: url('/img/projetos/fundo medidor hd.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  padding: 60px 20px;
  text-align: center;
  transition: all 0.5s ease;
  height: 450px;
  cursor: pointer;
  overflow: hidden;
}

/* Imagem para cada projeto específico */
#controlador-temperatura,
#medidor-kwh,
#sistema-incendio {
  background-size: cover;           /* cobre toda a área */
  background-position: center;      /* centraliza a imagem */
  background-repeat: no-repeat;     /* impede repetição */
  padding: 2rem;
  border-radius: 12px;
  color: rgb(82, 82, 82);
  margin-bottom: 2rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* Imagens específicas */
#controlador-temperatura {
  background-image: url('/img/projetos/controlador.webp');
}

#medidor-kwh {
  background-image: url('/img/projetos/medidor kwh.webp');
}

#sistema-incendio {
  background-image: url('/img/projetos/central.webp');
}


#medidor-fluxo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('/img/projetos/fundomedidor2 hd.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 0;
}

#medidor-fluxo.fade::before {
  opacity: 1;
}

#medidor-fluxo article {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

#medidor-fluxo h1,
#medidor-fluxo p,
#medidor-fluxo strong {
  filter: brightness(1);
  color: white;
  margin-bottom: 50px;
}

#medidor-fluxo p {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  height: 0;
  margin: 0;
  overflow: hidden;
}

#medidor-fluxo h1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3em;
  margin: 0;
  transition: all 0.7s ease;
  z-index: 10;
  text-align: center;
}

#medidor-fluxo:hover h1 {
  position: relative;
  top: 0;
  left: 0;
  transform: none;
  font-size: 2em;
  margin-bottom: 40px;
  transition: all 0.7s ease;
}

#medidor-fluxo:hover p {
  opacity: 1;
  visibility: visible;
  height: auto;
  margin-top: 1em;
}

/* ============================
   ECOSSISTEMA
============================ */

.ecosystem-section {
  background-color: #111;
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}

.ecosystem-section .section-title {
  font-size: 2rem;
  margin-bottom: 10px;
}

.ecosystem-section .section-desc {
  font-size: 1rem;
  max-width: 700px;
  margin: 0 auto 40px;
  color: #bbb;
}

.ecosystem-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 2rem;
  margin-top: 2rem;
}

.eco-card {
  background: #1a1a1a;
  padding: 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 280px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 0 transparent;
  text-align: center;
  cursor: pointer;
}

.eco-card:hover,
.eco-card.active {
  transform: translateY(-10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.eco-card img {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  border-radius: 50%;
  object-fit: cover;
}

.eco-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.eco-card p {
  font-size: 0.95rem;
  color: #ccc;
  margin: 0;
}

/* ============================
   FOOTER
============================ */

footer {
  background: #222;
  color: #fff;
  padding: 30px 20px;
  text-align: center;
  margin-top: auto;
}

/* ============================
   ANIMAÇÕES
============================ */

.fade-in {
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
}

.fade-in-delay-1 {
  animation-delay: 0.3s;
}

.fade-in-delay-2 {
  animation-delay: 0.6s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================
   RESPONSIVO
============================ */

@media (max-width: 1024px) {
  /* Projetos - 1 card por linha */
  .projetos {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    max-width: 100% !important;
    padding: 10px !important;
    margin: 0 auto 30px auto !important;
    justify-items: stretch !important;
  }
  .hero {
    top: -50px;
  }
  .projeto {
    width: 100% !important;
    max-width: none !important;
  }

  /* Ecossistema - 1 card por linha */


  /* Hero ajustes */
  .hero {
    top: -50px !important;
  }
}

@media (max-width: 768px) {
  /* Projetos: 1 card por linha para touch */
  .projetos {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    max-width: 100% !important;
    padding: 10px !important;
    margin: 0 auto 30px auto !important;
    justify-items: stretch !important;
  }

  .projeto {
    width: 100% !important;
    max-width: none !important;
  }

  /* Ecossistema: 1 card por linha para touch */
  .ecosystem-grid {
    display: flex !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Ajuste para hero */
  .hero {
    top: -50px !important;
  }
}

@media (max-width: 450px) {
  .section-projetos {
    font-size: 1.5em;
    padding: 0 10px;
    text-align: center;
  }
  .hero {
    top: -100px !important;
  }
}

@media (max-width: 425px) {
  .projeto h3 {
    font-size: 1.1em;
  }
  .projeto p {
    font-size: 0.9em;
  }
  .hero {
    top: -100px !important;
  }
}

@media (max-width: 320px) {
  .projeto h3 {
    font-size: 1.1em;
  }
  .projeto p {
    font-size: 0.9em;
  }
  .hero {
    top: -100px !important;
  }
  .hero-text{
    font-size: 0.9em;
  }
}
