/* Noto Serif JPのインポート */
@import url('https://fonts.googleapis.com/css2?family=Kiwi+Maru&family=Noto+Sans+JP:wght@100..900&display=swap');

/* 全体設定 */
body {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), url(/image.jsp?id=672615);
    background-size: cover;
    background-position: center;
    overflow-y: scroll;
    overflow-x: hidden;
    font-family: "Noto Sans JP", sans-serif;
}

header a{
    display: grid;
    grid-template-columns: 1fr;
    justify-content: center;
    padding: 1rem 0;
}

header a img {
    max-width: 200px;
    margin-inline: auto;
}

section {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 0 1rem;
}

section h2, section p {
    text-align: center;
}

/* ===================================================
   1. コンテナ設定（上下の行間を56pxに拡大）
=================================================== */
.sticky-container {
  display: flex;
  flex-wrap: wrap;
  row-gap: 56px;   /* 上下の行間をゆったり確保 */
  column-gap: 28px; /* 左右の間隔 */
  justify-content: center;
  align-items: flex-start;
  padding: 80px 24px;
  overflow: hidden;
}

/* ===================================================
   2. マスキングテープのアニメーション
=================================================== */
@keyframes tapeStick {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-22px) rotate(4deg);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.22);
  }
  65% {
    opacity: 1;
    transform: translateX(-50%) translateY(2px) rotate(-1deg);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(-1deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
}

/* ===================================================
   3. 付箋のベーススタイル（初期待機状態）
=================================================== */
.sticky-note {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 280px;
  min-height: 230px;
  height: auto;
  padding: 38px 20px 18px;
  box-sizing: border-box;
  background-color: #fff8b3;
  color: #333;
  line-height: 1.7;
  word-break: break-word;

  /* 周囲の行に干渉させないレイアウト分離（震え防止） */
  contain: layout style;

  /* 文字ボケ防止 */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity, box-shadow;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* 初期状態（スケール拡大をやめて位置ズレによるリフローを防止） */
  opacity: 0;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
  transform: translateZ(0) translateY(15px) rotate(0deg); /* ズレを小さくする */

  /* トランジション設定 */
  transition: 
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================================================
   4. 画面内に入って貼り付いた状態（.is-stuck）
=================================================== */
.sticky-note.is-stuck {
  opacity: 1;
  box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.12);
  transform: translateZ(0) translateY(0) rotate(-1.5deg);
  transition-duration: 0.85s;
}

/* 偶数番目（右傾き） */
.sticky-note.is-stuck:nth-child(even) {
  transform: translateZ(0) translateY(0) rotate(1.8deg);
}

/* 3の倍数番目（浅い傾き） */
.sticky-note.is-stuck:nth-child(3n) {
  transform: translateZ(0) translateY(0) rotate(-0.8deg);
}

/* ===================================================
   5. マスキングテープ（時間差アニメーション）
=================================================== */
.tape-top::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 90px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.72);
  border-left: 2px dotted rgba(0, 0, 0, 0.12);
  border-right: 2px dotted rgba(0, 0, 0, 0.12);
  pointer-events: none;
  transform-origin: center top;
  opacity: 0;
}

.sticky-note.is-stuck.tape-top::before {
  animation: tapeStick 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s forwards;
}

/* ===================================================
   6. ホバー演出（垂直浮上のみ・他行への影響なし）
=================================================== */
.sticky-note.is-stuck:hover {
  transform: translateZ(0) translateY(-8px) rotate(0deg);
  box-shadow: 4px 16px 26px rgba(0, 0, 0, 0.18);
  transition-duration: 0.25s;
  z-index: 20;
}

/* ===================================================
   7. バリエーションカラー
=================================================== */
.sticky-yellow { background-color: #fff8b3; }
.sticky-blue   { background-color: #d8f3fc; }
.sticky-pink   { background-color: #ffe0e9; }
.sticky-green  { background-color: #d8f8d8; } /* 必要に応じて追加可能 */
.sticky-orange { background-color: #ffe5cc; } /* 必要に応じて追加可能 */

/* ===================================================
   8. テキスト装飾
=================================================== */
.voice-text {
  margin: 0 0 18px;
  font-family: "Kiwi Maru", serif;
  flex-grow: 1;
  text-align: left;
}

.voice-user {
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.15);
  text-align: right;
  font-size: 12px;
  font-weight: bold;
  color: #666;
}

/* 最初は13件目以降を隠すクラス */
.sticky-note.is-hidden {
  display: none !important;
}

/* 「もっと見る」ボタンエリア */
.sticky-more-area {
  text-align: center;
  padding: 20px 20px 80px;
}

/* ボタンのデザイン（押しやすい丸みと影） */
.sticky-more-btn {
  display: inline-block;
  padding: 14px 40px;
  font-size: 15px;
  font-weight: bold;
  font-family: inherit;
  color: #444;
  background-color: #fff;
  border: 2px solid #e0dfd5;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.25s ease;
}

.sticky-more-btn:hover {
  background-color: #fff8b3; /* 付箋カラーに変化 */
  border-color: #eedd82;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}
