/* Shared desktop page-index navigation for the top and child pages. */

.page-index {
  display: none;
}

@media (min-width: 768px) {
  .page-index {
    position: fixed;
    z-index: 21;
    top: 50%;
    right: calc(34px + var(--top-menu-scrollbar-compensation));
    display: block;
    width: 104px;
    min-width: 0;
    pointer-events: none;
    text-align: right;
    transform: translateY(-50%);
  }

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

  .page-index__list {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 0;
  }

  .page-index__list::before {
    position: absolute;
    z-index: 0;
    top: 15px;
    right: 21.5px;
    bottom: 15px;
    width: 1px;
    background: rgba(154, 155, 155, .42);
    content: '';
  }

  .page-index__list a {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 104px;
    min-height: 30px;
    margin-left: auto;
    padding: 3px 16px 3px 0;
    pointer-events: auto;
    color: rgba(47, 47, 47, .55);
    font-family: var(--top-ja);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: .02em;
    line-height: 1.4;
    text-align: right;
    text-decoration: none;
  }

  /* Keep the page-index interaction opaque and independent of global link hover opacity. */
  .page-index a,
  .page-index a:hover,
  .page-index a:focus-visible,
  .page-index a[aria-current="location"] {
    opacity: 1;
  }

  /* Labels are visual hints only: never let them intercept the page below. */
  .page-index__label {
    position: absolute;
    top: -2px;
    right: 46px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: none;
    width: max-content;
    max-width: 250px;
    height: 34px;
    margin: 0;
    overflow: hidden;
    color: transparent;
    opacity: 0;
    visibility: visible;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
    transform: none;
    transition: opacity .25s ease, color .25s ease;
  }

  .page-index__list a:hover .page-index__label,
  .page-index__list a:focus-visible .page-index__label {
    color: var(--top-ink);
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* The dot element itself masks the rail, so the rail can never show through it. */
  .page-index__dot {
    position: relative;
    z-index: 2;
    display: block;
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    margin-left: 0;
    border-radius: 50%;
    isolation: isolate;
  }

  .page-index__dot::after {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    box-sizing: border-box;
    border: 1px solid #c5c6c6;
    border-radius: 50%;
    background-color: #c5c6c6;
    content: '';
    opacity: 1;
    transform: translate(-50%, -50%);
    transition: width .25s ease, height .25s ease, background-color .25s ease, border-color .25s ease;
  }

  .page-index__list a[aria-current="location"] {
    color: var(--top-ink);
    font-weight: 600;
  }

  .page-index__list a[aria-current="location"] .page-index__dot::after {
    width: 11px;
    height: 11px;
    border-color: var(--top-ink);
    background-color: var(--top-ink);
  }

  .page-index__list a:not([aria-current="location"]):hover .page-index__dot::after,
  .page-index__list a:not([aria-current="location"]):focus-visible .page-index__dot::after {
    width: 9px;
    height: 9px;
    border-color: #555656;
    background-color: #555656;
  }

  .page-index__list a:focus-visible {
    outline: 1px solid rgba(47, 47, 47, .5);
    outline-offset: 5px;
  }
}

/* Keep carousel controls clear on iPad landscape and other narrow desktop layouts. */
@media (min-width: 768px) and (max-width: 1399px) {
  .page-index__label {
    display: none;
    pointer-events: none;
  }
}

@media (min-width: 768px) and (max-width: 1366px) {
  .page-index {
    display: none;
  }
}
