h1 {
  z-index: 3;
  position: absolute;
  font-size: 2em;
  color: rgba(255, 255, 255, 0.5);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

}

.visually-hidden {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
}


.ad-container {
  width: 90%;
  margin: auto;
  position: relative;
  /* top: var(--nav-top); */
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.ad-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.ad-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.ad-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* === 關鍵修正 === */
  display: block;
}

@media (max-width: 600px) {

  .ad-content {
    display: none;
  }
}

.ad-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  /* background: rgba(0, 0, 0, 0.6);  */
  color: white;
  padding: 20px;
}

.ad-content h3 {
  margin-bottom: 4vh;
  font-size: 1.2em;
}

.ad-content p {
  margin-bottom: 4vh;
  font-size: 1em;
}

.ad-content a {
  display: inline-block;
  padding: 8px 16px;
  background: #ff5722;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.3s;
}

.ad-content a:hover {
  background: #e64a19;
}

.ad-nav {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
}

.ad-nav-item {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  margin: 0 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.ad-nav-item.active {
  background: white;
}

.ad-prev,
.ad-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s;
}

.ad-prev:hover,
.ad-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

.ad-prev {
  left: 20px;
}

.ad-next {
  right: 20px;
}