@charset "utf-8";
/* ==========================================================
   報恩寺 演出用CSS（motion.css）
   - 色や速さは下の変数でまとめて調整できます
   ========================================================== */

:root {
  --kj-ink: #2a2622;            /* 墨色 */
  --kj-line: #9a7b4f;           /* 見出しの線（金茶） */
  --kj-paper: #fbf9f3;          /* 本紙 */
  --kj-mount: #e9e1cc;          /* 表装（中廻し） */
  --kj-mount-edge: #d9ccad;     /* 一文字 */
  --kj-rod: #2b1d13;            /* 軸木 */
  --kj-rod-end: #b8975a;        /* 軸先 */
  --kj-glow: 255, 168, 82;      /* 灯明の色（RGB） */
}

/* ----------------------------------------------------------
   1. ヒーロー：ゆっくり寄る写真 + 灯明の揺らぎ + ロゴの墨入れ
   ---------------------------------------------------------- */
#FV .hero-slide .hero-slide-media {
  transform: scale(1.08);
  transition: transform 0s linear 1.6s; /* 消えた後に戻す */
}

#FV .hero-slide.is-active .hero-slide-media {
  transform: scale(1);
  transition: transform 8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#FV .hero-glow,
#FV .hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* 足元の灯りが、ゆらゆらと明滅する */
#FV .hero-glow {
  top: auto;
  height: 55%;
  background:
    radial-gradient(60% 70% at 30% 100%, rgba(var(--kj-glow), 0.32), rgba(var(--kj-glow), 0) 70%),
    radial-gradient(50% 60% at 78% 100%, rgba(var(--kj-glow), 0.26), rgba(var(--kj-glow), 0) 70%);
  mix-blend-mode: screen;
  animation: kj-flicker 5.5s ease-in-out infinite;
}

/* 四隅をわずかに沈めて、中央に視線を集める */
#FV .hero-vignette {
  background: radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.28) 100%);
}

@keyframes kj-flicker {
  0%   { opacity: 0.75; }
  12%  { opacity: 0.95; }
  20%  { opacity: 0.8; }
  38%  { opacity: 1; }
  47%  { opacity: 0.7; }
  60%  { opacity: 0.9; }
  72%  { opacity: 0.78; }
  86%  { opacity: 1; }
  100% { opacity: 0.75; }
}

/* 縦書きロゴ：上から下へ、墨がにじみながら書かれていく */
.top_header a#m_logo img {
  -webkit-mask-image: linear-gradient(to bottom, #000 42%, transparent 58%);
          mask-image: linear-gradient(to bottom, #000 42%, transparent 58%);
  -webkit-mask-size: 100% 240%;
          mask-size: 100% 240%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  animation: kj-ink 2.8s cubic-bezier(0.45, 0, 0.25, 1) 0.4s both;
}

@keyframes kj-ink {
  from {
    -webkit-mask-position: 0 100%;
            mask-position: 0 100%;
    filter: blur(5px);
    opacity: 0.4;
  }
  to {
    -webkit-mask-position: 0 0;
            mask-position: 0 0;
    filter: blur(0);
    opacity: 1;
  }
}

/* ----------------------------------------------------------
   2. 見出し：細い線が伸びて、文字が現れる（JSは TopMotion.tsx）
   ---------------------------------------------------------- */
.kj-heading {
  position: relative;
}

.kj-heading .kj-hline {
  position: absolute;
  display: block;
  width: 1px;
  background: var(--kj-line);
  transform-origin: top center;
  pointer-events: none;
}

/* 縦書き見出し：右側に縦線 */
.kj-heading.is-vertical .kj-hline {
  top: 0;
  right: -18px;
  height: 100%;
}

/* 横書き見出し：上から垂れる短い線 */
.kj-heading.is-horizontal .kj-hline {
  left: 50%;
  top: -56px;
  height: 40px;
}

/* ----------------------------------------------------------
   3. 霧の帯（#palalax / #palalax2）
   ---------------------------------------------------------- */
#palalax .menu-bg,
#palalax2 .menu-bg {
  overflow: hidden;
}

#palalax .menu-bg::before,
#palalax .menu-bg::after,
#palalax2 .menu-bg::before,
#palalax2 .menu-bg::after {
  content: "";
  position: absolute;
  inset: -20% -60%;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(30% 22% at 20% 60%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
    radial-gradient(26% 18% at 48% 40%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 70%),
    radial-gradient(34% 24% at 76% 70%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%);
  filter: blur(10px);
  will-change: transform;
}

