﻿/* ============================================================
   PSICOLOGÍA SOCIAL ORGANIZACIONAL — page-specific styles
   Requiere: css/styles.css (base)
   ============================================================ */

/* ── PAGE HERO ──────────────────────────────────────────────── */
.pso-hero {
  position: relative;
  background: linear-gradient(108deg, #0e0d30 0%, #141143 45%, #2F2D52 100%);
  overflow: hidden;
  padding: clamp(1.8rem, 3.6vw, 2.7rem) clamp(1.5rem, 4.5vw, 4rem);
  border-bottom: 3px solid #8d141e;
}

.pso-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.04) 1px, transparent 0);
  background-size: 36px 36px;
  pointer-events: none;
}

.pso-hero::after {
  display: none;
}

.pso-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pso-hero__content {
  padding-right: 0;
}

.pso-hero__overline {
  display: block;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.28);
  margin-bottom: 1rem;
}

.pso-hero__title {
  font-size: clamp(2rem, 4vw, 4.25rem);
  font-weight: 800;
  line-height: 1.0;
  color: white;
  padding-left: 0;
  white-space: nowrap;
}

.pso-hero__divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(141, 20, 30, 0.55) 30%, rgba(141, 20, 30, 0.55) 70%, transparent);
  flex-shrink: 0;
}

.pso-hero__nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0;
  padding-left: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(41, 38, 102, 0.92) rgba(255, 255, 255, 0.1);
  -webkit-overflow-scrolling: touch;
}

.pso-hero__nav::-webkit-scrollbar {
  height: 0.5rem;
}

.pso-hero__nav::-webkit-scrollbar-track {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11) 10%, rgba(255, 255, 255, 0.11) 90%, transparent);
  border-radius: 999px;
}

.pso-hero__nav::-webkit-scrollbar-thumb {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.18)),
    var(--nav-bg);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(41, 38, 102, 0.28), 0 4px 12px rgba(0, 0, 0, 0.18);
}

.pso-hero__nav-item {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.625rem;
  padding: 0.625rem 1.5rem;
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.22s;
  cursor: pointer;
}

.pso-hero__nav-item:first-child {
  padding-left: 0;
}

.pso-hero__nav-item:last-child {
  border-right: none;
}

.pso-hero__nav-num {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #8d141e;
  min-width: 1.5rem;
  flex-shrink: 0;
}

.pso-hero__nav-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  flex: 1;
  white-space: nowrap;
  transition: color 0.22s;
}

.pso-hero__nav-arrow {
  color: rgba(255, 255, 255, 0.15);
  transition: color 0.22s, transform 0.22s;
  flex-shrink: 0;
}

.pso-hero__nav-item:hover .pso-hero__nav-text {
  color: rgba(255, 255, 255, 0.9);
}

.pso-hero__nav-item:hover .pso-hero__nav-arrow {
  color: #8d141e;
  transform: translateX(4px);
}

/* ── REUSABLE EYEBROW ────────────────────────────────────────── */
.pso-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #8d141e;
  margin-bottom: 1.25rem;
  margin-top: 0;
}

.pso-eyebrow::before {
  display: none;
}

/* ── SECTION TITLES — sistema de encabezados promovidos ─────── */
.pso-section-title {
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: #141143;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.pso-section-subtitle {
  font-size: clamp(0.9375rem, 1.5vw, 1.125rem);
  font-weight: 500;
  color: #5c5b7f;
  line-height: 1.55;
  margin-bottom: 2rem;
  max-width: 680px;
}

/* ── ¿QUÉ ES? SECTION ────────────────────────────────────────── */
.pso-intro {
  background: #ffffff;
  padding: clamp(2rem, 4vw, 3rem) max(2rem, 6vw);
  scroll-margin-top: 5rem;
}

.pso-intro__inner {
  max-width: 900px;
  margin: 0 auto;
}

