/**
 * Valhalla for Vikinger — Social module styles.
 *
 * Builds on Vikinger classes (widget-box, user-preview, user-status, button…)
 * and only uses theme CSS variables, so presets and dark mode work
 * automatically. The online green is a status color (not a theme color) and
 * can be overridden with --vhl-social-online-color.
 */

:root {
  --vhl-social-online-color: #1df377;
}

/* ------------------------------------------------------------------
 * Online status badge
 *
 * Drawn inside the avatar element (hexagon `.user-avatar`, circle and
 * square `.user-avatar-circle`), centred on the avatar's upper-right edge —
 * the mirror image of Vikinger's level badge on the lower-right edge — with a
 * ring in the box background colour, so it reads as a cut-out in light and
 * dark presets. Size and ring follow the avatar size.
 * ---------------------------------------------------------------- */
.vhl-online-badge {
  --vhl-online-size: 14px;
  --vhl-online-ring: 3px;
  display: block;
  width: var(--vhl-online-size);
  height: var(--vhl-online-size);
  border-radius: 50%;
  background-color: var(--vhl-social-online-color);
  box-shadow: 0 0 0 var(--vhl-online-ring) var(--color-box-background, #fff);
  position: absolute;
  top: 17%;
  left: 84%;
  z-index: 7;
  transform: translate(-50%, -50%);
}

.user-avatar-circle > .vhl-online-badge {
  top: 14.6%;
  left: 85.4%;
}

.user-avatar-circle.user-avatar-circle-flat > .vhl-online-badge {
  top: 7%;
  left: 93%;
}

.user-avatar.big > .vhl-online-badge,
.user-avatar-circle.big > .vhl-online-badge {
  --vhl-online-size: 18px;
  --vhl-online-ring: 4px;
}

.user-avatar.medium > .vhl-online-badge,
.user-avatar-circle.medium > .vhl-online-badge {
  --vhl-online-size: 16px;
}

.user-avatar.small > .vhl-online-badge,
.user-avatar.user-avatar-forum > .vhl-online-badge,
.user-avatar-circle.small > .vhl-online-badge,
.user-avatar-circle.user-avatar-circle-forum > .vhl-online-badge {
  --vhl-online-size: 10px;
  --vhl-online-ring: 2px;
}

.user-avatar.tiny > .vhl-online-badge,
.user-avatar.micro > .vhl-online-badge,
.user-avatar-circle.smaller > .vhl-online-badge {
  --vhl-online-size: 8px;
  --vhl-online-ring: 2px;
}

/* Inline dot (fallback for theme lists outside user-status rows). */
.vhl-online-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--vhl-social-online-color);
  box-shadow: 0 0 0 2px var(--color-box-background, #fff);
  vertical-align: middle;
}

.vhl-online-dot-inline {
  margin-left: 6px;
  position: relative;
  top: -1px;
}

/* Theme user-status rows (member widgets): the dot printed after the name sits on the row's
   avatar (40 × 44 hexagon / 40 px circle at the row's top left) like the badge above. */
.user-status > .user-status-title > .vhl-online-dot-inline {
  width: 10px;
  height: 10px;
  margin: 0;
  position: absolute;
  top: 7px;
  left: 34px;
  z-index: 7;
  transform: translate(-50%, -50%);
}

.vhl-sr-only {
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  position: absolute;
}

/* ------------------------------------------------------------------
 * Profile header: Followers stat (Vikinger `.user-stat big` markup)
 * ---------------------------------------------------------------- */
.vhl-follower-stat-link {
  display: block;
  color: var(--color-text);
}

.vhl-follower-stat-link .user-stat-text {
  transition: color .2s ease-in-out;
}

.vhl-follower-stat-link:hover .user-stat-text,
.vhl-follower-stat-link:focus-visible .user-stat-text {
  color: var(--color-primary-dark);
}

/* ------------------------------------------------------------------
 * Follow buttons
 * ---------------------------------------------------------------- */
.vhl-follow-btn {
  font-family: inherit;
  cursor: pointer;
  transition: background-color .2s ease-in-out, box-shadow .2s ease-in-out, opacity .2s ease-in-out;
}

