/* CIERRE Y CONTACTO
   La pintura de fondo, la invitación a escribir y el nombre en grande.
   Tres filas: invitación y tarjeta de contacto, el nombre, y la base
   con navegación y créditos. */
footer {
  position: relative;
  display: grid;
  min-height: min(940px, calc(100vh - var(--edge) * 2), 150vw);
  min-height: min(940px, calc(100svh - var(--edge) * 2), 150vw);
  padding-bottom: max(clamp(22px, 3.4vw, 48px), env(safe-area-inset-bottom));
  margin: var(--edge);
  padding: clamp(28px, 6vw, 90px) max(clamp(20px, 6.2vw, 90px), calc(var(--gutter) + 12px)) clamp(22px, 3.4vw, 48px);
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--night-deep);
  color: #fff;
}

footer > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

footer::after {
  content: "";
  position: absolute;
  inset: 0;
  /* El fondo ya es noche: el velo solo apaga las pinceladas debajo
     de la invitación y del pie. */
  background: linear-gradient(180deg, rgba(7, 11, 44, .62) 0%, rgba(7, 11, 44, .12) 46%, rgba(7, 11, 44, .2) 70%, rgba(7, 11, 44, .7) 100%);
  pointer-events: none;
}

.footer-head,
.footer-wordmark,
.footer-base {
  position: relative;
  z-index: 1;
}

.footer-head {
  display: flex;
  gap: 28px;
  flex-direction: column;
}

.footer-invite i {
  display: block;
  width: 8px;
  height: 8px;
  margin-bottom: clamp(14px, 1.6vw, 23px);
  border-radius: 50%;
  background: var(--star-yellow);
}

.footer-invite h2 {
  max-width: 15em;
  font-weight: 400;
  font-size: clamp(1.875rem, 3.5vw, 3.125rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.footer-contact {
  display: flex;
  padding: clamp(16px, 1.8vw, 25px);
  gap: clamp(14px, 1.6vw, 24px);
  align-items: center;
  align-self: flex-start;
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  /* La tarjeta es blanca: aquí el foco vuelve a cobalto. */
  --color-focus: var(--starry-blue);
}

.footer-contact > img {
  width: clamp(64px, 6vw, 82px);
  height: clamp(64px, 6vw, 82px);
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.footer-contact > div {
  display: flex;
  gap: 10px;
  flex-direction: column;
  font-size: 0.875rem;
  line-height: 1.4;
  letter-spacing: 0;
}

.footer-mail {
  display: inline-block;
  padding: 4px 0;
  font-size: 1rem;
  font-weight: 500;
  text-underline-offset: 3px;
}

.footer-button {
  padding: 11px 18px;
  border: 1px solid var(--color-text);
  border-radius: 12px;
  font-size: 0.9375rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.footer-button:hover {
  border-color: var(--star-yellow);
  background: var(--star-yellow);
  color: var(--night-deep);
}

/* Tarjeta estrecha: retrato y nombre arriba, botones a todo el ancho,
   para que el número de WhatsApp no se parta en dos líneas. */
@media (max-width: 479px) {
  .footer-contact {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px 14px;
  }

  .footer-contact > div {
    display: contents;
  }

  .footer-contact > img {
    width: 56px;
    height: 56px;
  }

  .footer-button {
    padding-inline: 10px;
    grid-column: 1 / -1;
  }
}

/* El nombre, recortado al cielo completo. Es decorativo: el título
   de la sección es la invitación. */
.footer-wordmark {
  margin-bottom: 0;
  margin-top: clamp(48px, 8vw, 120px);
  align-self: end;
  justify-self: start;
  background: var(--title-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  /* El fondo recortado al texto solo pinta dentro de la caja: sin este
     margen interior la tilde de la Á queda fuera y no se ve. */
  padding-top: .12em;
  font-size: min(23.5vw, 26.5625rem);
  font-weight: 700;
  line-height: .78;
  letter-spacing: -.07em;
  white-space: nowrap;
}

.footer-base {
  display: flex;
  margin-top: clamp(22px, 3vw, 44px);
  gap: 12px 32px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0;
}

/* <small> encoge por defecto: aquí hereda los 13px del pie. */
.footer-base small {
  font-size: inherit;
}

.footer-links {
  display: flex;
  width: 100%;
  gap: 4px 22px;
  flex-wrap: wrap;
  font-size: 1rem;
}

.footer-links a {
  padding: 12px 0;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--star-yellow);
}

@media (min-width: 768px) {
  .footer-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .footer-contact {
    flex: none;
  }

  .footer-links {
    width: auto;
  }
}

/* ---------- WhatsApp ---------- */
.footer-button--wa {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

/* Burbuja flotante: siempre a la vista en escritorio. En móvil espera
   a que pase la portada, que ya tiene su propio botón, para no tapar
   las cifras (script.js pone .is-past-hero en el body). */
.whatsapp-fab {
  --fab-disc: 44px;
  --fab-glyph: 24px;
  --fab-pad: 6px;
  position: fixed;
  z-index: 9;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  padding: var(--fab-pad) 22px var(--fab-pad) var(--fab-pad);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(10, 15, 51, .08);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(7, 11, 44, .08), 0 12px 32px rgba(7, 11, 44, .18);
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: opacity .3s ease, transform .3s ease, box-shadow .3s ease;
}

/* Disco verde con el glifo en blanco encima. El glifo va como máscara,
   con el mismo archivo que usan los botones. */
.whatsapp-fab::before {
  content: "";
  width: var(--fab-disc);
  height: var(--fab-disc);
  flex: none;
  border-radius: 50%;
  background: linear-gradient(150deg, #2bd96d, #109a55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

.whatsapp-fab::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--fab-pad) + (var(--fab-disc) - var(--fab-glyph)) / 2);
  width: var(--fab-glyph);
  height: var(--fab-glyph);
  margin-top: calc(var(--fab-glyph) / -2);
  background: #fff;
  -webkit-mask: url("../images/icono-whatsapp.svg") center / contain no-repeat;
  mask: url("../images/icono-whatsapp.svg") center / contain no-repeat;
}

@media (hover: hover) {
  .whatsapp-fab:hover {
    box-shadow: 0 2px 4px rgba(7, 11, 44, .1), 0 18px 40px rgba(7, 11, 44, .24);
    transform: translateY(-2px);
  }
}

@media (max-width: 767px) {
  /* En móvil, solo el disco. */
  .whatsapp-fab {
    --fab-disc: 56px;
    --fab-glyph: 30px;
    --fab-pad: 0px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: 0 10px 26px rgba(7, 11, 44, .28);
  }

  .whatsapp-fab span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .whatsapp-fab:not(.is-shown) {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
  }

  .is-past-hero .whatsapp-fab {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

/* Sitio para la burbuja: que no tape la última línea del pie. */
.footer-base {
  padding-bottom: 64px;
}

@media (min-width: 768px) {
  .footer-base {
    padding-right: 200px;
    padding-bottom: 0;
  }
}
