/* asset/css/amane-hero.css — ヒーロー領域のブランド適用
   テンプレート: view/common/hero.phtml、JavaScript: asset/js/amane-hero-slides.js

   配色: 資料の画像がよく見えるよう、画像全体には薄いサンド色の膜だけをかける。
   見出し・文・ロゴの下にだけ、生成りのすりガラスの板を敷く。文字はヘッダーのロゴの文字と同じ緑
   （見出し #1d6d63、文は少し濃い #124a44）。
   板の濃さ（--amane-hero-panel-alpha）は、amane-hero-slides.js が板の下の画像の明るさから決める（.30〜.72）。
   既定の .72 は、下の画像が真っ黒でも見出し 3.27:1・文 5.35:1 になる濃さで、測れないとき・JavaScript が無いときに使う。
   読みやすさは、ぼかし（backdrop-filter）が効かなくても保てるよう、ぼかし無しで計算している。 */

.hero-section {
  --amane-deep-brown: #3a2f28;
}

/* ===== 背景のランダムな資料の画像 ===== */
.amane-hero-slides {
  overflow: hidden;
  background: linear-gradient(135deg, #efe9df 0%, #d9cfbf 100%); /* 画像を読み込むまで */
}
.amane-hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.amane-hero-slide.is-active {
  opacity: 1;
}
/* 画像全体にかける、薄いサンド色の膜（#efe9df α.20） */
.amane-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(239, 233, 223, .20);
}

/* ===== 見出し・文・ロゴの板（生成り #f7f4ee α.72 ＋ぼかし） ===== */
.amane-hero-panel {
  display: inline-block;
  max-width: 100%;
  padding: 2rem 2.5rem 1.75rem;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 1.25rem;
  --amane-hero-panel-alpha: .72;
  background: rgba(247, 244, 238, var(--amane-hero-panel-alpha));
  box-shadow: 0 .75rem 2rem rgba(58, 47, 40, .18);
  color: var(--amane-teal-dark, #1d6d63);
  transition: background-color 1.6s ease; /* 画像のフェードと同じ長さ */
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
}
.hero-section .amane-hero-panel h1,
.hero-section .amane-hero-panel .lead {
  text-shadow: none;
}
.hero-section .amane-hero-panel h1 {
  color: var(--amane-teal-dark, #1d6d63); /* ヘッダーのロゴの文字と同じ。大きな文字なので 3:1 以上 */
}
.hero-section .amane-hero-panel .lead {
  color: #124a44; /* 見出しより少し濃い緑。4.5:1 以上 */
}
.hero-section .amane-hero-panel h1 {
  margin-bottom: 1rem !important;
}

/* AMANE Archives のロゴ（「閲覧 Explore」のボタンの代わり。ボタンと同じくらいの大きさ） */
.amane-hero-logo img {
  display: block;
  width: auto;
  height: 112px;
  margin: 0 auto;
}

/* ===== 右下のキャプション（資料群名と資料名。資料のページへのリンク） =====
   地は生成り α.85（下が黒でも焦茶の文字との差 8.4:1） */
.amane-hero-caption {
  position: absolute;
  right: 1rem;
  bottom: calc(60px + .75rem);
  z-index: 2;
  display: block;
  max-width: min(28rem, calc(100% - 5.5rem));
  padding: .35rem .7rem .4rem;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: .5rem;
  background: rgba(247, 244, 238, .85);
  color: var(--amane-deep-brown);
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.amane-hero-caption-set,
.amane-hero-caption-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.amane-hero-caption-set[hidden] {
  display: none;
}
.amane-hero-caption-set {
  font-size: .72rem;
  color: #5c5047; /* 生成り α.85 の地（下が黒）でも 5.0:1 */
}
.amane-hero-caption-title {
  font-size: .85rem;
  font-weight: 700;
}
.amane-hero-caption:hover,
.amane-hero-caption:focus-visible {
  color: var(--amane-deep-brown);
}
.amane-hero-caption:hover .amane-hero-caption-title,
.amane-hero-caption:focus-visible .amane-hero-caption-title {
  text-decoration: underline;
}

/* ===== 左下の、自動の切り替えを止める・再開するボタン ===== */
.amane-hero-toggle {
  position: absolute;
  left: 1rem;
  bottom: calc(60px + .75rem);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(58, 47, 40, .35);
  border-radius: 50%;
  background: rgba(247, 244, 238, .85);
  color: var(--amane-deep-brown);
  font-size: 1.1rem;
}
.amane-hero-toggle:hover {
  background: rgba(247, 244, 238, .97);
}
.amane-hero-caption:focus-visible,
.amane-hero-toggle:focus-visible {
  outline: 3px solid var(--amane-teal-dark, #1d6d63);
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .amane-hero-panel {
    padding: 1.5rem 1.25rem 1.25rem;
  }
  .amane-hero-logo img {
    height: 88px;
  }
  .amane-hero-caption {
    right: .75rem;
    max-width: calc(100% - 4.5rem);
  }
  .amane-hero-toggle {
    left: .75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .amane-hero-slide,
  .amane-hero-panel {
    transition: none;
  }
}
