/* Instituto específico */
.section-sub{
  margin:6px 0 0;
  opacity:.85;
}

.page-instituto .hero{
  background-image: url("/assets/img/instituto/INSTITUCION-1.png");
}
@media (max-width: 980px){
  .page-instituto .hero{
    background-image: url("/assets/img/instituto/INSTITUTO-TABLET.png");
  }
}
@media (max-width: 520px){
  .page-instituto .hero{
    background-image: url("/assets/img/instituto/INSTITUTO-MOBILE.png");
  }
}

.info-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:16px;
}

/* Autoridades */
.staff-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:20px;
  margin-top:18px;
}

.staff-card{
  background: #EDEDED;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 14px 16px;
  box-shadow: var(--shadow);
  text-align:center;
  min-height: 320px;
}

.staff-photo{
  width: 168px;
  height: 168px;
  margin: 0 auto 14px;
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid #d6dbe5;
  overflow: hidden;
  display:grid;
  place-items:center;
}

.staff-photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.staff-body{
  padding: 0;
}

.staff-body h3{
  margin:0 0 8px;
  color:#143057;
  font-weight: 700;
  font-size: 1.04rem;
  line-height: 1.24;
  text-transform: uppercase;
}

.staff-role{
  margin:0;
  color: #0f4ec7;
  font-weight:500;
  line-height: 1.45;
}

.staff-text{
  margin:0;
  opacity:.86;
}

.hint{
  margin-top:14px;
  opacity:.8;
}

/* Carrusel de acreditaciones (cinta continua) */
.logos-marquee{
  overflow:hidden;
  position:relative;
}

.logos-marquee__track{
  display:flex;
  width:max-content;
  animation: logos-marquee-scroll 22s linear infinite;
}

.logos-marquee__group{
  display:flex;
  gap:6px;
  padding-right:6px;
}

.logos-marquee__item{
  flex:0 0 340px;
  height:186px;
  display:grid;
  place-items:center;
  padding:4px 8px;
}

.logos-marquee__link{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
}

.logos-marquee__item img{
  max-width:100%;
  max-height:172px;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
}

.logos-marquee:hover .logos-marquee__track{
  animation-play-state: paused;
}

@keyframes logos-marquee-scroll{
  from{
    transform: translateX(0);
  }
  to{
    transform: translateX(-50%);
  }
}

/* Galería */
.gallery{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:16px;
  margin-top:14px;
}

.gallery-item{
  border-radius: var(--radius);
  overflow:hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--muted);
  height: 220px;
}

.gallery-item img{
  width:100%;
  height:100%;
  object-fit: cover;
}

/* San Martín */
.sanmartin{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:24px;
  align-items:center;
  margin-top:14px;
}

.sanmartin__text.panel{
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sanmartin__title-block{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 16px;
}

.sanmartin__title-block h2{
  margin: 0 0 6px;
}

.sanmartin__title-block .section-sub{
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  opacity: .85;
}

.sanmartin__text > p{
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  opacity: .85;
}

.sanmartin__media{
  border-radius: var(--radius);
  position: relative;
  overflow:hidden;
  border: 0;
  box-shadow: none;
  background: transparent;
  min-height: 0;
}

.sanmartin__media img{
  width:100%;
  height:auto;
  object-fit: contain;
}

/* Responsive */
@media (max-width: 920px){
  .info-grid{ grid-template-columns:1fr; }
  .staff-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery{ grid-template-columns:1fr; }
  .gallery-item{ height: 200px; }
  .sanmartin{ grid-template-columns:1fr; }
  .sanmartin__text.panel{ min-height: auto; }
  .sanmartin__media{ min-height: 0; }

  .logos-marquee__item{
    flex-basis: 250px;
    height: 136px;
  }

  .logos-marquee__track{
    animation-duration: 18s;
  }
}

@media (max-width: 620px){
  .staff-grid{
    grid-template-columns:1fr;
  }
  .staff-card{
    min-height: auto;
  }

  .logos-marquee{
    overflow:hidden;
    padding-inline: 6px;
  }

  .logos-marquee__track{
    animation: logos-marquee-scroll 16s linear infinite;
    width:max-content;
    padding-inline: 6px;
  }

  .logos-marquee__group{
    gap:8px;
    padding-right:8px;
  }

  .logos-marquee__item{
    flex:0 0 210px;
    height:118px;
  }

  .logos-marquee__item img{
    max-height: 106px;
  }
}

@media (prefers-reduced-motion: reduce){
  .logos-marquee__track{
    animation: none;
  }
}

/* Desktop: centrar las 2 ultimas cards de Autoridades */
@media (min-width: 921px){
  .page-instituto .staff-grid > .staff-card:nth-child(5){
    grid-column: 2;
  }
  .page-instituto .staff-grid > .staff-card:nth-child(6){
    grid-column: 3;
  }
}

