:root {
  --social-bg: var(--brand-dark, #1f4d1f);
  --social-icon: #ffffff;
  --social-hover: var(--brand-accent, #7fc41a);
}

.social-strip {
  position: fixed;
  top: 50%;
  right: env(safe-area-inset-right, 0px);
  z-index: 900;
  width: 48px;
  transform: translateY(-50%);
  border-radius: 12px 0 0 12px;
  background: var(--social-bg);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: width 200ms ease;
}

.social-links {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-links--strip {
  flex-direction: column;
}

.social-links--strip li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.social-link {
  color: var(--social-icon);
  -webkit-tap-highlight-color: transparent;
}

.social-links--strip .social-link {
  display: flex;
  width: 48px;
  min-width: 48px;
  height: 48px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 12px;
  color: var(--social-icon);
  text-decoration: none;
  transition: width 200ms ease, transform 200ms ease, background-color 200ms ease, color 200ms ease;
}

.social-icon {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.social-link-label {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.social-link:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--social-hover);
  outline-offset: -3px;
}

.social-links--footer {
  gap: 10px;
  margin-top: 16px;
}

.social-links--footer .social-link {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--social-bg);
  color: var(--social-icon);
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.social-links--footer .social-icon {
  width: 18px;
  height: 18px;
}

.social-link:hover,
.social-links--footer .social-link:hover {
  background: var(--social-hover);
  color: var(--brand-dark, #1f4d1f);
}

.social-links--footer .social-link:hover {
  transform: translateY(-2px);
}

@media (min-width: 1024px) {
  .social-strip:has(.social-link:hover),
  .social-strip:has(.social-link:focus-visible) {
    width: 164px;
  }

  .social-links--strip .social-link:hover,
  .social-links--strip .social-link:focus-visible {
    width: 164px;
    transform: translateX(-6px);
    background: var(--social-hover);
    color: var(--brand-dark, #1f4d1f);
  }

  .social-link-label {
    display: inline;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: max-width 200ms ease, opacity 200ms ease;
  }

  .social-links--strip .social-link:hover .social-link-label,
  .social-links--strip .social-link:focus-visible .social-link-label {
    max-width: 96px;
    opacity: 1;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .social-strip {
    width: 44px;
  }

  .social-links--strip .social-link {
    width: 44px;
    min-width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0 10px;
  }
}

@media (max-width: 767px) {
  .social-strip {
    right: env(safe-area-inset-right, 0px);
    width: 40px;
  }

  .social-links--strip .social-link {
    width: 40px;
    min-width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0 8px;
  }

  .social-links--strip .social-icon {
    width: 22px;
    height: 22px;
  }

  body:has(.social-strip) main,
  body:has(.social-strip) .site-footer {
    padding-right: calc(58px + env(safe-area-inset-right, 0px));
  }

  body:has(.social-strip) .main-nav {
    padding-right: calc(58px + env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 359px) {
  .social-strip {
    top: auto;
    right: 50%;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: auto;
    transform: translateX(50%);
    border-radius: 12px;
  }

  .social-links--strip {
    flex-direction: row;
  }

  .social-links--strip li + li {
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
  }

  body:has(.social-strip) main,
  body:has(.social-strip) .site-footer,
  body:has(.social-strip) .main-nav {
    padding-right: initial;
  }
}

@media print {
  .social-strip,
  .social-links--footer {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-strip,
  .social-link,
  .social-link-label {
    transition-duration: 0.01ms;
  }
}
