/* === Sticky ヘッダー（タイトル + タブを一体化） === */

/* ::before の -100vw 拡張による水平オーバーフローを防止 */
/* overflow: clip は scroll container を生成しないため sticky を壊さない */
#math, #english {
  overflow-x: clip;
}

.sticky-header {
  position: sticky;
  top: -1px; /* stuck検知用: 1px はみ出しで intersectionRatio < 1 */
  z-index: 40;
  padding: 17px 0 14px;
}

/* 背景: ::before 疑似要素でフルwidth */
.sticky-header::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -100vw;
  right: -100vw;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
  background-position: 0 0;
  background-size: cover;
  background-attachment: fixed;
  background-image: url('../images/bg_transparent.webp');
}

#math .sticky-header::before { background-color: #e3e9f9; }
#english .sticky-header::before { background-color: #fceaef; }

.sticky-header.is-stuck::before { opacity: 1; }

/* sticky-header 内の要素調整 */
.sticky-header .section_title {
  margin: 0;
}

.sticky-header .yeartab__wrapper__inner {
  width: fit-content;
  margin: 8px auto 0;
}

/* --- タブ切替フェードアニメーション --- */
.w-tab-content {
  transition: opacity 0.18s ease;
}
