/*
Theme Name: Kaito Kubo
Author: Kaito Kubo
Description: オリジナルポートフォリオテーマ
Version: 1.0
*/

/* ==========================================================================
   Basic Settings (基本設定)
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: bembo-mt-pro, "Yu Mincho", YuMincho, "游明朝", serif;
  font-weight: normal;
  background-color: #ffffff;
  color: #1a1a1a;
  line-height: 1.4;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  font-feature-settings: "palt";
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.7;
}

ul {
  list-style: none;
}

/* ★英語・英数字のフォントサイズを日本語の1.1倍にする設定 */
.en {
  font-size: 1.18em;
  line-height: 1;
}

/* ==========================================================================
   Layout (レイアウト)
   ========================================================================== */
.container {
  display: flex;
  min-height: 101vh;
}

/* 左側：ナビゲーションバー */
.sidebar {
  width: 280px;
  padding: 25px 35px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background-color: #ffffff;
  z-index: 100;
  letter-spacing: 0.5px;
}

/* 右側：主要コンテンツエリア */
.content {
  flex-grow: 1;
  margin-left: 280px;
  padding: 0px 280px 60px 0px;
}

.content-inner {
  width: 100%;
  max-width: calc(4 * 280px + 3 * 30px);
  margin: auto;
}

/* ==========================================================================
   Logo & Navigation (ロゴとナビゲーション)
   ========================================================================== */
.logo {
  height: 90px;
  margin-bottom: 20px;
}

.name {
  display: block;
  font-size: 16px;
}

.title {
  display: block;
  text-transform: lowercase;
  font-size: 14px;
}

.main-nav ul li {
  font-size: 14px;
  margin-bottom: 1px;
  letter-spacing: 1.5px;
}

.main-nav ul li:last-child {
  margin-top: 25px;
  margin-bottom: 0;
}

.main-nav a {
  text-transform: lowercase;
  color: #1a1a1a;
}

.main-nav a:hover {
  opacity: 0.7;
}

