/**
 * Theia — card duas colunas
 * Col 1: módulos com hover. Col 2: print da tela. Abaixo: texto do módulo ativo.
 * Hover no módulo troca imagem e descrição.
 */

.section-theia {
  padding: var(--section-gap) 0 calc(var(--section-gap) * 2);
  background: var(--color-bg);
}

.theia-head {
  text-align: center;
  padding: 0 var(--space) var(--section-gap);
  max-width: var(--max-width);
  margin: 0 auto;
}

.theia-head__title {
  font-family: var(--font-primary);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  margin: 0 0 0.35em;
  color: var(--color-text);
}

.theia-head__subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* —— Card: duas colunas —— */
.theia-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: calc(var(--space) * 2);
  align-items: start;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space);
}

/* —— Coluna 1: lista de módulos (hover) —— */
.theia-card__col-modules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.theia-module {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-family: var(--font-primary);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theia-module:hover,
.theia-module:focus-visible {
  background: rgba(56, 113, 132, 0.06);
  border-left-color: rgba(56, 113, 132, 0.4);
  color: var(--color-accent);
}

.theia-module.theia-module--active {
  border-left-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(17, 128, 76, 0.06);
}

/* —— Coluna 2: print da tela —— */
.theia-card__col-screen {
  position: relative;
}

.theia-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(56, 113, 132, 0.12);
  background: var(--color-bg-section);
}

.theia-screen__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.theia-screen__img.active {
  opacity: 1;
  z-index: 1;
}

.theia-screen:hover .theia-screen__img.active {
  transform: scale(1.06);
}

/* —— Texto do módulo (abaixo do card, largura total) —— */
.theia-desc {
  max-width: 960px;
  margin: calc(var(--space) * 1.5) auto 0;
  padding: 0 var(--space);
  min-height: 3.5em;
  position: relative;
}

.theia-desc__text {
  position: absolute;
  inset: 0;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.theia-desc__text.theia-desc__text--active {
  position: relative;
  opacity: 1;
}

/* —— CTA —— */
.theia-cta-wrap {
  text-align: center;
  padding: var(--section-gap) var(--space) 0;
}

.theia-cta {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
}

.theia-cta:hover {
  background: var(--color-accent-hover);
}

/* —— Mobile: colunas empilhadas —— */
@media (max-width: 767px) {
  .theia-card {
    grid-template-columns: 1fr;
    gap: var(--space);
  }

  .theia-card__col-modules {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .theia-module {
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
  }

  .theia-module:hover,
  .theia-module:focus-visible {
    border-left: none;
    border-bottom-color: rgba(56, 113, 132, 0.4);
  }

  .theia-module.theia-module--active {
    border-left: none;
    border-bottom-color: var(--color-accent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .theia-screen__img,
  .theia-desc__text,
  .theia-module {
    transition-duration: 0.01ms;
  }

  .theia-screen:hover .theia-screen__img.active {
    transform: none;
  }
}
