/**
 * @file
 * Página "Información financiera y Políticas" — Clínica Palermo.
 *
 * Secciones: hero con título descriptivo + imagen, indicadores financieros
 * (4 cards) y acordeón de políticas institucionales. 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 - Info financiera -
 * Políticas" (node 824:2552): paleta #D7E4F4 / #0E4FBE / var(--cp-text-ink) / #F5F5F5,
 * verde #13AD58 y rojo #AD1316 para variación, tipografía Manrope (títulos)
 * y Montserrat (cuerpo).
 */

/* ==========================================================================
   Hero — texto a la izquierda + imagen decorativa
   ========================================================================== */

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

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

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

/* Velo para legibilidad del texto sobre el banner */
.fi-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%);
}

.fi-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 1440px;
  margin-inline: auto;
  min-height: 460px;
}

.fi-hero__text {
  max-width: 540px;
  padding-inline: clamp(1.25rem, 5vw, 5rem);
  box-sizing: border-box;
}

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

.fi-hero__accent {
  color: var(--cp-blue-700);
}

.fi-hero__description {
  font-family: var(--cp-font-body);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--cp-text-ink);
  max-width: 444px;
}

/* ==========================================================================
   Información financiera — documentos PDF (Figma 824:2562)
   ========================================================================== */

.fi-docs {
  background: var(--cp-white);
  padding-block: 56px;
}

.fi-docs__inner {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  max-width: 1275px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* Columna izquierda — texto */
.fi-docs__text {
  flex: 0 0 452px;
  max-width: 452px;
}

.fi-docs__title {
  font-family: var(--cp-font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 44px;
  color: var(--cp-blue-700);
  margin-bottom: 20px;
}

.fi-docs__description {
  font-family: var(--cp-font-body);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 20px;
  color: var(--cp-text-ink);
}

/* Columna derecha — contenedor PDFs */
.fi-docs__container {
  flex: 0 0 548px;
  max-width: 548px;
  height: 307px;
  border: 1px solid var(--cp-gray-blue);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fi-docs__list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Item de documento PDF */
.fi-doc-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 16px;
  min-height: 69px;
  background: var(--cp-white);
  border: 1px solid #E4E7EC;
  border-radius: 12px;
  box-sizing: border-box;
}

.fi-doc-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 47px;
  height: 47px;
  flex: 0 0 auto;
  background: #d93542;
  border-radius: 10px;
  font-family: var(--cp-font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
  color: var(--cp-white);
}

.fi-doc-item__info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fi-doc-item__title {
  font-family: var(--cp-font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
  color: var(--cp-text-ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-doc-item__subtitle {
  font-family: var(--cp-font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  color: var(--cp-text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-doc-item__download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  background: rgba(14, 79, 190, 0.05);
  border-radius: 999px;
  color: var(--cp-blue-700);
  text-decoration: none;
  transition: background 200ms ease;
}

.fi-doc-item__download:hover {
  background: rgba(14, 79, 190, 0.12);
}

.fi-doc-item__download:focus-visible {
  outline: 2px solid var(--cp-blue-700);
  outline-offset: 2px;
}

/* Paginador */
.fi-docs__paginator {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px 0;
  gap: 10px;
  flex: 0 0 auto;
}

.fi-docs__prev,
.fi-docs__next {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--cp-font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--cp-blue-700);
  transition: opacity 200ms ease;
}

.fi-docs__prev:disabled,
.fi-docs__next:disabled {
  color: var(--cp-text-help);
  cursor: not-allowed;
  opacity: 0.6;
}

.fi-docs__prev:disabled svg,
.fi-docs__next:disabled svg {
  color: var(--cp-text-help);
}

.fi-docs__prev:focus-visible,
.fi-docs__next:focus-visible {
  outline: 2px solid var(--cp-blue-700);
  outline-offset: 2px;
}

.fi-docs__numbers {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.fi-docs__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: var(--cp-font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--cp-text-help);
  transition: background 200ms ease, color 200ms ease;
}

.fi-docs__num:hover {
  background: rgba(14, 79, 190, 0.08);
  color: var(--cp-blue-700);
}

.fi-docs__num.is-active {
  background: var(--cp-blue-700);
  color: var(--cp-white);
  font-weight: 700;
}

.fi-docs__num:focus-visible {
  outline: 2px solid var(--cp-blue-700);
  outline-offset: 2px;
}

/* ==========================================================================
   Nuestras políticas — acordeón
   ========================================================================== */

.fi-policies {
  background: #f5f5f5;
  padding: 56px 0;
}

.fi-policies__title {
  font-family: var(--cp-font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 44px;
  color: var(--cp-blue-700);
  margin-bottom: 20px;
}

/* Acordeón de políticas: reutiliza clases .servicios-accordion / .servicios-acc__*
   definidas en servicios.css — sin CSS adicional requerido. */

/* Figma 824-2612: gap icono-texto 15px (servicios usa 20px). Título de tarjeta
   18px/22px = valor por defecto de servicios, sin override. */
.fi-policies .servicios-acc__id {
  gap: 15px;
}

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

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

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

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

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

/* Tablet */
@media (max-width: 1024px) {
  .fi-hero__inner {
    gap: 2.5rem;
  }

  .fi-hero__text {
    padding-inline: 2rem;
  }

  .fi-hero__text {
    max-width: 100%;
  }

  .fi-docs__inner {
    flex-direction: column;
    align-items: center;
  }

  .fi-docs__text {
    flex: 0 0 auto;
    max-width: 100%;
    text-align: center;
  }

  .fi-docs__container {
    flex: 0 0 auto;
    width: 100%;
    max-width: 548px;
  }
}

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

  .fi-hero__inner {
    min-height: 320px;
  }

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

  .fi-hero__text {
    padding-inline: 1.25rem;
  }

  .fi-docs__inner {
    padding-inline: 16px;
  }

  .fi-docs__title,
  .fi-policies__title {
    font-size: 1.5rem;
  }

  .fi-docs__text {
    flex: 0 0 auto;
  }

  .fi-docs__container {
    height: auto;
    min-height: 260px;
  }

  /* servicios-acc styles are mobile-first, no override needed */
}

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

@media (prefers-reduced-motion: reduce) {
  .js-fi-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

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

  .servicios-acc__arrow svg {
    transition: none;
  }
}