
:root {
  --text: #000;
  --sub: #737373;
  --line: #dbdbdb;
  --bg: #fff;
  --blue: #0095f6;
  --light-bg: #fafafa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial;
  background:#ffffff; /* ページ全体の背景を白に */
  color: #000000; /* 文字色も黒で見やすく */
}


/* ---------- Layout ---------- */
.container {
  max-width: 935px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* ---------- Top Bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 20px;
}
.topbar svg { fill: var(--text); }

/* ---------- Profile Section ---------- */
.profile {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 40px 0 24px;
}
.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: url('../images/700aikon.jpg') center/cover no-repeat;
}
.info { flex: 1; }
.username {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.username h2 {
  font-size: 28px;
  font-weight: 400;
}
.btns { display: flex; gap: 8px; }
.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 16px;
  font-weight: 600;
  font-size: 14px;
  background: var(--light-bg);
  cursor: pointer;
}
.btn.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.stats {
  display: flex;
  gap: 40px;
  margin-bottom: 16px;
}
.stat .num { font-weight: 700; }
.bio {
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Highlights ---------- */
.highlights {
  display: flex;
  gap: 22px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.story {
  text-align: center;
  cursor: pointer;
}
.story img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
}
.story .cap {
  font-size: 13px;
  color: var(--sub);
  margin-top: 6px;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-top: 20px;
}
.post {
  position: relative;
  aspect-ratio: 3/ 4;
  cursor: pointer;
}
.post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay p {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.post:hover .overlay { opacity: 1; }

/* ---------- Story Modal ---------- */
#highlightModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#highlightModal.active { display: flex; }

.story-viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-viewer img {
  width: auto;
  height: 80vh;
  border-radius: 16px;
  object-fit: cover;
}
.progress-container {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar div {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width linear;
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: #fff;
  cursor: pointer;
  opacity: 0.6;
}
.arrow.left { left: 30px; }
.arrow.right { right: 30px; }
.arrow:hover { opacity: 1; }

/* ---------- Post Modal ---------- */
#postModal {
  position: fixed;
  inset: 0;
  background: #fff;
  display: none;
  z-index: 1500;
}
#postModal.active { display: block; }
.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 24px;
  font-weight: 600;
  border: none;
  background: none;
  color: #111;
  cursor: pointer;
  z-index: 1600;
}
.post-scroll {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}
.post-page {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.image-container {
  position: relative;
  width: 60%;
  max-width: 700px;
  height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-container img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s ease;
}
.image-container img.active { opacity: 1; }
.arrow.white {
  color: #111;
  opacity: 0.3;
}
.arrow.white:hover { opacity: 1; }
.caption {
  width: 60%;
  max-width: 700px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.6;
  color: var(--sub);
  text-align: left;
}
/* 9:16フレーム（画像をこの中で重ねる） */
.story-viewer{
  position: relative;
  width: auto;
  height: 80vh;
  aspect-ratio: 9/16;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,.4);
  background: #000;
}

/* A/B 2レイヤーを重ね、.active だけ見せる */
.story-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;                 /* ← デフォルトは非表示 */
  transition: opacity .35s ease;
}
.story-img.active{
  opacity: 1;                 /* ← 表示するのは .active だけ */
}

/* 既存の .story-viewer img という汎用指定があれば無効化（削除 or 上記で上書き） */
/* メインコンテナ（プロフィール〜グリッド） */
main {
  background: #ffffff;
}

/* 投稿グリッドやプロフィールカードが半透明やグレーだった場合 */
.profile, .grid, .highlights {
  background: #ffffff;
}

/* 各カード間に白背景を維持したまま軽い影を加えると自然 */
.grid .post img {
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.04);
}


/* 追加：main を前面に出してクリック可能にする */
main {
  position: relative; /* スタッキングコンテキストを作る */
  z-index: 1000;      /* all.css の header/figure より大きい値を指定 */
  background: #ffffff;/* 必要なら背景も明示する */
}

/* もし header の背景画像がクリックを奪っているならオーバーライド（all.cssを変えずに上書き） */
header figure {
  pointer-events: none; /* header 内の背景はクリックを受け取らない */
}

/* 必要なら header 内のメニューは明示的にクリック可能にする */
header ul, header a {
  pointer-events: auto;
  position: relative;
  z-index: 1010; /* メニューを main より上に見せたい場合は調整 */
}

