@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap');

body.has-top-nav {
  padding-top: 3.35rem;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  padding: 10px 16px;
  padding-right: max(16px, calc(5.75rem + env(safe-area-inset-right, 0px)));
  background: rgba(0, 20, 40, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: 'Orbitron', sans-serif;
}

.top-nav__link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: clamp(0.75rem, 1.9vw, 0.95rem);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.top-nav__link:hover {
  color: #7fd4ff;
  background: rgba(255, 255, 255, 0.08);
}

.top-nav__link--current {
  color: #9ae5ff;
  font-weight: 600;
}

.top-nav__trigger.top-nav__link--current {
  color: #9ae5ff;
  font-weight: 600;
}

/* 下に不可視のホバー領域を広げ、ボタン→メニュー移動でホバーが切れないようにする */
.top-nav__dropdown {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: -14px;
}

.top-nav__trigger {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.75rem, 1.9vw, 0.95rem);
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.top-nav__trigger:hover {
  color: #7fd4ff;
  background: rgba(255, 255, 255, 0.08);
}

.top-nav__sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  min-width: 11rem;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  flex-direction: column;
  z-index: 110;
}

.top-nav__sub a {
  color: #003366;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 10px 16px;
  transition: background-color 0.2s, color 0.2s;
}

.top-nav__sub a:hover {
  background: rgba(0, 51, 102, 0.08);
  color: #006699;
}

.top-nav__sub a[aria-current="page"] {
  font-weight: 600;
  background: rgba(0, 51, 102, 0.12);
  color: #003366;
}

.top-nav__dropdown:hover .top-nav__sub,
.top-nav__dropdown:focus-within .top-nav__sub,
.top-nav__dropdown.is-open .top-nav__sub {
  display: flex;
}

/* リコーロゴ：メニュー帯の右端（リンクの中央寄せを崩さないよう絶対配置） */
.top-nav__rikoh-logo {
  position: absolute;
  right: max(10px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  height: clamp(26px, 5.5vmin, 40px);
  width: auto;
  max-width: min(104px, 24vw);
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

@media screen and (max-width: 768px) {
  .top-nav {
    gap: 0.25rem 0.6rem;
    padding: 8px 10px;
    padding-right: max(10px, calc(4.5rem + env(safe-area-inset-right, 0px)));
  }

  .top-nav__rikoh-logo {
    height: clamp(22px, 6vmin, 32px);
    max-width: min(88px, 28vw);
  }
}