.pso-intro__title {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: #141143;
  margin-bottom: 2rem;
  margin-top: 0.25rem;
}

.pso-intro__body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pso-intro__body p {
  font-size: clamp(0.9375rem, 1.35vw, 1.0625rem);
  font-weight: 400;
  color: #5c5b7f;
  line-height: 1.82;
}

.pso-intro__body strong {
  font-weight: 700;
  color: #141143;
}

.pso-intro__highlight {
  padding: 1.25rem 1.75rem;
  background: rgba(20,17,67,0.03);
  border-radius: 0 0.5rem 0.5rem 0;
}

.pso-intro__highlight p {
  font-size: clamp(0.9375rem, 1.25vw, 1.0625rem) !important;
  font-style: italic;
  color: #141143 !important;
  font-weight: 500 !important;
  line-height: 1.75 !important;
}

/* ── QUIÉNES SOMOS SECTION ───────────────────────────────────── */
.pso-team {
  background: #f4f2ff;
  padding: clamp(2rem, 4vw, 3rem) max(2rem, 6vw);
  scroll-margin-top: 5rem;
}

.pso-team__inner {
  max-width: 900px;
  margin: 0 auto;
}

.pso-team__title {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: #141143;
  margin-bottom: 1.75rem;
  margin-top: 0.25rem;
}

.pso-team__body p {
  font-size: clamp(0.9375rem, 1.35vw, 1.0625rem);
  font-weight: 400;
  color: #5c5b7f;
  line-height: 1.82;
}

.pso-team__disciplines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.875rem;
}

.pso-team__pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #141143;
  background: rgba(20,17,67,0.06);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(20,17,67,0.10);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.pso-team__pill:hover {
  background: rgba(141,20,30,0.07);
  border-color: rgba(141,20,30,0.2);
  color: #8d141e;
}

/* ── DIRECTOR — bio + photo layout ───────────────────────────── */
.pso-director {
  background: #ffffff;
  padding: clamp(2rem, 4vw, 3rem) max(2rem, 6vw);
  scroll-margin-top: 5rem;
}

.pso-director__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.pso-director__name {
  font-size: clamp(1.875rem, 3.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: #141143;
  margin-bottom: 0;
  margin-top: 0.375rem;
}

/* Grid: content left, photo right */
.pso-director__grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
  margin-top: 2.5rem;
}

/* Credentials list */
.pso-cred-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.pso-cred-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9375rem 1.25rem;
  background: #f4f2ff;
  border-radius: 0.625rem;
  /*border-left: 3px solid rgba(141,20,30,0.28);*/
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), border-color 0.2s, background 0.2s;
}

.pso-cred-item:hover {
  transform: translateX(5px);
  border-left-color: #8d141e;
  background: #eae8f7;
}

.pso-cred-dot {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: rgba(141,20,30,0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.pso-cred-dot svg { color: #8d141e; }

.pso-cred-text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #141143;
  line-height: 1.5;
}

/* Photo */
.pso-director__photo-wrap {
  position: sticky;
  top: 5.5rem;
}

.pso-director__img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
  border-radius: 1rem;
  display: block;
  box-shadow:
    0 2px 8px rgba(20,17,67,0.08),
    0 8px 32px rgba(20,17,67,0.14);
}

.pso-director__img-caption {
  font-size: 0.8rem;
  font-weight: 600;
  color: #5c5b7f;
  text-align: center;
  margin-top: 0.875rem;
  letter-spacing: 0.01em;
}

/* ── TRAYECTORIA — client categories ─────────────────────────── */
.pso-trayectoria {
  background: #faf8f3;
  padding: clamp(2rem, 4vw, 3rem) max(2rem, 6vw);
}

.pso-trayectoria__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.pso-trayectoria__title {
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #141143;
  margin-bottom: 2rem;
  margin-top: 0.375rem;
}

/* ── LOGOS BELT ──────────────────────────────────────────── */
.pso-logos-belt {
  position: relative;
  overflow: hidden;
  padding: 1.875rem 0;
  margin-bottom: 2.5rem;
  background: rgba(20, 17, 67, 0.028);
  border-top: 1px solid rgba(20, 17, 67, 0.08);
  border-bottom: 1px solid rgba(20, 17, 67, 0.08);
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 7%,
    black 93%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 7%,
    black 93%,
    transparent 100%
  );
}

