/*
 * notice.css
 * 重要なお知らせ帯（全ページ共通・画面最上部）
 */

/* お知らせ帯が表示されているときだけ、その高さ分の値を確保する */
/* ※ 404 のようにヘッダーが body 外にあるテンプレートでも効くよう html スコープで定義 */
html:has(.notice) {
  --notice-height: 44px;
}
@media screen and (max-width: 768px) {
  html:has(.notice) {
    --notice-height: 40px;
  }
}

/* お知らせ帯本体：横100%、背景#9F2934、白文字の固定帯 */
.notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000; /* 固定ヘッダー(z-index:1000)より前面に表示 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--notice-height, 44px);
  padding: 0 20px;
  background-color: #ae1730;
  color: #fff;
  text-align: center;
}
.s .notice {
  padding: 0 16px;
}

/* リンクの帯のホバー（共通の opacity:0.5 は薄すぎるため上書き） */
a.notice:hover {
  opacity: 0.85;
}

.notice-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.s .notice-text {
  font-size: 14px;
}

/* 固定ヘッダーをお知らせ帯の下へ配置（帯が無い場合は 0 のまま） */
header.header {
  top: var(--notice-height, 0px);
}
