/** @fileoverview Кнопка и компактное окно onion-зеркала в палитре TorLink. */
.onion-trigger { font: inherit; cursor: pointer; gap: 8px; }
.onion-trigger[hidden] { display: none; }
.onion-address { position: fixed; inset: 112px 24px auto auto; margin: 0; width: min(360px, calc(100vw - 48px)); box-sizing: border-box; padding: 24px; border: 1px solid #40314f; border-radius: 12px; background: #100d18; color: #eeeaf5; font-family: var(--ui-font); font-size: 14px; line-height: 20px; box-shadow: 0 16px 48px #0008; }
.onion-address strong { font-size: 16px; font-weight: 500; }
.onion-address p { margin: 8px 0 16px; color: #aca3ba; }
.onion-address a { display: block; overflow-wrap: anywhere; color: #d5bdff; margin-bottom: 16px; }
.onion-address button { padding: 8px 12px; border: 1px solid #635078; border-radius: 8px; background: transparent; color: #dfccff; font: inherit; cursor: pointer; }
.onion-address button:hover { background: #21172e; }
.onion-address :is(a, button):focus-visible, .onion-trigger:focus-visible { outline: 2px solid #d5bdff; outline-offset: 4px; }
#onion-copy-status { display: block; color: #aca3ba; margin-top: 8px; }

/** Копирайт и визитка выровнены по краям общего контейнера подвала. */
.site-footer { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 80px 24px 32px; text-align: left; }
.site-footer .footer-bookmark { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #c5b6db; font-size: 14px; line-height: 20px; text-decoration: none; white-space: nowrap; }
.site-footer .footer-bookmark:hover { color: #eee5ff; }
.site-footer .footer-bookmark:focus-visible { outline: 2px solid #d5bdff; outline-offset: 4px; }
@media (max-width: 560px) {
  .site-footer { flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px 80px 24px 24px; font-size: 12px; }
}

/** Ссылки на зеркало и визитку образуют одну компактную группу. */
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
/** На средней ширине копирайт и ссылки помещаются в одну строку. */
@media (min-width: 561px) and (max-width: 760px) {
  .site-footer { gap: 12px; padding: 24px 64px 24px 16px; font-size: 12px; }
  .site-footer > div { white-space: nowrap; }
  .footer-links { flex-wrap: nowrap; gap: 12px; }
  .site-footer .footer-bookmark { gap: 3px; font-size: 12px; }
}

.footer-links [hidden] { display: none; }
.header-telegram[hidden],
.onion-trigger[hidden] { display: none !important; }

/** Базовое выравнивание пилюль: иконка и подпись на одной оси (Tor Browser / Firefox). */
.site-header .header-right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}
.site-header :is(.header-telegram, .onion-trigger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: #e5e1eb;
  background: transparent;
  border-color: #ffffff24;
  box-shadow: none;
}
.site-header :is(.header-telegram, .onion-trigger):hover {
  background: #ffffff06;
  border-color: #ffffff50;
  color: #fff;
  box-shadow: none;
}
.site-header :is(.support-btn, .torscan-btn) {
  background: transparent;
  border-color: #ffffff24;
  color: #e5e1eb;
  box-shadow: none;
}
.site-header :is(.support-btn, .torscan-btn):hover {
  background: #ffffff06;
  border-color: #ffffff50;
  color: #fff;
  box-shadow: none;
}
.site-header :is(.header-telegram, .onion-trigger) svg,
.onion-trigger-icon {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  align-self: center;
  transform: none;
  color: var(--violet-bright, #a775ff);
}
.header-telegram-label,
.onion-trigger-label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/** Единая строка копирайта и ссылок даёт ровную вертикальную ось подвала. */
.site-footer { font-size: 14px; line-height: 20px; }
.site-footer > div, .footer-links { line-height: 20px; }

/**
 * Компактный режим: подписи скрыты, кнопки — круги 36px.
 * Правила ниже базовых, чтобы не перебить display:none у подписей.
 */
@media (max-width: 960px) {
  .site-header .header-right { gap: 6px; }
  .header-telegram-label,
  .onion-trigger-label,
  .site-header .support-btn__label { display: none !important; }
  .site-header :is(.header-telegram, .onion-trigger, .support-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    gap: 0;
  }
}

@media (max-width: 640px) {
  .site-header .header-right { gap: 4px; }
  .onion-address { inset: 112px 16px auto; width: auto; max-height: calc(100dvh - 144px); overflow-y: auto; }
}

@media (max-width: 380px) {
  .site-header .logo-img { max-width: 88px; }
  .site-footer { padding: 24px 16px; font-size: 12px; }
  .footer-links { gap: 8px; }
  .site-footer .footer-bookmark { gap: 3px; font-size: 12px; }
}

@media (max-width: 360px) {
  .site-header { flex-wrap: nowrap; justify-content: space-between; gap: 4px; padding: 12px 8px; }
  .site-header .header-left { width: auto; flex: 0 0 auto; }
  .site-header .logo-img { width: 64px; height: auto; }
  .site-header .header-right { width: auto; gap: 3px; }
  .site-header :is(.header-telegram, .onion-trigger, .support-btn) {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
  }
  .site-header .torscan-btn { height: 32px; padding-inline: 6px; gap: 3px; }
  .site-header .torscan-btn__logo { width: 52px; height: auto; }
  .onion-address { inset: 112px 12px auto; max-height: calc(100dvh - 136px); }
}

@media (max-width: 280px) {
  .site-header { padding-inline: 4px; gap: 2px; }
  .site-header .logo-img { width: clamp(44px, 22vw, 60px); }
  .site-header .header-right { gap: 2px; }
  .site-header :is(.header-telegram, .onion-trigger, .support-btn) {
    width: clamp(26px, 12vw, 32px);
    min-width: 0;
    height: clamp(26px, 12vw, 32px);
    min-height: 0;
  }
  .site-header .torscan-btn { height: clamp(26px, 12vw, 32px); padding-inline: 4px; gap: 2px; }
  .site-header .torscan-btn__logo { width: clamp(38px, 18vw, 50px); }
}
