/* /gallery/index.html 専用スタイル */

/* カテゴリ別プレビュー */
.gallery-showcase {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-bottom: 1.5rem; /* 全制作物一覧セクションとの余白を詰めました */
}

.gallery-category-preview {
  position: relative;
  background: var(--kp-accent-2); /* 背景色を薄い緑に変更 */
  /* 内側に金色のアクセントを持つ二重ボーダー */
  border: 1px solid var(--kp-line);
  box-shadow: inset 0 0 0 1px var(--kp-line), inset 0 0 0 5px var(--kp-kogane);
  border-radius: var(--kp-radius);
  padding: clamp(32px, 5vw, 48px) clamp(24px, 4vw, 32px) clamp(24px, 4vw, 32px);
  box-shadow: var(--kp-shadow);
}

.gallery-category-preview__title {
  /* 和書の「題簽（だいせん）」風のデザイン */
  position: absolute;
  top: -0.8rem; /* 少し上に配置 */
  left: 32px;
  transform: translateY(-50%);
  background: linear-gradient(
    to bottom,
    color-mix(in oklab, var(--kp-leaf) 15%, #fff 85%),
    color-mix(in oklab, var(--kp-leaf) 5%, #fff 95%)
  ); /* より濃い緑のグラデーションに変更 */
  border: 1px solid var(--kp-line);
  /* border-bottom: 1px solid var(--kp-paper); */ /* 下のボーダーを統一 */
  padding: 8px 10px;
  border-radius: 8px 8px 0 0;
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--kp-matcha); /* デフォルトの色を濃く */
  letter-spacing: 0.05em;
  cursor: default;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* デフォルトで薄い影 */
  z-index: 2; /* 親要素のボーダーや影の上に表示 */
  transition: all 0.3s ease; /* トランジションを簡素化 */
}

.gallery-category-preview:hover .gallery-category-preview__title {
  transform: translateY(-50%) translateY(-6px); /* ホバーでさらに浮き上がる */
  color: color-mix(
    in oklab,
    var(--kp-matcha) 85%,
    #000 15%
  ); /* ホバーで少し濃い色に */
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.1); /* ホバーで影を強調 */
}

.gallery-grid--preview {
  --grid-cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: clamp(16px, 2.5vw, 24px);
  margin-bottom: 2rem;
}

.gallery-category-preview__footer {
  text-align: center;
}

/* プレビュー内の制作物タイルにホバーエフェクトを追加 */
.gallery-grid--preview .gallery-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.gallery-grid--preview .gallery-item:hover {
  border-color: color-mix(in oklab, var(--kp-line) 70%, var(--kp-leaf));
}

/* プレビュー画面ではタグを非表示にする */
.gallery-grid--preview .item-tags {
  display: none;
}

/* カテゴリアイコン（制作物タイル右上のバッジ） */
.gallery-item {
  position: relative; /* アイコンを配置する基準 */
}

/* カテゴリラベル（制作物タイル右上のバッジ） */
.item-category {
  top: -25px;
  padding: 4px 10px;
  background-color: color-mix(
    in oklab,
    var(--kp-paper) 85%,
    transparent
  ); /* 少し透けた和紙の色 */
  -webkit-backdrop-filter: blur(4px); /* iOS Safari向け */
  backdrop-filter: blur(4px); /* 背景をぼかす */
  color: #43676b;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 1; /* 画像の上に表示 */
}

/* 全制作物一覧セクション */
.gallery-section {
  background: linear-gradient(180deg, #ffffff, #ffffffef),
    var(--kp-washi) repeat;
  background-blend-mode: normal, multiply;
  padding: 0 clamp(24px, 4vw, 32px) clamp(24px, 4vw, 32px);
  box-shadow: var(--kp-shadow);
}

.gallery-section__title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--kp-matcha); /* 色を抹茶色に統一 */
  margin-bottom: 0;
  margin-right: auto;
  text-align: left;
  position: relative;
  padding: 0.2em 1em 0.2em 0; /* 左の余白を削除 */
  display: inline-block; /* アニメーションのためにインラインブロック要素に変更 */
  letter-spacing: 0.08em; /* 文字間隔を少し広げる */
}

/* 下線のベース（ホバーで伸びる線） */
.gallery-section__title::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0; /* 初期状態では幅0 */
  height: 1.5px;
  background-color: var(--kp-leaf);
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 両端の「留め」アクセント */
.gallery-section__title::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-image: linear-gradient(
    to right,
    var(--kp-leaf) 10%,
    transparent 10%,
    transparent 90%,
    var(--kp-leaf) 90%
  );
  background-size: 100% 100%;
  opacity: 0; /* 初期状態では非表示 */
  transform: scaleX(0.8); /* 少し縮めた状態から開始 */
  transition: opacity 0.3s ease-out 0.2s, transform 0.4s ease-out 0.2s;
}

