/* 
   assets/css/gallery.css
   ポートフォリオ専用：洗練されたギャラリーデザイン
*/

:root {
  --bg-color: #fdfaf7;
  /* 紙のような温かい白 */
  --text-main: #2c3e50;
  /* 深みのあるグレー */
  --accent: #568eef;
  /* アクセントカラー */
  --font-serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
}

/* --- Base --- */
body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
}

/* --- Minimal Header --- */
.l-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(253, 250, 247, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.l-header_inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 25px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.l-header_logo {
  text-decoration: none;
  color: inherit;
}

.l-header_logo img {
  height: 50px;
  display: block;
}



.l-header_nav {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.l-header_nav a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: 0.3s;
  opacity: 0.7;
}

.l-header_nav li a.is-active {
  opacity: 1;
  color: var(--accent);
}



.l-header_nav a:hover {
  opacity: 1;
  color: var(--accent);
}

/* --- Masonry Gallery --- */
.gallery-container {
  max-width: 1800px;
  /* 最大幅を少し広げて、大画面での巨大化を防ぐ */
  margin: 40px auto;
  padding: 0 3vw;
}

.gallery-grid {
  /* デフォルト（超大画面 1600px以上）は5列 */
  column-count: 5;
  column-gap: 25px;
  /* 隙間も少しタイトにして密度を上げる */
}


/* 画面幅 1200px 〜 1600px：4列 */
@media (max-width: 1600px) {
  .gallery-grid {
    column-count: 4;
    column-gap: 20px;
  }
}

/* 画面幅 900px 〜 1200px：3列 */
@media (max-width: 1200px) {
  .gallery-grid {
    column-count: 3;
    column-gap: 20px;
  }
}

/* 画面幅 600px 〜 900px：2列（タブレットなど） */
@media (max-width: 900px) {
  .gallery-grid {
    column-count: 2;
    column-gap: 15px;
  }
}

/* 画面幅 600px以下：1列（スマホ） */
@media (max-width: 600px) {
  .gallery-grid {
    column-count: 1;
    column-gap: 0;
  }

  .work-item {
    margin-bottom: 20px;
    /* スマホでは余白を少し詰める */
  }
}

.work-item {
  break-inside: avoid;
  margin-bottom: 30px;
  position: relative;
  cursor: pointer;
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
  /* 読み込み時のふわっとした動き */
  animation: fadeUp 1s cubic-bezier(0.2, 1, 0.3, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.work-img-wrap {
  width: 100%;
  position: relative;
  line-height: 0;
}

.work-img-wrap img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  /* どんなに縦長でも画面の7割までに抑える（お好みで） */
  object-fit: cover;
  /* もし最大高さを超えたら切り抜く */
  transition: 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

/* --- オーバーレイの配置：完全センター化 --- */
.work-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 35, 40, 0.7);
  /* 深みのある色に変更 */

  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 垂直中央 */
  align-items: center;
  /* 水平中央 */

  opacity: 0;
  transition: all 0.4s ease;
  padding: 20px;
  text-align: center;
  box-sizing: border-box;
  /* パディングを含めて計算 */
}

.work-item:hover .work-overlay {
  opacity: 1;
}

.work-item:hover img {
  transform: scale(1.05);
  filter: blur(2px) brightness(0.9);
}


/* タイトル：より小さく、美しく */
.work-overlay h3 {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  /* さらに小さく */
  margin: 0;
  padding: 0;
  letter-spacing: 0.1em;
  line-height: 1.4;
  color: white;
}

/* 年号：さらに控えめに */
.work-overlay p {
  color: white;
  font-size: 9px;
  margin-top: 4px;
  opacity: 0.6;
  letter-spacing: 0.1em;
}

.work-item:hover h3 {
  transform: translateY(0);
}



/* ライクボタンエリア */
.work-overlay-like {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  transition: 0.3s;

  span {
    color: white;
    font-weight: 500;
  }
}

.work-overlay-like:hover {
  background: rgba(255, 255, 255, 0.3);
}

.work-overlay-like svg {
  width: 13px;
}



/* パーティクルの器 */
.particle-container {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  /* クリックを邪魔しない */
  z-index: 9999;
}

/* ハート一粒のスタイル */
.heart-particle {
  position: absolute;
  color: #e84118;
  font-size: 14px;
  user-select: none;
  animation: heart-burst 0.8s ease-out forwards;
}

@keyframes heart-burst {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }

  100% {
    /* CSS変数を使ってランダムな方向に飛ばす */
    transform: translate(var(--tx), var(--ty)) scale(1.2) rotate(var(--tr));
    opacity: 0;
  }
}