#palalax .menu-bg::before,
#palalax2 .menu-bg::before {
  animation: kj-fog-a 46s linear infinite alternate;
}

#palalax .menu-bg::after,
#palalax2 .menu-bg::after {
  opacity: 0.7;
  transform: scaleX(-1);
  animation: kj-fog-b 62s linear infinite alternate;
}

#palalax .menu-bg .scrolldown1 {
  position: relative;
  z-index: 2;
}

@keyframes kj-fog-a {
  from { transform: translate3d(-12%, 0, 0); }
  to   { transform: translate3d(12%, -3%, 0); }
}

@keyframes kj-fog-b {
  from { transform: scaleX(-1) translate3d(-10%, 2%, 0); }
  to   { transform: scaleX(-1) translate3d(14%, -2%, 0); }
}

/* ----------------------------------------------------------
   4. 月例行事カード：ゆっくり寄る写真 + 炎色の灯り
   ---------------------------------------------------------- */
article#main .sec1_cont figure {
  position: relative;
}

article#main .sec1_cont figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(var(--kj-glow), 0.55), rgba(var(--kj-glow), 0) 60%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.9s ease;
}

article#main .sec1_cont figure img {
  transition: transform 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

article#main .sec1_cont:hover figure img {
  transform: translateZ(0) scale(1.08);
}

article#main .sec1_cont:hover figure::after {
  opacity: 1;
}

/* ----------------------------------------------------------
   5. 掛け軸スライダー（KakejikuSlider.tsx）
   掛け軸の高さは画像の比率に合わせて変わります。
   一番縦長の画像ぶんの高さを確保して、切り替え時に下のコンテンツが揺れないようにしています。
   ---------------------------------------------------------- */
.kakejiku-section {
    padding: 120px 20px 50px;
    overflow: hidden;
    background: #fffaee;
}

/* 左右の余白を均等にして、掛け軸を中央に吊るす */
.kj-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  column-gap: 56px;
}

.kj-scroll {
  /* 横幅は画面幅と、一番縦長の画像が画面の高さに収まる幅の小さいほう */
  --kj-w: min(560px, 80vw, calc((100svh - 260px) / var(--kj-max-ratio, 1.42) + 98px));
  --kj-pad-x: 98px;   /* 表装の左右余白 + 本紙の余白 */
  --kj-pad-y: 116px;  /* 表装の上下余白 + 本紙の余白 */
  grid-column: 2;
  position: relative;
  width: var(--kj-w);
  padding-top: 40px; /* 掛け紐のぶん */
  min-height: calc(68px + var(--kj-pad-y) + (var(--kj-w) - var(--kj-pad-x)) * var(--kj-max-ratio, 1.42));
}

/* 掛け紐（逆V字） */
.kj-cord {
  position: absolute;
  top: 0;
  left: 50%;
  width: 120px;
  height: 46px;
  transform: translateX(-50%);
  background:
    linear-gradient(to top left, transparent calc(50% - 0.6px), rgba(80, 60, 40, 0.55) 50%, transparent calc(50% + 0.6px)) left / 50% 100% no-repeat,
    linear-gradient(to top right, transparent calc(50% - 0.6px), rgba(80, 60, 40, 0.55) 50%, transparent calc(50% + 0.6px)) right / 50% 100% no-repeat;
}

/* 軸木 */
.kj-rod {
  position: relative;
  left: -22px;
  width: calc(100% + 44px);
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(to bottom, #4a3526 0%, var(--kj-rod) 45%, #3a2a1d 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  z-index: 3;
}

/* 軸先（両端の飾り） */
.kj-rod::before,
.kj-rod::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 12px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(to right, #8e6f3c, var(--kj-rod-end) 45%, #7a5d30);
}

.kj-rod::before { left: -10px; }
.kj-rod::after  { right: -10px; }

.kj-rod--top {
  height: 12px;
}

.kj-rod--top::before,
.kj-rod--top::after {
  display: none;
}

.kj-frame {
  position: relative;
  margin-bottom: 16px; /* 下の軸のぶん */
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.14));
  user-select: none;
}

.kj-frame .kj-rod--bottom {
  position: absolute;
  margin-top: -2px;
}

