/* ============================
   matsushima CHIHIRO. - Style
   ============================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Shippori Mincho', 'Noto Serif JP', serif;
  background: #f0ece4;
  overflow-x: hidden;
  color: #3a3a3a;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  -webkit-user-drag: none;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* --- 紙背景 --- */
.paper-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.paper-texture {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- キャンバス（全オブジェクト配置領域） --- */
.canvas {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  z-index: 1;
}

/* --- 共通エレメント --- */
.element {
  position: absolute;
  display: block;
  transition: filter 0.4s ease, transform 0.35s ease;
}

.element img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* --- ホバーエフェクト（リンク付きオブジェクト） --- */
.hoverable {
  cursor: pointer;
}

.hoverable:hover {
  transform: none; /* 傾けない */
}

.hoverable:hover img {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.memo:hover {
  transform: none; /* 傾けない */
}

/* --- PC レイアウト（デフォルト） --- */

.logo {
  top: 4.4%;
  left: 2.9%;
  width: 27.9%;
}

.star {
  top: 2.7%;
  right: 1.6%;
  width: 11.9%;
  z-index: 10;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.star:hover {
  animation: katakata-star 0.3s steps(3) infinite;
}

.star:hover img {
  opacity: 1;
}

@keyframes katakata-star {
  0%   { transform: rotate(0deg); }
  33%  { transform: rotate(3deg); }
  66%  { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}

.flower {
  top: 19.6%;
  left: 21.1%;
  width: 11.2%;
}

.window {
  top: 4.8%;
  left: 32.6%;
  width: 32.3%;
}

.pic {
  top: 25.3%;
  right: 19.1%;
  width: 15.6%;
}

.memo {
  top: 49.3%;
  right: 68.7%;
  width: 10.2%;
  cursor: pointer;
}

.memo:hover {
  transform: rotate(-2.5deg);
}

.memo:hover img {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.book {
  top: 7.1%;
  left: 65.6%;
  width: 14.3%;
}

.table {
  top: 48.9%;
  left: 32.2%;
  width: 34.7%;
}

.camera {
  top: 59.9%;
  right: 11.5%;
  width: 18.3%;
}

.hikouki {
  top: 81.6%;
  left: 8.0%;
  width: 14.7%;
}

/* --- オブジェクトラベル（各オブジェクト中央に配置） --- */
.obj-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(10px, 0.85vw, 14px);
  color: #5a5040;
  white-space: nowrap;
  letter-spacing: 0.12em;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

/* ラベル個別位置 */
.window .obj-label { top: 40.2545%; left: 44.1306%; }
.pic .obj-label { top: 50%; left: 50%; }
.memo .obj-label { top: 1.85308%; left: 48.1414%; }
.book .obj-label { top: 50%; left: 50%; }
.table .obj-label { top: 12.9772%; left: 74.0386%; }
.camera .obj-label { top: 37.1443%; left: 31.3532%; }
.hikouki .obj-label { top: 0.451613%; left: 48.7103%; }

.hoverable:hover .obj-label,
.memo:hover .obj-label {
  opacity: 1;
}

@media (max-width: 768px) {
  .obj-label {
    font-size: clamp(9px, 2.5vw, 13px);
  }

  /* スマホ版ラベル位置 */
  .window .obj-label { top: 38.8607%; left: 45.9163%; }
  .pic .obj-label { top: 50%; left: 50%; }
  .memo .obj-label { top: -3.96825%; left: 44.4444%; }
  .book .obj-label { top: 50%; left: 50%; }
  .table .obj-label { top: 11.7759%; left: 74.8726%; }
  .camera .obj-label { top: 33.5043%; left: 25.0763%; }
  .hikouki .obj-label { top: -9.24313%; left: 49.0476%; }
}

/* --- メモ ツールチップ --- */
.memo-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 252, 0.95);
  border: 1px solid #c8bfb0;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: #5a5040;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 12px rgba(80, 60, 40, 0.1);
  letter-spacing: 0.05em;
}

.memo-tooltip.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* --- フルスクリーンメニュー --- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #f5f0e8;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.menu-inner {
  text-align: center;
  position: relative;
}

.menu-close {
  position: fixed;
  top: 2.7%;
  right: 1.6%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 11.9%;
  animation: katakata-star 0.4s steps(3) infinite;
  z-index: 101;
}

@media (max-width: 768px) {
  .menu-close {
    top: 2.7%;
    left: 76.5%;
    right: auto;
    width: 19.6%;
  }
}
.menu-close img { width: 100%; height: auto; display: block; }

.menu-nav-wrapper {
  display: flex;
  align-items: center;
  gap: 32px;
}

.menu-siri {
  height: 350px;
  width: auto;
  opacity: 0.85;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: flex-start;
}

.menu-nav a {
  display: block;
  transition: opacity 0.25s ease;
}

.menu-nav a:hover {
  opacity: 0.5;
}

.menu-nav a img {
  height: 45px;
  width: auto;
  display: block;
}

@media (max-width: 768px) {
   .menu-nav-wrapper {
     position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .menu-siri {
    position: absolute;
    left: -5px;        /* ← 左への距離、数値で調整 */
    height: 280px;
    width: auto;
    transform: translateX(-100%);  /* siriをnavの左外に出す */
  }

  .menu-nav {
    align-items: center;
  }

  .menu-nav a img {
    height: 35px !important;
  }
}

/* ============================
   モバイル レイアウト
   ============================ */
@media (max-width: 768px) {
  .canvas {
    aspect-ratio: auto;
    max-width: 100vw;
    width: 100%;
    height: 100vh;
    height: 100svh;
  }

  .logo {
    top: 3.0%;
    left: 4.8%;
    width: 57.9%;
  }

  .star {
    top: 2.7%;
    right: 3.9%;
    width: 22.2%;
  }

  .flower {
    top: 18.8%;
    left: 0.9%;
    width: 20.5%;
  }

  .window {
    top: 14.2%;
    left: 16.1%;
    width: 65.3%;
  }

  .pic {
    top: 15.4%;
    right: 2.5%;
    width: 24.9%;
  }

  .memo {
    top: 34.5%;
    right: 6.1%;
    width: 19.2%;
  }

  .book {
    top: 40.8%;
    left: 1.7%;
    width: 23.9%;
  }

  .table {
    top: 46.3%;
    left: 17.2%;
    width: 65.4%;
  }

  .camera {
    top: 69.6%;
    right: 3.5%;
    width: 32.1%;
  }

  .hikouki {
    top: 84.3%;
    left: 5.6%;
    width: 28.0%;
  }

  .menu-nav a {
    font-size: 1.3rem;
  }

  .memo-tooltip {
    font-size: 0.75rem;
    padding: 8px 12px;
  }
}

/* 小さいスマホ */
@media (max-width: 400px) {
  .logo {
    width: 32%;
  }

  .star {
    width: 9%;
  }
}

/* 大きなPC画面 */
@media (min-width: 1400px) {
  .canvas {
    margin-top: 2vh;
  }
}

/* ============================
   サブページ共通スタイル
   ============================ */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 60px 5% 80px;
  max-width: 800px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d4cbbf;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: #5a5040;
}

.back-link {
  font-size: 0.9rem;
  color: #a08a6e;
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: #5a5040;
}

/* 日記・記事一覧 */
.entries {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.entry-card {
  background: rgba(255, 255, 252, 0.7);
  border: 1px solid #e0d8cc;
  border-radius: 10px;
  padding: 24px 28px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.entry-card:hover {
  box-shadow: 0 4px 20px rgba(80, 60, 40, 0.1);
  transform: translateY(-2px);
}

.entry-card a {
  display: block;
}

.entry-date {
  font-size: 0.8rem;
  color: #a08a6e;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.entry-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #4a4235;
  margin-bottom: 8px;
}

.entry-excerpt {
  font-size: 0.9rem;
  color: #7a7060;
  line-height: 1.8;
}

.entry-cover {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 12px;
  object-fit: cover;
  max-height: 300px;
}

/* 記事詳細 */
.article-content {
  line-height: 2;
  font-size: 1rem;
  color: #4a4235;
}

.article-content p {
  margin-bottom: 1.5em;
}

.article-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1.5em 0;
}

.article-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2em 0 0.8em;
  color: #5a5040;
}
.article-content h2:first-child,
.article-container > h2:first-child {
  margin-top: 0;
}
/* ローディング */
.loading {
  text-align: center;
  padding: 40px;
  color: #a08a6e;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #d4cbbf;
  border-top-color: #a08a6e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Workページ グリッド */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.work-card {
  background: rgba(255, 255, 252, 0.7);
  border: 1px solid #e0d8cc;
  border-radius: 0px;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.work-card:hover {
  box-shadow: 0 4px 20px rgba(80, 60, 40, 0.1);
  transform: translateY(-2px);
}

.work-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.work-card-body {
  padding: 16px 20px;
}

.work-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #4a4235;
  margin-bottom: 6px;
}

.work-card-desc {
  font-size: 0.85rem;
  color: #7a7060;
  line-height: 1.6;
}

/* Aboutページ */
.about-content {
  line-height: 2;
  font-size: 1rem;
  color: #4a4235;
}

.about-content p {
  margin-bottom: 1.5em;
}

/* Archive フォトグリッド */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.photo-grid img:hover {
  opacity: 0.85;
}
/* ============================
   スマホ版：カスタムレイアウト調整
   ============================ */
@media (max-width: 768px) {
  .logo { top: 3.0%; left: 4.8%; width: 48.9%; transform: none !important; }
  /* 鉄瓶（star）だけは、動きを邪魔しないように transform: none を消しました */
  .star { top: 2.7%; left: 76.5%; width: 19.6%; } 
  .flower { top: 18.8%; left: 0.9%; width: 20.5%; transform: none !important; }
  .window { top: 14.2%; left: 16.1%; width: 65.3%; transform: none !important; }
  .pic { top: 15.4%; left: 72.6%; width: 24.9%; transform: none !important; }
  .memo { top: 34.5%; left: 74.7%; width: 19.2%; transform: none !important; }
  .book { top: 40.8%; left: 1.7%; width: 23.9%; transform: none !important; }
  .table { top: 46.3%; left: 17.2%; width: 65.4%; transform: none !important; }
  .camera { top: 69.6%; left: 64.4%; width: 32.1%; transform: none !important; }
  .hikouki { top: 84.3%; left: 5.6%; width: 28.0%; transform: none !important; }
}

/* ページ内フッター */
.page-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid #e0d8cc;
  text-align: center;
  font-size: 0.8rem;
  color: #b0a898;
  letter-spacing: 0.08em;
}

/* ============================
   Workページ セクション分け（透過PNG対応）
   ============================ */

.work-section {
  margin-bottom: 56px;
}

.work-section-title {
  font-size: 1.15rem;
  font-weight: 400;
  color: #5a5040;
  letter-spacing: 0.1em;
  margin-bottom: 40px;
 
}

/* 一覧のグリッド：スマホで2列、PCでバランスよく */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* カード：背景・枠線を消してイラストを際立たせる */
.work-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: transform 0.3s ease;
  text-align: center;
}

