/* ==========================================================
   GC SHARE LINKS
   Módulo: Compartir artículo en redes sociales + copiar URL
   Prefijo BEM : gc-share
   Archivo     : templates/guiacolon/shareLinks/gc-share-links.css
   ========================================================== */

/* ------- Variables ------- */
:root {
  --gc-share-color-facebook: #0866ff; /* rgb(8, 102, 255) — AddToAny exact */
  --gc-share-color-x: #000000;
  --gc-share-color-whatsapp: #12af0a; /* rgb(18, 175, 10) — AddToAny exact */
  --gc-share-color-linkedin: #0288d1;
  --gc-share-color-link: #888990;
  --gc-share-btn-size: 2.45rem;
  --gc-share-icon-size: 2.5rem;
  --gc-share-gap: 0.56rem;
}

/* ==========================================================
   CONTENEDOR RAÍZ
   ========================================================== */

.gc-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gc-share-gap);
  /* padding: 1rem 0; */
  flex-wrap: nowrap;
}

/* ------- Título "Compartir:" ------- */
.gc-share__title {
  font-size: 1rem;
  font-weight: 700;
  color: currentColor;
  white-space: nowrap;
  margin-inline-end: 0.375rem;

  @media (max-width: 767px) {
    display: none;
  }
}

/* ------- Lista de botones ------- */
.gc-share__list {
  display: flex;
  align-items: center;
  gap: var(--gc-share-gap);
  list-style: none;
  margin: 0;
  padding: 0;

  @media (max-width: 767px) {
    flex-direction: column;
    transform: scale(0.9) translateY(-12px);
    gap: 8px;
  }
}

/* En Home, en mobile, mantener el share horizontal sin transform */
@media (max-width: 767px) {
  .gc-home .gc-share__list {
    flex-direction: row;
    transform: none;
  }
}

/* ==========================================================
   BOTONES
   ========================================================== */

/* ------- Base ------- */
.gc-share__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--gc-share-btn-size);
  height: var(--gc-share-btn-size);
  padding: 0;
  box-sizing: border-box;
  border-radius: 0.5rem;
  border: none;
  line-height: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  color: #ffffff;
  background-color: #9ca3af;
  appearance: none;
  -webkit-appearance: none;
  transition:
    filter 0.2s ease,
    transform 0.15s ease;

  &:hover,
  &:focus-visible {
    /* Neutraliza el a:hover global del template */
    color: #ffffff;
    text-decoration: none;
    filter: brightness(1.15);
    transform: scale(1.1);
  }

  &:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
  }
}

/* ------- Modificadores de color por red ------- */
.gc-share__btn--facebook {
  background-color: transparent;
}
.gc-share__btn--x {
  background-color: transparent;
}
.gc-share__btn--whatsapp {
  background-color: var(--gc-share-color-whatsapp);
}
.gc-share__btn--linkedin {
  background-color: transparent;
}
.gc-share__btn--link {
  background-color: var(--gc-share-color-link);
}

/* ------- Ícono SVG ------- */
/* icon-size = btn-size → el SVG llena el botón y el border-radius recorta las esquinas */
.gc-share__icon {
  display: block;
  width: var(--gc-share-icon-size);
  height: var(--gc-share-icon-size);
  flex-shrink: 0;
  pointer-events: none;
}

/* Ajuste optico: el icono de cadena tiene el peso visual levemente bajo */
/* Sin compensaciones manuales: el centrado debe ser geometrico */

/* ------- Label: solo accesible (sr-only) ------- */
.gc-share__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ==========================================================
   OVERLAY — COPIAR URL
   ========================================================== */

.gc-share__overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background-color: rgba(0, 0, 0, 0.55);
  padding: 1rem;

  &[hidden] {
    display: none;
  }
}

/* ------- Panel central ------- */
.gc-share__overlay-panel {
  position: relative;
  width: 100%;
  max-width: 28rem;
  background-color: #ffffff;
  border-radius: 0.75rem;
  padding: 2rem 1.5rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ------- Botón cerrar (X) ------- */
.gc-share__overlay-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  cursor: pointer;
  color: #6b7280;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;

  & svg {
    width: 1.125rem;
    height: 1.125rem;
    pointer-events: none;
  }

  &:hover,
  &:focus-visible {
    background-color: #f3f4f6;
    color: #111827;
  }

  &:focus-visible {
    outline: 3px solid var(--gc-share-color-link);
    outline-offset: 1px;
  }
}

/* ------- Título del panel ------- */
.gc-share__overlay-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem;
}

/* ------- Fila URL + botón Copiar ------- */
.gc-share__overlay-url-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.gc-share__overlay-url {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: #f9fafb;
  color: #374151;
  outline: none;
  min-width: 0;

  &:focus {
    border-color: var(--gc-share-color-link);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
  }
}

.gc-share__overlay-copy {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 0.375rem;
  background-color: var(--gc-share-color-link);
  color: #ffffff;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease;

  &:hover,
  &:focus-visible {
    filter: brightness(1.1);
  }

  &:focus-visible {
    outline: 3px solid var(--gc-share-color-link);
    outline-offset: 2px;
  }
}

/* ------- Feedback "¡Copiado!" ------- */
.gc-share__overlay-feedback {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #16a34a;

  &[hidden] {
    display: none;
  }
}
