.nav {
  background-color: #2a2a2a;
  width: 100%;
  position: fixed;
  z-index: 1001;
  height: 45px;
}

.nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.nav ul li {
  margin-left: 4px;
  margin-right: 4px;
  height: 100%;
}

.nav ul li.right {
  margin-left: auto;
}

.nav a,
.nav a:visited {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  text-decoration: none;
  color: #fff;
  font-size: 20px;
  box-sizing: border-box;
  transition-duration: 0.35s;
  -webkit-text-size-adjust: 100%; /* iOS Safari対策 */
}

.nav a:hover {
  color: #f0ffff;
  background-color: #3a3a3a;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 44px;
  padding: 0 10px;
  border: none;
  background: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition-duration: 0.35s;
}

.theme-toggle:hover {
  color: #f0ffff;
  background-color: #3a3a3a;
}

.theme-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
}

/* ライト時は月（=ダークへ切替）、ダーク時は太陽を見せる */
.theme-icon-light {
  display: none;
}

:root[data-theme="dark"] .theme-icon-light {
  display: inline-block;
}

:root[data-theme="dark"] .theme-icon-dark {
  display: none;
}

:root[data-theme="dark"] .nav {
  box-shadow: 0px 4px 10px #000;
}

.nav img {
  display: block;
  max-height: 30px;
  max-width: 30px;
  margin-right: 10px;
}

@media screen and (max-width: 640px) {
  .nav a {
    font-size: 16px;
    line-height: 24px;
  }
}