/* --- Search & Filter UI --- */
.search-bar {
  max-width: 500px;
  margin: 0 auto 60px;
  text-align: center;
}

.search-bar input {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid #ddd;
  padding: 10px;
  font-size: 16px;
  outline: none;
  text-align: center;
  transition: 0.3s;
}

.search-bar input:focus {
  border-color: var(--accent);
}

/* --- Fullscreen Modal --- */
.c-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 2000;

  /* 重要：スクロールを許可する設定 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* 上寄せにする（スクロールのため） */
  padding: 80px 20px;
  /* 上下に十分な余白 */
  overflow-y: auto;
  /* 縦スクロールを出す */
}

.tilt-wrapper {
  perspective: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  flex-shrink: 0;
  /* 縮まないように固定 */
}



.c-modal-img-container {
  /* transformの変更を、0.3秒かけてゆっくり追いかけさせる（さらに負荷が分散されます） */
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);

  /* 「ブラウザさん、これ動くから準備しておいて」と伝える魔法の一行 */
  will-change: transform;

  transform-style: preserve-3d;
}


.c-modal-img-container img {
  max-width: 100%;
  max-height: 60vh;
  /* 70vhから60vhに下げて、下の文字を見えやすく */
  border-radius: 2px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15);
}

/* 画面の高さが極端に低い（横長画面）の時の調整 */
@media (max-height: 700px) {
  .c-modal-img-container img {
    max-height: 45vh;
  }

  .c-modal-text-v {
    margin-top: 20px;
    /* 余白も詰める */
  }
}

/* 画像に重なる光沢（ハイライト）効果 */
.c-modal-img-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 50%);
  pointer-events: none;
  border-radius: 2px;
}

/* テキストエリア：画像の下に配置し、美術館のラベル風に */
.c-modal-text-v {
  margin-top: 40px;
  text-align: center;
  max-width: 600px;
  animation: textFadeIn 1s ease forwards;
  opacity: 0;
}

@keyframes textFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.c-modal-text-v h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.c-modal-text-v .meta {
  font-size: 11px;
  color: #999;
  letter-spacing: 0.2em;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.c-modal-text-v .caption {
  font-size: 14px;
  line-height: 1.8;
  color: #444;
}

.close-btn {
  position: fixed;
  top: 30px;
  right: 40px;
  font-size: 30px;
  cursor: pointer;
  color: #ccc;
  z-index: 2100;
}



@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.c-modal-content {
  display: flex;
  gap: 60px;
  max-width: 1300px;
  width: 100%;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .c-modal-content {
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    height: 90vh;
  }
}

.c-modal-img {
  flex: 1.3;
  text-align: right;
}

.c-modal-img img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.c-modal-text {
  flex: 0.7;
  padding-top: 40px;
}

.c-modal-text h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin: 0 0 10px;
}

.c-modal-text .meta {
  font-size: 12px;
  color: #999;
  margin-bottom: 25px;
  letter-spacing: 0.1em;
}

.c-modal-text .caption {
  font-size: 14px;
  line-height: 2;
  margin-bottom: 30px;
  color: #555;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.tag-item {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  border: none;
  color: #777;
  border: 1px solid #d1d1d1;
  transition: 0.2s;
}

.tag-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  cursor: pointer;
}

.close-btn {
  position: fixed;
  top: 30px;
  right: 40px;
  font-size: 30px;
  cursor: pointer;
  color: #ccc;
  transition: 0.3s;
}

.close-btn:hover {
  color: #333;
}


/* --- モーダルの表示・非表示アニメーション --- */

