/*
 * ============================================================================
 *  THE STYLES OF THE MENU OF THE SITE
 * ============================================================================
 *
 *  The menu is the list of the apps that opens downwards from the button
 *  in the header. It has to work on a phone as well, where the width of
 *  the window is small.
 *
 * ============================================================================
 */

.tsite-menu-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}

.tsite-menu-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.28);
}

.tsite-menu-btn:focus-visible {
  outline: 2px solid #7c6cff;
  outline-offset: 2px;
}

.tsite-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
}

.tsite-menu-grid i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

/* ------------------------------------------------------------- the panel */

.tsite-menu-panel {
  position: fixed;
  z-index: 2147483006;
  width: 330px;
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(16, 16, 24, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: tsite-menu-rise 0.16s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.tsite-menu-panel[hidden] {
  display: none;
}

@keyframes tsite-menu-rise {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.tsite-menu-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  gap: 1px;
}

/* -------------------------------------------------------------- the rows */

.tsite-menu-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 9px;
  border-radius: 11px;
  transition: background 0.14s;
}

.tsite-menu-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tsite-menu-row.is-current {
  background: color-mix(in srgb, var(--ts-accent, #7c6cff) 16%, transparent);
}

.tsite-menu-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--ts-accent, #7c6cff), rgba(0, 0, 0, 0.4));
  color: #fff;
}

.tsite-menu-icon svg {
  width: 17px;
  height: 17px;
}

.tsite-menu-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}

.tsite-menu-name {
  font: 600 13.5px/1.35 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: #f2f2f7;
}

.tsite-menu-tagline {
  font: 400 11.5px/1.4 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsite-menu-links {
  display: flex;
  gap: 5px;
  flex: none;
}

.tsite-menu-open,
.tsite-menu-detail {
  padding: 6px 10px;
  border-radius: 8px;
  font: 600 11.5px/1 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s, color 0.14s;
}

.tsite-menu-open {
  background: rgba(255, 255, 255, 0.08);
  color: #f2f2f7;
}

.tsite-menu-open:hover {
  background: rgba(255, 255, 255, 0.16);
}

.tsite-menu-detail {
  background: color-mix(in srgb, var(--ts-accent, #7c6cff) 22%, transparent);
  color: #d9d4ff;
}

.tsite-menu-detail:hover {
  background: color-mix(in srgb, var(--ts-accent, #7c6cff) 36%, transparent);
  color: #fff;
}

.tsite-menu-open:focus-visible,
.tsite-menu-detail:focus-visible {
  outline: 2px solid #7c6cff;
  outline-offset: 1px;
}

/* -------------------------------------------------------------- the foot */

.tsite-menu-foot {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.tsite-menu-all {
  font: 600 12.5px/1.4 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: #a78bfa;
  text-decoration: none;
}

.tsite-menu-all:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- phone */

@media (max-width: 520px) {
  .tsite-menu-panel {
    width: min(330px, calc(100vw - 20px));
  }

  .tsite-menu-tagline {
    display: none;
  }
}
