/* 日本語フォントの設定: フォールバック（代替）フォントを指定 */
:root {
  --md-text-font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo UI", sans-serif;
}

/* カスタムカラー変数 */
:root {
  --md-accent-fg-color: #ff6f00;
  --md-accent-fg-color--transparent: #ff6f001a;
}

/* ナビゲーションの改善 */
.md-nav__title {
  font-weight: 600;
}

.md-nav__link {
  border-radius: 0.1rem;
  transition: background-color 125ms;
}

.md-nav__link:hover {
  background-color: var(--md-accent-fg-color--transparent);
}

/* 3列グリッドレイアウト */
.md-content ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

/* 小枠 */
.md-content ul li {
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  min-height: 3rem;
  /* display: flex; */
  /* align-items: center; */
  word-break: break-word;
}

.md-content ul li strong:first-child {
  white-space: nowrap;
  margin-right: 0.5rem;
}

/* 小枠のモーション */
.md-content ul li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-color: var(--md-accent-fg-color);
}

/* レスポンシブ対応 */
@media screen and (max-width: 76.1875em) {
  .md-content ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 44.9375em) {
  .md-content ul {
    grid-template-columns: 1fr;
  }
}

/* ページ遷移アニメーション */
.md-content {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* ダークモード用の調整 */
[data-md-color-scheme="slate"] {
  --md-hue: 210;
  --md-default-bg-color: #1a1a1a;
  --md-default-fg-color: #e1e5e9;
}

/* プロジェクトカードのスタイル (index.md用) */
.md-typeset .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1em;
}
.card {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 8px; /* 角丸を少し大きく */
    padding: 1.5rem; /* パディングを増やす */
    transition: transform 0.2s, box-shadow 0.2s;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    color: white !important; /* テキスト全体を白に強制 */
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); /* 文字の可読性向上 */
    height: 100%; /* 高さ揃え */
    min-height: 250px; /* 最低高さを確保 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none !important; /* aタグの下線を消す */
}
/* オーバーレイ：背景画像を暗くして文字を見やすくする */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.8));
    z-index: 1;
    transition: opacity 0.3s ease;
}
/* ホバー時に少し明るくする */
.card:hover::before {
    opacity: 0.9;
}

/* コンテンツを前面に出す */
.card > * {
    position: relative;
    z-index: 2;
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transform: translateY(-4px);
    border-color: var(--md-accent-fg-color); /* アクセントカラーで枠を光らせる */
}
.card h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: white !important; /* タイトルも白で統一 */
    transition: color 0.2s;
}
.card:hover h4 {
    color: var(--md-accent-fg-color) !important; /* ホバー時にタイトルをアクセントカラーに */
    text-decoration: none; /* 下線を消す */
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.2); /* 半透明の白 */
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    margin-right: 4px;
    margin-bottom: 4px;
    color: white;
    backdrop-filter: blur(4px); /* すりガラス効果 */
}
.achievement {
    font-weight: bold;
    color: #ffeb3b; /* 黄色で強調 */
    margin: 0.5rem 0;
    font-size: 0.95rem;
}
.year-header {
    border-bottom: 2px solid var(--md-primary-fg-color);
    padding-bottom: 0.2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: bold;
}
/* 説明文の視認性調整 */
.card p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.5rem 0 1rem 0;
    color: rgba(255, 255, 255, 0.95);
}

/* 技術スタック概要 (index.md) 用のスタイル */
.tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.tech-category h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: var(--md-primary-fg-color);
    border-bottom: 2px solid var(--md-default-fg-color--lighter);
    padding-bottom: 0.3rem;
}
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tech-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    background-color: var(--md-default-fg-color--lighter);
    color: var(--md-default-fg-color);
    font-size: 0.85rem;
    font-weight: 500;
}
.more-skills-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--md-primary-fg-color);
    color: white !important;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
}
.more-skills-btn:hover {
    background-color: var(--md-primary-fg-color--dark);
}

/* -------------------------------
   Qiita Articles Style (index.md)
   ------------------------------- */
.qiita-articles {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 1em;
}

.article-card {
    display: block;
    padding: 15px 20px;
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lighter);
    border-left: 5px solid #55c500; /* Qiita Green */
    border-radius: 8px;
    text-decoration: none !important;
    color: var(--md-default-fg-color) !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(85, 197, 0, 0.2);
    border-color: #55c500;
}

.article-date {
    font-size: 0.8em;
    color: var(--md-default-fg-color--light);
    margin-bottom: 5px;
}

.article-title {
    margin: 0 0 10px 0 !important;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--md-default-fg-color) !important;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.article-tags .tag {
    background: var(--md-default-fg-color--lighter);
    color: var(--md-default-fg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    border: none;
}

