/* ==========================================================================
   GAVARA EVENTOS — components.css
   Botones, lightbox, cursor personalizado y micro-interacciones.
   ========================================================================== */

/* --------------------------------------------------------------- BOTONES */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.9rem 1.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--dur-fast) var(--ease-editorial), border-color var(--dur-fast) var(--ease-editorial), transform var(--dur-fast) var(--ease-editorial);
}
.btn:active { transform: scale(0.97); }

.btn-gold {
  color: var(--gavara-navy-900);
  background: var(--gavara-gold-foil);
  background-size: 180% 180%;
  background-position: 0% 0%;
  box-shadow: 0 14px 30px -14px rgba(184, 135, 58, 0.65);
}
.btn-gold:hover, .btn-gold:focus-visible {
  background-position: 100% 100%;
  box-shadow: 0 18px 36px -12px rgba(184, 135, 58, 0.8);
}

.btn-ghost {
  color: inherit;
  border: 1px solid currentColor;
}
.btn-ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: currentColor;
  transform: translateX(-101%);
  transition: transform var(--dur-med) var(--ease-editorial);
}
.btn-ghost:hover, .btn-ghost:focus-visible { color: var(--gavara-navy-900); }
.btn-ghost:hover::before, .btn-ghost:focus-visible::before { transform: translateX(0); }
.btn-ghost.on-dark:hover, .btn-ghost.on-dark:focus-visible { color: var(--gavara-navy-900); }

/* Subrayado animado genérico para links de texto */
.link-underline {
  position: relative;
  padding-bottom: 2px;
}
.link-underline::after {
  content: '';
  position: absolute;
  left: 50%; right: 50%; bottom: 0;
  height: 1px;
  background: currentColor;
  transition: left var(--dur-fast) var(--ease-editorial), right var(--dur-fast) var(--ease-editorial);
}
.link-underline:hover::after,
.link-underline:focus-visible::after { left: 0; right: 0; }

/* ------------------------------------------------------------- CURSOR UI */
.gallery-cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 999;
  width: 5.5rem; height: 5.5rem;
  border-radius: 50%;
  background: rgba(45, 36, 89, 0.88);
  color: var(--gavara-cream-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: opacity 0.25s var(--ease-editorial), transform 0.25s var(--ease-editorial);
  will-change: transform;
}
.gallery-cursor.is-active { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (hover: none), (pointer: coarse) {
  .gallery-cursor { display: none !important; }
}

/* ---------------------------------------------------------------- LIGHTBOX */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(17, 14, 30, 0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-med) var(--ease-editorial), visibility 0s linear var(--dur-med);
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-med) var(--ease-editorial), visibility 0s;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  color: var(--gavara-cream-50);
}
.lightbox-title { font-family: var(--font-display); font-size: 1.1rem; }
.lightbox-count { font-size: 0.8rem; opacity: 0.7; margin-left: 0.6rem; }

.lightbox-close {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--gavara-cream-50);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.lightbox-close:hover { background: rgba(255,255,255,0.1); transform: rotate(90deg); }

.lightbox-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-md) var(--space-md);
  min-height: 0;
}
.lightbox-frame {
  position: relative;
  max-width: min(92vw, 78rem);
  max-height: 76vh;
}
.lightbox-frame img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  border-radius: 0.35rem;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.4s var(--ease-editorial), transform 0.4s var(--ease-editorial);
}
.lightbox-frame img.is-shown { opacity: 1; transform: scale(1); }
.lightbox-caption {
  margin-top: var(--space-sm);
  text-align: center;
  color: rgba(250,247,241,0.7);
  font-size: 0.85rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.9rem; height: 2.9rem;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gavara-cream-50);
  background: rgba(255,255,255,0.08);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.18); }
.lightbox-prev { left: clamp(0.5rem, 2vw, 2rem); }
.lightbox-next { right: clamp(0.5rem, 2vw, 2rem); }
.lightbox-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(3px); }

.lightbox-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 var(--space-md) var(--space-md);
  scrollbar-width: thin;
}
.lightbox-thumbs button {
  flex: none;
  width: 4.2rem; height: 4.2rem;
  border-radius: 0.3rem;
  overflow: hidden;
  opacity: 0.45;
  border: 2px solid transparent;
  transition: opacity var(--dur-fast), border-color var(--dur-fast);
}
.lightbox-thumbs button.is-active { opacity: 1; border-color: var(--gavara-gold-400); }
.lightbox-thumbs button {
  /* Placeholder discreto mientras la miniatura entra en pantalla */
  background: rgba(246, 241, 231, 0.09);
}
.lightbox-thumbs img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-editorial);
}
.lightbox-thumbs img[data-loaded] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .lightbox-thumbs img { transition: none; }
}

body.lightbox-locked { overflow: hidden; }

/* ---------------------------------------------------- TEXTO DORADO (foil) */
.text-gold {
  background: var(--gavara-gold-foil);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .text-gold { background: none; color: var(--gavara-gold-600); }
}

/* -------------------------------------------- TEXTO CORRIDO JUSTIFICADO */
p,
.lede,
.support,
.service-copy p,
.project-copy p,
.manifesto-text p,
.planeacion-text p,
.lightbox-caption,
.carousel-caption,
.cap-text {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
/* ...salvo los bloques que el diseño centra o que son de interfaz */
.contact-head p,
.clientes-head p,
.carousel-hint,
.library-meta,
.footer-bottom p,
.cta-mini,
.hero-meta p,
.eyebrow { text-align: inherit; hyphens: manual; }

.hero-sub,
.hero-title,
h1, h2, h3, h4 { hyphens: manual; }

/* ------------------------------------------------ BOTÓN FLOTANTE WHATSAPP */
.wa-float {
  position: fixed;
  right: clamp(1rem, 2.4vw, 2rem);
  bottom: clamp(1rem, 2.4vw, 2rem);
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.72rem 1.15rem 0.72rem 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(184, 135, 58, 0.55);
  background: var(--gavara-navy-900);
  color: var(--gavara-cream-50);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 16px 34px -14px rgba(27, 23, 48, 0.75);
  transform: translateY(0);
  transition: transform var(--dur-fast, .25s) var(--ease-editorial, ease),
              box-shadow var(--dur-fast, .25s) var(--ease-editorial, ease),
              border-color var(--dur-fast, .25s) var(--ease-editorial, ease);
}
.wa-float-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  background: var(--gavara-gold-foil);
  background-size: 180% 180%;
  background-position: 0% 0%;
  color: var(--gavara-navy-900);
  transition: background-position var(--dur-slow, .6s) var(--ease-editorial, ease);
}
.wa-float:hover,
.wa-float:focus-visible {
  transform: translateY(-3px);
  border-color: var(--gavara-gold-400);
  box-shadow: 0 22px 40px -14px rgba(27, 23, 48, 0.85);
}
.wa-float:hover .wa-float-icon,
.wa-float:focus-visible .wa-float-icon { background-position: 100% 100%; }
.wa-float:active { transform: translateY(-1px) scale(0.98); }

@media (max-width: 560px) {
  .wa-float { padding: 0.55rem; gap: 0; }
  .wa-float-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-float, .wa-float-icon { transition: none; }
  .wa-float:hover, .wa-float:focus-visible { transform: none; }
}
