/* Sign in with Google — sizing for the official pre-approved button assets.
 *
 * Google fixes how the button looks, so this file touches the box around the
 * artwork and nothing inside it: no fill, no border, no filter or opacity that
 * would shift the standard color "G" or the label. The hover state is a shadow
 * that falls outside the asset and the focus state is a ring beside it.
 * https://developers.google.com/identity/branding-guidelines
 *
 * Usage:
 *
 *   <a class="google-signin google-signin-block" href="...">
 *     <img src="{% static 'img/google/google-signin-dark-rect.svg' %}"
 *          width="216" height="48" alt="Sign in with Google">
 *   </a>
 *
 * Match the asset to the surface behind it — `-dark-` for the near-black pages
 * here, `-light-` for white, `-neutral-` for anything else. See
 * `static/img/google/README.md` for the full set.
 *
 * Loaded by base.html (public site) and admin/login.html (staff panel), so the
 * button has one definition in both.
 */

.google-signin {
  /* Admin defines --primary; the public site defines --purple-300. */
  --google-signin-ring: var(--purple-300, var(--primary, #7c5ce6));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Matches the -rect artwork's 4px corners so the focus ring traces it. */
  border-radius: 4px;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

/* The asset is 180x40 and vector, so it scales without loss as long as the
 * aspect ratio is left alone — Google requires that. 48px keeps the button the
 * same height as the .button-large it replaces. */
.google-signin img { display: block; height: 48px; width: auto; }

.google-signin:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.google-signin:active { transform: translateY(1px); }
.google-signin:focus-visible { outline: 2px solid var(--google-signin-ring); outline-offset: 3px; }

/* The -pill artwork is fully rounded, so the ring has to follow it. */
.google-signin-pill { border-radius: 999px; }

/* Centred in the column, but only as wide as the artwork.
 *
 * It used to be ``width: 100%`` so the link filled the card the way
 * ``.button-block`` did. The box is transparent, so nothing showed -- until
 * something outlined the box: ``:hover`` casts its shadow from the *link's*
 * border-box, so hovering drew a 346px rectangle of shadow around a 216px
 * button, an empty halo on both sides that read as a stray panel over the
 * column. The focus ring had the same fault.
 *
 * ``fit-content`` makes the box the artwork's size, so the shadow and the ring
 * trace the button, and ``margin-inline: auto`` keeps it centred -- auto
 * margins, not ``align-self``, because the sign-in card is a column flex
 * container whose default ``stretch`` alignment is precisely what made the
 * link full width in the first place. ``max-width`` is the phone guard: the
 * artwork must stay at its own size rather than be squashed, per the branding
 * guidelines. */
.google-signin-block {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
