/* ============================================================
   effects.css — 演出アニメーション(全ページ共通)
   ・スクロール連動の画像リビール(JS: assets/js/scroll-reveal.js)
   ・初回訪問時のオープニングロード演出(JS: assets/js/intro.js)

   html.has-reveal-js / html.eisho-intro は、header.php内の
   同期スクリプトが CSS ペイント前に付与するフラグクラスです。
   (IntersectionObserver 非対応・prefers-reduced-motion: reduce・
   セッション内2回目以降のアクセスでは付与されず、その場合は
   このファイルのルールは一切効かず通常表示のままになります)
   ============================================================ */

/* ============ スクロール画像リビール ============ */
html.has-reveal-js .img-ph > img,
html.has-reveal-js .single-news-body img {
  clip-path: inset(0 100% 0 0);
  transform: scale(1.045);
  transition:
    clip-path 1.15s cubic-bezier(.76,0,.24,1),
    transform 1.45s cubic-bezier(.2,.7,.3,1);
}
html.has-reveal-js .img-ph > img.is-revealed,
html.has-reveal-js .single-news-body img.is-revealed {
  clip-path: inset(0);
  transform: scale(1);
}
/* ファーストビュー(トップのメインビジュアル)は対象外 */
html.has-reveal-js .hero-img img {
  clip-path: none;
  transform: none;
  transition: none;
}

.img-reveal-wrap { position: relative; display: block; overflow: hidden; }
.img-reveal-cover {
  position: absolute; inset: 0; z-index: 2;
  background: var(--sumi);
  pointer-events: none;
  transition: transform 1s cubic-bezier(.76,0,.24,1);
  transition-delay: .12s;
}
.img-reveal-cover.is-revealed { transform: translateX(101%); }

/* ============ オープニングロード演出 ============ */
.intro-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  align-items: center; justify-content: center;
  background: var(--paper);
}
html.eisho-intro body { overflow: hidden; }
html.eisho-intro .intro-overlay {
  display: flex;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s cubic-bezier(.76,0,.24,1);
}
html.eisho-intro.eisho-intro-exit body { overflow: auto; }
html.eisho-intro.eisho-intro-exit .intro-overlay {
  clip-path: inset(0 0 100% 0);
}

.intro-overlay-text { text-align: center; opacity: 0; transform: translateY(16px); }
html.eisho-intro .intro-overlay-text {
  animation: eishoIntroTextIn .7s cubic-bezier(.2,.7,.3,1) .2s forwards;
}
html.eisho-intro.eisho-intro-exit .intro-overlay-text {
  animation: eishoIntroTextOut .3s ease forwards;
}
@keyframes eishoIntroTextIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes eishoIntroTextOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.intro-overlay-brand {
  display: block;
  font-family: "Shippori Mincho", serif;
  font-size: 26px; font-weight: 600; letter-spacing: .3em;
  color: var(--sumi);
}
.intro-overlay-text small {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: .4em;
  color: var(--copper); margin-top: 14px;
}

html.eisho-intro .site-content {
  transform: translateY(46px);
  transition: transform 1s cubic-bezier(.76,0,.24,1);
}
html.eisho-intro.eisho-intro-exit .site-content {
  transform: translateY(0);
}

/* ============ 動きを抑える設定への配慮 ============ */
@media (prefers-reduced-motion: reduce) {
  html.has-reveal-js .img-ph > img,
  html.has-reveal-js .single-news-body img {
    clip-path: none; transform: none; transition: none;
  }
  .img-reveal-cover { display: none; }
  html.eisho-intro .intro-overlay {
    display: none !important;
  }
  html.eisho-intro .site-content {
    transform: none !important;
    transition: none !important;
  }
  html.eisho-intro .intro-overlay-text {
    animation: none !important;
  }
  html.eisho-intro body { overflow: auto; }
}