/* 1. アニメーションが動いている最中の設定（transition） */
.modal-fade-enter-active, 
.modal-fade-leave-active {
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 2. 中身のコンテンツだけ少し遅れて、スッと浮き上がる動き */
.modal-fade-enter-active .tilt-wrapper {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-fade-leave-active .tilt-wrapper {
    transition: all 0.4s cubic-bezier(0.7, 0, 0.84, 0); /* 閉じる時は少し速く */
}

/* 3. 消えている時の状態（ここから始まり、ここへ戻る） */
.modal-fade-enter-from, 
.modal-fade-leave-to {
    opacity: 0;
}

.modal-fade-enter-from .tilt-wrapper, 
.modal-fade-leave-to .tilt-wrapper {
    transform: translateY(40px) scale(0.95); /* 少し下で、少し小さい状態 */
    opacity: 0;
}






/* --- About Page --- */

.p-about-container {
  max-width: 800px; /* 読みやすい幅に制限 */
  margin: 100px auto;
  padding: 0 40px;
  text-align: center;
  animation: fadeUp 1.2s cubic-bezier(0.2, 1, 0.3, 1) both;
}

/* プロフィール画像（旧 btn_nav.gif）を飾る */
.p-about-visual {
  margin-bottom: 60px;
}

.p-about-visual img {
  max-width: 150px; /* アイコン的なサイズ感 */
  height: auto;
  /* 質感に合わせて少し柔らかい印象に */
  filter: grayscale(20%);
}

.p-about-content h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}

.p-about-content .sub-title {
  font-size: 12px;
  color: #999;
  letter-spacing: 0.3em;
  margin-bottom: 50px;
  text-transform: uppercase;
}

.p-about-text {
  font-size: 15px;
  line-height: 2.4; /* 行間を贅沢にあけて読みやすく */
  color: #444;
  text-align: center;
}

/* スマホでは文字を左寄せにして読みやすくする調整 */
@media (max-width: 600px) {
  .p-about-container { margin: 60px auto; }
  .p-about-text {
      text-align: justify;
      font-size: 14px;
      line-height: 2.2;
  }
}

.p-about-text br {
  display: block;
  content: "";
  margin-top: 10px;
}

/* お仕事依頼への導線 */
.p-about-link {
  margin-top: 60px;
}

.p-about-link a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  transition: 0.3s;
}

.p-about-link a:hover {
  color: var(--accent);
  border-color: var(--accent);
}



/* ==========================================
   Footer & Social Links Style
   ========================================== */

/* フッター全体のコンテナ */
footer {
  padding: 100px 0 60px;
  text-align: center;
  background-color: transparent; /* 背景色に馴染ませる */
}

/* SNSリンクを並べるコンテナ */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px; /* アイコン同士の間隔 */
  margin-bottom: 40px;
}

/* 個別のSNSリンク */
.social-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px; /* アイコンと文字の間隔 */
  text-decoration: none;
  color: var(--text-main);
  opacity: 0.5; /* 通常時は少し薄く */
  transition: all 0.3s ease;
}

/* ホバー時に色を変えて浮かせる */
.social-link:hover {
  opacity: 1;
  color: var(--accent);
  transform: translateY(-3px); /* わずかに上に動かす */
}

/* SVGアイコンのサイズ設定 */
.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor; /* テキストの色と連動 */
}

/* アイコン下のテキスト (X, Instagramなど) */
.social-link span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* コピーライトテキスト */
footer p {
  color: #ccc;
  font-size: 10px;
  letter-spacing: 0.2em;
  margin-top: 20px;
}

/* スマホ表示の微調整 */
@media (max-width: 600px) {
  .social-links {
      gap: 40px; /* 指で押しやすいように広げる */
  }
  footer {
      padding: 60px 0 40px;
  }
}






/* ==========================================
   Contact Page Style
   ========================================== */

   .p-contact-container {
    max-width: 700px; /* フォームが広がりすぎないように制限 */
    margin: 80px auto;
    padding: 0 40px;
    animation: fadeUp 1.2s cubic-bezier(0.2, 1, 0.3, 1) both;
}

.p-contact-header {
    text-align: center;
    margin-bottom: 60px;
}

.p-contact-header h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.p-contact-header p {
    font-size: 13px;
    color: #999;
    margin-top: 10px;
}

/* フォーム項目 */
.p-contact-form-item {
    margin-bottom: 30px;
}

.p-contact-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.p-contact-input, 
.p-contact-textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #ddd; /* 線だけのミニマルな入力欄 */
    padding: 12px 0;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--text-main);
    transition: border-color 0.3s ease;
    border-radius: 0;
}

.p-contact-input:focus, 
.p-contact-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.p-contact-textarea {
    min-height: 120px;
    resize: vertical;
}

/* エラーメッセージ */
.p-contact-error {
    color: #e84118;
    font-size: 11px;
    margin-top: 5px;
    display: block;
}

