/* ヘッダー最上部のアフィリエイト帯。高さ固定で CLS を出さない。 */
.aff-ticker {
  --aff-h: 2.7rem;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  height: var(--aff-h);
  min-height: var(--aff-h);
  max-height: var(--aff-h);
  box-sizing: border-box;
  overflow: hidden;
  background: linear-gradient(90deg, #ffe6f1 0%, #fff7fb 45%, #f6ecff 100%);
  border-bottom: 2px solid #ffc2da;
  color: var(--color-pink-deep, #9d1454);
  font-family: inherit;
  line-height: 1;
}
.aff-ticker-pr {
  flex: none;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  padding: 0 0.45rem;
  background: linear-gradient(135deg, #c21a6b 0%, #9d1454 70%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 2px 0 8px rgba(157, 20, 84, 0.18);
}
.aff-ticker-hint {
  flex: none;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem 0 0.45rem;
  background: #fff0f6;
  color: #c21a6b;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-right: 1px solid #ffc2da;
}
.aff-ticker-viewport {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.aff-ticker-track {
  display: flex;
  align-items: stretch;
  height: 100%;
  width: max-content;
  will-change: transform;
  animation: aff-ticker-scroll var(--aff-duration, 45s) linear infinite;
}
.aff-ticker-set {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  flex: none;
  padding: 0 0.5rem;
}
.aff-ticker:hover .aff-ticker-track,
.aff-ticker:focus-within .aff-ticker-track,
.aff-ticker.is-paused .aff-ticker-track {
  animation-play-state: paused;
}
.aff-ticker-item {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
  text-decoration: none;
  color: #9d1454;
  font-size: 0.74rem;
  font-weight: 800;
  height: 1.95rem;
  max-height: calc(100% - 0.4rem);
  padding: 0 0.2rem 0 0.45rem;
  background: #fff;
  border: 1.5px solid #ff8ab8;
  border-radius: 999px;
  box-shadow: 0 1px 0 #ffc2da, 0 1px 4px rgba(157, 20, 84, 0.08);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 138, 184, 0.28);
}
.aff-ticker-item:hover,
.aff-ticker-item:focus-visible {
  color: #7c0f43;
  background: #ffe3ef;
  border-color: #c21a6b;
  text-decoration: none;
  box-shadow: 0 2px 0 #ff8ab8, 0 2px 8px rgba(157, 20, 84, 0.14);
}
.aff-ticker-item:focus-visible {
  outline: 2px solid #c21a6b;
  outline-offset: 1px;
}
.aff-ticker-item:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 #ff8ab8;
}
.aff-ticker-emo {
  flex: none;
  font-size: 0.86rem;
  line-height: 1;
}
.aff-ticker-name {
  flex: none;
}
.aff-ticker-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  margin-left: 0.08rem;
  padding: 0.18rem 0.42rem 0.18rem 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #c21a6b 0%, #9d1454 80%);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}
.aff-ticker-item:hover .aff-ticker-cta,
.aff-ticker-item:focus-visible .aff-ticker-cta {
  background: linear-gradient(135deg, #9d1454 0%, #7c0f43 80%);
}
@keyframes aff-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); } /* 同じセットを2つ並べる前提 */
}

@media (prefers-reduced-motion: reduce) {
  .aff-ticker-track,
  .aff-ticker.is-static .aff-ticker-track {
    animation: none;
    will-change: auto;
    transform: none;
  }
  .aff-ticker-viewport,
  .aff-ticker.is-static .aff-ticker-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
}

.site-header:has(.aff-ticker) {
  padding-top: 0;
}
.site-header:has(.aff-ticker) .wrap {
  padding-top: 0.6rem;
}