.pso-logos-track {
  display: flex;
  align-items: center;
  min-width: max-content;
  animation: pso-logos-scroll 54s linear infinite;
  will-change: transform;
}

.pso-logos-set {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  padding-right: 1.35rem; /* cierra el gap entre los dos sets */
  flex-shrink: 0;
}

.pso-logos-item {
  flex-shrink: 0;
  width: 124px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.5rem;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(20, 17, 67, 0.06);
  box-shadow: 0 2px 12px rgba(20,17,67,0.04);
}

.pso-logos-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: saturate(1.04) contrast(1.02);
  opacity: 0.92;
  transition: filter 0.35s ease;
  display: block;
}

.pso-logos-belt:hover .pso-logos-item:hover img {
  filter: saturate(1.12) contrast(1.04);
  opacity: 1;
}

@keyframes pso-logos-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .pso-logos-track { animation: none; }
}

@media (hover: hover) and (pointer: fine) {
  .pso-logos-belt:hover .pso-logos-track {
    animation-play-state: paused;
  }
}

@media (max-width: 640px) {
  .pso-logos-track {
    animation-duration: 36s;
  }

  .pso-logos-set {
    gap: 1rem;
    padding-right: 1rem;
  }

  .pso-logos-item {
    width: 112px;
    height: 58px;
  }
}

/* ── /LOGOS BELT ─────────────────────────────────────────── */

.pso-cats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.25rem;
}

.pso-cat-card {
  grid-column: span 2;
  background: white;
  border-radius: 0.875rem;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(20,17,67,0.04), 0 3px 12px rgba(20,17,67,0.04);
  border-top: 3px solid #8d141e;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s;
}

.pso-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(20,17,67,0.10);
}

.pso-cat-card__label {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8d141e;
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pso-cat-card__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(141,20,30,0.18);
}

.pso-cat-card__body {
  font-size: 0.875rem;
  font-weight: 400;
  color: #5c5b7f;
  line-height: 1.72;
}

/* ── CV WRAPPER — une las secciones del CV de Carlos ─────────── */
.pso-cv-wrap {
  position: relative;
}

