/* The account in the bar, the same on the landing and in the hub: «Войти» for a visitor, a black square with the
   initials for someone who entered; it opens a panel with who they are, where they may go and «Выйти».
   And the right column of the footer: the places of the hub the person may open. */

.account { position: relative; flex: none; margin-left: 16px; }
.sections + .account, .variants + .account { margin-left: 16px; }

.account__in,
.account__menu > summary {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px;
  font: inherit; font-size: 15px; line-height: 1;
  color: var(--rm-black); background: var(--rm-white);
  border: 1px solid var(--rm-black); border-radius: 0;
  text-decoration: none; cursor: pointer;
  transition: background-color 140ms ease-out, color 140ms ease-out;
}
.account__in { padding: 0 16px; }
.account__in:hover { background: var(--rm-black); color: var(--rm-white); }

.account__menu > summary { width: 40px; list-style: none; background: var(--rm-black); color: var(--rm-white); letter-spacing: 0.02em; }
.account__menu > summary::-webkit-details-marker { display: none; }
.account__menu > summary:hover,
.account__menu[open] > summary { background: var(--rm-white); color: var(--rm-black); }
.account__in:focus-visible,
.account__menu > summary:focus-visible { outline: 2px solid var(--rm-black); outline-offset: 3px; }

.account__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  width: 280px; max-width: calc(100vw - 32px);
  background: var(--rm-white); border: 1px solid var(--rm-black);
  font-size: 15px; line-height: 1.35; color: var(--rm-black);
}
.account__who { padding: 16px 16px 14px; border-bottom: 1px solid var(--rm-grey-200); }
.account__name { display: block; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.account__email { display: block; margin-top: 2px; color: #4d4d4d; overflow-wrap: anywhere; }
.account__role { display: block; margin-top: 10px; font-size: 14px; color: #4d4d4d; }

.account__links { list-style: none; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--rm-grey-200); }
.account__links:empty { display: none; }
.account__links a,
.account__out button {
  display: flex; align-items: center; width: 100%;
  min-height: 40px; padding: 0 16px;
  font: inherit; color: var(--rm-black); text-align: left; text-decoration: none;
  background: none; border: 0; border-radius: 0; cursor: pointer;
}
.account__links a:hover,
.account__out button:hover { background: var(--rm-grey-100); }
.account__links a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--rm-red); }
.account__links a:focus-visible,
.account__out button:focus-visible { outline: 2px solid var(--rm-black); outline-offset: -2px; }
.account__out { margin: 0; padding: 6px 0; }

/* The footer: year | slogan | where to go. */
.foot__end { grid-column: 3; justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; }
.foot__end a { color: inherit; text-decoration-color: var(--rm-grey-300); text-underline-offset: 4px; }
.foot__end a:hover { color: var(--rm-red); text-decoration-color: currentColor; }

@media (max-width: 767px) {
  /* The bar wraps: the way home and the account on the first line, the sections under them. */
  .account { margin-left: auto; order: 1; }
  .bar > .sections { order: 2; }
  .account__in { height: 36px; padding: 0 12px; font-size: 14px; }
  .account__menu > summary { width: 36px; height: 36px; font-size: 14px; }
  .foot__end { grid-column: auto; justify-self: start; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .account__in, .account__menu > summary { transition: none; }
}
