/* style.css */

html{
  scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Helvetica Neue', sans-serif;
    color: #333;
    background: #f8f7f2;
  }

  p {
  line-height: 28px;
  letter-spacing: 0.05em;
}
  
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: sticky;
    top: 0;
    background: #f8f7f2;
    border-bottom: 1px solid #eee;
    z-index: 10;
  }
  
  header .logo img{
    width: 100px;
    z-index: 20;
  }


  nav a:hover{
    color: #707070;
  }
  
  nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
  }
  
  nav a {
    text-decoration: none;
    color: #333;
    transition: all 0.4s ease-in-out;
  }
  
  #home {
    padding: 100px 5% 60px;
    text-align: center;
  }
  
  #home h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 300;
  }
  
  #works {
    padding: 60px 5%;
  }
  
  #works h2 {
    margin-bottom: 20px;
  }

  #works h2 .en{
    font-size: 2rem;
    font-weight: 300;
  }

  #works h2 .ja{
    font-size: .8rem;
    font-weight: 400;
    color: #707070;
  }
/* 画像６枚を横３枚で折り返して２行にして貼る */
#works{
    /* 一番下に120px余白 */
margin-bottom: 50px;
}

#works .works-list{
    list-style: none;
    /* 画像横並び */
    display: flex;
    /* 画像折り返しの設定 */
    flex-wrap: wrap;
    padding: 0;
}

#works .works-list .caption{
font-size: .9rem;
font-weight: 300;
    border-bottom: solid 1px #333;
    line-height: 5;

}

#works .works-list li{
    /* 横幅を３２％×３＝９６％、間の２％×２＝４％で足したら１００％になるから
    横３列に均等に並ぶ！ */
    width: 29%;
    margin: 0 6% 6% 0;
}
#works .works-list li img{
  aspect-ratio: 1 /1;
  position: center;
  object-fit: cover;
}

/* ー擬似クラスについてー
、特定の要素がある状態の場合にスタイルを適用させることができるセレクタです。
:hover カーソルを要素の上に乗せた際に適用
:visited 訪問済みのリンクに適用
:checked ラジオボタン、チェックボックスなどで選択されている場合に適用
:first-child 最初の要素に適用
:last-child 最後の要素に適用
:nth-child(odd) 奇数の要素に適用
:nth-child(even) 偶数の要素に適用
:nth-child(2) 2番目の要素に適用（※3番目以降は中の数字が変わります）
:nth-child(2n) 2の倍数の要素に適用（※3番目以降は中の数字が変わります） */

#works .works-list li:nth-child(3n){
    margin-right: 0;
}

.works-list img {
  width: 100%;         /* 枠に合わせて広げる */
  height: auto;        /* 比率は維持して潰れない */
  object-fit: contain;   /* 必要ならトリミング */
  display: block;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease; /* アニメーションを付ける */
}

#works .works-list li img:hover {
  transform: scale(1.02); /* 1.02倍に拡大 */
}
  
footer {
  margin-top: 30px;
  background-color: #333;
  padding: .8rem;
}

footer p {
  margin: 0;
  font-size: 0.6rem;
  font-weight: 100;
  text-align: center;
}
  
footer p a{
transition: all 0.4s ease-in-out;
text-decoration: none;
color: #f8f5f2;
  }

footer p a:hover{
    color: #c9c9c9;
  }

  /* ===== モーダル用 ===== */
.modal {
  display: none; /* 初期は非表示 */
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8); /* 背景暗く */
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.6);
  animation: zoomIn 0.3s ease;
}

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
}

/* 拡大アニメーション */
@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

#caption {
  margin-top: 10px;
  color: #fff;
  text-align: center;
  font-size: 1rem;
}


  
  @media screen and (max-width:765px) {
    body{
      text-align: center;
    }

    #works h2 {
      display: flex;
      flex-direction: column;
    }
    #works h2 .ja{
      font-size: .8rem;
      font-weight: 400;
    }

    header nav {
      display: none;
    }

    header .logo {
      margin: 0 auto ;
      align-items: center;
    }
    header .logo img{
      width: 60px;
      text-align: center;
    }

    #works .works-list {
  flex-direction: column;  
  margin: 0 auto;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin-top: 50px;
    }
    
  #works .works-list li {
    width: 70%;
    margin: 0 auto;
  }

    #works .works-list .caption{
    margin-bottom: 50px;
    }

  #works .works-list li:nth-child(3n){
    margin: 0 auto;
}

}