/* === Fuente global === */
@font-face {
  font-family: "Area Normal";
  src: url("../fonts/AreaNormal-SemiBold.eot");
  src: url("../fonts/AreaNormal-SemiBold.eot?#iefix")
      format("embedded-opentype"),
    url("../fonts/AreaNormal-SemiBold.woff2") format("woff2"),
    url("../fonts/AreaNormal-SemiBold.woff") format("woff"),
    url("../fonts/AreaNormal-SemiBold.ttf") format("truetype"),
    url("../fonts/AreaNormal-SemiBold.svg#AreaNormal-SemiBold") format("svg");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Area Normal";
  src: url("../fonts/AreaNormal-Black.eot");
  src: url("../fonts/AreaNormal-Black.eot?#iefix") format("embedded-opentype"),
    url("../fonts/AreaNormal-Black.woff2") format("woff2"),
    url("../fonts/AreaNormal-Black.woff") format("woff"),
    url("../fonts/AreaNormal-Black.ttf") format("truetype"),
    url("../fonts/AreaNormal-Black.svg#AreaNormal-Black") format("svg");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --colorWhite: #fff;
  --colorBlack: #000;
  --colorBlackLight: #272f35;
  --colorGray: #d8dadc;
  --colorAlabaster: #efefe1;
  --fontPrimary: "Area Normal", sans-serif;
}

* {
  font-family: var(--fontPrimary);
}

p {
  margin-block: 0 !important;
}

ul {
  padding: 0px 15px;
}

.proy-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* ====== Contenedor de tabs ====== */
.proy-tabs-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 65%;
}

/* ====== Carrusel horizontal para títulos de pestañas ====== */
.proy-tab-titles {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 22px;
  padding: 8px 4px;
  margin: 0;
  list-style: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;

  /* efecto de fade en extremos */
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 24px,
    #000 calc(100% - 24px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 24px,
    #000 calc(100% - 24px),
    transparent 100%
  );

  /* snap para encastrar */
  scroll-snap-type: x mandatory;
  width: 100%;
}

.proy-tab-titles::before {
  content: "";
  flex: 1 0 auto; /* crea espacio scrollable a la izquierda */
}

.proy-tab-titles::-webkit-scrollbar {
  height: 6px;
}
.proy-tab-titles::-webkit-scrollbar-thumb {
  background: var(--colorGray);
  border-radius: 6px;
}
.proy-tab-titles::-webkit-scrollbar-track {
  background: transparent;
}

/* ====== Ítems de pestaña: en columna (título / tipo / institución) ====== */
.proy-tab-title {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  white-space: normal;
  background: transparent;
  color: var(--colorGray);
  padding: 10px 5px;
  cursor: pointer;
  user-select: none;
  transition: color 0.25s, background 0.25s;
  outline: none;
  min-width: clamp(200px, 24vw, 180px);
  scroll-snap-align: start; /* 👈 encastre */
}

.proy-title-main {
  display: block;
  font-weight: 600;
  color: var(--colorGray);
  line-height: 1.15;
  font-size: 0.8rem;
}

.proy-title-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--colorGray);
  line-height: 1.2;
}

/* Hover / focus accesible */
.proy-tab-title:hover,
.proy-tab-title:focus {
  color: var(--colorBlackLight);
}

/* Estado activo */
.proy-tab-title.is-active .proy-title-main {
  color: var(--colorBlackLight);
}
.proy-tab-title.is-active .proy-title-sub {
  color: var(--colorBlackLight);
}

/* ====== Separadores verticales finitos entre ítems ====== */
.proy-tab-title + .proy-tab-title {
  position: relative;
}
.proy-tab-title + .proy-tab-title::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 3rem;
  background: var(--colorGray);
}

button.proy-tab-prev::before {
  right: -11px;
}

/* ====== Botones de navegación ====== */
button.proy-tab-prev,
button.proy-tab-next {
  color: var(--colorBlackLight);
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0 20px; /* menos padding lateral para no desbordar */
  margin: 0;
  cursor: pointer;
  font-size: 1.5rem; /* tamaño del ícono Font Awesome */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s, opacity 0.25s;
  flex: 0 0 auto;
}