/* 表装（中廻し）と一文字の線 */
.kj-sheet {
  padding: 34px 30px 44px;
  background:
    linear-gradient(var(--kj-mount-edge), var(--kj-mount-edge)) top 22px left 0 / 100% 2px no-repeat,
    linear-gradient(var(--kj-mount-edge), var(--kj-mount-edge)) bottom 30px left 0 / 100% 2px no-repeat,
    linear-gradient(to bottom, #efe8d6, var(--kj-mount) 60%, #e3d9bf);
}

/* 本紙 */
.kj-image {
  display: block;
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(120, 95, 50, 0.22);
  background: var(--kj-paper);
  cursor: zoom-in;
  font: inherit;
  line-height: 0;
  overflow: hidden;
}

.kj-image img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.kj-image:focus-visible,
.kj-arrow:focus-visible,
.kj-dots button:focus-visible {
  outline: 2px solid var(--kj-line);
  outline-offset: 3px;
}

/* 右側：題箋と操作 */
.kj-side {
  grid-column: 3;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 110px;
}

.kj-caption {
  min-height: 380px;
}

.kj-caption-body {
  display: flex;
  writing-mode: vertical-rl;
  gap: 18px;
  color: var(--kj-ink);
}

.kj-number {
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--kj-line);
  border-right: 1px solid var(--kj-line);
  padding: 0.2em 10px 0 0;
  height: max-content;
}

article#main .kj-title,
.kj-title {
  font-size: 26px;
  letter-spacing: 0.25em;
  line-height: 1.4;
  margin: 0;
}

article#main .kj-sub,
.kj-sub {
  font-size: 14px;
  letter-spacing: 0.15em;
  line-height: 1.6;
  color: #6b6156;
  margin: 2.2em 0 0;
}

/* 操作 */
.kj-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
}

.kj-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(80, 60, 40, 0.35);
  border-radius: 50%;
  background: transparent;
  color: var(--kj-ink);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.kj-arrow:hover {
  background: var(--kj-ink);
  border-color: var(--kj-ink);
  color: #fff;
}

.kj-count {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: #6b6156;
  min-width: 4.5em;
  text-align: center;
}

.kj-dots {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.kj-dots li {
  margin: 0;
  padding: 0;
}

.kj-dots li::before {
  display: none;
}

.kj-dots button {
  display: block;
  width: 18px;
  height: 3px;
  padding: 0;
  border: 0;
  background: rgba(80, 60, 40, 0.2);
  cursor: pointer;
  transition: background 0.5s ease, width 0.5s ease;
}

.kj-dots button.is-active {
  width: 34px;
  background: var(--kj-line);
}

article#main .kj-hint,
.kj-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #8a8075;
  letter-spacing: 0.1em;
}

/* タブレット・スマホ：題箋と操作を掛け軸の下へ */
@media screen and (max-width: 960px) {
  .kj-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 28px;
  }

  .kj-scroll,
  .kj-side {
    grid-column: 1;
  }

  .kj-side {
    justify-self: center;
    padding-top: 0;
  }

  .kj-caption {
    min-height: 0;
    text-align: center;
  }

  .kj-caption-body {
    writing-mode: horizontal-tb;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .kj-number {
    border-right: 0;
    padding: 0;
  }

  article#main .kj-title,
  .kj-title {
    font-size: 22px;
  }

  article#main .kj-sub,
  .kj-sub {
    margin: 0;
    font-size: 13px;
  }

  .kj-controls {
    margin-top: 20px;
  }
}

@media screen and (max-width: 768px) {
  .kakejiku-section {
    padding: 70px 16px 60px;
  }

  .kj-scroll {
    --kj-w: min(420px, 80vw, calc((100svh - 200px) / var(--kj-max-ratio, 1.42) + 50px));
    --kj-pad-x: 50px;
    --kj-pad-y: 70px;
    padding-top: 30px;
    min-height: calc(58px + var(--kj-pad-y) + (var(--kj-w) - var(--kj-pad-x)) * var(--kj-max-ratio, 1.42));
  }

  .kj-cord {
    width: 90px;
    height: 34px;
  }

  .kj-sheet {
    padding: 22px 16px 30px;
    background:
      linear-gradient(var(--kj-mount-edge), var(--kj-mount-edge)) top 13px left 0 / 100% 2px no-repeat,
      linear-gradient(var(--kj-mount-edge), var(--kj-mount-edge)) bottom 18px left 0 / 100% 2px no-repeat,
      linear-gradient(to bottom, #efe8d6, var(--kj-mount) 60%, #e3d9bf);
  }

  .kj-image {
    padding: 8px;
  }

  .kj-rod {
    left: -14px;
    width: calc(100% + 28px);
  }

  .kj-heading.is-horizontal .kj-hline {
    top: -40px;
    height: 28px;
  }
}

/* ----------------------------------------------------------
   6. 月例行事 ご案内 ―「移ろう灯り」（MonthlyEvents.tsx）
   ---------------------------------------------------------- */
:root {
  --me-shu: #a8452a; /* 朱色：次の行事の印 */
}

/* 左の写真を sticky で固定するため、親の overflow: hidden を clip に
   （clip は見た目は同じで、sticky を邪魔しない） */
main {
  overflow: hidden;
  overflow: clip;
}

.monthly-events.me .sec1box_wrap {
  overflow: visible;
}

.me-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 6vw;
  align-items: start;
  margin-top: 70px;
}

