/* ============================================
   tentmochi / style.css
   Win95.cssの上に乗せる独自スタイル
   スマホ対応込み
   ============================================ */

/* ---------- フォント ---------- */
/* 全体: Noto Sans JP（読みやすい・日本語対応）
   win95らしさはfont-weight:700 + letter-spacing + box-shadowで表現 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --win95-gray:     #c0c0c0;
  --win95-dark:     #808080;
  --win95-blue:     #000080;
  --win95-white:    #ffffff;
  --win95-black:    #000000;
  --win95-desktop:  #008080;

  --shadow-raise: 2px 2px 0 var(--win95-white) inset,
                  -2px -2px 0 var(--win95-dark) inset;
  --shadow-sink:  2px 2px 0 var(--win95-dark) inset,
                  -2px -2px 0 var(--win95-white) inset;

  /*
   * 背景画像の設定
   * /assets/bg.png を用意して以下のコメントを外すと適用される。
   * サイズはそのままタイル繰り返し（repeat）。
   *
   * --bg-image: url('/assets/bg.png');
   *
   * 画像なしのデフォルトはWin95風のドットパターン。
   */
  --bg-image: url('/assets/bg.png');
}

/* ---------- ベース ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  background-color: var(--win95-desktop);
  background-image: var(--bg-image);
  background-repeat: repeat;
  background-size: auto;  /* 画像サイズそのまま繰り返し */
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--win95-black);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* UI部品（ナビ・タイトルバー・ボタン等）は
   font-weight:700 + 小さめサイズで引き締まった印象に */
.win-titlebar,
.win-title,
.taskbar-nav,
.start-btn,
.nav-item,
.hamburger,
.mobile-menu a,
.btn95,
.statusbar,
.win-btn {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, sans-serif;
}

a {
  color: var(--win95-blue);
}
a:hover {
  color: var(--win95-black);
}

/* ---------- タスクバー風ナビ ---------- */
.taskbar-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--win95-gray);
  box-shadow: var(--shadow-raise);
  height: 36px;
}

.taskbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 6px;
  gap: 4px;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: var(--win95-gray);
  box-shadow: var(--shadow-raise);
  font-weight: 700;
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
  color: var(--win95-black);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  border: none;
  letter-spacing: 0.02em;
}
.start-btn:hover {
  color: var(--win95-black);
}
.start-btn:active {
  box-shadow: var(--shadow-sink);
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-item {
  padding: 4px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--win95-black);
  background: var(--win95-gray);
  box-shadow: var(--shadow-raise);
  white-space: nowrap;
}
.nav-item:hover, .nav-item.active {
  box-shadow: var(--shadow-sink);
  color: var(--win95-black);
}

/* ハンバーガー（スマホのみ表示） */
.hamburger {
  display: none;
  background: var(--win95-gray);
  border: none;
  box-shadow: var(--shadow-raise);
  padding: 2px 8px;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: auto;
  font-family: inherit;
}
.hamburger:active {
  box-shadow: var(--shadow-sink);
}

/* モバイルメニュー */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--win95-gray);
  box-shadow: var(--shadow-raise);
  position: sticky;
  top: 36px;
  z-index: 99;
  padding: 4px 0;
}
.mobile-menu.open {
  display: flex;
}
.mobile-menu a {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--win95-black);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--win95-dark);
}
.mobile-menu a:hover {
  background: var(--win95-blue);
  color: var(--win95-white);
}

/* ---------- メインコンテンツ ---------- */
.site-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 20px auto;
  padding: 0 12px;
}

/* ---------- ウィンドウ共通 ---------- */
.win-window {
  background: var(--win95-gray);
  box-shadow:
    2px 2px 0 var(--win95-white) inset,
    -2px -2px 0 var(--win95-dark) inset,
    4px 4px 8px rgba(0,0,0,0.4);
  margin-bottom: 16px;
}

.win-titlebar {
  background: var(--win95-blue);
  color: var(--win95-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  user-select: none;
}

.win-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.title-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.win-controls {
  display: flex;
  gap: 2px;
}

.win-btn {
  background: var(--win95-gray);
  color: var(--win95-black);
  border: none;
  width: 20px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-raise);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.win-btn:active {
  box-shadow: var(--shadow-sink);
}
.win-btn.win-close {
  font-size: 12px;
}

.win-body {
  padding: 12px;
}

.win-footer {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--win95-dark);
}

/* ---------- プロフィール ---------- */
.profile-window {
  margin-bottom: 16px;
}

.profile-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.avatar-box {
  width: 72px;
  height: 72px;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--win95-white);
  box-shadow: var(--shadow-sink);
  flex-shrink: 0;
}

.profile-name {
  margin: 0 0 6px 0;
  font-size: 1.3rem;
  font-family: inherit;
}

.profile-desc {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.profile-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- ボタン ---------- */
.btn95 {
  display: inline-block;
  padding: 5px 16px;
  background: var(--win95-gray);
  color: var(--win95-black);
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-raise);
  cursor: pointer;
  border: none;
  user-select: none;
  min-width: 70px;
  text-align: center;
}
.btn95:hover {
  color: var(--win95-black);
}
.btn95:active {
  box-shadow: var(--shadow-sink);
}

