/*
Theme Name: inter fog face
Description: Editorial layout with fixed header/footer and scroll-linked meta info.
Version: 1.0
Author: Midori Miyamori
*/

/* --- リセット & 基本設定 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: #fff;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", YuGothic, "Hiragino Kaku Gothic ProN", sans-serif;
}

/* --- デスクトップ用：上下フィックス構造 --- */
body {
  overflow: hidden;
}

.site-frame {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
}

/* 1. 上部固定ヘッダー */
.site-header {
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #111;
  flex: 0 0 60px;
  background: #fff;
  z-index: 10;
}

.site-title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.site-title a {
  display: block;
  text-decoration: none;
  color: #000;
  transition: opacity 0.2s ease;
}

.site-title a:hover {
  opacity: 0.6;
}

.site-logo-img {
  height: 24px;
  width: auto;
  display: block;
}

/* 2. 中央メイン（スクロールエリア） */
.site-main-viewport {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  overflow: hidden;
}

/* 右側：縦スクロールするプロジェクト・トラック */
.scroll-track {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 15vh;
  padding-bottom: 15vh;
  
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

/* --- 各プロジェクトの塊（スライド単位） --- */
.project-group {
  min-height: 50vh; /* 高さをしっかり確保して中身が潰れないようにする */
  display: flex;
  justify-content: center;
  align-items: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;

  /* 非アクティブ時は薄くし、クリック無効化 */
  opacity: 0.25 !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease;
}

/* 画面中央にスナップしたアクティブなプロジェクトはくっきり、クリック可能に */
.project-group.is-active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* リンク要素（テキスト ＋ 画像グリッド を内包） */
.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transform: scale(0.72);
  transform-origin: center center;
  transition: transform 0.4s ease;
}

.project-group.is-active .project-link {
  transform: scale(1);
  transform-origin: center center;
}

/* テキストと画像グリッドを横並びにするインナーコンテナ */
.project-inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

/* 左側のメタ情報（時期＋タイトル） */
.project-meta {
  width: 260px;
  flex-shrink: 0;
  text-align: right;
}
.meta-date {
  font-size: 12px;
  font-weight: bold;
}

.meta-time {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
}
.meta-title {
  font-size: 14px;
  line-height: 1.4;
}

/* プロジェクト内の写真グリッド */
.project-media-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 650px;
}

.project-main-img img,
.project-sub-imgs img {
  width: 100%;
  aspect-ratio: 1.782 / 1;
  object-fit: cover;
  display: block;
}

/* サブ画像のグリッド崩れを完全に防ぐ */
.project-sub-imgs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  width: 100%;
}

/* 3. 下部固定フッター */
.site-footer {
  height: 60px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 1px solid #111 !important;
  flex: 0 0 60px;
  background: #fff;
  z-index: 10;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  height: 100px;
  border-bottom: 1px solid #000;
}

.footer-nav-piece {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #000;
  white-space: nowrap;
  letter-spacing: -0.01em;
  border-right: 1px solid #111;
}

.footer-nav-piece:last-child {
  border-right: none;
}

.footer-copy {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 12px;
  white-space: nowrap;
}


/* --- タブレット・中間サイズ用（画面幅が 970px 以下の場合） --- */
@media screen and (max-width: 970px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }

  .site-frame {
    height: 100vh;
    position: absolute;
    overflow: hidden;
  }

  .site-header {
    height: 70px;
    padding: 0 20px;
    flex: 0 0 60px;
  }
  .site-title {
    font-size: 20px;
  }

  .site-main-viewport {
    display: flex;
    height: auto;
    width: 100%;
    overflow: hidden;
  }

  .scroll-track {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-left: 10px;
    padding-top: 10vh;
    padding-bottom: 30vh;
    
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
  }

  .project-group {
    min-height: 5vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 80px;
    scroll-snap-align: center;
    scroll-snap-stop: always;

    opacity: 0.25 !important;
    pointer-events: none !important;
    transition: opacity 0.4s ease;
  }

  .project-group:first-child {
    margin-top: 150px;
  }

  .project-group.is-active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* 非アクティブ時はスマホ用に適したスケール（0.8）で縮小 */
  .project-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transform: scale(0.8);
    transform-origin: right center;
    transition: transform 0.4s ease;
    width: 100%;
    margin: 0 auto;
  }

  /* アクティブ化したら等倍（1.0）へ拡大 */
  .project-group.is-active .project-link {
    transform: scale(1);
    transform-origin: center center;
  }

  .project-inner {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
  }

  .project-meta {
    width: 80px;
    flex-shrink: 0;
    text-align: right;
  }
  .meta-date {
    font-size: 11px;
    font-weight: bold;
  }

  .meta-time {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
  }

  .meta-title {
    font-size: 10px;
    line-height: 1.3;
  }

  .project-media-grid {
    flex: 1;
    min-width: 0;
  }

  .project-sub-imgs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
  }

  .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    min-height: 60px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid #111 !important;
    background: #fff;
    z-index: 100;
    font-size: 13px;
    box-sizing: border-box;
  }
}