/* 0. Google Fonts の読み込み */
@import url('https://fonts.googleapis.com/css2?family=Lexend+Exa:wght@100..900&family=Zain:ital,wght@0,200;0,300;0,400;0,700;0,800;0,900;1,300;1,400&display=swap');

body {
  font-family:  "Lexend Exa", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;

  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  padding: 20px;
  background-color: #f8f8f8;

  padding-top: 80px; /* ←ヘッダー60px＋余白20px */
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

p{
  font-size: 12px;
  line-height: 2;
  text-align: justify;
  text-justify: inter-ideograph;
}
h4{
  font-size: 12px;
  font-weight: 500;
  margin-top: 40px;
  margin-bottom: 10px;
  color: darkgray;
  line-height:1.8;
}

/* 1. ヘッダー */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 60px;
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 50px;
  padding-right: 40px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 1000;
  box-sizing: border-box; /* 余白込みでサイズ計算 */
  overflow: visible;
}

/* 2. ヘッダー左のタイトル */
.site-title {
  font-size: 20px;
  font-weight: bold;
  white-space: nowrap; /* 改行しない */
}

/* 3. ヘッダー右のナビ */
.top-nav {
  display: flex;
  gap: 24px;
  /* 幅いっぱいに広げる */
  flex-grow: 1;
  justify-content: flex-end;
  overflow: hidden; /* はみ出し防止 */
}

.top-nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 24px;
  white-space: nowrap; /* 折り返さず */
}

.top-nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap; /* 改行しない */
}

.top-nav a:hover {
  color: rgb(171, 171, 171);
}

.top-nav a.current {
  font-weight: bold;
  pointer-events: none; /* クリック無効 */
  cursor: default;
  color: #333; /* hover時の色変化を打ち消す用 */
}

/* currentにはhoverを適用しない */
.top-nav a.current:hover {
  color: #333; /* 通常色に固定 */
}



/* 4. サイドのカテゴリタブ */
nav.side-nav {
  position: fixed;
  top: 60px; /* ヘッダーの下に */
  left: 0;
  width: 240px;
  height: calc(100vh - 60px); /* ヘッダー分引く */
  background: white;
  padding-top: 40px;
  padding-left: 40px;
  padding-right: 80px;
  overflow-y: auto;
  z-index: 999;
  box-sizing: border-box;
  /* 画面全体に広がらないように念押し */
  max-width: 240px;
}

#categoryList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#categoryList li {
  padding: 8px 0;
  cursor: pointer;
  text-align: left; /* 左揃え */
  border-bottom: 1px solid #eee;
  user-select: none;
  color: #333;
  transition: color 0.2s ease;
}

#categoryList li:hover {
  color: rgb(171, 171, 171);
}

#categoryList li.active {
  font-weight: bold;
  color: #111;
}

/* 5. メインコンテンツ部分（ギャラリー） */
.work-gallery {
  margin-left: 240px; /* サイドバーの幅+余白 */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.work-gallery .work-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px !important; /* !important で強制 */
  aspect-ratio: 1 / 1 !important;
  display: flex;
  align-items: center; /* 縦方向の中央揃え */
  justify-content: center; /* 横方向の中央揃えもしたいなら */

}

.work-gallery .work-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: inherit !important;
  display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}


/* 🔸作品タイトルと説明（PC & スマホ対応） */
.work-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.6em 1em;
  box-sizing: border-box;
  text-align: left; /* ← 左端に揃える */
  white-space: normal; /* 改行OK */
  overflow: visible; /* 見切れ防止 */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.work-meta .title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  word-break: break-word; /* 長い単語対応 */
}

.work-meta .category {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.3em;
}

/* ホバーでフェードイン（PC用） */
.work-item:hover .work-meta {
  opacity: 1;
}


.work-item {
  position: relative; /* 子要素の絶対配置用 */
}

.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24; /* サイズ調整 */
  color: white;       /* アイコン色 */
  background: rgba(0,0,0,0.6); /* 背景半透明 */
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  position: absolute; /* 絶対配置 */
  bottom: 8px;
  right: 8px;
  opacity: 0;         /* hover前は非表示 */
  transition: opacity 0.2s ease;
}

.work-item:hover .material-symbols-outlined {
  opacity: 1; /* hoverで表示 */
}

/* 6. works各作品ページ */
.work-detail {
  display: flex;
  min-height: 100vh;
  margin-left: 40px; /* 左側の固定スペース */
}

/* 左：作品説明 */
.work-description {
  position: fixed;
  top: 60px; /* ヘッダーがあるならそれを考慮 */
  left: 0;
  width: 400px;
  height: calc(100vh - 60px);
  background: white;
  padding-left: 50px;
  overflow-y: auto;
  z-index: 999;
}

.work-description h2 {
  font-size: 24px;
  margin-top: 40px;
  margin-bottom: 10px;
}

.work-description h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: rgb(200, 200, 200);
}

.work-description p {
  font-size: 14px;
  margin-top: 25px;
  width: 84%;
}
.back-link{
  display: inline-block;
  margin-top: 120px;
  margin-bottom: 40px; /* 下に余白を追加！ */
  font-size: 14px;
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: rgb(171, 171, 171);
}

