/* ==========================================================================
   Inicio — Unidades y alianzas educativas
   ========================================================================== */

.home-units-section {
  background: #ececec;
  padding: 2.75rem 0;
}

.home-units-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.home-units-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.home-unit-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  padding: 1.5rem 1.25rem;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-unit-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.home-unit-card__image {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  max-height: 120px;
  object-fit: contain;
}

.home-unit-card__fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 90px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1e5069;
  padding: 0 0.75rem;
}

.home-alliances-section {
  background: #ececec;
  padding: 3rem 0 2.5rem;
}

.home-alliances-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
}

.home-alliances-title {
  text-align: center;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: #222;
  letter-spacing: 0.06em;
  margin: 0 0 1.75rem;
}

.home-alliances-carousel {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.home-alliances-carousel__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  width: 100%;
  max-width: 360px;
}

.home-alliances-carousel__image {
  display: block;
  width: auto;
  max-width: min(340px, 88vw);
  max-height: 400px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  transition: opacity 0.25s ease;
}

.home-alliances-carousel__image.is-changing {
  opacity: 0.15;
}

.home-alliances-logos-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2rem;
  padding: 0.5rem 0 1.5rem;
}

.home-alliances-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.home-alliances-item:hover,
.home-alliances-item.is-active {
  transform: scale(1.04);
  opacity: 1;
}

.home-alliances-item.is-active {
  outline: 2px solid rgba(138, 32, 52, 0.35);
  outline-offset: 4px;
  border-radius: 4px;
}

.home-alliances-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.home-alliances-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.home-alliances-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.home-alliances-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.home-alliances-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  color: #333;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
}

.home-alliances-modal__close:hover {
  color: #8A2034;
}

.home-alliances-modal__title {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin: 0 2rem 1rem 0;
  line-height: 1.4;
}

.home-alliances-modal__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.home-alliances-item__logo {
  display: block;
  width: auto;
  max-width: 120px;
  max-height: 72px;
  object-fit: contain;
}

.home-alliances-item--wide .home-alliances-item__logo {
  max-width: 180px;
  max-height: 80px;
}

.home-alliances-action {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.home-alliances-note {
  max-width: 760px;
  margin: 0;
  padding: 1rem 1.25rem;
  border-left: 5px solid #8A2034;
  background: #fff;
  color: #333;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

@media (max-width: 991.98px) {
  .home-alliances-carousel__frame {
    min-height: 220px;
  }

  .home-alliances-item__logo {
    max-width: 100px;
    max-height: 56px;
  }

  .home-alliances-item--wide .home-alliances-item__logo {
    max-width: 140px;
    max-height: 64px;
  }

  .home-alliances-action {
    justify-content: center;
  }
}

@media (max-width: 575.98px) {
  .home-alliances-logos-row {
    gap: 1rem 1.25rem;
  }

  .home-alliances-note {
    font-size: 0.88rem;
    padding: 0.9rem 1rem;
  }
}

/* ==========================================================================
   Síguenos en redes sociales — widget externo (Elfsight, Tagembed, Juicer)
   ========================================================================== */

.social-feed-section {
  background: linear-gradient(180deg, #1a2332 0%, #141b26 100%);
  color: #f8f9fa;
  padding: 3.5rem 0 4rem;
  margin-top: 0;
}

.social-feed-section__title {
  text-align: center;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 1.75rem;
  letter-spacing: 0.02em;
}

.social-feed-profiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto 2.5rem;
}

.social-feed-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 1 220px;
  max-width: 320px;
}

.social-feed-profile__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.social-feed-profile__link:hover {
  color: #fff;
  opacity: 0.88;
}

.social-feed-profile__icon {
  font-size: 2rem;
  line-height: 1;
}

.social-feed-profile__handle {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.social-feed-section__subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
  max-width: 42rem;
  margin: 0 auto 2.25rem;
  line-height: 1.5;
}

.social-feed-widget {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  min-height: 120px;
}

/* Contenedor del mosaico: el widget externo o el placeholder heredan este grid */
.social-feed-mosaic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

.social-feed-placeholder {
  width: 100%;
}

.social-feed-placeholder__note {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 1.25rem;
  font-style: italic;
}

.social-feed-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.social-feed-card:nth-child(3n + 2) {
  min-height: 260px;
}

.social-feed-card:nth-child(5n) {
  min-height: 300px;
}

.social-feed-card__media {
  flex: 1;
  background: linear-gradient(135deg, rgba(30, 80, 105, 0.35) 0%, rgba(138, 32, 52, 0.25) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.social-feed-card__media i {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.35);
}

.social-feed-card__body {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.social-feed-card__line {
  display: block;
  height: 0.55rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  margin-bottom: 0.45rem;
}

.social-feed-card__line--short {
  width: 55%;
}

.social-feed-card__line--medium {
  width: 78%;
}

/* Widgets externos: ancho fluido sin romper el layout */
.social-feed-widget iframe,
.social-feed-widget embed,
.social-feed-widget object {
  max-width: 100%;
}

.social-feed-widget > div[class*="elfsight"],
.social-feed-widget .elfsight-app-12c46930-d38d-4295-a29d-e9d89a327303 {
  width: 100% !important;
  max-width: 100%;
}

@media (max-width: 991.98px) {
  .social-feed-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .social-feed-card {
    min-height: 200px;
  }

  .social-feed-card:nth-child(3n + 2),
  .social-feed-card:nth-child(5n) {
    min-height: 220px;
  }
}

@media (max-width: 575.98px) {
  .social-feed-section {
    padding: 2.5rem 0 3rem;
  }

  .social-feed-profiles {
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    margin-bottom: 2rem;
  }

  .social-feed-profile {
    max-width: 100%;
    width: 100%;
  }

  .social-feed-mosaic {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .social-feed-card,
  .social-feed-card:nth-child(3n + 2),
  .social-feed-card:nth-child(5n) {
    min-height: 180px;
  }
}

/* ==========================================================================
   Consultas descargables
   ========================================================================== */

.home-consultas-section {
  background: #ececec;
  padding: 3.25rem 0 3.5rem;
}

.home-consultas-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.home-consultas-title {
  text-align: center;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: #222;
  letter-spacing: 0.06em;
  margin: 0 0 2rem;
  text-transform: uppercase;
}

.home-consultas-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 1.75rem;
  align-items: start;
  justify-items: center;
  max-width: 980px;
  margin: 0 auto;
}

.home-consultas-card {
  display: block;
  width: 100%;
  max-width: 200px;
  text-decoration: none;
  color: inherit;
  line-height: 0;
  background: transparent;
  border-radius: 2px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.home-consultas-card:hover,
.home-consultas-card:focus-visible {
  transform: translateY(-4px);
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.34));
  outline: none;
}

.home-consultas-card__cover {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  outline: 0;
  border-radius: 2px;
  background: transparent !important;
  box-shadow: none;
  padding: 0;
  margin: 0;
  vertical-align: top;
}

.home-consultas-card__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 991.98px) {
  .home-consultas-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    max-width: 480px;
  }

  .home-consultas-card {
    max-width: 210px;
  }
}

@media (max-width: 575.98px) {
  .home-consultas-section {
    padding: 2.5rem 0 3rem;
  }

  .home-consultas-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 360px;
  }

  .home-consultas-card {
    max-width: none;
  }
}