/* Hilo rojo continuo que corre por el borde izquierdo de todo el bloque */
.pso-cv-wrap::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(
    to bottom,
    #8d141e 0%,
    rgba(141,20,30,0.55) 55%,
    rgba(141,20,30,0.15) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* Chapter header — barra slim oscura que identifica el bloque como CV */
.pso-cv-chapter {
  background: linear-gradient(100deg, #141143 0%, #1e1c50 100%);
  padding: 1rem max(2rem, 6vw);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.pso-cv-chapter__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pso-cv-chapter__label {
  font-size: 0.5625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.pso-cv-chapter__sep {
  width: 1px;
  height: 0.875rem;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.pso-cv-chapter__name {
  font-size: 0.875rem;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.pso-cv-chapter__accent {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(141,20,30,0.45), transparent);
}

.pso-cv-chapter__nav {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

.pso-cv-chapter__nav-link {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.pso-cv-chapter__nav-link:hover {
  color: rgba(255,255,255,0.82);
  border-bottom-color: #8d141e;
}

/* scroll-margin-top para secciones que ahora son targets de anchor */
.pso-trayectoria {
  scroll-margin-top: 5rem;
}

/* ── SECTION RULE ────────────────────────────────────────────── */
.pso-rule {
  height: 1px;
  background: linear-gradient(to right, rgba(20,17,67,0.12) 0%, transparent 100%);
}

/* Separator label between books and organizations grid */
.pso-tray-separator {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.25rem 0 1.5rem;
}

.pso-tray-separator__label {
  font-size: 0.5625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(20,17,67,0.30);
  white-space: nowrap;
  flex-shrink: 0;
}

.pso-tray-separator__line {
  flex: 1;
  height: 1px;
  background: rgba(20,17,67,0.10);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  /* Director: photo stacks above bio on tablet */
  .pso-director__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .pso-director__photo-wrap {
    order: -1;
    position: static;
  }

  .pso-director__img {
    aspect-ratio: 16/9;
    max-height: 460px;
  }

  .pso-cats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pso-cat-card {
    grid-column: span 2;
  }

  .pso-cat-card:nth-child(5) {
    grid-column: 2 / span 2;
  }
}

@media (max-width: 640px) {
  .pso-hero         { padding: 1.5rem; }
  .pso-hero__title  { white-space: normal; }
  .pso-intro        { padding: 1.5rem; }
  .pso-team         { padding: 1.5rem; }
  .pso-director     { padding: 1.5rem; }
  .pso-trayectoria  { padding: 1.5rem; }
  .pso-cred-list {
  
      margin-top: 20%;
  }

  .pso-hero__divider {
    display: block;
    margin: -0.25rem 0 0;
  }

  .pso-hero__nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    padding-left: 0;
    padding-bottom: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .pso-hero__nav-item,
  .pso-hero__nav-item:first-child {
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
  }

  .pso-hero__nav-item:first-child {
    padding-left: 0;
  }

  .pso-hero__nav-item:last-child {
    border-right: none;
  }

  .pso-hero__nav-text {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.875rem;
    line-height: normal;
  }

  .pso-hero__nav-arrow {
    display: block;
    color: rgba(255, 255, 255, 0.15);
  }

  .pso-cv-chapter { padding: 0.875rem 1.5rem; }
  .pso-cv-chapter__nav { display: none; }
  .pso-cv-chapter__accent { display: none; }

  /* Director: nombre → foto → contenido en mobile */
  .pso-director__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
  }

  .pso-director__photo-wrap {
    order: -1;
    position: relative;
    width: min(72%, 240px);
    margin: 0 auto 1.75rem;
    z-index: 0;
  }

  /* Marco decorativo detrás de la foto, sin invadir el contenido de abajo */
  .pso-director__photo-wrap::before {
    content: '';
    position: absolute;
    top: 12px;
    left: -12px;
    right: 12px;
    bottom: -12px;
    background: rgba(141, 20, 30, 0.06);
    border: 1.5px solid rgba(141, 20, 30, 0.22);
    border-radius: 1.25rem;
    z-index: 0;
    pointer-events: none;
  }

  .pso-director__photo-wrap::after {
    content: '';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-top: 2.5px solid #8d141e;
    border-right: 2.5px solid #8d141e;
    border-radius: 0 0.5rem 0 0;
    z-index: 2;
    opacity: 0.7;
    pointer-events: none;
  }

  .pso-director__img {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: none;
    border-radius: 1rem;
    object-fit: cover;
    object-position: top center;
    box-shadow:
      0 4px 16px rgba(20,17,67,0.14),
      0 12px 36px rgba(20,17,67,0.10);
	margin-top: -37%;
  }

  /* En mobile ocultamos el caption para no repetir el nombre */
  .pso-director__img-caption {
    display: none;
  }

  .pso-cats-grid {
    grid-template-columns: 1fr;
  }

  .pso-cat-card {
    grid-column: 1;
  }

  .pso-cat-card:nth-child(5) {
    grid-column: 1;
  }

}

@media (min-width: 1021px) {
  .pso-cat-card:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .pso-cat-card:nth-child(5) {
    grid-column: 4 / span 2;
  }
}