.vhl-follow-btn.is-following:hover {
  background-color: var(--color-tertiary, #fd4350);
  box-shadow: var(--color-tertiary-shadow, none);
}

.vhl-follow-button-wrap {
  display: inline-block;
}

.vhl-follow-button-wrap .vhl-follow-btn:not(.full) {
  padding: 0 24px;
}

.vhl-is-busy {
  opacity: .6;
  pointer-events: none;
}

/* ------------------------------------------------------------------
 * Followers / Following tabs (member cards)
 * ---------------------------------------------------------------- */
.vhl-social-tab .section-header + .grid {
  margin-top: 32px;
}

.vhl-social-card .user-preview-footer.padded .vhl-follow-btn {
  width: 100%;
}

.vhl-social-card .user-short-description-text:empty {
  display: none;
}

.vhl-social-follows-you {
  display: table;
  margin: 10px auto 0;
  padding: 4px 10px;
  border-radius: 200px;
  background-color: var(--color-box-highlight-background, #f7f7fb);
  color: var(--color-text-alt, #8f91ac);
  font-size: calc((10 / var(--vikinger-font-size-base, 16)) * 1rem);
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.vhl-social-pager {
  margin-top: 32px;
}

.vhl-social-pager .section-pager-item,
.vhl-social-pager .slider-control {
  text-decoration: none;
}

.vhl-social-pager .section-pager-item .section-pager-item-text {
  color: var(--color-text, #3e3f5e);
}

.vhl-social-empty-wrap {
  margin-top: 32px;
}

/* ------------------------------------------------------------------
 * Online members box
 * ---------------------------------------------------------------- */
/* Borderless avatars (like the theme's user-status rows), so the online badge sits on the picture. */
.vhl-online-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 22px;
}

.vhl-online-item {
  position: relative;
  line-height: 0;
}

.vhl-online-more {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  border-radius: 12px;
  background-color: var(--color-box-highlight-background, #f7f7fb);
  color: var(--color-text, #3e3f5e);
  font-size: calc((12 / var(--vikinger-font-size-base, 16)) * 1rem);
  font-weight: 700;
  transition: color .2s ease-in-out, background-color .2s ease-in-out;
}

a.vhl-online-more:hover {
  background-color: var(--color-box-hover-background, #f2f2f9);
  color: var(--color-primary-dark, #00c7d9);
}

.vhl-social-shortcode + .vhl-social-shortcode {
  margin-top: 16px;
}

/* ------------------------------------------------------------------
 * Most followed list
 * ---------------------------------------------------------------- */
.vhl-top-followed-item {
  padding-right: 32px;
  position: relative;
}

.vhl-top-followed-rank {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  color: var(--color-text-alt-2, #adafca);
  font-size: calc((14 / var(--vikinger-font-size-base, 16)) * 1rem);
  font-weight: 700;
}

/* ------------------------------------------------------------------
 * Account Hub → Profile Visitors
 * ---------------------------------------------------------------- */
.vhl-visitors-page .vhl-social-paragraph {
  color: var(--color-text, #3e3f5e);
  font-size: calc((14 / var(--vikinger-font-size-base, 16)) * 1rem);
  font-weight: 500;
  line-height: 1.7142857143em;
}

.vhl-visitors-summary + .user-status-list,
.vhl-visitors-summary + .no-results-text {
  margin-top: 28px;
}

.vhl-visitor {
  padding-right: 96px;
  position: relative;
}

.vhl-visitor-count {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 200px;
  background-color: var(--color-box-highlight-background, #f7f7fb);
  color: var(--color-text, #3e3f5e);
  font-size: calc((12 / var(--vikinger-font-size-base, 16)) * 1rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.vhl-visitors-privacy .checkbox-info {
  padding-left: 34px;
}

.vhl-visitors-privacy .checkbox-info-text {
  color: var(--color-text-alt, #8f91ac);
}

.vhl-social-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

.vhl-social-form-actions .button {
  padding: 0 32px;
  font-family: inherit;
  cursor: pointer;
}

.vhl-social-private-form.vhl-js .vhl-social-form-actions {
  display: none;
}

.vhl-visitors-saved {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------
 * Responsive (theme breakpoints)
 * ---------------------------------------------------------------- */
@media screen and (max-width: 680px) {
  .vhl-visitor {
    padding-right: 0;
  }

  .vhl-visitor-count {
    position: static;
    display: inline-block;
    margin-top: 8px;
    transform: none;
  }
}

@media screen and (max-width: 480px) {
  /* The theme keeps two stats on phones (it hides the last one): show Posts, Friends and
     Followers — Comments is the one left out when Followers was added as a fourth stat. */
  .profile-header .profile-header-info .user-stats.vhl-stats-followers .user-stat {
    padding: 0 16px;
  }

  .profile-header .profile-header-info .user-stats.vhl-stats-followers .user-stat:last-child {
    display: block;
  }

  .profile-header .profile-header-info .user-stats.vhl-stats-followers .user-stat:nth-last-child(2)::after {
    display: block;
  }

  .profile-header .profile-header-info .user-stats.vhl-stats-add .user-stat:nth-last-child(2) {
    display: none;
  }
}
