/* ==================================================
   TECH & ROOTS 共通スタイルシート
   ================================================== */

:root {
    --main-color:   #2c3e50;
    --accent-olive: #6b8e23;
    --bg-color:     #f4f7f6;
    --white:        #ffffff;
    --border-color: #cccccc;
    --text-color:   #333333;
}

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

body {
    margin: 0; padding: 0;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --------------------------------------------------
   ヘッダー
   -------------------------------------------------- */
header {
    background: var(--main-color);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.header-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.header-logo {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.3rem;
    white-space: nowrap;
}

/* ナビゲーション */
.nav-menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    margin-left: 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    white-space: nowrap;
}

.nav-menu a:hover {
    border-bottom-color: var(--accent-olive);
}

/* カテゴリリンク：やや透過して区別 */
.nav-menu .nav-cat {
    color: rgba(255,255,255,0.85);
}

.nav-menu .nav-divider {
    color: rgba(255,255,255,0.3);
    margin-left: 12px;
    font-size: 0.85rem;
}

/* --------------------------------------------------
   共通コンテナ
   -------------------------------------------------- */
.container {
    max-width: 860px;
    margin: 30px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

/* --------------------------------------------------
   フッター
   -------------------------------------------------- */
footer {
    background: var(--white);
    border-top: 1px solid #ddd;
    margin-top: 50px;
    padding: 30px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

footer a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover { text-decoration: underline; }

/* --------------------------------------------------
   トップページ：記事カード
   -------------------------------------------------- */
/* カードのラッパー（index.html で使用） */
.post-card-wrap {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    border-left: 6px solid var(--accent-olive);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card-wrap:hover {
    transform: translateX(6px);
    box-shadow: 4px 4px 16px rgba(0,0,0,0.12);
}

/* カード内リンク（画像＋テキスト部分） */
.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0 0 4px 0;
}

/* カード内アイキャッチ */
.post-card-wrap .eyecatch-wrapper {
    width: 100%;
    max-height: 320px;
    overflow: hidden;
    background: #eee;
}

.post-card-wrap .eyecatch-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* カード内テキスト */
.post-card-link .post-meta { padding: 16px 24px 0; }
.post-card-link .post-title { padding: 4px 24px 0; margin: 0; font-size: 1.2rem; line-height: 1.45; color: var(--main-color); }
.post-card-link .post-summary { padding: 8px 24px 12px; margin: 0; font-size: 0.9rem; color: #666; }

/* カテゴリタグ行 */
.post-meta-tags {
    padding: 0 24px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --------------------------------------------------
   カテゴリバッジ（共通）
   -------------------------------------------------- */
.cat-link {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid var(--main-color);
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--main-color);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.cat-link:hover {
    background: var(--main-color);
    color: var(--white);
}

/* --------------------------------------------------
   記事詳細ページ（single.html）
   -------------------------------------------------- */
/* post-article：single専用ラッパー（post-contentとクラスを分離） */
.post-article {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 30px;
    margin-bottom: 30px;
}

/* アイキャッチ画像 */
.eyecatch-wrapper {
    width: 100%;
    overflow: hidden;
    background: #eee;
    border-radius: 6px;
    margin-bottom: 24px;
}

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

/* 投稿日 */
.post-meta { margin-bottom: 4px; }
.post-date { color: #4a6b1a; font-size: 0.9rem; font-weight: bold; }

/* 記事タイトル */
.post-title {
    margin: 0.3rem 0 1.5rem;
    color: var(--main-color);
    font-size: 1.8rem;
    line-height: 1.35;
}

/* --------------------------------------------------
   記事本文（entry-content）
   -------------------------------------------------- */
.entry-content h2 {
    padding: 10px 15px;
    margin: 40px 0 20px;
    color: var(--main-color);
    font-size: 1.4rem;
    background: #f8f9fa;
    border-left: 6px solid var(--main-color);
    border-bottom: 1px solid #e0e0e0;
}

.entry-content h3 {
    padding: 5px 0 8px 10px;
    margin: 30px 0 15px;
    color: var(--main-color);
    font-size: 1.2rem;
    border-bottom: 2px solid #ddd;
}

.entry-content p { margin-bottom: 1.4rem; }

.entry-content a {
    color: #3d5c0f;
    text-decoration: underline;
}

.entry-content a:hover { text-decoration: none; }

/* コードブロック */
.entry-content pre {
    background: #282c34;
    color: #abb2bf;
    padding: 1.2rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}

.entry-content code {
    font-family: Consolas, Monaco, "Andale Mono", monospace;
}

/* 引用 */
.entry-content blockquote {
    background: #fdf2e9;
    padding: 1.2rem 1.5rem;
    border-left: 5px solid #fad7a0;
    margin: 2rem 0;
    border-radius: 0 4px 4px 0;
}

/* 表 */
.entry-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    text-align: left;
}

.entry-content th {
    background: #f0f4f8;
    font-weight: bold;
    color: var(--main-color);
}

/* 記事内タグリンクをバッジ化 */
.entry-content a[href*="/tags/"] {
    display: inline-block;
    background: #f0f4f8;
    color: var(--main-color);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    text-decoration: none;
    margin: 4px 6px 4px 0;
    border: 1px solid #d1d9e0;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}

.entry-content a[href*="/tags/"]:hover {
    background: var(--main-color);
    color: var(--white);
    border-color: var(--main-color);
}

/* --------------------------------------------------
   目次
   -------------------------------------------------- */
.toc-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 30px;
}

.toc-title {
    display: block;
    font-weight: bold;
    font-size: 1rem;
    color: var(--main-color);
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

#TableOfContents ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

#TableOfContents li { margin: 5px 0; }

#TableOfContents a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
}

#TableOfContents a:hover {
    text-decoration: underline;
    color: var(--accent-olive);
}

/* --------------------------------------------------
   筆者カード
   -------------------------------------------------- */
.post-divider {
    border: 0;
    border-top: 1px dashed var(--border-color);
    margin: 40px 0;
}

.author-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    background: #fcfcfc;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 24px;
    margin: 20px 0;
}

.author-avatar-wrapper {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
}

.author-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.author-text { flex: 1; }
.author-label { font-size: 0.7rem; font-weight: bold; color: #4a6b1a; margin: 0; }
.author-name  { font-weight: bold; font-size: 1.1rem; margin: 4px 0; color: var(--main-color); }
.author-description { font-size: 0.85rem; color: #666; margin: 0; line-height: 1.6; }

.author-description a {
    color: var(--main-color);
    text-decoration: underline;
}

/* --------------------------------------------------
   前後記事ナビゲーション
   -------------------------------------------------- */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
}

.post-nav-item { flex: 1; }

.post-nav-item a {
    display: block;
    padding: 14px;
    border: 1px solid #eee;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.85rem;
    line-height: 1.5;
    transition: background 0.2s;
}

.post-nav-item a:hover { background: #f4f7f6; }
.post-nav-item.next { text-align: right; }

/* --------------------------------------------------
   カテゴリ一覧ページ（list.html）
   -------------------------------------------------- */
.list-header {
    background: var(--white);
    padding: 24px 28px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.list-title {
    margin: 0 0 12px;
    color: var(--main-color);
    font-size: 1.8rem;
    border-bottom: 3px solid var(--accent-olive);
    padding-bottom: 10px;
}

.category-desc {
    font-size: 0.95rem;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 4px;
    margin: 0;
    color: #555;
}

/* --------------------------------------------------
   固定ページ（page.html / about）
   -------------------------------------------------- */
.page-article {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 30px;
}

.page-avatar-wrapper {
    text-align: center;
    margin: 16px 0 28px;
}

.page-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    object-fit: cover;
}

/* --------------------------------------------------
   内部リンクカード shortcode（link.html）
   -------------------------------------------------- */
.custom-blog-card {
    margin: 2em 0;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    max-width: 100%;
    width: 100%;
}

.custom-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--accent-olive);
}

.custom-blog-card a {
    display: flex;
    text-decoration: none;
    color: inherit;
    min-height: 110px;
}

.card-img-box {
    flex: 0 0 130px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-right: 1px solid #f0f0f0;
}

.card-content {
    flex: 1;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.card-label {
    font-size: 0.7rem;
    color: #4a6b1a;
    font-weight: bold;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.card-title {
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--main-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------
   レスポンシブ
   -------------------------------------------------- */
@media (max-width: 600px) {
    /* ヘッダー：カテゴリナビを非表示 */
    .nav-menu .nav-cat,
    .nav-menu .nav-divider { display: none; }

    /* 記事カード */
    .post-card-wrap { border-left-width: 4px; }
    .post-card-link .post-title { font-size: 1.05rem; padding: 4px 16px 0; }
    .post-card-link .post-summary { padding: 6px 16px 10px; }
    .post-meta-tags { padding: 0 16px 14px; }

    /* 記事詳細 */
    .post-article { padding: 20px 16px; }
    .post-title { font-size: 1.4rem; }

    /* 筆者カード */
    .author-card { flex-direction: column; text-align: center; }
    .author-text  { text-align: center; }

    /* 前後ナビ */
    .post-nav { flex-direction: column; }

    /* リンクカード：縦並び */
    .custom-blog-card a { flex-direction: column; }
    .card-img-box {
        flex: 0 0 160px;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* --------------------------------------------------
   記事ページ：カテゴリ・タグボタン
   -------------------------------------------------- */
.post-terms {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 24px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.post-terms-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.post-terms-label {
    font-size: 0.8rem;
    color: #555;
    white-space: nowrap;
}

/* タグボタン */
.tag-link {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    background: #f0f4f8;
    border: 1px solid #d1d9e0;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--main-color);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.tag-link:hover {
    background: var(--main-color);
    color: var(--white);
    border-color: var(--main-color);
}

/* もしもアフィリエイトボタンのコントラスト修正 */
/* Yahoo!ショッピング（青をより濃く） */
.easyLink-info-btn-yahoo { 
    background-color: #0056b3 !important; 
    color: #ffffff !important; 
}

/* Amazon（オレンジをより濃い茶褐色寄りへ） */
.easyLink-info-btn-amazon { 
    background-color: #c45500 !important; 
    color: #ffffff !important; 
}

/* 楽天（赤をより深く） */
.easyLink-info-btn-rakuten { 
    background-color: #bf0000 !important; 
    color: #ffffff !important; 
}


/* リンクテキストの視認性向上 */
.easyLink-info-name a { color: #333 !important; font-weight: bold; }


/* もしもアフィリエイトの「HTMLソース（静的版）」 */
.static-affiliate-box {
    display: flex;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    background: #fff;
}

.aff-image img {
    max-width: 120px;
    height: auto;
    margin-right: 15px;
}

.aff-name {
    font-weight: bold;
    color: #333; /* コントラスト確保 */
    margin-bottom: 10px;
}

.aff-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.aff-buttons a {
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #fff !important; /* 文字色は白で固定 */
    font-size: 14px;
}

.btn-amazon { background-color: #c45500 !important; } /* 濃いオレンジ */
.btn-rakuten { background-color: #bf0000 !important; } /* 濃い赤 */
.btn-yahoo { background-color: #0056b3 !important; }   /* 濃い青 */

/* =========================================
   フッター主要記事リンク — style.cssに追記
   ========================================= */

.footer-links {
  max-width: 860px;
  margin: 0 auto 1.5rem;
  padding: 1.5rem 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-links-title {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--main-color, #3eb8a0);
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.5rem;
}

@media (max-width: 640px) {
  .footer-links-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 400px) {
  .footer-links-grid {
    grid-template-columns: 1fr;
  }
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-links-cat {
  font-size: 0.7rem;
  font-weight: 700;
  color: #8aa0b8;
  margin-bottom: 0.2rem;
  letter-spacing: 0.05em;
}

.footer-links-col a {
  font-size: 0.78rem;
  color: #b0c8e0;
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s;
}

.footer-links-col a:hover {
  color: #fff;
  text-decoration: underline;
}

