/* ==========================================================
   LLEBIPC – Componentes: enlaces, botones, vídeos, líneas,
   Instagram, listas y vista ampliada de imágenes
   ========================================================== */

/* Enlaces dentro de los textos */
.fe-block a:not(.btn):not(.insta):not(.fe-zoom) {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.section--teal .fe-block a:not(.btn):not(.insta):not(.fe-zoom),
.section--dark .fe-block a:not(.btn):not(.insta):not(.fe-zoom) {
  color: #fff;
}

.fe-block a:not(.btn):hover {
  opacity: 0.7;
}

/* Botón principal (naranja, ocupa todo su bloque) */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  background: var(--color-orange);
  color: #fff;
  font-weight: 700;
  font-size: min(calc((1.25 - 1) * 1.2vw + 1rem), max(calc((1.25 - 1) * 0.012 * var(--max-page-width) + 1rem), 1.25rem));
  line-height: 1.2em;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.1s linear;
}

.btn:hover,
.btn:focus-visible {
  opacity: 0.8;
}

@media screen and (max-width: 767px) and (orientation: portrait) {
  .btn {
    font-size: calc((1.25 - 1) * 0.012 * min(100vh, 900px) + 1rem);
  }
}

/* Vídeos de YouTube en proporción 16:9 */
.video {
  position: relative;
  width: 100%;
  padding-bottom: 56.5%;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Línea horizontal */
.fe-block:has(> .fe-hr) {
  justify-content: center;
}

.fe-hr {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--hr, #000);
}

/* Textos: contenedor normal para que los márgenes entre párrafos se fusionen */
.fe-text > :first-child { margin-top: 0; }
.fe-text > :last-child { margin-bottom: 0; }

/* Párrafo vacío = una línea en blanco, como en el editor original */
.fe-text p:empty {
  min-height: var(--body-line-height);
}

/* Publicación de Instagram (tarjeta vertical 3:4 que define su propia altura) */
.insta {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.insta img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.insta:hover img {
  opacity: 0.85;
}

/* Imágenes con enlace o con vista ampliada */
.fe-zoom {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  cursor: pointer;
}

/* Listas numeradas (artículos científicos) */
.fe-block ol {
  margin: 0;
  padding-left: 40px;
  counter-reset: lista;
}

.fe-block ol li {
  list-style: none;
  counter-increment: lista;
}

.fe-block ol li p {
  margin: 0.5em 0;
}

/* Número "1." alineado a la derecha en el margen, igual que el editor original */
.fe-block ol li > p:first-child::before {
  content: "  " counter(lista) ". ";
  display: inline-block;
  width: 40px;
  margin-left: -40px;
  text-align: right;
  white-space: pre;
}

/* Vista ampliada (lightbox) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 36px;
  line-height: 40px;
}

/* Rectángulo decorativo (forma de Squarespace) */
.fe-shape {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: var(--fill, #fff);
}

.fe-block:has(> .fe-shape) {
  align-self: stretch;
}

/* Lista de equipo: fotos circulares con nombre y cargo (Grupo Humano) */
.page-section.team-section {
  padding-block: calc(var(--pad-max, 0) * max(1vw, 1vh));
}

.team {
  list-style: none;
  margin: 0;
  padding: 0 calc(var(--team-pad-x, 2) * 1vw);
  display: grid;
  grid-template-columns: repeat(var(--team-cols, 4), minmax(0, 1fr));
  gap: var(--team-gap, 60px);
  align-items: start;
}

.team-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team-photo {
  position: relative;
  width: 75%;
  margin: 0 auto 8%;
  padding-bottom: 75%;
  border-radius: 50%;
  overflow: hidden;
}

.team-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

.team-name {
  width: 75%;
  margin: 0 auto;
  text-align: center;
  font-size: min(calc(0.2 * 1.2vw + 1rem), max(calc(0.2 * 0.012 * var(--max-page-width) + 1rem), 1.2rem));
  line-height: calc(var(--heading-line-height) * (1 + (1 - var(--h2)) / 25));
}

.team-role {
  width: 75%;
  margin: 4% auto 0;
  text-align: center;
  font-size: min(calc(-0.1 * 1.2vw + 1rem), max(calc(-0.1 * 0.012 * var(--max-page-width) + 1rem), 0.9rem));
}

.team-role p {
  margin: 0;
}

@media screen and (max-width: 1099px) {
  .team { grid-template-columns: repeat(min(var(--team-cols, 4), 3), minmax(0, 1fr)); }
}

@media screen and (max-width: 767px) {
  .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 575px) {
  .team { grid-template-columns: minmax(0, 1fr); }
}

/* Móvil vertical: los tamaños del equipo escalan con la altura de la pantalla, como el resto de títulos */
@media screen and (max-width: 767px) and (orientation: portrait) {
  .team-name { font-size: calc(0.2 * 0.012 * min(100vh, 900px) + 1rem); }
  .team-role { font-size: calc(-0.1 * 0.012 * min(100vh, 900px) + 1rem); }
}