/* 右：画像エリア */
/* ベースに戻すなら、こっちを適用 */

.image-wrapper {
  position: relative;
  display: inline-block;
}

.zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  color: rgba(255, 255, 255, 0.8);
  font-size: 36px;
  pointer-events: none; /* アイコンがクリックを邪魔しない */
}
.image-wrapper:hover .zoom-icon {
  color: rgba(255, 255, 255, 1);
}

.work-images {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-left: 415px; /* 左側の固定スペース + 余白 */
  margin-right: 10px;
  padding: 0px; /* 上部はヘッダー考慮 */
  flex-grow: 1;
  
}
.work-images-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-left: 415px; /* 左側の固定スペース + 余白 */
  margin-right: 10px;
  padding: 0px; /* 上部はヘッダー考慮 */
  flex-grow: 1;
}

.work-images-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-left: 415px; /* 左側の固定スペース + 余白 */
  margin-right: 10px;
  padding: 0px; /* 上部はヘッダー考慮 */
  flex-grow: 1;
}

.work-images img,
.work-images-2 img,
.work-images-3 img {
  position: relative;
  cursor: zoom-in;
  transition: transform 0.3s;
  width: 100%;
  max-width: 2000px;
  margin-bottom: 0px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
/* 画像にカーソルヒント + 少し拡大 */
.work-images img,
.work-images-2 img,
.work-images-3 img {
  cursor: zoom-in; /* 拡大できることを示す */
  transform-origin: left center; /* ←拡大の基準を左端に固定 */
  transition: transform 0.3s; /* なめらかに拡大 */
}

.work-images img:hover,
.work-images-2 img:hover,
.work-images-3 img:hover {
  transform: scale(1.05);
}

/* アイコンを右下に重ねる */
.work-images img::after {
  content: url('https://cdn-icons-png.flaticon.com/512/60/60740.png'); /* 任意のアイコンURL */
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 20px;   /* アイコンサイズ調整 */
  height: 20px;
  opacity: 0.7;
  pointer-events: none; /* クリックを邪魔しない */
}

/* ---------------------------
   モーダル（中央寄せ）＋左右ナビ
   --------------------------- */
.modal {
  display: none; /* 最初は非表示 */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.85);

  /* 中央に画像を置く */
  align-items: center;
  justify-content: center;

  padding-top: 30px; /* ヘッダー分（必要に応じて調整） */
  box-sizing: border-box;
}

/* 中央に画像を置く */
.modal-content {
  display: flex;
  align-items: center;
  justify-content: center;

  padding-top: 30px; /* ヘッダー分（必要に応じて調整） */
  box-sizing: border-box;
}

/* modal の中の画像 */
.modal-content {
  max-width: 95vw;
  max-height: calc(100vh - 120px); /* ヘッダー分やボタン領域を考慮 */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  display: block;
}

/* 左右ナビボタン（共通） */
.modal-nav {
  color: #fff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.25);
  border: none;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.3em 0.6em;
  transition: background 0.2s;
}

/* 左右位置 */
#modal-prev { left: 20px; }
#modal-next { right: 20px; }

/* ホバー時の淡い変化 */
.modal-nav:hover {
  background: rgba(0, 0, 0, 0.5);
}


#modal-prev { left: 20px; }
#modal-next { right: 20px; }

/* スマホ表示用に少しサイズ調整 */
@media screen and (max-width: 768px) {
  .modal-nav {
    font-size: 34px;
  }
  #modal-prev { left: 12px; }
  #modal-next { right: 12px; }
}


/* 閉じるボタンは既存の #image-modal-close を使うけど、視認性向上 */
#image-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  color: #fff;
  font-size: 34px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
}
#image-modal-close:hover {
  color: #bbb;
}

/* 7. aboutページ */
.about-section {
  max-width: 800px;
  padding-left: 20px;
}

.about-section img {
  width: 60%;
  max-width: 320px;
  margin-top: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  
}

/* 8. contactフォーム */
.contact-section {
  margin-left: 20px;
}

form {
  display: flex;
  flex-direction: column;
  max-width: 400px;
  margin-top: 60px; /* ヘッダーの下に余白 */
}

label {
  text-align: left;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
}

