/* ==========================================================================
   bl-fill · blomon-base
   Seccion anclada: el scroll se detiene y el texto se rellena bloque a bloque.

   AJUSTES RAPIDOS: todos en el bloque .bl-fill de aqui abajo.
     --bl-header        alto de la cabecera fija del sitio (offset superior)
     --bl-heading-size  tamano del titulo de la seccion
     --bl-intro-size    tamano del parrafo de entrada
     --bl-title-size    tamano de los titulos de cada fila
     --bl-text-size     tamano del texto de cada fila y del cierre
     --bl-maxw          ancho maximo del contenido
     --bl-copy-w        ancho maximo de los parrafos largos
     --bl-row-pad       aire dentro de cada fila
     --bl-gutter        separacion de las columnas con el rail
     --bl-pad-y         aire arriba y abajo de la seccion
   ========================================================================== */

.bl-fill {
  /* Color */
  --bl-fill-on: #fcfaf5;                     /* color final (relleno) */
  --bl-fill-head: #fcfaf5;                   /* titulo de la seccion */
  --bl-fill-mid: rgba(252, 250, 245, 0.78);  /* parrafo de entrada */
  --bl-fill-off: rgba(252, 250, 245, 0.24);  /* color de partida (apagado) */
  --bl-fill-rail: rgba(252, 250, 245, 0.16);

  /* Tipografia */
  --bl-heading-size: clamp(2rem, 3.4vw, 3.5rem);
  --bl-intro-size: clamp(1rem, 1.15vw, 1.2rem);
  --bl-title-size: clamp(1.3rem, 2.1vw, 2.25rem);
  --bl-text-size: clamp(0.95rem, 1.05vw, 1.15rem);

  /* Medidas */
  --bl-header: 80px;
  --bl-maxw: 1280px;
  --bl-copy-w: 78ch;
  --bl-pad-y: clamp(1.25rem, 4vh, 2.5rem);
  --bl-row-pad: clamp(0.35rem, 1vh, 0.9rem);
  --bl-gutter: clamp(1.5rem, 3.5vw, 3.5rem);

  position: relative;
  display: block;
  background: transparent;
  padding-top: calc(var(--bl-header) + var(--bl-pad-y));
  padding-bottom: var(--bl-pad-y);
}

/* Barra de administracion de WordPress */
body.admin-bar .bl-fill { --bl-header: 112px; }

/* Variante para fondos claros (crema) */
.bl-fill--dark {
  --bl-fill-on: #202833;
  --bl-fill-head: #202833;
  --bl-fill-mid: rgba(32, 40, 51, 0.78);
  --bl-fill-off: rgba(32, 40, 51, 0.22);
  --bl-fill-rail: rgba(32, 40, 51, 0.14);
}

/* El alto lo fija el inner: asi el padding de la seccion nunca se desborda */
.bl-fill__inner {
  width: 100%;
  max-width: var(--bl-maxw);
  min-height: calc(100svh - var(--bl-header) - (var(--bl-pad-y) * 2));
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vh, 2rem);
}

/* --- Cabecera de la seccion (siempre visible) -------------------------- */

.bl-fill__head {
  flex: 0 0 auto;
  max-width: var(--bl-copy-w);
}

.bl-fill .bl-fill__heading {
  margin: 0 0 0.5em;
  max-width: 22ch;
  font-size: var(--bl-heading-size);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--bl-fill-head);
}

.bl-fill .bl-fill__intro {
  margin: 0;
  max-width: var(--bl-copy-w);
  font-size: var(--bl-intro-size);
  line-height: 1.6;
  color: var(--bl-fill-mid);
}

/* --- Lista ------------------------------------------------------------- */
/* Ocupa todo el hueco central: las filas se reparten ese espacio y, al ser
   contiguas, el rail queda continuo de principio a fin. */

.bl-fill__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  display: grid;
  grid-auto-rows: minmax(min-content, 1fr);
}

.bl-fill__item {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) 0px minmax(0, 1.1fr);
  column-gap: var(--bl-gutter);
  align-items: start;
}

/* --- Textos que se rellenan -------------------------------------------- */

.bl-fill__title {
  margin: 0;
  padding-block: var(--bl-row-pad);
  font-size: var(--bl-title-size);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--bl-fill-off);
}

