/**
 * SYCSL: Botón "Preferir <site> en Google".
 * Cargado en los 4 article-X.twig (article-one, two, three, four) vía
 * attach_library('news_platform_artisan/google-prefer').
 */

.google-prefer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background-color: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  margin-left: auto;
}

a.google-prefer-btn:hover,
a.google-prefer-btn:focus {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
  text-decoration: none;
}

a.google-prefer-btn:hover span,
a.google-prefer-btn:focus span {
  color: #fff !important;
}

.google-prefer-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.google-prefer-btn span {
  white-space: nowrap;
}

/* Dark mode (DaisyUI usa [data-theme="dark"] o prefers-color-scheme).
   El botón base es transparente con borde — funciona en ambos modos.
   Hover en dark se invierte: fondo blanco + texto negro. */
[data-theme="dark"] .google-prefer-btn {
  border-color: #4b5563;
}

[data-theme="dark"] a.google-prefer-btn:hover,
[data-theme="dark"] a.google-prefer-btn:focus {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
}

[data-theme="dark"] a.google-prefer-btn:hover span,
[data-theme="dark"] a.google-prefer-btn:focus span {
  color: #000 !important;
}

/* NOTA: NO usar @media (prefers-color-scheme: dark) porque este theme
   gestiona el dark mode con [data-theme="dark"] (toggle del usuario), no
   con la preferencia del SO. Mezclar ambos hace que el modo del SO
   prevalezca y rompa el hover en LIGHT mode cuando macOS está en dark. */

/* Responsive: en pantallas pequeñas el botón puede pasar a la siguiente línea
   en el flex-wrap del contenedor padre, pero mantiene márgenes razonables. */
@media (max-width: 640px) {
  .google-prefer-btn {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}