input,
textarea {
  margin-bottom: 20px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

button {
  background: #333;
  color: white;
  padding: 12px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

button:hover {
  background: #555;
}

/* CSSのいちばん最後あたり（button {...}の下など）にこれを追加！ */

.mobile-category {
  display: none !important;
}

@media screen and (max-width: 768px) {
  .mobile-category {
    display: block !important;
    margin: 0 auto;
    width: 90%;
    max-width: 400px;
    padding: 8px 0;
  }

  .side-nav {
    display: none !important;
  }
}


/* =========================================================
   📱 スマホ表示用スタイル（768px以下）
   ========================================================= */
@media screen and (max-width: 980px) {

  /* === ギャラリー全体 === */
  .work-gallery {
    margin-left: 0;
    grid-template-columns: 1fr;
    padding: 10px;
    padding-top: 0; /* 上余白を調整 */
  }

  /* === サイドナビ非表示 === */
  nav.side-nav,
  .side-nav {
    display: none;
  }

  /* === 作品カード === */
  .work-item {
    position: static;                 /* 絶対配置を解除 */
    aspect-ratio: auto;               /* 高さを自動に */
    display: flex;
    flex-direction: column;           /* テキスト→画像の縦並び */
    border-radius: 0;
  }

  .work-item img {
    width: 100%;
    height: auto;
    border-radius: 10px;
  }

  /* === 作品メタ情報（タイトルやカテゴリ） === */
  .work-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    padding: 0.6em 1em;
  }

  .work-meta .title {
    font-size: 1rem;
    line-height: 1.4;
  }

  .work-meta .category {
    font-size: 0.85rem;
    opacity: 0.85;
  }

  /* ==== worksページ：スマホ表示 ==== */
    .work-detail {
      flex-direction: column !important;  /* 横並び→縦並び */
      margin-right: 10px !important;          /* サイドマージン解除 */
      text-align: left !important;
    }
    /* ==============================
      worksページ全体背景を白に統一
      ============================== */
    .work-description {
      width: 100% !important;             /* 幅いっぱい */
      position: static !important;        /* 固定解除 */
      height: auto !important;            /* 高さ自動 */
      padding-left: 0px !important;      /* 左余白 */
      margin-bottom: 20px !important;     /* 下余白 */
      background-color: #f8f8f8 !important;
    }
    .work-description p {
      font-size: 14px;
      margin-top: 25px;
      width: 84%;
    }
    .work-description h2 {
      font-size: 20px;
      margin-top: 40px;
      margin-bottom: 10px;
    }
    .work-description h3 {
      font-size: 14px;
      margin-bottom: 10px;
      color: rgb(200, 200, 200);
    }
    .back-link{
      display: inline-block;
      margin-top: 120px;
      margin-bottom: 40px; /* 下に余白を追加！ */
      font-size: 16px;
      color: #333;
      text-decoration: none;
      transition: color 0.2s ease;
    }
    .work-images,
    .work-images-2,
    .work-images-3 {
      margin-left: 0;      /* ← PCの415pxをリセット */
      margin-right: 0;
      display: flex;
      flex-direction: column; /* 縦に並べる */
      align-items: center;    /* 中央寄せ */
      gap: 16px;              /* 画像間の余白 */
      padding: 0 16px;        /* 端に少し余白 */
      width: 100% !important;        /* 幅いっぱいに */
    }

    .work-images img,
    .work-images-2 img,
    .work-images-3 img {
      display: inline-block;         /* 中央揃え用 */
      margin: 0 auto;                /* 自動余白で中央 */
      max-width: 100%;               /* 親幅に収める */
      height: auto;
    }
    .work-images img:hover {
      transform: none;
    }
    .work-item {
      flex-direction: column;             /* テキスト→画像の縦並び */
      position: static;                   /* 絶対配置解除 */
      aspect-ratio: auto;                 /* 高さ自動 */
    }

    .work-item img {
      width: 100%;
      height: auto;
      border-radius: 10px;
    }

    .work-meta {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      opacity: 1 !important;
      background: rgba(0,0,0,0.45);
      color: #fff;
      padding: 0.6em 1em;
    }

    .work-meta .title {
      font-size: 1rem;
      line-height: 1.4;
    }

    .work-meta .category {
      font-size: 0.85rem;
      opacity: 0.85;
    }
    /* 閉じるボタン */
    #image-modal-close {
      position: absolute;
      top: 10px;
      right: 35px;
      color: #fff;
      font-size: 100px;
      font-weight: bold;
      cursor: pointer;
      z-index: 10000;
    }

    #image-modal-close:hover {
      color: #bbb;
    }
  

  /* === モバイルカテゴリプルダウン === */
  .mobile-category {
    display: block;
    text-align: center;
    margin: 16px 0;
  }

  .mobile-category select,
  #categorySelect {
    display: inline-block;
    width: 95%;
    margin-top: 4px;
    padding: 0.6em 1em;
    font-size: 1rem;
    font-family: inherit;
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1em center;
    background-size: 1em;
    margin: 0 auto;              /* ← これで中央揃え */
  }

  /* === ヘッダー === */
  header {
    width: 100%;
    height: auto !important;
    padding: 12px 0 !important;
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
  }

  /* === サイトタイトル === */
  .site-title a {
    font-size: 1.2rem !important;  /* ← ここでスマホ時の文字サイズ調整！ */
    font-weight: 700;
    color: #000;
    text-decoration: none;
    margin-bottom: 14px;
    line-height: 1.2;
  }

  /* === ナビゲーション === */
  .top-nav {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .top-nav ul {
    list-style: none;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 26px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 0;
  }
  .top-nav a {
    text-decoration: none;
    color: #000;
    font-size: 0.9rem!important;
    font-weight: 500;
    transition: 0.2s;
  }
  .top-nav a:hover {
    color: #888;
  }
}