.bl-fill__text {
  margin: 0;
  padding-block: var(--bl-row-pad);
  max-width: 46ch;
  font-size: var(--bl-text-size);
  line-height: 1.6;
  color: var(--bl-fill-off);
}

.bl-fill__outro {
  flex: 0 0 auto;
  margin: 0;
  max-width: var(--bl-copy-w);
  font-size: var(--bl-text-size);
  line-height: 1.6;
  color: var(--bl-fill-off);
}

/* Palabras generadas por JS */
.bl-fill__w {
  color: var(--bl-fill-off);
  will-change: color;
}

/* --- Rail y puntos ------------------------------------------------------ */

.bl-fill__rail {
  position: relative;
  align-self: stretch;
  justify-self: center;
  width: 1px;
  font-size: var(--bl-text-size); /* referencia para el punto */
  background: var(--bl-fill-rail);
}

.bl-fill__fill {
  position: absolute;
  inset: 0;
  background: var(--bl-fill-on);
  transform: scaleY(0);
  transform-origin: top center;
  will-change: transform;
}

/* Alineado con la primera linea del texto de la derecha */
.bl-fill__dot {
  position: absolute;
  top: calc(var(--bl-row-pad) + 0.8em);
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--bl-fill-rail);
}

/* --- Indicador de scroll (mismo motivo que bl-stack) -------------------- */
/* Va en el flujo, justo debajo de la lista y alineado a la derecha. */

.bl-fill__scroll {
  flex: 0 0 auto;
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--bl-fill-mid);
  pointer-events: none;
}

.bl-fill__scrollLabel {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

/* El circulo recorta: la flecha se va por abajo y vuelve por arriba. */
.bl-fill__scrollIcon {
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  line-height: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.bl-fill .bl-fill__scrollIcon svg {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
  max-width: none;
  animation: bl-fill-arrow 1.9s cubic-bezier(.45, 0, .2, 1) infinite;
}

@keyframes bl-fill-arrow {
  0%   { transform: translateY(-120%); opacity: 0; }
  30%  { transform: translateY(-15%);  opacity: 1; }
  55%  { transform: translateY(15%);   opacity: 1; }
  85%  { transform: translateY(120%);  opacity: 0; }
  100% { transform: translateY(120%);  opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bl-fill .bl-fill__scrollIcon svg { animation: none; }
}

/* --- Estado sin JS / reduced motion ------------------------------------ */

.bl-fill.is-static .bl-fill__title,
.bl-fill.is-static .bl-fill__text,
.bl-fill.is-static .bl-fill__outro,
.bl-fill.is-static .bl-fill__w {
  color: var(--bl-fill-on);
}

.bl-fill.is-static .bl-fill__fill { transform: scaleY(1); }
.bl-fill.is-static .bl-fill__dot { background: var(--bl-fill-on); }
.bl-fill.is-static .bl-fill__scroll { display: none; }

/* --- Movil -------------------------------------------------------------- */

@media (max-width: 767px) {
  .bl-fill {
    padding-top: clamp(2rem, 6vh, 3.5rem);
    padding-bottom: clamp(2rem, 6vh, 3.5rem);
  }

  .bl-fill__inner {
    min-height: 0;
    display: block;
  }

  .bl-fill .bl-fill__heading { max-width: none; }

  .bl-fill__head { margin-bottom: clamp(1.5rem, 5vh, 2.5rem); }

  .bl-fill__list { display: block; }

  .bl-fill__item {
    grid-template-columns: 1fr;
    column-gap: 0;
    gap: 0.4rem;
    padding-block: clamp(0.9rem, 2.5vh, 1.4rem);
    padding-left: 1.1rem;
    border-left: 1px solid var(--bl-fill-rail);
  }

  .bl-fill__title,
  .bl-fill__text { padding-block: 0; }

  .bl-fill__rail { display: none; }
  .bl-fill__text { max-width: none; }

  .bl-fill__outro { margin-top: clamp(1.5rem, 5vh, 2.5rem); }

  /* Fijo: la seccion no cabe en pantalla, asi el indicador sigue visible */
  .bl-fill__scroll {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    opacity: 0;
    visibility: hidden;
  }
}