/* --- 左：移ろう写真 --- */
.me-visual {
  position: sticky;
  top: 12vh;
  height: 76vh;
  min-height: 420px;
}

.me-visual-inner {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #1a1410;
}

.me-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.07);
  filter: blur(8px) brightness(0.9);
  transition:
    opacity 1.2s ease,
    filter 1.2s ease,
    transform 2.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.me-visual img.is-active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0) brightness(1);
}

.me-visual-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(20, 12, 6, 0.6), rgba(20, 12, 6, 0) 45%),
    linear-gradient(to left, rgba(20, 12, 6, 0.45), rgba(20, 12, 6, 0) 35%),
    radial-gradient(70% 45% at 40% 100%, rgba(var(--kj-glow), 0.28), rgba(var(--kj-glow), 0) 70%);
  animation: kj-flicker 6s ease-in-out infinite;
}

article#main .me-visual-days,
.me-visual-days {
  position: absolute;
  top: 34px;
  right: 30px;
  margin: 0;
  writing-mode: vertical-rl;
  color: #fff;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: 0.22em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.me-visual-cycle {
  display: block;
  font-size: 13px;
  letter-spacing: 0.3em;
  opacity: 0.85;
  margin-left: 0.8em;
}

article#main .me-visual-count,
.me-visual-count {
  position: absolute;
  left: 28px;
  bottom: 22px;
  margin: 0;
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.2em;
}

.me-visual-count span {
  opacity: 0.6;
  font-size: 12px;
}

/* --- 右：一覧 --- */
.me-next {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0 0 6vh;
  padding: 18px 22px;
  border: 1px solid rgba(168, 69, 42, 0.35);
  background: #fffaf3;
  text-align: left;
  font: inherit;
  color: var(--kj-ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.me-next:hover {
  background: #fff3e6;
  border-color: var(--me-shu);
}

.me-next-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--me-shu);
}

/* 灯のように、ゆっくり明滅する点 */
.me-next-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--me-shu);
  box-shadow: 0 0 0 0 rgba(168, 69, 42, 0.5);
  animation: me-pulse 2.4s ease-out infinite;
}

@keyframes me-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(168, 69, 42, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(168, 69, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(168, 69, 42, 0); }
}

.me-next-date {
  font-size: 19px;
  letter-spacing: 0.1em;
}

.me-next-title {
  font-size: 14px;
  line-height: 1.7;
  color: #5b534b;
}

article#main ol.me-list,
.me-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

article#main .me-list .me-item,
.me-item {
  position: relative;
  margin: 0;
  padding: 11vh 0;
  border-top: 1px solid rgba(80, 60, 40, 0.14);
  opacity: 0.32;
  transition: opacity 0.8s ease;
}

.me-list .me-item:first-child {
  border-top: 0;
  padding-top: 4vh;
}

.me-list .me-item::before {
  display: none;
}

.me-item.is-active {
    opacity: 1 !important;
}

.me-item-photo {
  display: none;
}

.me-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

article#main .me-item-days,
.me-item-days {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.16em;
  line-height: 1.5;
  color: var(--kj-ink);
}

.me-item-cycle {
  padding: 2px 9px;
  border: 1px solid var(--kj-line);
  color: var(--kj-line);
  font-size: 12px;
  letter-spacing: 0.15em;
  line-height: 1.6;
}

.me-item-badge {
  font-style: normal;
  padding: 3px 10px;
  background: var(--me-shu);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1.6;
}

