/* ── Social login (Google / Facebook / X) ─────────────────────────────
   Markup: the theme wrapper `.ac-social` from inc/social-login.php around
   Nextend Social Login's own button container.

   Specificity note — this file has to WIN, not just come last. Nextend
   prints its stylesheet inline on `wp_head` at priority 100, i.e. AFTER
   this file's <link>, and its rules are shaped like
   `div.nsl-container .nsl-button-default div.nsl-button-label-container`
   (0,3,2). Every rule below is therefore anchored on
   `.ac-social div.nsl-container …` so it outranks the plugin's own skin
   rather than relying on source order. The one inline declaration Nextend
   writes — the provider fill on `.nsl-button` — needs `!important`.

   The result is `ac-btn--white-outline` in button form: white, 1.5px
   #CDD4DF, radius 8, hover → border #111827.

   Nothing here renders until a provider is configured; the PHP returns an
   empty string, so there is no empty divider and no reserved space. */

.ac-social {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── "or continue with" rule ─────────────────────────────────────────── */

.ac-social .ac-social__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b97aa;
  line-height: 1.2;
}

.ac-social .ac-social__divider::before,
.ac-social .ac-social__divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: #e8ecf2;
}

.ac-social .ac-social__divider span {
  flex: 0 0 auto;
}

/* ── Button stack ────────────────────────────────────────────────────── */

/* Beats `div.nsl-container .nsl-container-buttons` (display:flex, padding)
   and `div.nsl-container-block-fullwidth .nsl-container-buttons`
   (flex-flow:column, align-items:center). */
.ac-social div.nsl-container .nsl-container-buttons {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
  padding: 0;
  margin: 0;
}

/* Beats `div.nsl-container div.nsl-container-buttons a[data-plugin="nsl"]`
   and the fullwidth `… .nsl-container-buttons a` margin. */
.ac-social div.nsl-container div.nsl-container-buttons a[data-plugin="nsl"] {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  text-decoration: none;
  box-shadow: none;
  border: 0;
  border-radius: 8px;
  color: inherit;
}

/* Beats `div.nsl-container .nsl-button` (border-radius:4px) and the
   per-provider `[data-skin]` rules that add an inset ring. */
.ac-social div.nsl-container .nsl-button.nsl-button-default {
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  padding: 12px 16px;
  background-color: #ffffff !important;
  border: 1.5px solid #cdd4df;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  vertical-align: top;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

/* Optical centring: the label is the flexible middle, so this balances the
   mark's width on the trailing edge and keeps the text on the button axis. */
.ac-social div.nsl-container .nsl-button.nsl-button-default::after {
  content: "";
  flex: 0 0 20px;
}

/* Beats `div.nsl-container .nsl-button-svg-container` (padding:8px). */
.ac-social div.nsl-container .nsl-button-svg-container {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
}

/* Beats `div.nsl-container svg` (24px). */
.ac-social div.nsl-container .nsl-button svg {
  display: block;
  width: 20px;
  height: 20px;
  vertical-align: top;
}

/* Beats `div.nsl-container .nsl-button-default div.nsl-button-label-container`
   (Helvetica 16/20, letter-spacing .25px, 0 24px 0 12px margin). */
.ac-social div.nsl-container .nsl-button-default div.nsl-button-label-container {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0;
  color: #111827;
  text-align: center;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Nextend's stock labels bold the provider name ("Continue with
   <b>Google</b>"); keep the line one weight whatever the label says. */
.ac-social div.nsl-container .nsl-button-label-container b,
.ac-social div.nsl-container .nsl-button-label-container strong {
  font-weight: 600;
}

/* ── Provider marks ──────────────────────────────────────────────────── */

/* Google ships its four-colour G and Facebook (skin: light) a blue glyph,
   both of which read correctly on a white button. X only ships a white
   mark, so it is recoloured to ink — a CSS `fill` outranks the SVG's
   presentation attribute, and this holds for either X skin. */
.ac-social div.nsl-container .nsl-button-twitter svg path {
  fill: #111827;
}

/* Insurance if Facebook's skin is ever switched back to a solid variant
   with a knocked-out white glyph. */
.ac-social div.nsl-container .nsl-button-facebook[data-skin="black"] svg > path:first-child {
  fill: #1877f2;
}

/* ── States ──────────────────────────────────────────────────────────── */

.ac-social div.nsl-container div.nsl-container-buttons a[data-plugin="nsl"]:hover .nsl-button.nsl-button-default {
  border-color: #111827;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.08);
}

.ac-social div.nsl-container div.nsl-container-buttons a[data-plugin="nsl"]:active .nsl-button.nsl-button-default {
  transform: translateY(1px);
  box-shadow: none;
}

.ac-social div.nsl-container div.nsl-container-buttons a[data-plugin="nsl"]:focus-visible {
  outline: 2px solid #2447c6;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ac-social div.nsl-container .nsl-button.nsl-button-default {
    transition: none;
  }
  .ac-social div.nsl-container div.nsl-container-buttons a[data-plugin="nsl"]:active .nsl-button.nsl-button-default {
    transform: none;
  }
}

/* ── Placement variants ──────────────────────────────────────────────── */

/* Inside the /login/ card the card's own 16px column gap does the spacing. */
.ac-social--card {
  margin: 0;
}

/* WooCommerce sign-in panels: the checkout "Returning customer?" drawer and
   the /my-account/ login column. The block lands inside the form, after
   WooCommerce's lost-password link. */
.ac-social--woo {
  margin: 18px 0 4px;
  clear: both;
}

/* Woo's login column is wider than the login card; two-up once there's room. */
@media (min-width: 700px) {
  .ac-social--woo div.nsl-container .nsl-container-buttons {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* Narrow phones: let the label shrink rather than clip. */
@media (max-width: 380px) {
  .ac-social div.nsl-container .nsl-button.nsl-button-default {
    padding: 12px;
    gap: 10px;
  }
  .ac-social div.nsl-container .nsl-button-default div.nsl-button-label-container {
    font-size: 14.5px;
  }
}