/* ボタン */
.p-contact-submit-area {
    margin-top: 50px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-gallery {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 13px;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-gallery:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.btn-gallery:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 確認画面のテーブル */
.p-contact-confirm-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
}

.p-contact-confirm-table th, 
.p-contact-confirm-table td {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 14px;
}

.p-contact-confirm-table th {
    width: 30%;
    color: #999;
    font-weight: 500;
}

/* フェード切り替え用 */
.v-fade-enter-active, .v-fade-leave-active { transition: opacity 0.5s ease; }
.v-fade-enter-from, .v-fade-leave-to { opacity: 0; }




/* --- Digital Book: Final Geometry --- */
.hero-viewport {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  
  /* 背景画像と影（ビネット）を1つのプロパティで指定することで不具合を防ぎます */
  background: 
      url('/assets/images/site_top_bg.png') center center / cover no-repeat; /* 木目画像 */
    
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2500px;
  z-index: 1;
}

.book-container {
  position: relative;
  width: 840px; /* 見開き全体の幅 */
  height: 580px;
  transform-style: preserve-3d;
}

/* 各「紙（リーフ）」 */
.book-page {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transition: transform 1.8s cubic-bezier(0.4, 0, 0.2, 1); /* よりゆったりと */
  transform-style: preserve-3d;
}

/* ページをめくった状態 */
.book-page.is-flipped {
  transform: rotateY(-180deg);
}

/* ページの内側（表・裏）共通 */
.page-side {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden; /* 回転中に裏側を絶対に見せない */
  -webkit-backface-visibility: hidden;
  background: #fff;
  padding: 40px; /* イラスト周囲の余白を多めにとって洗練させる */
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.02);
}

/* 表面（右ページ） */
.page-side.front {
  z-index: 2;
}

/* 裏面（めくられた後の左ページ） */
.page-side.back {
  transform: rotateY(180deg); /* 背中合わせにする */
  z-index: 1;
}

/* イラストをページ内に完全に収める設定 */
.page-side img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* 縦横比を維持して収める */

}

/* 中央の綴じ目（本らしさを強調） */
.book-spine {
  position: absolute;
  top: 0; left: 50%;
  width: 2px; height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.1), transparent, rgba(0,0,0,0.1));
  z-index: 100;
}

@media (max-width: 900px) {
  .book-container { width: 90vw; height: 70vw; }
  .page-side { padding: 20px; }
}

/* --- アトリエ小物（ペン、眼鏡など） --- */
.desk-item {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}
.item-pen { bottom: 10%; right: 5%; width: 150px; transform: rotate(-15deg); }
.item-glasses { top: 15%; left: 8%; width: 120px; opacity: 0.8; }



/* --- めくる手のアニメーション（ページ下部を掴む設定） --- */
.flipping-hand {
  position: absolute;
  width: 220px; /* 少し大きめの方が掴んでいる感が出ます */
  height: auto;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  
  /* 位置：画面下側、本の右下角あたりを狙う */
  top: 85%; 
  right: 10%;
  transform: translate(0, -50%) rotate(0deg);
  will-change: transform, opacity;
}

/* 手が動く時のアニメーション：右下から左下へ弧を描く */
.hand-anim-active {
  animation: hand-flip-bottom 2.2s ease-in-out forwards;
}

@keyframes hand-flip-bottom {
  0% {
      opacity: 0;
      transform: translate(150px, 0) rotate(10deg);
  }
  15% {
      opacity: 1;
      /* ページ右下角を掴む位置 */
      transform: translate(0, 0) rotate(0deg); 
  }
  30% {
      /* めくり始め：少し上に持ち上げる（パラパラ感を出す） */
      transform: translate(-100px, -40px) rotate(-15deg);
  }
  70% {
      opacity: 1;
      /* 左ページ側へ移動 */
      transform: translate(-550px, 0px) rotate(-30deg); 
  }
  100% {
      opacity: 0;
      /* 画面外（左下）へ消えていく */
      transform: translate(-700px, 100px) rotate(-40deg);
  }
}


/* 表紙・裏表紙用の特別な質感（任意） */
.page-side.cover {
  background: #ffffff; /* 表紙らしい色味 */
  box-shadow: inset -5px 0 15px rgba(0,0,0,0.1);
}



/* ページ下のめくり部分に少し隙間があるような影（任意） */
.page-side.front::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 50px; height: 50px;
  background: linear-gradient(135deg, transparent 70%, rgba(0,0,0,0.02) 100%);
}