button.proy-tab-prev:hover,
button.proy-tab-next:hover,
button.proy-tab-prev:focus,
button.proy-tab-next:focus {
  background: transparent;
  color: var(--colorBlack); /* hover un poco más oscuro */
}

button.proy-tab-prev:disabled,
button.proy-tab-next:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Feedback drag */
.proy-tab-titles.dragging {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}

/* ====== Contenido de pestañas ====== */
.proy-tab-contents {
  margin-top: 18px;
  background-color: var(--colorAlabaster);
  font-size: 1.3em;
  font-weight: 600;
  line-height: 1.5em;
  color: var(--colorBlackLight);
  width: 100%;
}
.proy-tab-content {
  display: none;
}
.proy-tab-content.is-active {
  display: block;
}

/* Imagen y texto del contenido */
.proy-tab-image {
  margin-bottom: 16px;
}
.proy-tab-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.proy-tab-text {
  width: 40%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  margin: 0 auto;
  padding: 20px 0px;
}

.proy-tab-content-header {
  border-left-width: 1px;
  border-left-style: solid;
  border-left-color: var(--colorBlackLight);
  padding: 0px 0px 0px 20px;
}

.proy-tab-content-title {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--colorBlackLight);
  margin: 0;
}

.proy-tab-content-team {
  font-size: 0.8rem;
  color: var(--colorBlackLight);
}

.proy-tab-content-description {
  padding: 20px 0px;
}

.proy-extra-body,
.proy-extra-resena {
  font-size: 0.8rem;
  color: var(--colorBlackLight);
  line-height: 1.5rem;
}

.proy-extra-body ul li {
  font-weight: 900;
}

.testimonio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 40px 0px;
}

.proy-extra-resena-nombre {
  font-size: 0.8rem;
  font-weight: 900;
}

img.proy-extra-icon-testimonio {
  width: 180px !important;
  height: auto !important;
}

/* ====== Responsive ====== */
@media (max-width: 640px) {
  .proy-tab-title {
    padding: 8px 12px;
  }
  .proy-tab-titles {
    gap: 14px;
  }
  .proy-title-main {
    font-size: 1rem;
  }
  .proy-title-sub {
    font-size: 0.88rem;
  }
}

/* === Ensures natural left-to-right order for tab titles === */
.proy-tab-titles {
  direction: ltr;
  display: flex;
  flex-direction: row;
}

/* Optional: ensure prev/next arrows don't flip in RTL contexts */
.proy-tab-prev,
.proy-tab-next {
  unicode-bidi: isolate;
}

/* === Mostrar 4 pestañas por defecto y luego permitir scroll === */
:root {
  --proy-tabs-per-view: 4; /* desktop: 4 visibles */
}

.proy-tab-titles {
  overflow-x: auto; /* inicia scroll cuando hay más de las visibles */
  white-space: nowrap; /* evita salto de línea */
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.proy-tab-title {
  flex: 0 0 calc(100% / var(--proy-tabs-per-view));
  box-sizing: border-box;
  scroll-snap-align: start;
}

/* Tablet: 3 por vista */
@media (max-width: 1024px) {
  :root {
    --proy-tabs-per-view: 3;
  }
}

/* Mobile: 2 por vista */
@media (max-width: 640px) {
  :root {
    --proy-tabs-per-view: 2;
  }
}

/* === Para monitores grandes o TV (Full HD en adelante) === */
@media (min-width: 1600px) {
  :root {
    --proy-tabs-per-view: 4; /* 6 pestañas visibles en pantallas >=1600px */
  }
  .proy-tab-title {
    flex: 0 0 calc(100% / var(--proy-tabs-per-view));
  }

  .proy-tabs-nav {
    max-width: 50%;
  }
}

/* Para televisores 4K o pantallas muy grandes */
@media (min-width: 1920px) {
  :root {
    --proy-tabs-per-view: 8; /* 8 pestañas visibles en >=1920px */
  }
  .proy-tab-title {
    flex: 0 0 calc(100% / var(--proy-tabs-per-view));
  }
}
