/* Compartir nota: barra en línea, botón flotante y panel. Mobile first.
   Solo se usa en las notas del blog. Tokens heredados del sitio (acento #00ff88, fondo #050d14). */

.share,
.share-fab,
.share-pop,
.share-toast {
  --s-accent: var(--accent, #00ff88);
  --s-line: rgba(255, 255, 255, 0.13);
  --s-bg: rgba(255, 255, 255, 0.045);
  --s-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
.share [hidden],
.share-pop [hidden] { display: none !important; }

/* ---------- Barra en línea ---------- */
.share { margin: 1.75rem 0 2rem; }
.share__title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #fff;
}

.share__native {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 54px;
  margin: 0 0 0.75rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 16px;
  background: var(--s-accent);
  color: #021008;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(0, 255, 136, 0.55), 0 2px 0 rgba(255, 255, 255, 0.25) inset;
  transition: transform 0.35s var(--s-ease), box-shadow 0.35s var(--s-ease);
}
.share__native svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share__native:active { transform: scale(0.98); }

.share__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.share__list > li { margin: 0; padding: 0; min-width: 0; }
/* Si el botón de la celda está oculto (p. ej. Estado de WhatsApp en escritorio), la celda no ocupa lugar */
.share__list > li:has(> [hidden]) { display: none; }

.share__btn {
  --b: var(--s-accent);
  --b-tint: rgba(0, 255, 136, 0.12);
  --b-line: rgba(0, 255, 136, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  min-height: 74px;
  padding: 0.6rem 0.25rem;
  border: 1px solid var(--s-line);
  border-radius: 16px;
  background: var(--s-bg);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.4s var(--s-ease), color 0.25s, border-color 0.25s, background-color 0.25s, box-shadow 0.4s var(--s-ease);
}
.share__btn svg {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.share__btn svg.is-solid { fill: currentColor; stroke: none; }

.share__btn--wa { --b: #25d366; --b-tint: rgba(37, 211, 102, 0.13); --b-line: rgba(37, 211, 102, 0.6); }
.share__btn--story { --b: #25d366; --b-tint: rgba(37, 211, 102, 0.13); --b-line: rgba(37, 211, 102, 0.6); }
.share__btn--fb { --b: #4a9bff; --b-tint: rgba(74, 155, 255, 0.14); --b-line: rgba(74, 155, 255, 0.6); }
.share__btn--x { --b: #ffffff; --b-tint: rgba(255, 255, 255, 0.12); --b-line: rgba(255, 255, 255, 0.55); }
.share__btn--in { --b: #4aa3ff; --b-tint: rgba(74, 163, 255, 0.14); --b-line: rgba(74, 163, 255, 0.6); }
.share__btn--tg { --b: #2aabee; --b-tint: rgba(42, 171, 238, 0.14); --b-line: rgba(42, 171, 238, 0.6); }

@media (hover: hover) {
  .share__btn:hover {
    color: var(--b);
    background: var(--b-tint);
    border-color: var(--b-line);
    transform: translateY(-3px);
    box-shadow: 0 14px 22px -14px rgba(0, 0, 0, 0.9);
  }
  .share__native:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(0, 255, 136, 0.6), 0 2px 0 rgba(255, 255, 255, 0.25) inset; }
}
.share__btn:active { transform: scale(0.96); }
.share__btn.is-done { color: var(--s-accent); background: rgba(0, 255, 136, 0.12); border-color: rgba(0, 255, 136, 0.6); }

.share__btn:focus-visible,
.share__native:focus-visible,
.share-fab:focus-visible {
  outline: 2px solid var(--s-accent);
  outline-offset: 3px;
}

/* ---------- Variante al final de la nota ---------- */
.share--end {
  margin: 3rem 0 0;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--s-line);
  border-radius: 22px;
  background: rgba(0, 255, 136, 0.04);
}
.share--end .share__title { font-size: 1.2rem; font-weight: 800; }

/* ---------- Escritorio ---------- */
@media (min-width: 720px) {
  .share__native { width: auto; display: inline-flex; margin-right: 0.75rem; }
  .share__list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
  .share__list > li { flex: none; }
  .share__btn {
    flex-direction: row;
    width: auto;
    height: auto;
    min-height: 46px;
    padding: 0 1.05rem 0 0.95rem;
    border-radius: 999px;
    gap: 0.6rem;
    font-size: 0.9rem;
  }
  .share--end { padding: 1.75rem 1.75rem; }
}

/* ---------- Botón flotante ---------- */
.share-fab {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 56px;
  padding: 0 1.3rem 0 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--s-accent);
  color: #021008;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 16px 28px -12px rgba(0, 0, 0, 0.85), 0 8px 18px -8px rgba(0, 255, 136, 0.5), 0 2px 0 rgba(255, 255, 255, 0.28) inset;
  opacity: 0;
  transform: translateY(26px) scale(0.94);
  pointer-events: none;
  transition: transform 0.55s var(--s-ease), opacity 0.35s ease, box-shadow 0.4s var(--s-ease);
}
.share-fab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.share-fab.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.share-fab:active { transform: scale(0.96); }
@media (hover: hover) {
  .share-fab.is-visible:hover { transform: translateY(-3px); }
}

/* ---------- Panel del botón flotante (escritorio) ---------- */
.share-pop {
  position: fixed;
  z-index: 91;
  right: 1rem;
  bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px));
  width: min(340px, calc(100vw - 2rem));
  padding: 0.85rem;
  border: 1px solid var(--s-line);
  border-radius: 20px;
  background: #0a1628;
  box-shadow: 0 28px 48px -18px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom right;
  pointer-events: none;
  transition: transform 0.45s var(--s-ease), opacity 0.25s ease;
}
.share-pop.is-open { opacity: 1; transform: none; pointer-events: auto; }
.share-pop__title { margin: 0.1rem 0.25rem 0.7rem; font-size: 0.9rem; font-weight: 700; color: #fff; }
.share-pop .share__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
.share-pop .share__btn {
  flex-direction: row;
  justify-content: flex-start;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0 0.85rem;
  border-radius: 14px;
  font-size: 0.86rem;
  text-align: left;
}

/* ---------- Aviso breve ---------- */
.share-toast {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.1rem;
  border: 1px solid rgba(0, 255, 136, 0.5);
  border-radius: 14px;
  background: #0a1628;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 18px 30px -14px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: transform 0.45s var(--s-ease), opacity 0.25s ease;
}
.share-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .share__btn, .share__native, .share-fab, .share-pop, .share-toast { transition: none; }
}
@media print {
  .share, .share-fab, .share-pop, .share-toast { display: none !important; }
}