.main-nav a.active {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ハンバーガーボタン（PCでは非表示） */
.hamburger {
  display: none;
}

/* ==========================================================================
   Filters (作品分類フィルター)
   ========================================================================== */
.filters {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  z-index: 90;
  padding: 25px 280px 0px 0px;
  height: 130px;
  letter-spacing: 1.5px;
  color: #a1a1a1;
  font-size: 13px;
}

.filters ul {
  width: 100%;
  max-width: calc(4 * 280px + 3 * 30px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: flex-start;
}

.filters a {
  text-transform: lowercase;
  color: #a1a1a1;
  padding-bottom: 2px;
}

.filters a:hover {
  color: #1a1a1a;
}

.filters a.active {
  color: #ff140c;
  text-decoration: none;
}

/* ==========================================================================
   Works Grid (作品網格)
   ========================================================================== */
.works-grid {
  padding-top: 137px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 35px 20px;
  justify-content: flex-start;
  width: 100%;
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.image-wrapper {
  width: 100%;
  aspect-ratio: 7 / 5;
  overflow: hidden;
  background-color: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

/* ホバー時に少し透過させる場合 */
.image-wrapper img:hover {
  opacity: 0.85;
}

.image-wrapper.placeholder {
  background-color: #e0e0e0;
}

.item-details {
  padding-top: 6px;
  width: 100%;
}

.item-details h3 {
  font-size: 12px;
  color: #a1a1a1;
  font-weight: normal;
}

/* ==========================================================================
   List of Works (テキスト一覧ページ)
   ========================================================================== */
.list-container {
  padding-top: 135px;
  width: 100%;
  max-width: 900px;
}

.year-section {
  margin-bottom: 50px;
}

.year-title {
  font-size: 14px;
  font-weight: normal;
  margin-bottom: 6px;
  letter-spacing: 1.5px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.works-list {
  width: 100%;
}

.works-list li {
  display: flex;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: none;
  line-height: 1.6;
}

.work-date {
  width: 60px;
  flex-shrink: 0;
  color: #1a1a1a;
  font-size: 12px;
  letter-spacing: 1px;
}

.work-title {
  flex-grow: 1;
  color: #1a1a1a;
}

.work-category {
  width: 120px;
  flex-shrink: 0;
  text-align: right;
  color: #a1a1a1;
  font-size: 11px;
  text-transform: lowercase;
}

/* 丸括弧と中のテキストを小さくし、高さを整える */
.parenthesis {
  font-size: 0.8em;
  display: inline-block;
  position: relative;
  top: -1px;
}

/* リスト内のリンクから下線を消す */
.works-list a {
  text-decoration: none;
  border-bottom: none;
}

/* アスタリスクを赤くする */
.asterisk {
  color: #ff0000;
  margin-right: 5px;
}

/* ==========================================================================
   About Page (アバウトページ)
   ========================================================================== */
.about-container {
  padding-top: 135px;
  width: 100%;
  max-width: 400px;
  text-align: justify;
  text-justify: inter-ideograph;
}

.about-name {
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 400;
}

.about-bio p {
  margin-bottom: 30px;
  line-height: 1.9;
}

.about-bio p.bio-en {
  font-size: 11px;
  line-height: 1.5;
  color: #808080;
  margin-bottom: 45px;
}

.about-bio a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s ease;
}

.about-bio a:hover {
  color: #ff140c;
}

/* ==========================================================================
   News Page (ニュースページ)
   ========================================================================== */
.news-container {
  padding-top: 133px;
  width: 100%;
  max-width: 900px;
}

.news-list {
  width: 100%;
}

.news-item {
  margin-bottom: 30px;
}

.news-date {
  display: block;
  font-size: 12px;
  color: #1a1a1a;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.news-text {
  font-size: 13px;
  line-height: 1.9;
  color: #1a1a1a;
}

.news-text a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s ease;
}

.news-text a:hover {
  color: #ff140c;
}

/* ==========================================================================
   Work Detail Page (作品詳細ページ)
   ========================================================================== */
.work-detail-container {
  padding-top: 135px; /* 他のページと開始位置を統一 */
  width: 100%;
}

/* 画像エリア */
.detail-images {
  display: flex;
  flex-direction: column;
  gap: 7px; /* 画像と画像の間の余白 */
  margin-bottom: 30px; /* 画像群とテキストの間の大きな余白 */
}

.detail-images img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* テキストエリア（文字が横に広がりすぎないよう最大幅を絞る） */
.detail-text {
  max-width: 400px;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* マスト項目（タイトルと分類） */
.detail-header {
  margin-bottom: 15px;
  line-height: 1.6; /* listページと同じ行間 */
}

.detail-title {
  font-size: 15px;
  font-weight: normal;
  color: #1a1a1a;
}

.detail-category {
  font-size: 14px;
  color: #a1a1a1;
  text-transform: lowercase;
  letter-spacing: 1px;
}

/* 補足情報（行間 1.9 に設定） */
.detail-description {
  margin-bottom: 30px;
}

/* 変動クレジット ＆ リンク情報の共通ブロック */
.detail-info-group,
.detail-links {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 13px; /* 項目同士の余白 */
}

.info-item {
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* 項目名（上に小さく記載） */
.info-label {
  font-size: 11px;
  color: #1a1a1a;
  margin-bottom: 1px;
  letter-spacing: 1px;
  text-transform: lowercase;
}

.info-value {
  font-size: 13.5px;
  color: #1a1a1a;
}

.detail-description p {
  line-height: 1.9; /* aboutページと同じ行間 */
  margin-bottom: 30px; /* 段落同士の余白 */
}

.detail-description p:last-child {
  margin-bottom: 0;
}

/* リンクテキストの装飾 */
.info-link {
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s ease;
  color: #1a1a1a;
}

.info-link:hover {
  color: #ff140c; /* ホバー時は他のページと同じく赤色に */
}

/* ==========================================================================
   Global Footer (コピーライト)
   ========================================================================== */
.global-footer {
  position: fixed;
  bottom: 20px;
  left: 35px;
  z-index: 110;
  font-size: 9px;
  color: #a1a1a1;
  letter-spacing: 1px;
}

/* ==========================================================================
   Responsive Design (レスポンシブ設計)
   ========================================================================== */
@media (max-width: 1200px) {
  .content {
    padding: 0px 35px 60px 0px;
  }

  .filters {
    padding: 25px 35px 0px 0px;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 22px 20px 68px 20px;
    text-align: left;
  }

  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
  }

  .logo {
    height: auto;
    margin-bottom: 0;
  }

  /* ★修正: テキストベースのメニューボタン */
  .hamburger {
    display: block;
    position: relative;
    cursor: pointer;
    z-index: 110;
    margin-top: 2px; /* 「Kaito Kubo」の頭と視覚的に揃えるための微調整 */
    color: #1a1a1a;
  }

  /* 以前の3本線（spanタグ）はCSSで非表示にする */
  .hamburger span {
    display: none;
  }

  /* ★追加: 通常時は「menu」という文字を表示 */
  .hamburger::before {
    content: "menu";
    display: block;
  }

  /* ★追加: クリックされて is-active が付いたら「close」に書き換える */
  .hamburger.is-active::before {
    content: "close";
  }

  /* メニューの初期状態を非表示に */
  .main-nav {
    display: none;
    width: 100%;
    margin-top: 45px;
  }

  .main-nav.is-active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .main-nav ul {
    display: block;
  }

  .main-nav ul li {
    margin-bottom: 1px;
  }

  .main-nav ul li:last-child {
    margin-top: 25px;
    margin-bottom: 0;
  }

  .content {
    margin-left: 0;
    padding: 0 20px 45px 20px;
  }

  .filters {
    position: static;
    height: auto;
    padding: 0 0 30px 0;
    margin-bottom: 0;
    text-align: left;
  }

  .filters ul {
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filters ul::-webkit-scrollbar {
    display: none;
  }

  .works-grid,
  .list-container,
  .about-container,
  .news-container,
  .work-detail-container {
    padding-top: 0;
  }

  .works-grid {
    justify-content: flex-start;
  }

  .global-footer {
    position: static;
    text-align: left;
    padding: 0 20px 20px 20px;
  }
}

@media (max-width: 620px) {
  .works-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .image-wrapper {
    width: 100%;
  }

  /* =========================================================
     ★ フィルターメニューの折り返し制御（620px以下）
     ========================================================= */
  .filters ul {
    flex-wrap: wrap; /* 折り返しを許可 */
    overflow-x: visible; /* 横スクロールを解除 */

    /* ▼ 行間（上下の隙間）と 列間（左右の隙間）はここで調整できます ▼ */
    /* 前の数値「15px」が行間、 後ろの数値「20px」が列間です */
    gap: 1px 15px;
  }

  /* CSSの機能を使って、「others」の直前で強制的に改行させる仕組み */
  .filters ul li:nth-child(1) {
    order: 1;
  } /* all */
  .filters ul li:nth-child(2) {
    order: 2;
  } /* books */
  .filters ul li:nth-child(3) {
    order: 3;
  } /* exhibitions */
  .filters ul li:nth-child(4) {
    order: 4;
  } /* logo, identities */

  /* ★魔法のコード：4番目の後に「横幅100%の見えないブロック」を挟み込んで改行させる */
  .filters ul::after {
    content: "";
    display: block;
    flex-basis: 100%;
    order: 5;
  }

  /* others以降は新しい行の左端からスタートする（余計なスペースは一切入りません） */
  .filters ul li:nth-child(5) {
    order: 6;
  } /* others */
  .filters ul li.separator {
    order: 7;
  } /* / */
  .filters ul li:last-child {
    order: 8;
  } /* list of works */
}

/* =========================================================
   ★ 詳細ページのテキスト幅制御（500px以下）
   ========================================================= */
@media (max-width: 500px) {
  /* 作品詳細ページのテキスト制限を解除し、スマホ幅いっぱいに広げる */
  .detail-text,
  .about-container {
    max-width: 100%;
  }
}
