/* 基本設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #ffffff;
  color: #0f1419;
  overflow-x: hidden;
}

/* ヒーローエリア */
.hero {
  height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: #f7f9fa;
  border-bottom: 1px solid #eff3f4;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.8rem; color: #1d9bf0; font-weight: 800; }
.hero p { color: #536471; }
.arrow { margin-top: 1rem; font-size: 1.5rem; color: #1d9bf0; animation: bounce 2s infinite; }
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ネットミームとは？セクション */
.about-section { max-width: 800px; margin: 4rem auto 0 auto; padding: 0 2rem; }
.about-card { background: #ffffff; padding: 2.5rem; border-radius: 16px; border: 1px solid #eff3f4; box-shadow: 0 12px 32px rgba(0,0,0,0.05); }
.badge { display: inline-block; background-color: #e8f5fe; color: #1d9bf0; font-size: 0.85rem; font-weight: bold; padding: 0.2rem 0.8rem; border-radius: 9999px; margin-bottom: 1rem; }
.about-card h2 { font-size: 1.5rem; margin-bottom: 1rem; font-weight: 800; }
.about-card p { color: #536471; line-height: 1.8; }

/* ==========================================
   💡 新・タイムラインレイアウト（横幅広々仕様）
   ========================================== */
.timeline-container {
  position: relative;
  max-width: 1100px; /* 全体の幅を少し広げてゆったりに */
  margin: 0 auto;
  padding: 6rem 2rem;
}

/* 中央の縦線 */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #cfd9de;
  transform: translateX(-40%);
}
.timeline-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 40%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #1d9bf0;
}

/* 1つの出来事の行（横並びにするための2部構成） */
.timeline-row {
  display: display; /* Weasyprint互換のためのブロック表示ベース */
  width: 100%;
  margin-bottom: 7rem;
  position: relative;
}

/* メディア（年数＋画像）と 吹き出しの共通幅設定（50%ずつに分ける） */
.timeline-media, .timeline-bubble {
  width: 46%; /* 中央の線と被らないように少し余白をあける */
  display: block;
}

/* --- パターンA: 左に画像 ➔ 右に大きな吹き出し --- */
.timeline-row.left-media .timeline-media {
  float: left;
  text-align: right; /* 画像や年数を右（中央線）に寄せる */
}
.timeline-row.left-media .timeline-bubble {
  float: right;
}

/* --- パターンB: 右に画像 ➔ 左に大きな吹き出し --- */
.timeline-row.right-media .timeline-media {
  float: right;
  text-align: left; /* 画像や年数を左（中央線）に寄せる */
}
.timeline-row.right-media .timeline-bubble {
  float: left;
}

/* floatの解除（レイアウト崩れ防止） */
.timeline-row::after {
  content: "";
  display: table;
  clear: both;
}

/* 年数ラベル */
.time-label {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1d9bf0;
  margin-bottom: 0.8rem;
}

/* 画像 */
.meme-image img {
  width: 100%;
  max-width: 450px; /* 画像が大きくなりすぎないようにストッパー */
  display: inline-block;
  border-radius: 16px;
  border: 1px solid #eff3f4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 💬 概要が詳しく書ける！巨大な吹き出し（Twitter風） */
.timeline-bubble {
  background: #ffffff;
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid #cfd9de;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 12px 32px rgba(0,0,0,0.05);
  position: relative;
  text-align: left;
}

.timeline-bubble h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f1419;
  margin-bottom: 0.8rem;
}

.timeline-bubble p {
  font-size: 0.95rem;
  color: #536471;
  line-height: 1.7;
  margin-bottom: 0.8rem;
}
.timeline-bubble p:last-child { margin-bottom: 0; }

/* 吹き出しをホバーした時のTwitter風エフェクト */
.timeline-bubble:hover {
  background-color: #f7f9fa;
}

/* ==========================================
   吹き出しの「しっぽ」の設定（中央線に向かって伸びる）
   ========================================== */

/* 左画像・右吹き出し（しっぽは左に付く） */
.timeline-row.left-media .timeline-bubble::before,
.timeline-row.left-media .timeline-bubble::after {
  content: ''; position: absolute; top: 30px; border-style: solid;
}
.timeline-row.left-media .timeline-bubble::before {
  left: -10px; border-width: 10px 10px 10px 0; border-color: transparent #cfd9de transparent transparent; z-index: 1;
}
.timeline-row.left-media .timeline-bubble::after {
  left: -8px; border-width: 9px 9px 9px 0; border-color: transparent #ffffff transparent transparent; z-index: 2;
}
.timeline-row.left-media .timeline-bubble:hover::after { border-right-color: #f7f9fa; }

/* 右画像・左吹き出し（しっぽは右に付く） */
.timeline-row.right-media .timeline-bubble::before,
.timeline-row.right-media .timeline-bubble::after {
  content: ''; position: absolute; top: 30px; border-style: solid;
}
.timeline-row.right-media .timeline-bubble::before {
  right: -10px; border-width: 10px 0 10px 10px; border-color: transparent transparent transparent #cfd9de; z-index: 1;
}
.timeline-row.right-media .timeline-bubble::after {
  right: -8px; border-width: 9px 0 9px 9px; border-color: transparent transparent transparent #ffffff; z-index: 2;
}
.timeline-row.right-media .timeline-bubble:hover::after { border-left-color: #f7f9fa; }


/* ==========================================
   ★スクロール連動アニメーションの設定
   ========================================== */
.timeline-row {
  view-timeline-name: --row-fade;
  view-timeline-axis: block;
  animation-timeline: --row-fade;
  animation-range: entry 5% cover 30%;
  animation-fill-mode: both;
}

/* 左に画像がある行は、左からスライドイン */
.timeline-row.left-media { animation-name: fadeInLeft; }
/* 右に画像がある行は、右からスライドイン */
.timeline-row.right-media { animation-name: fadeInRight; }

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================
   スマホ対応（縦並びにして1列にスッキリまとめる）
   ========================================== */
@media (max-width: 900px) {
  .timeline-line { left: 20px; }
  .timeline-media, .timeline-bubble { width: 100% !important; float: none !important; text-align: left !important; }
  .timeline-row { padding-left: 45px; margin-bottom: 4rem; }
  .timeline-bubble { margin-top: 1.5rem; }
  /* スマホのしっぽはすべて左側に統一 */
  .timeline-row.right-media .timeline-bubble::before { left: -10px; right: auto; border-width: 10px 10px 10px 0; border-color: transparent #cfd9de transparent transparent; }
  .timeline-row.right-media .timeline-bubble::after { left: -8px; right: auto; border-width: 9px 9px 9px 0; border-color: transparent #ffffff transparent transparent; }
  .timeline-row.right-media .timeline-bubble:hover::after { border-left-color: transparent; border-right-color: #f7f9fa; }
  .timeline-row.right-media { animation-name: fadeInLeft; }
}

/* 別ページへのナビゲーション（ここもそのまま残せます） */
.nav-section { max-width: 1000px; margin: 4rem auto 6rem auto; padding: 0 2rem; }
.nav-container { background: #ffffff; padding: 2rem; border-radius: 16px; border: 1px solid #eff3f4; box-shadow: 0 12px 32px rgba(0,0,0,0.05); }
.nav-container h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 1.5rem; }
.nav-buttons { display: flex; gap: 1.5rem; }
.nav-btn { flex: 1; display: flex; align-items: center; gap: 1rem; padding: 1.2rem; background-color: #ffffff; border: 1px solid #cfd9de; border-radius: 12px; text-decoration: none; color: #0f1419; transition: all 0.2s ease; }
.nav-btn:hover { background-color: #f7f9fa; border-color: #1d9bf0; transform: translateY(-2px); }
.btn-icon { font-size: 1.8rem; }
.btn-text { display: flex; flex-direction: column; flex: 1; }
.btn-title { font-size: 1.1rem; font-weight: 700; }
.btn-sub { font-size: 0.85rem; color: #536471; margin-top: 0.2rem; }
.btn-arrow { font-size: 1.2rem; color: #1d9bf0; font-weight: bold; transition: transform 0.2s; }
.nav-btn:hover .btn-arrow { transform: translateX(4px); }
@media (max-width: 768px) { .nav-buttons { flex-direction: column; gap: 1rem; } }
footer { text-align: center; padding: 3rem; color: #536471; font-size: 0.9rem; border-top: 1px solid #eff3f4; background-color: #f7f9fa; }