/* 大きな通し番号（PCでは見出しの右に薄く） */
.me-item-no {
  position: absolute;
  top: 9vh;
  right: 0;
  font-size: 64px;
  line-height: 1;
  letter-spacing: 0.05em;
  color: rgba(154, 123, 79, 0.16);
  pointer-events: none;
  user-select: none;
}

.me-list .me-item:first-child .me-item-no {
  top: 2vh;
}

article#main .me-item-title,
.me-item-title {
  position: relative;
  margin: 16px 0 14px;
  padding-bottom: 14px;
  font-size: 25px;
  font-weight: normal;
  letter-spacing: 0.1em;
  line-height: 1.6;
  color: var(--kj-ink);
}

/* タイトル下の細い線：見出しが現れたあとに伸びる */
.me-item-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 1px;
  background: var(--kj-line);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1) 0.6s;
}

.me-item.is-seen .me-item-title::after {
  transform: scaleX(1);
}

article#main .me-item-desc,
.me-item-desc {
  max-width: 30em;
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 2.1;
  color: #4d463f;
}

.me-item-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--kj-ink);
  text-decoration: none;
}

.me-item-more::after {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.me-item-more:hover::after {
  width: 60px;
}

/* 見出しのフェード：日付 → 札 → タイトル → 説明 → リンク の順に、ぼかしからふわっと */
.me-fade {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition:
    opacity 1s ease,
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1s ease;
}

.me-item.is-seen .me-fade {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

.me-item.is-seen .me-item-days  { transition-delay: 0s; }
.me-item.is-seen .me-item-badge { transition-delay: 0.15s; }
.me-item.is-seen .me-item-title { transition-delay: 0.25s; }
.me-item.is-seen .me-item-desc  { transition-delay: 0.45s; }
.me-item.is-seen .me-item-more  { transition-delay: 0.6s; }

.me-all {
  margin-top: 4vh;
}
section.monthly-events.me h2 {
    text-align: center;
    font-size: 40px;
    margin: 0 0 80px;
}section.monthly-events.me h2 span {
       font-size: 18px;
    text-align: center;
    margin: 0 40px;
    letter-spacing: 0.1em;
}
/* セクション前後の余白 */
.monthly-events.me {
  padding: 60px 0 160px;
}

.monthly-events.me .sec1box_wrap {
  padding-top: 100px;
}

/* ==========================================================
   スマホ・タブレット：「灯りの札」
   写真を背景にした縦長の札。スクロールすると少しずつずれて重なっていく
   ========================================================== */
@media screen and (max-width: 960px) {
  .monthly-events.me {
    padding: 30px 0 100px;
  }

  .monthly-events.me .sec1box_wrap {
    padding-top: 70px;
  }

  .me-body {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .me-visual {
    display: none;
  }

  .me-next {
    margin-bottom: 22px;
  }

  /* 札 */
  article#main .me-list .me-item,
  .me-item {
    position: sticky;
    top: calc(112px + var(--i, 0) * 6px); /* 目次ボタンの下で止まり、重なった札の縁が少しずつ見える */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: min(68svh, 580px);
    height: var(--me-card-h, auto); /* 全部の札を同じ高さに（MonthlyEvents.tsx で計算） */
    margin: 0 0 36svh; /* 札が止まってから次の札が重なるまでの“間”。大きいほど長く読める */
    padding: 0;
    border: 0;
    border-radius: 4px;
    overflow: hidden;
    opacity: 1;
    background: #1a1410;
    color: #fff;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.18);
    isolation: isolate; /* 写真を札の中だけで一番下に敷く */
  }

  .me-list .me-item:first-child {
    padding-top: 0;
  }

  .me-list .me-item:last-child {
    margin-bottom: 0;
  }

  /* 背景の写真：札が中央に来ると、ゆっくり寄りながら明るくなる */
  .me-item-photo {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: block;
    margin: 0;
    line-height: 0;
  }

  .me-item-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.12);
    filter: brightness(0.55);
    transition:
      transform 2.4s cubic-bezier(0.22, 1, 0.36, 1),
      filter 1.2s ease;
  }

  .me-item.is-active .me-item-photo img {
    transform: scale(1);
    filter: brightness(0.75);
  }

  /* 文字を読みやすくする影と、灯明の光 */
  .me-item-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to top, rgba(16, 10, 5, 0.92) 0%, rgba(16, 10, 5, 0.55) 45%, rgba(16, 10, 5, 0) 75%),
      linear-gradient(to right, rgba(16, 10, 5, 0.5), rgba(16, 10, 5, 0) 40%),
      radial-gradient(80% 40% at 30% 100%, rgba(var(--kj-glow), 0.3), rgba(var(--kj-glow), 0) 70%);
  }

  /* 日付（上）とタイトル・説明（下）を縦に並べる。日付が長くても重ならない */
  .me-item-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px 22px 28px;
  }

  /* 日付は右上に白の縦書きで大きく */
  .me-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: auto; /* 下の文章との間をあけ、文章を札の下側に寄せる */
    padding-bottom: 28px;
  }

  article#main .me-item-days,
  .me-item-days {
    display: block;
    writing-mode: vertical-rl; /* 左上に縦書き（右上は「目次」ボタンと重なるため） */
    font-size: 26px;
    line-height: 1.3;
    letter-spacing: 0.2em;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  }

  .me-item-cycle {
    display: block;
    margin-left: 0.7em;
    padding: 0;
    border: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    letter-spacing: 0.3em;
  }

  .me-item-badge {
    margin-top: 94px; /* 「目次」ボタンの下 */
    writing-mode: vertical-rl; /* 縦長の短冊 */
    padding: 10px 4px;
    letter-spacing: 0.15em;
    pointer-events: auto;
  }

  .me-item-no {
    position: static;
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.6);
  }

  .me-list .me-item:first-child .me-item-no {
    top: auto;
  }

  article#main .me-item-title,
  .me-item-title {
    margin: 0 0 12px;
    padding-bottom: 12px;
    font-size: 21px;
    color: #fff;
  }

  .me-item-title::after {
    background: rgba(255, 255, 255, 0.6);
  }

  article#main .me-item-desc,
  .me-item-desc {
    margin-bottom: 18px;
    font-size: 13.5px;
    line-height: 1.95;
    color: rgba(255, 255, 255, 0.85);
  }

  .me-item-more {
    color: #fff;
  }

  .me-all {
    margin-top: 40px;
  }
}

