/**
 * @file
 * Página "Nosotros" — Clínica Palermo.
 *
 * Secciones: hero con carousel, timeline histórica, propósito institucional
 * (Misión / Visión). Estilos específicos; la base viene de tokens.css,
 * elements.css, grid.css, site-header.css y site-footer.css (lib global).
 *
 * Valores extraídos del prototipo Figma "Nosotros - Historia - Visión - Misión"
 * (node 461:1475): paleta #D7E4F4 / #0E4FBE / var(--cp-text-ink) / #F5F5F5, tipografía
 * Manrope (títulos) y Montserrat (cuerpo).
 */

/* ==========================================================================
   Hero — dos columnas: texto + carousel de imágenes
   ========================================================================== */

.nosotros-hero {
  position: relative;
  padding-block: 3.5rem;
  overflow: hidden;
}

/* Banner de fondo full-width del hero (Figma: Banner-nosotros-historia) */
.nosotros-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.nosotros-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Velo para legibilidad del texto sobre el banner */
.nosotros-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(234 240 250 / 88%) 0%, rgb(234 240 250 / 40%) 42%, transparent 72%);
}

.nosotros-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 7.125rem);
  align-items: stretch;
  max-width: 1115px;
  min-height: 460px;
  margin-inline: auto;
}

.nosotros-hero__text {
  align-self: center;
  max-width: 452px;
}

.nosotros-hero__title {
  font-family: var(--cp-font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 40px;
  color: var(--cp-text-ink);
  margin-bottom: 1.25rem;
}

.nosotros-hero__title .cp-highlight {
  color: var(--cp-blue-700);
}

.nosotros-hero__description {
  font-family: var(--cp-font-body);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.22;
  color: var(--cp-text-ink);
}

/* Carousel de imágenes del hero — llena el alto del banner (toca arriba y
   abajo los límites del hero, igual que el fondo). */
.nosotros-carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.nosotros-carousel__main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--cp-shadow-md, 0 0.75rem 2rem rgb(35 31 32 / 16%));
}

.nosotros-carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.nosotros-carousel__slide.is-active {
  opacity: 1;
}

.nosotros-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Flechas del carousel — dentro de la foto, círculo blanco al 70% */
.nosotros-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 70%);
  box-shadow: var(--cp-shadow-sm, 0 0.25rem 1rem rgb(35 31 32 / 10%));
  cursor: pointer;
  transition: box-shadow 180ms ease;
}

.nosotros-carousel__arrow:hover {
  background: rgb(255 255 255 / 90%);
  box-shadow: var(--cp-shadow-md, 0 0.75rem 2rem rgb(35 31 32 / 16%));
}

.nosotros-carousel__arrow--prev {
  left: 20px;
}

.nosotros-carousel__arrow--next {
  right: 20px;
}

.nosotros-carousel__arrow svg {
  width: 20px;
  height: 20px;
  stroke: var(--cp-blue-700);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Thumbnails inferiores */
.nosotros-carousel__thumbs {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  justify-content: center;
}

.nosotros-carousel__thumb {
  flex: 0 0 101.8px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: border-color 180ms ease, opacity 180ms ease;
}

.nosotros-carousel__thumb.is-active {
  border-color: var(--cp-blue-700);
  opacity: 1;
}

.nosotros-carousel__thumb:hover {
  opacity: 0.85;
}

.nosotros-carousel__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Propósito institucional — Misión / Visión
   ========================================================================== */

.nosotros-purpose {
  padding-block: clamp(4rem, 7vw, 7rem);
  background: var(--cp-gray-bg);
}

.nosotros-purpose__title {
  font-family: var(--cp-font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cp-blue-700);
  margin-bottom: 3rem;
}

.nosotros-purpose__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* Cards de Misión / Visión — Figma: 547.5x387, radius 10, stroke #D5DFEB */
.nosotros-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--cp-white, #fff);
  border: 1px solid var(--cp-gray-blue);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
}

.nosotros-card__icon {
  width: 44px;
  height: 44px;
  color: var(--cp-blue-700);
}

.nosotros-card__icon svg {
  width: 100%;
  height: 100%;
}

.nosotros-card__heading {
  font-family: var(--cp-font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cp-blue-700);
  margin-bottom: 16px;
}

.nosotros-card__text {
  font-family: var(--cp-font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--cp-text-ink);
  margin-bottom: 0;
}

/* Quote / caja destacada (solo Misión) — Figma: fondo #D7E4F4, radius 10,
   borde 1px #0E4FBE, texto 16px w600 var(--cp-text-ink) */
.nosotros-card__quote {
  width: 100%;
  margin: 0 auto;
  background: var(--cp-blue-200);
  border: 1px solid var(--cp-blue-700);
  border-radius: 10px;
  padding: 15px;
  font-family: var(--cp-font-body);
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.6;
  color: var(--cp-text-ink);
  box-sizing: border-box;
}

/* ==========================================================================
   ¿A quién va dirigido? — CTA Hermanas Dominicas (Figma: 1160-13994/13995)
   ========================================================================== */

.nosotros-audience {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 56px 0;
  gap: 20px;
  width: 100%;
  background: url('/sites/default/files/bg-quien-va-dirigido.png'), var(--cp-white, #fff);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.nosotros-audience__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  gap: 100px;
  width: 100%;
  max-width: 1115px;
}

.nosotros-audience__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  gap: 20px;
  width: 452px;
  flex-shrink: 0;
}

