/**
 * Homepage header + main links – small-screen / touch / Safari
 * Does not add a new navbar. Keeps the existing Beacons header (Subscribe / Share)
 * and the existing link stack, and stops real overflow/clipping.
 */

html:has(body.index-page),
html:has(body.index-page) body {
  overflow-x: visible;
  max-width: none;
}

body.index-page {
  --top-btn-h: 2.75rem;
  --top-btn-icon: 1rem;
}

body.index-page .container {
  overflow-x: visible;
}

body.index-page .profile-buttons {
  box-sizing: border-box;
}

body.index-page .profile-buttons .subscribe-btn,
body.index-page .profile-buttons .share-btn {
  min-height: var(--top-btn-h);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body.index-page .profile-buttons .subscribe-btn .btn-label {
  display: inline;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: nowrap;
}

body.index-page .profile-name-card {
  max-width: 100%;
  box-sizing: border-box;
}

body.index-page .profile-name {
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.index-page .links a.link-beacons,
body.index-page .app-download-beacons,
body.index-page .cards-container .card.card-beacons .action-btn {
  max-width: 100%;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body.index-page .links a.link-beacons .link-text span,
body.index-page .links a.link-beacons .link-text small {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

body.index-page .share-popup {
  max-width: min(100%, 21.25rem);
  box-sizing: border-box;
}

body.index-page .share-popup-close {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  top: 4px;
  right: 4px;
  padding: 0;
}

body.index-page .share-menu-item {
  min-height: 2.75rem;
  box-sizing: border-box;
}

body.index-page .toast {
  max-width: min(calc(100% - 2rem), var(--content-max));
}

body.index-page #popup1.popup-box,
body.index-page #popup2.popup-box {
  width: min(calc(100% - 1.5rem), 26.25rem);
}

/* 320px – keep SUBSCRIBE readable, do not collapse to icon-only */
@media (max-width: 20rem) {
  body.index-page .profile-buttons .subscribe-btn .btn-label {
    display: inline !important;
    font-size: 0.625rem;
    letter-spacing: 0.04em;
  }

  body.index-page .profile-buttons .subscribe-btn {
    width: auto !important;
    min-width: 0;
    max-width: calc(100% - 3.25rem) !important;
    padding: 0 0.75rem !important;
    gap: 5px;
  }
}

@media (min-width: 20.0625rem) and (max-width: 29.9375rem) {
  body.index-page .profile-buttons .subscribe-btn .btn-label {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
  }
}

@media (hover: none) {
  body.index-page .links a.link-beacons:hover,
  body.index-page .app-download-beacons:hover {
    transform: none;
  }
}