.work-card:hover {
  transform: translateY(-5px);
}

/* 画像のガタつきを抑えるための正方形の枠 */
.work-thumbnail-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}

.work-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  background: transparent;
}

.work-card p {
  font-size: 0.95rem;
  color: #4a4235;
  margin-top: 8px;
  letter-spacing: 0.05em;
}

/* ============================
   Work 詳細モーダル（スマホ対応）
   ============================ */
.modal {
  display: none; /* 初期状態は隠す */
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 252, 0.98); /* 紙のような白背景 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-content {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  position: relative;
}

/* モーダル内の画像：スマホで見切れないように */
.modal-images img {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  margin-bottom: 20px;
  display: block;
}

.modal-info {
  text-align: center;
  padding: 0 20px 60px;
}

.modal-info h2 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: #4a4235;
}

.modal-info p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #666;
  text-align: left; /* 説明文は読みやすく左寄せ */
}

.close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 1.8rem;
  color: #5a5040;
  cursor: pointer;
  background: none;
  border: none;
  padding: 12px;    
  margin: -12px;    
}

.modal-back-btn {
  display: block;
  margin: 32px auto 8px;
  background: none;
  border: 1px solid #a08a6e;
  border-radius: 24px;
  padding: 10px 32px;
  font-family: 'Shippori Mincho', serif;
  font-size: 0.9rem;
  color: #5a5040;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: background 0.3s ease, color 0.3s ease;
}
.modal-back-btn:hover {
  background: #a08a6e;
  color: #f5f0e8;
}