/* ---------- グリッド ---------- */
.windows-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.windows-grid > .win-window:first-child {
  grid-column: 1 / -1;
}

/* ---------- ブログ記事リスト ---------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-list li {
  padding: 6px 0;
  border-bottom: 1px dotted var(--win95-dark);
  font-size: 0.85rem;
}
.post-list li:last-child {
  border-bottom: none;
}
.post-list .post-meta {
  font-size: 0.75rem;
  color: var(--win95-dark);
  margin-left: 8px;
}
.post-list .post-tag {
  display: inline-block;
  background: var(--win95-blue);
  color: var(--win95-white);
  padding: 0 4px;
  font-size: 0.7rem;
  margin-right: 4px;
}

/* ---------- ローディングバー ---------- */
.loading-bar {
  height: 16px;
  background: var(--win95-white);
  box-shadow: var(--shadow-sink);
  margin-bottom: 6px;
  overflow: hidden;
}
.loading-fill {
  height: 100%;
  width: 0%;
  background: var(--win95-blue);
  transition: width 1s ease;
}
.loading-text {
  font-size: 0.8rem;
  color: var(--win95-dark);
  margin: 0;
}

/* ---------- ツール一覧 ---------- */
.tool-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px;
  background: var(--win95-white);
  box-shadow: var(--shadow-sink);
}
.tool-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.tool-name {
  font-size: 0.85rem;
  font-weight: bold;
  display: block;
}
.tool-desc {
  font-size: 0.78rem;
  color: var(--win95-dark);
  margin: 2px 0 0 0;
}

/* ---------- カテゴリリスト ---------- */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.category-list li {
  padding: 6px 4px;
  border-bottom: 1px solid var(--win95-dark);
  font-size: 0.85rem;
}
.category-list li:last-child {
  border-bottom: none;
}
.category-desc {
  color: var(--win95-dark);
  font-size: 0.8rem;
}

/* ---------- ツールカードグリッド（tool/index.html） ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.tool-card {
  background: var(--win95-white);
  box-shadow: var(--shadow-sink);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-card-icon {
  font-size: 1.6rem;
}

.tool-status {
  font-size: 0.7rem;
  padding: 1px 6px;
  font-family: 'DotGothic16', monospace;
}
.status-live    { background: #008000; color: #fff; }
.status-wip     { background: #808000; color: #fff; }
.status-stopped { background: #808080; color: #fff; }

.tool-card-name {
  font-size: 0.95rem;
  margin: 0;
  font-family: inherit;
}
.tool-card-name a {
  color: var(--win95-black);
  text-decoration: none;
}
.tool-card-name a:hover {
  text-decoration: underline;
}

.tool-card-desc {
  font-size: 0.82rem;
  color: #333;
  margin: 0;
  line-height: 1.5;
  flex: 1;
}

.tool-card-footer {
  margin-top: 4px;
}

.btn95[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: var(--shadow-sink);
}

/* ---------- ドラッグ可能ウィンドウ（PCのみ） ---------- */
@media (pointer: fine) {
  /* ドラッグ移動後はabsoluteで自由配置（通常フローから外れる） */
  .win-window.is-dragged {
    position: absolute;
    z-index: 10;
    margin-bottom: 0;
  }

  /* ドラッグ中のウィンドウを最前面・影強調 */
  .win-window.is-dragging {
    z-index: 200;
    box-shadow:
      2px 2px 0 var(--win95-white) inset,
      -2px -2px 0 var(--win95-dark) inset,
      8px 8px 16px rgba(0,0,0,0.55);
  }

  /* タイトルバーをつまめることを示すカーソル */
  .draggable-window .win-titlebar {
    cursor: grab;
  }
  .draggable-window.is-dragging .win-titlebar {
    cursor: grabbing;
  }

  /* ドラッグ移動が起きているページのmainはrelativeにして座標基準にする */
  .drag-mode-active {
    position: relative;
  }
}

/* ---------- ステータスバー風フッター ---------- */
.statusbar {
  background: var(--win95-gray);
  box-shadow: 0 -2px 0 var(--win95-white) inset;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.statusbar-sep {
  color: var(--win95-dark);
}

/* ============================================
   スマホ対応 (max-width: 600px)
   ============================================ */
@media (max-width: 600px) {

  html { font-size: 14px; }

  /* ナビ */
  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* メイン */
  .site-main {
    margin: 10px auto;
    padding: 0 8px;
  }

  /* プロフィール */
  .profile-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-links {
    justify-content: center;
  }

  /* グリッド → 1カラム */
  .windows-grid {
    grid-template-columns: 1fr;
  }
  .windows-grid > .win-window:first-child {
    grid-column: 1;
  }

  /* ウィンドウ */
  .win-body {
    padding: 8px;
  }

  /* ウィンドウボタンは飾りなのでスマホでは非表示 */
  .win-controls {
    display: none;
  }
}

/* ---------- タブレット (601px ~ 768px) ---------- */
@media (min-width: 601px) and (max-width: 768px) {
  .windows-grid {
    grid-template-columns: 1fr;
  }
  .windows-grid > .win-window:first-child {
    grid-column: 1;
  }
}