/* ----------------------------------------------------------
   7. ページ遷移
   ---------------------------------------------------------- */
/* Swup のような、やわらかいページ切り替え（NavigationHelper.tsx）
   本文だけを消して、次のページをゆっくり表示する。ヘッダー・目次ボタンなどはそのまま */
#page-transition {
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1); /* 現れる速さ（最初にすっと、最後はゆっくり） */
}

html.is-leaving #page-transition {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1); /* 消える速さ */
  pointer-events: none;
}

/* 次のページに差し替えた瞬間（いったん透明にしてから表示を始める） */
html.is-swap #page-transition {
  opacity: 0;
  transition: none;
}

/* 読み込みに時間がかかったときだけ出る、画面上端の細い読み込みバー */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 100%;
  height: 2px;
  background: var(--kj-line);
  transform-origin: left center;
  transform: scaleX(1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 0.15s;
}

.route-progress.is-loading {
  opacity: 0.7;
  transition: opacity 0.4s ease 0.8s; /* すぐ切り替わるときは出さない */
  animation: kj-route 6s cubic-bezier(0.1, 0.7, 0.2, 1) 0.8s both;
}

@keyframes kj-route {
  from { transform: scaleX(0); }
  to   { transform: scaleX(0.9); }
}

/* ----------------------------------------------------------
   8. Lenis（慣性スクロール / SmoothScroll.tsx）
   ---------------------------------------------------------- */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* ----------------------------------------------------------
   動きを減らす設定の方には、演出を止める
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #FV .hero-slide .hero-slide-media,
  #FV .hero-slide.is-active .hero-slide-media {
    transform: none;
    transition: none;
  }

  #FV .hero-glow,
  #palalax .menu-bg::before,
  #palalax .menu-bg::after,
  #palalax2 .menu-bg::before,
  #palalax2 .menu-bg::after {
    animation: none;
  }

  .top_header a#m_logo img {
    animation: none;
    -webkit-mask-image: none;
            mask-image: none;
  }

  .kj-heading .kj-hline {
    display: none;
  }

  article#main .sec1_cont figure img {
    transition: none;
  }

  .me-visual img,
  .me-item {
    transition: none;
  }

  .me-visual-glow,
  .me-next-label::before {
    animation: none;
  }

  .me-fade {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .route-progress.is-loading {
    animation: none;
    transform: scaleX(0.6);
  }

  #page-transition,
  html.is-leaving #page-transition,
  html.is-swap #page-transition {
    transition: none;
  }
}