@media (max-width: 768px) {
  .work-grid {
    grid-template-columns: 1fr 1fr; /* スマホは2列 */
    gap: 15px;
  }
  .modal-content {
    margin: 20px auto;
    padding: 10px;
  }
  .modal-info h2 { font-size: 1.15rem; }
}


/* ============================
   Photoページ ライトボックス
   ============================ */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 28, 24, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  cursor: zoom-out;
}

.photo-lightbox.open {
  opacity: 1;
  visibility: visible;
}

.photo-lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.photo-lightbox-close {
  position: fixed;
  top: 20px;
  right: 28px;
  font-size: 2.4rem;
  color: #f0ece4;
  cursor: pointer;
  transition: transform 0.3s ease;
  line-height: 1;
  z-index: 201;
}

.photo-lightbox-close:hover {
  transform: rotate(90deg);
}

.photo-lightbox-caption {
  color: #d4cbbf;
  font-size: 0.85rem;
  margin-top: 16px;
  letter-spacing: 0.06em;
  text-align: center;
  max-width: 80vw;
}

@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .photo-lightbox img {
    max-width: 95vw;
    max-height: 75vh;
  }
}

/* Notion記事内スタイル */
.article-content figure {
  margin: 1.5em 0;
}

.article-content figcaption {
  font-size: 0.8rem;
  color: #a08a6e;
  text-align: center;
  margin-top: 8px;
}

