:root {
  --iaha-titleW: 100px;
  --primary-colorC: #163561;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.iaha,
.iaha * {
  font-family: 'Poppins', sans-serif;
}

.iaha {
  display: flex;
  gap: 12px;
  min-height: 520px;
  overflow: hidden;
  background: transparent;
  transition: all 0.3s ease;
}

.iaha-trigger {
  cursor: pointer;
}

.iaha-item {
  position: relative;
  flex: 1 1 0%;
  flex-grow: 1;
  transition: flex-grow 0.38s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  color: #111;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.iaha-item.active {
  flex-grow: 6;
}

.iaha-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg) center/cover no-repeat;
  opacity: 0.1;
  pointer-events: none;
}

.iaha-item .iaha-trigger {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--iaha-titleW);
  height: 100%;
  border: 0;
  background: transparent;
  color: #111;
  padding: 0;
  display: flex;
  align-items: end;
  justify-content: center;
}

.iaha-trigger .title {
  font-family: 'Poppins', sans-serif;
  color: var(--primary-colorC);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 700;
  margin-bottom: 60px;
  font-size: 20px;
  line-height: 1.1;
  text-align: center;
}

/* Número 01, 02… */
.iaha-index {
  position: absolute;
  bottom: 16px;
  left: calc(var(--iaha-titleW) / 2);
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #999;
  opacity: 0.8;
}

/* Panel animado (slide + fade) */
.iaha-content {
  cursor: default;
  position: relative;
  z-index: 2;
  height: 100%;
  margin-left: var(--iaha-titleW);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  color: #111;
  max-width: 0;
  overflow: hidden;
  transition: max-width 0.38s ease;
  display: flex;
  align-items: center;
}

.iaha-item.active .iaha-content {
  max-width: 960px;
}

.iaha-content-inner {
  padding: 42px;
  transform: translateX(12px);
  opacity: 0;
  transition: transform 0.32s ease, opacity 0.32s ease;
  max-width: 960px;
}

.iaha-item.active .iaha-content-inner {
  transform: translateX(0);
  opacity: 1;
}

.iaha-content h3 {
  margin: 0 0 14px;
  font-size: 28px;
}

.iaha-content p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}

.iaha-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--primary-colorC);
  border-radius: 8px;
  border: solid 2px var(--primary-colorC);
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
}

.iaha-btn .arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.iaha-btn:hover {
  background: var(--primary-colorC);
  color: #fff;
}

.iaha-btn:hover .arrow {
  transform: translateX(4px);
}

/* =============================
   RESPONSIVE (Desktop → Móvil)
   ============================= */

@media (max-width: 1200px) {
  .iaha-item.active .iaha-content {
    max-width: 760px;
  }
  .iaha-content-inner {
    min-width: 440px;
    padding: 32px;
  }
}

@media (max-width: 1024px) {
  .iaha {
    height: 460px;
  }
  .iaha-trigger .title {
    font-size: 20px;
  }
  .iaha-item.active .iaha-content {
    max-width: 600px;
  }
  .iaha-content-inner {
    min-width: 360px;
    padding: 28px;
  }
}

/* ==============================================
   MODO VERTICAL (para pantallas <= 989px)
   ============================================== */
@media (max-width: 989px) {
  .iaha {
    flex-direction: column;
    min-height: auto;
    gap: 8px;
  }

  .iaha-item {
    width: 100%;
    flex: unset;
    flex-grow: unset;
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
  }

  .iaha-item.active {
    flex-grow: unset;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
  }

  .iaha-item .iaha-trigger {
    position: relative;
    width: 100%;
    height: auto;
    padding: 16px 18px;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }

  .iaha-trigger .title {
    writing-mode: horizontal-tb;
    transform: none;
    margin: 0;
    font-size: 18px;
  }

  .iaha-index {
    position: static;
    transform: none;
    font-size: 16px;
    opacity: 0.6;
  }

  .iaha-content {
    margin-left: 0;
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    max-height: 0;
    max-width: 100%;
    transition: max-height 0.4s ease;
    overflow: hidden;
    display: block;
  }

  .iaha-item.active .iaha-content {
    max-height: 600px; /* suficiente para texto */
  }

  .iaha-content-inner {
    padding: 20px 18px;
    min-width: auto;
    max-width: 100%;
    transform: none;
    opacity: 1;
  }
}
