/* ============================================================
   UNIDADES-ENSINO.CSS — página Unidades de Ensino
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s ease, transform .55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.hero {
  position: relative;
  height: 75vh;
  min-height: 360px;
  max-height: none;
  isolation: isolate;
  overflow: hidden;
}

.hero-slides,
.hero-slide {
  min-height: inherit;
}

.hero-slides {
  display: flex;
  width: 100%;
  transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.hero-slide {
  position: relative;
  z-index: 0;
  flex: 0 0 100%;
}

.hero-banner-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -3;
}

.hero-slide::before,
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hero-slide::before {
  background: radial-gradient(circle at 10% 20%, rgba(0, 176, 240, 0.2), transparent 36%);
  background-size: cover;
  background-position: center;
  z-index: -2;
}

.hero-slide::after {
  background: linear-gradient(100deg, rgba(4, 16, 26, 0.76), rgba(4, 16, 26, 0.34) 45%, rgba(4, 16, 26, 0.55));
  z-index: -1;
}

.hero-content {
  min-height: inherit;
  display: grid;
  align-content: center;
  gap: 1rem;
  color: #edf8ff;
  padding-block: 9rem 4rem;
  max-width: 760px;
}

.hero h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.08;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  text-wrap: balance;
}

.hero p {
  margin: 0;
  max-width: 58ch;
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 0.5rem;
}

.dot {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(237, 248, 255, 0.4);
}

.dot.is-active {
  background: var(--primary);
}

.hero-social {
  position: absolute;
  right: max(1rem, calc((100vw - 1200px) / 2 + 1rem));
  left: auto;
  bottom: 1.1rem;
  display: flex;
  gap: 0.55rem;
  z-index: 2;
}

.hero .hero-social {
  right: max(1rem, calc((100vw - 1200px) / 2 + 1rem));
  left: auto;
  bottom: 1.1rem;
}

.hero-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(237, 248, 255, 0.45);
  background: rgba(4, 16, 26, 0.45);
  color: #edf8ff;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.hero-social-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hero-social-link:hover {
  transform: translateY(-2px);
}

.hero-social-fb:hover {
  background: #1877f2;
  border-color: #1877f2;
}

.hero-social-yt:hover {
  background: #ff0000;
  border-color: #ff0000;
}

.hero-social-wa:hover {
  background: #25d366;
  border-color: #25d366;
}

.hero-social-ig:hover {
  background: linear-gradient(135deg, #f9ce34 0%, #ee2a7b 52%, #6228d7 100%);
  border-color: #ee2a7b;
}

#unidades-organicas {
  background: #f5fbff;
}

.unidades-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.unidade-card {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  border: 1px solid rgba(145, 212, 241, 0.24);
  min-height: 460px;
  background: #0d2434;
  box-shadow: 0 22px 52px rgba(1, 8, 14, 0.24);
}

.unidade-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.unidade-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  transform: scale(1);
  transition: transform 0.45s ease;
}

.unidade-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 18, 29, 0.9) 12%, rgba(5, 18, 29, 0.08) 55%);
}

.unidade-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 0.4rem;
  padding: 1.6rem 1.6rem 2.35rem;
  text-align: left;
}

.unidade-overlay h3 {
  margin: 0 0 1.35rem;
  font-family: "Space Grotesk", sans-serif;
  color: #f3fbff;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.25;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.48);
}

.unidade-overlay p {
  margin: 0;
  max-width: 35ch;
  color: rgba(243, 251, 255, 0.92);
  font-size: 0.98rem;
  line-height: 1.45;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.unidade-views {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(219, 244, 255, 0.95);
}

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

.unidade-card:hover {
  border-color: rgba(113, 215, 255, 0.5);
}

body.dark #unidades-organicas {
  background: transparent;
}

body.dark .unidade-card {
  border-color: rgba(167, 211, 237, 0.24);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
}

@media (max-width: 1020px) {
  .unidades-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unidade-card {
    min-height: 420px;
  }
}

@media (max-width: 680px) {
  .hero-content {
    padding-top: 8rem;
    max-width: 100%;
  }

  .hero-social {
    right: 1rem;
    left: auto;
    bottom: 3.6rem;
    justify-content: flex-end;
  }

  .hero-social-link {
    width: 36px;
    height: 36px;
  }

  .unidades-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .unidade-card {
    min-height: 400px;
  }
}