.nosotros-audience__title {
  font-family: var(--cp-font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 40px;
  color: var(--cp-text-ink);
  margin: 0;
}

.nosotros-audience__title--blue {
  color: var(--cp-blue-700);
}

.nosotros-audience__cta {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 15px 20px 15px 15px;
  gap: 10px;
  max-width: 408px;
  width: 100%;
  height: 67px;
  background: var(--cp-blue-700);
  border-radius: 10px;
  color: var(--cp-white);
  text-decoration: none;
  transition: background 180ms ease;
  flex-shrink: 0;
}

.nosotros-audience__cta:hover {
  background: #0b3d97;
}

.nosotros-audience__cta-logo {
  width: 23.49px;
  height: 37px;
  align-self: stretch;
  flex-shrink: 0;
}

.nosotros-audience__cta span {
  font-family: var(--cp-font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 20px;
  color: var(--cp-white, #fff);
}

/* ==========================================================================
   Footer — idéntico al resto del sitio (sin overrides)
   ========================================================================== */

/* ==========================================================================
   Reveal-on-scroll (animaciones de entrada)
   ========================================================================== */

/* Progresive enhancement: el contenido es visible sin JS; la clase
   .js-nosotros-reveal se añade vía JS y activa la animación. */
.js-nosotros-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-nosotros-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delay escalonado para elementos hijos */
.js-nosotros-reveal[data-delay="1"] { transition-delay: 0.1s; }
.js-nosotros-reveal[data-delay="2"] { transition-delay: 0.2s; }
.js-nosotros-reveal[data-delay="3"] { transition-delay: 0.3s; }
.js-nosotros-reveal[data-delay="4"] { transition-delay: 0.4s; }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .nosotros-hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
    min-height: 0;
  }

  .nosotros-hero__text {
    max-width: 100%;
    text-align: center;
  }

  .nosotros-carousel {
    height: auto;
    width: 100%;
    max-width: 500px;
    margin-inline: auto;
  }

  .nosotros-carousel__main {
    flex: none;
    aspect-ratio: 16 / 9;
  }

  .nosotros-purpose__grid {
    grid-template-columns: 1fr;
  }

  .nosotros-audience__inner {
    flex-direction: column;
    gap: 2rem;
  }

  .nosotros-audience__text {
    width: 100%;
    max-width: 100%;
    align-items: center;
    text-align: center;
  }

  .nosotros-audience__cta {
    width: 100%;
    max-width: 408.49px;
    justify-content: center;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .nosotros-hero {
    padding-block: 2.5rem;
  }

  .nosotros-hero__title {
    font-size: 1.75rem;
  }

  .nosotros-carousel__arrow--prev {
    left: 8px;
  }

  .nosotros-carousel__arrow--next {
    right: 8px;
  }

  .nosotros-carousel__thumb {
    flex: 0 0 70px;
    height: 50px;
  }

  .nosotros-card {
    padding: 20px;
  }

  .nosotros-audience__title {
    font-size: 1.5rem;
    line-height: 32px;
  }
}

/* ==========================================================================
   Indicadores por Especialidad — Figma node 846:4433
   ========================================================================== */

.nosotros-indicadores {
  padding-block: clamp(4rem, 7vw, 7rem);
  background: var(--cp-gray-bg);
}

.nosotros-indicadores__header {
  margin-bottom: 32px;
}

.nosotros-indicadores__title {
  font-family: var(--cp-font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cp-blue-700);
  margin-bottom: 12px;
}

.nosotros-indicadores__subtitle {
  font-family: var(--cp-font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--cp-text-ink);
}

/* Tabs de filtro */
.nosotros-indicadores__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.nosotros-indicadores__tab {
  font-family: var(--cp-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--cp-gray-blue);
  background: var(--cp-white, #fff);
  color: var(--cp-text-ink);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.nosotros-indicadores__tab:hover {
  background: var(--cp-primary-100);
  border-color: var(--cp-blue-700);
}

.nosotros-indicadores__tab.is-active {
  background: var(--cp-blue-700);
  color: var(--cp-white, #fff);
  border-color: var(--cp-blue-700);
}

/* Grid de cards */
.nosotros-indicadores__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Card de indicador */
.nosotros-indicador-card {
  background: var(--cp-white, #fff);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--cp-gray-blue);
  transition: opacity 300ms ease, transform 300ms ease;
}

.nosotros-indicador-card[hidden] {
  display: none;
}

.nosotros-indicador-card__title {
  font-family: var(--cp-font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--cp-text-ink);
  margin-bottom: 20px;
}

.nosotros-indicador-card__metrics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Métrica individual */
.nosotros-indicador-metric__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.nosotros-indicador-metric__label {
  font-family: var(--cp-font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--cp-text-ink);
}

.nosotros-indicador-metric__value {
  font-family: var(--cp-font-heading);
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--cp-blue-700);
}

.nosotros-indicador-metric__bar {
  width: 100%;
  height: 8px;
  background: var(--cp-primary-100);
  border-radius: 999px;
  overflow: hidden;
}

.nosotros-indicador-metric__fill {
  height: 100%;
  background: var(--cp-blue-700);
  border-radius: 999px;
  transition: width 0.8s ease;
}

.nosotros-indicador-metric__fill--accent {
  background: #ff8c45;
}

/* ==========================================================================
   Responsive — Indicadores
   ========================================================================== */

@media (max-width: 1024px) {
  .nosotros-indicadores__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nosotros-indicadores__filters {
    gap: 6px;
  }

  .nosotros-indicadores__tab {
    font-size: 0.75rem;
    padding: 6px 14px;
  }

  .nosotros-indicador-card {
    padding: 20px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .nosotros-carousel__slide {
    transition: none;
  }

  .js-nosotros-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js-nosotros-reveal[data-delay] {
    transition-delay: 0s;
  }

  .nosotros-indicador-metric__fill {
    transition: none;
  }
}