.article-content blockquote {
  border-left: 3px solid #d4cbbf;
  padding-left: 16px;
  margin: 1.5em 0;
  color: #7a7060;
  font-style: italic;
}

.article-content .callout {
  background: rgba(255, 255, 252, 0.7);
  border: 1px solid #e0d8cc;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 1.5em 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid #e0d8cc;
  margin: 2em 0;
}

.article-content code {
  background: rgba(160, 138, 110, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.88em;
}

/* ============================
   全ページ共通：ブランドレイアウト
   ============================ */

/* ヘッダー：赤いロゴ(01) */
.header-logo {
    width: 180px !important; 
    height: auto;
    display: block;
    margin-bottom: 12px;
    transition: opacity 0.3s;
}
.header-logo:hover { opacity: 0.7; }

/* ロゴのリンク設定（枠を消す） */
.logo-link {
    display: inline-block;
    text-decoration: none;
    border: none;
}

/* ページ見出し(h1)の調整 */
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #5a5040;
    margin: 0;
}

/* フッター：手書き署名(02) */
.handwritten-footer {
    width: 260px !important; 
    height: auto;
    display: block;
    margin: 80px auto 40px !important;
}

/* 余計な線を消し、茶色の線だけを活かす */
.page-header {
    border-bottom: 1px solid #d4cbbf; /* 茶色い線 */
    padding-bottom: 8px;
    margin-bottom: 15px;
    /* 【修正】text-align: center; を削除し、display: block; を追加 */
    display: block !important; /* 中央寄せを解除し、縦並びに固定 */
}

/* フッターの不要なテキストを消去 */
.page-footer {
    border-top: 1px solid #d4cbbf;
    margin-top: 60px;
    text-align: center;
}
.page-footer p, .page-footer span { display: none !important; }