/* ホバー時のアニメーション */
.gallery-section__title:hover::before {
  width: 100%;
  left: 0;
}
.gallery-section__title:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.gallery-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.gallery-controls {
  display: block;
  padding: 0 0 1.5rem 0;
  background: transparent; /* 背景を透明に */
  border-radius: 0; /* 角丸をリセット */
  border: none; /* ボーダーをリセット */
  border-bottom: 1px solid var(--kp-line);
  margin-bottom: 2rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0;
  align-items: center;
  order: 1;
  margin-right: auto;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5em 1.2em;
  border: none;
  border-right: 1px solid var(--kp-line);
  background: transparent;
  color: var(--kp-heading);
  cursor: pointer;
  border-radius: 0;
  transition: color 0.2s ease, background-color 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
}

.filter-btn:last-child {
  border-right: none;
}

.filter-btn:hover {
  background-color: rgba(0, 0, 0, 0.02);
  color: var(--kp-matcha);
}

.filter-btn.active {
  background-color: transparent;
  color: var(--kp-matcha);
  border-color: var(--kp-line);
  box-shadow: none;
  font-weight: 700;
}

.filter-btn.active::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 1.2em;
  right: 1.2em;
  height: 1.5px;
  background-color: var(--kp-matcha);
}

.search-box {
  display: flex;
  align-items: center;
  position: relative;
  padding-right: 0;
}

/* 検索フォームとフィルターの間の縦線 */
.search-box::after {
  display: none;
}

.search-input {
  border: 1px solid #999; /* 視認性を向上させるため濃いグレーに変更 */
  border-radius: 999px;
  padding: 0.7em 2.8em 0.7em 1.2em;
  font-size: 0.95rem;
  outline: none; /* 枠線を削除 */
  width: 260px;
  background-color: #fff;
  color: var(--kp-ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--kp-matcha);
  box-shadow: 0 4px 12px rgba(46, 78, 46, 0.15);
}

.search-btn {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  padding: 0.4em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kp-matcha);
  opacity: 0.7;
  transition: all 0.2s ease;
}
.search-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
  color: var(--kp-matcha);
}

.item-client-name {
  font-size: 0.85rem;
  font-weight: 320;
  font-family: "Noto Sans JP", "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  border-top: 1px solid #dad5d5; /* 線が見えやすいように色を濃く変更 */
  padding-top: 0em;
  margin-top: 0.8em;
  display: block;
}

@media (max-width: 1024px) {
  .gallery-grid--preview {
    --grid-cols: 3;
  }
}

@media (max-width: 768px) {
  .gallery-category-preview {
    padding: 2.5rem 1.5rem 1.5rem;
  }
  .gallery-grid--preview {
    --grid-cols: 2;
  }
  .gallery-controls {
    gap: 1.5rem;
  }
  .search-box::after {
    display: none; /* スマホでは縦線を非表示 */
  }
  .search-input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .gallery-grid--preview {
    --grid-cols: 1;
  }
  .filter-buttons {
    justify-content: center;
  }
}

.kp-sec__desc {
  margin-top: -1em;
}

.modal-image {
  display: flex;
  flex-direction: column;
  max-width: 660px;
  gap: 10px;
  margin: 0 auto; /* コンテナ自体を中央寄せにする */
  align-items: center; /* 画像下中央にボタンを配置 */
}

.modal-image-main img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--kp-line); /* 薄いグレーのボーダー */
  border-radius: 0; /* メイン画像は角丸にしない */
  box-shadow: var(--kp-shadow); /* 他の要素と合わせた影を追加 */
}

/* ========== staff notes ========== */

.staff-notes-section {
  padding: 2em;

  background-color: #f9f9f9;
}

#sort-container {
  display: flex;
  align-items: center;
  margin-right: 0.5rem;
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--kp-ink-soft);
  cursor: pointer;
  padding: 0.5em 1.6em 0.5em 0.5em;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232e4e2e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 14px;
  transition: color 0.2s ease;
}

.sort-select:hover {
  color: var(--kp-matcha);
}

.sort-select:focus {
  outline: none;
}

.modal-specs {
  font-family: "Noto Sans JP", "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: "Noto Sans JP", "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

.item-subtitle {
  font-family: "Noto Sans JP", "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}
