/* ------------------------------------------- */
/* --- 基本設定と共通スタイル --- */
/* ------------------------------------------- */

:root {
    --color-main: #000; /* メインカラー: 黒 (テキスト、罫線) */
    --color-sub: #fff;  /* サブカラー: 白 (背景) */
    --color-accent: #333; /* アクセントカラー: ダークグレー */
    --color-light-gray: #f0f0f0; /* 背景用: 薄いグレー (セクションの区切り) */
    --color-border: #e0e0e0; /* 細い罫線用 */
    --color-code-bg: #272822; /* コードブロック背景 */
    --color-code-text: #f8f8f2; /* コードブロック文字色 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--color-main);
    background-color: var(--color-sub);
    overflow-x: hidden;
}

body.menu-active {
    overflow-y: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--color-main);
    text-decoration: none;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.7;
}

/* ------------------------------------------- */
/* --- ヘッダー/ナビゲーション --- */
/* ------------------------------------------- */
header {
    background-color: var(--color-sub);
    padding: 15px 0;
    top: 0;
    z-index: 1000;
}

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

header h1 a {
    font-size: 1.5rem;
    font-weight: 700;
}

/* PC用グローバルナビゲーションのスタイル */
#global-nav > ul {
    list-style: none;
    display: flex;
}

#global-nav ul li {
    margin-left: 30px;
}

#global-nav a {
    font-weight: 500;
    font-size: 0.95rem;
}

/* NEW: ハンバーガーメニューボタン (モバイル時のみ表示) */
.menu-toggle {
    display: none; /* PCでは非表示 */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s;
}

/* 技術カテゴリナビゲーション (PC表示用) */
.tech-nav.pc-only-nav {
    background-color: var(--color-sub);
    border-bottom: 1px solid var(--color-border);
    padding: 10px 0;
    text-align: center;
}

.tech-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.tech-nav ul li {
    margin: 0 15px;
}

.tech-nav a {
    display: block;
    padding: 5px 0;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    color: var(--color-accent);
}

.tech-nav a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-main);
    transition: width 0.3s;
}

.tech-nav a:hover {
    opacity: 1;
    color: var(--color-main);
}

.tech-nav a:hover::after {
    width: 100%;
}

/* モバイル専用ナビゲーションはPCでは非表示 */
#tech-nav-mobile {
    display: none;
}


/* ------------------------------------------- */
/* --- ヒーローセクション（メインビジュアル） --- */
/* ------------------------------------------- */
.hero {
    background-color: var(--color-sub);
    color: var(--color-main);
    text-align: center;
    padding: 120px 0;
    border-bottom: 10px solid var(--color-light-gray);
}

.hero .subtitle {
    font-size: 1rem;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.hero h2 {
    font-size: 2.8rem;
    margin-bottom: 40px;
    line-height: 1.3;
    font-weight: 800;
}

/* ------------------------------------------- */
/* --- ボタン共通スタイル --- */
/* ------------------------------------------- */
.button {
    display: inline-block;
    padding: 12px 35px;
    border: 2px solid;
    border-radius: 30px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.primary-button {
    background-color: var(--color-main);
    color: var(--color-sub);
    border-color: var(--color-main);
}

.primary-button:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.secondary-button {
    background-color: transparent;
    color: var(--color-main);
    border-color: var(--color-main);
    border-radius: 5px;
}

/* 小さいボタン (サイドバー用) */
.small-button {
    padding: 6px 15px;
    font-size: 0.85rem;
    border-radius: 5px;
    width: 100%; 
    margin-top: 15px;
}

.secondary-button:hover {
    background-color: var(--color-main);
    color: var(--color-sub);
}

/* ------------------------------------------- */
/* --- メインコンテンツとレイアウト --- */
/* ------------------------------------------- */
.section-padding {
    padding: 100px 0;
}

h3 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
    display: inline-block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.text-center {
    text-align: center;
    margin-top: 50px;
}

/* メインコンテンツとサイドバーのレイアウト */
.main-content-wrapper {
    display: grid;
    /* PCビューでは 3:1 の比率で記事エリアとサイドバーを配置 */
    grid-template-columns: 3fr 1fr; 
    gap: 40px;
    padding-top: 60px; 
    padding-bottom: 60px;
}

.article-sections {
    /* 最新記事とおすすめ記事の間隔調整 */
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.latest-posts, .featured-posts {
    padding: 0;
}

/* おすすめの記事セクション */
.featured-posts {
    background-color: var(--color-light-gray); /* 薄いグレーを背景にして区別する */
    padding: 40px; 
    border-radius: 8px;
    margin: 0;
}

/* セクションH3の調整 (記事セクション内では左寄せ) */
.latest-posts h3, .featured-posts h3 {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
    display: block;
    width: 100%;
    margin-bottom: 30px;
}


/* ------------------------------------------- */
/* --- 記事カードグリッド --- */
/* ------------------------------------------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.post-card {
    background-color: var(--color-sub);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    transition: box-shadow 0.3s, transform 0.3s;
}

.post-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.post-card .category a {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-sub);
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 3px;
    margin-bottom: 15px;
}

.post-card h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    line-height: 1.5;
    font-weight: 600;
}

.post-card .date {
    color: var(--color-accent);
    font-size: 0.85rem;
}


/* ------------------------------------------- */
/* --- サイドバー (aside) のスタイル --- */
/* ------------------------------------------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: var(--color-sub);
    padding: 25px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.sidebar-widget h4 {
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--color-main);
    text-align: left;
    width: 100%;
}

/* プロフィールカード */
.profile-card {
    text-align: center;
}

.profile-img {
    border-radius: 50%;
    margin-bottom: 15px;
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.profile-name {
    font-weight: 600;
    margin-bottom: 10px;
}

.profile-bio {
    font-size: 0.9rem;
    text-align: left;
    color: var(--color-accent);
}

/* 人気タグリスト */
.tag-list .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    display: inline-block;
    background-color: var(--color-light-gray);
    color: var(--color-main);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.3s;
}

.tag-link:hover {
    background-color: var(--color-main);
    color: var(--color-sub);
    opacity: 1;
}

/* アーカイブリスト */
.archive-list ul {
    list-style: none;
}

.archive-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--color-border);
}

.archive-list li:last-child {
    border-bottom: none; 
}

.archive-list li a {
    display: block;
    font-size: 0.95rem;
}


/* ------------------------------------------- */
/* 🚩 追加: 記事詳細ページ (single.php) のスタイル */
/* ------------------------------------------- */
.single-post-content {
    background-color: var(--color-sub);
    padding: 40px 30px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.single-post-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--color-border);
}

.single-post-header .category {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.single-post-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 15px;
}

.single-post-content .post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--color-accent);
}

.single-post-content .post-tags {
    margin-top: 10px;
    font-size: 0.8rem;
}

.single-post-content .post-tags a {
    display: inline-block;
    margin-right: 5px;
    background-color: var(--color-light-gray);
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 500;
}

.post-thumbnail {
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 4px;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* 記事本文内の要素の装飾 (post-entry-content) */
.post-entry-content h2,
.post-entry-content h3,
.post-entry-content h4,
.post-entry-content h5,
.post-entry-content h6 {
    margin: 40px 0 15px;
    line-height: 1.4;
    font-weight: 700;
}

.post-entry-content h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 5px;
}

.post-entry-content h3 {
    font-size: 1.5rem;
    border-left: 5px solid var(--color-main);
    padding-left: 15px;
}

.post-entry-content p {
    margin-bottom: 1.2em;
}

.post-entry-content ul,
.post-entry-content ol {
    margin: 0 0 1.5em 20px;
}

.post-entry-content li {
    margin-bottom: 0.5em;
}

/* 引用 (blockquote) */
.post-entry-content blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    border-left: 4px solid var(--color-accent);
    background-color: var(--color-light-gray);
    font-style: italic;
    color: var(--color-accent);
    border-radius: 0 4px 4px 0;
}

/* コードブロック (pre) */
.post-entry-content pre {
    background-color: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 15px;
    overflow-x: auto;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
    margin-bottom: 1.5em;
}

.post-entry-content code {
    background-color: rgba(0, 0, 0, 0.05); /* インラインコード */
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.post-entry-content pre code {
    background-color: transparent;
    padding: 0;
}

/* 画像 (img) */
.post-entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

/* ------------------------------------------- */
/* --- フッター --- */
/* ------------------------------------------- */
footer {
    background-color: var(--color-accent);
    color: var(--color-sub);
    padding: 40px 0;
}

footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.footer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-sub);
}

.footer-nav ul {
    list-style: none;
    display: flex;
}

.footer-nav ul li {
    margin-left: 20px;
}

.footer-nav a {
    color: var(--color-sub);
    font-size: 0.9rem;
}

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

.copyright {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}


/* ------------------------------------------- */
/* --- トップへ戻るボタン --- */
/* ------------------------------------------- */
.to-top-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--color-main);
    color: var(--color-sub);
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
    cursor: pointer;
}

.to-top-button.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ------------------------------------------- */
/* --- レスポンシブ対応 (メディアクエリ) --- */
/* ------------------------------------------- */

@media (max-width: 900px) { 
    /* PCとモバイルの中間ブレークポイント (記事タイトルなどが大きすぎる問題を緩和) */
    .single-post-header h1 {
        font-size: 1.8rem;
    }
}


@media (max-width: 768px) {
    /* PC専用要素の非表示 */
    .pc-only {
        display: none;
    }
    
    /* PC専用ナビゲーションを非表示 */
    .pc-only-nav {
        display: none;
    }
    
    /* ----------------------------------------------------------- */
    /* グローバルナビゲーション（アニメーション設定） */
    /* ----------------------------------------------------------- */
    #global-nav {
        display: flex; 
        flex-direction: column;
        
        /* アニメーションの初期状態: 閉じている状態 */
        height: 0; 
        opacity: 0; 
        padding-top: 0;
        padding-bottom: 0;
        overflow: hidden; 
        transition: height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;

        position: fixed; 
        top: 60px; 
        left: 0;
        width: 100%;
        height: calc(100vh - 60px); 
        background-color: var(--color-sub);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        z-index: 999; 
    }

    /* ハンバーガーメニューが開いたときのスタイル */
    #global-nav.is-open {
        height: calc(100vh - 60px); 
        opacity: 1;
        padding-top: 20px; 
        padding-bottom: 40px;
        overflow-y: auto; 
    }

    /* モバイル時のグローバルナビのレイアウト */
    #global-nav > ul {
        flex-direction: column;
        padding: 0 0 20px 0; 
        margin: 0 40px; 
        border-bottom: 1px solid var(--color-border);
    }
    #global-nav ul li {
        margin: 15px 0;
        text-align: center;
    }
    #global-nav a {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--color-main);
        display: block;
    }

    /* ----------------------------------------------------------- */
    /* モバイル専用カテゴリナビゲーション（アニメーション設定）*/
    /* ----------------------------------------------------------- */
    #tech-nav-mobile {
        max-height: 0; 
        opacity: 0; 
        overflow: hidden; 
        transition: max-height 0.3s ease-out 0.1s, opacity 0.3s ease-out 0.1s;
        
        padding: 0 40px; 
        border-top: 1px solid var(--color-border);
    }
    
    /* ハンバーガーメニューが展開されたとき（global-nav.is-open）のみ表示 */
    #global-nav.is-open #tech-nav-mobile {
        max-height: 500px; 
        opacity: 1;
        padding-top: 15px; 
        padding-bottom: 25px; 
    }
    
    #tech-nav-mobile h4 {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 15px;
        color: var(--color-accent);
    }
    #tech-nav-mobile ul {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 0;
    }
    #tech-nav-mobile li {
        width: 100%;
        margin: 5px 0;
        border-bottom: 1px solid var(--color-light-gray);
        padding: 8px 0;
    }
    #tech-nav-mobile li:last-child {
        border-bottom: none;
    }
    #tech-nav-mobile a {
        font-size: 1rem;
        color: var(--color-main);
        display: block;
    }
    /* ---------------------------------------------------------------------- */

    /* ハンバーガーメニューボタンをモバイル時のみ表示 */
    .menu-toggle {
        display: block;
        z-index: 1001; 
    }

    /* ヒーローセクション */
    .hero {
        padding: 80px 0 60px;
    }

    .hero h2 {
        font-size: 1.6rem;
    }

    /* メインコンテンツのレイアウト変更 (1カラムへ) */
    .main-content-wrapper {
        grid-template-columns: 1fr; /* 1カラムにする */
        gap: 40px;
        padding: 40px 20px;
    }
    
    /* 記事詳細のモバイル調整 */
    .single-post-content {
        padding: 20px 15px;
    }
    .single-post-header h1 {
        font-size: 1.6rem;
    }
    .post-entry-content h2 {
        font-size: 1.5rem;
    }
    .post-entry-content h3 {
        font-size: 1.3rem;
    }

    /* 記事グリッド */
    .post-grid {
        grid-template-columns: 1fr;
    }

    .featured-posts {
        padding: 20px; 
    }

    /* フッター */
    footer .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand {
        margin-bottom: 15px;
    }

    .footer-nav ul {
        flex-direction: column;
    }
    
    .footer-nav ul li {
        margin: 5px 0;
    }

    /* トップへ戻るボタンのサイズ調整 */
    .to-top-button {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 0.75rem;
        bottom: 15px;
        right: 15px;
    }
}

/* ------------------------------------------- */
/* 🚩 追加: Portfolio記事一覧のスタイル調整 */
/* ------------------------------------------- */

/* ポートフォリオ記事一覧のセクション */
.portfolio-list {
    margin-top: 60px; /* 固定ページコンテンツとの間隔 */
}

/* 記事一覧セクション内の見出し (h3) */
.portfolio-list-heading {
    /* 記事一覧セクション内のh3は、メインセクションのh3とは違い、左寄せのシンプルにする */
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-main);
    display: block;
    width: 100%;
    text-align: left; /* 左寄せ */
}

/* ------------------------------------------- */
/* 🚩 追加: アイキャッチ付き記事カードのスタイル (ポートフォリオ一覧用) */
/* ------------------------------------------- */

/* アイキャッチ付きの記事カード全体 */
.post-card.post-card-with-thumb {
    padding: 0; /* 画像を端まで見せるために元のカードパディングをリセット */
    overflow: hidden; /* 角丸と画像がはみ出さないように */
}

/* アイキャッチ画像へのリンクコンテナ */
.post-card-thumb-link {
    display: block;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 のアスペクト比を維持（一般的なPC画面の比率） */
    overflow: hidden;
    position: relative;
    margin-bottom: 15px; /* 画像とコンテンツの間隔 */
}

/* アイキャッチ画像 */
.post-card-thumb-link img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* コンテナいっぱいに画像を拡大・トリミング */
    transition: transform 0.3s ease;
}

/* ホバー時の画像ズームエフェクト */
.post-card.post-card-with-thumb:hover img {
    transform: scale(1.05);
}

/* カードのテキストコンテンツ部分 */
.post-card-content {
    padding: 0 25px 25px; /* 元のカードパディングを再現（左右下に適用） */
}

/* post-card-content内の要素の調整 */
.post-card-content .category {
    margin-bottom: 10px; /* カテゴリとタイトルの間隔を調整 */
}

/* モバイル対応 */
@media (max-width: 768px) {
    .post-card-content {
        padding: 0 15px 15px; /* モバイル時のパディングを調整 */
    }
}

/* =======================================
 * 6. About Me ページ専用スタイル
 * ======================================= */

.about-page-content {
    /* ページのコンテンツ幅を広げる（メインエリアがサイドバーなしで広く使えるように） */
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px 20px; /* 上下のパディングを確保 */
}

/* ページタイトル */
.about-page-content .page-title {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    border-bottom: 3px solid #00bcd4; /* テーマカラーを想定した下線 */
    padding-bottom: 10px;
    margin-bottom: 40px;
}

/* セクションタイトル (h2, h3) */
.about-page-content h2 {
    font-size: 1.8em;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #00bcd4; /* テーマカラーを適用 */
}

.about-page-content h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 10px;
    color: #444;
}

/* パラグラフとリスト */
.about-page-content .entry-content p,
.about-page-content .entry-content ul {
    line-height: 1.8;
    margin-bottom: 20px;
    color: #555;
}

.about-page-content .entry-content ul {
    list-style: disc;
    padding-left: 25px;
}

/* 罫線（hrタグ）のスタイル */
.about-page-content hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 30px 0;
}


/* --- テーブル（学歴・スキル）のスタイル --- */

.about-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
    border: 1px solid #ddd;
}

.about-page-content th,
.about-page-content td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #eee;
}

.about-page-content th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #333;
    width: 30%; /* 期間や分類の列幅を調整 */
}

.about-page-content td {
    background-color: #fff;
}

/* 最初の挨拶の強調部分 */
.about-page-content .entry-content > p:first-child strong {
    color: #333;
}


/* =======================================
 * 7. About Me - プロフィール画像/挨拶レイアウト (修正版)
 * ======================================= */

/* 1. トップエリアの2カラムレイアウト設定 */
.profile-intro-grid {
    display: grid;
    /* 1列目を画像の幅を200pxに拡大、2列目を残りの幅（1fr）にする */
    grid-template-columns: 0.7fr 1fr; 
    gap: 30px; /* 画像とテキストの間隔 */
    align-items: start; /* 縦の配置を上揃えにする */
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee; 
}

/* 2. プロフィール画像（左側のカラム） */
.profile-image-wrap {
    width: 100%;
    height: 100%;
    /* border-radius: 50%; <--- 削除して四角形に戻す */
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
    flex-shrink: 0; 
}

.profile-image-wrap .profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
}

/* 3. 挨拶とミッション（右側のカラム） */
.intro-text {
    /* 右側エリアのデフォルトのスタイル */
}

/* ページタイトル (About Me: 大村雅人) のスタイル調整 */
.intro-text p:first-child {
    margin-top: 0;
    margin-bottom: 5px;
}
.intro-text strong span {
    font-size: 1.8em !important; /* フォントサイズを調整 */
    color: #333;
}

/* 挨拶とミッションの H2 タグを小さくする */
.intro-text h2 {
    font-size: 1.3em; 
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 10px;
    color: #00bcd4; /* テーマカラーを維持 */
    border-bottom: none; /* 下線を削除してテキストと一体化 */
}

/* 4. 強み以降のコンテンツは通常の1カラムで表示されます */
/* H2セクション（強み、スキル、経歴、学歴）はセクション6のスタイルを維持 */
.about-page-content h2 {
    /* このスタイルはセクション6で定義されているものが適用されます */
    /* font-size: 1.8em; ... */
    margin-top: 40px; 
    border-bottom: 3px solid #00bcd4; 
    padding-bottom: 5px;
}

/* レスポンシブ対応 (スマートフォン向け) */
@media (max-width: 768px) {
    .profile-intro-grid {
        grid-template-columns: 1fr; /* 1カラムに戻す */
        gap: 20px;
        text-align: center; /* 中央揃え */
    }
    .profile-image-wrap {
        width: 200px; /* スマホでも200pxを維持 */
        height: 200px; /* スマホでも200pxを維持 */
        margin: 0 auto; /* 画像を中央に配置 */
    }
    .intro-text h2 {
        text-align: center;
    }
    /* スマホでタイトルが大きすぎるのを調整 */
    .profile-header-area strong span {
        font-size: 1.5em !important; 
    }
}

/* =======================================
 * 9. 記事ナビゲーション (the_post_navigation) スタイル
 * ======================================= */

/* ナビゲーション全体 (記事ページ下の区切り線と余白) */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* リンクコンテナ */
.nav-links {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

/* 個別リンク（前の記事へ/次の記事へ） */
.nav-previous, .nav-next {
    width: 49%; /* ほぼ均等に幅を割り当てる */
}

/* リンク本体のスタイル */
.nav-previous a, .nav-next a {
    display: block;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s ease; /* ホバー時のアニメーション */
    text-decoration: none;
    color: #333;
    height: 100%; /* ボックスの高さを揃える */
}

/* ホバー時の装飾 */
.nav-previous a:hover, .nav-next a:hover {
    background-color: #f0faff; /* 淡い背景色 */
    border-color: #00bcd4; /* テーマカラーの枠線 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* サブタイトル（「前の記事」「次の記事へ」） */
.nav-subtitle {
    display: block;
    font-size: 0.8em;
    color: #00bcd4; /* テーマカラー */
    font-weight: bold;
    margin-bottom: 5px;
}

/* 記事タイトル */
.nav-title {
    display: block;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.4;
    /* ホバー時以外は少し暗くしておく */
    color: #555; 
}
.nav-previous a:hover .nav-title, 
.nav-next a:hover .nav-title {
    color: #00bcd4; /* ホバー時にテーマカラーで強調 */
}


/* --- レスポンシブ対応 (スマートフォン向け) --- */
@media (max-width: 600px) {
    .post-navigation {
        margin: 20px 0;
        flex-direction: column; /* 縦積みレイアウトに変更 */
    }
    
    .nav-links {
        flex-direction: column;
    }
    
    .nav-previous, .nav-next {
        width: 100%;
        margin-bottom: 10px; /* 縦積み時の間隔 */
    }
    
    .nav-previous a, .nav-next a {
        text-align: left; /* スマホでは左揃えが読みやすい */
    }
    .nav-next a {
        text-align: left; /* 強制的に左揃えに戻す */
    }
}

/* =======================================
 * 10. Aboutページ限定 - ヘッダー固定解除
 * ======================================= */

/* 1. スクロールに追従するposition: sticky; の解除 */
.no-sticky-header .site-header {
    position: static !important; /* または position: relative !important; */
    top: auto !important;
}

/* 2. 画面に固定するposition: fixed; の解除 */
.no-sticky-header .header-fixed-wrapper {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
}

/* ※注意: .site-header や .header-fixed-wrapper は
      ご利用のテーマのヘッダー要素のクラス名に合わせて修正してください。 */

/* =======================================
 * 11. サイドバー ウィジェットタイトルの調整
 * ======================================= */

/* サイドバー内のウィジェットタイトルをターゲット */
.sidebar .widget-title,
.sidebar h2, 
.sidebar h3 {
    font-size: 1.2em; /* 標準的なサイズ (例: 1.2em) に調整 */
    font-weight: bold;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    /* 必要に応じて下線などの装飾を調整 */
    border-bottom: 2px solid #00bcd4; 
    padding-bottom: 5px;
}

/* サイドバー全体をターゲット */
.sidebar {
    /* 以前のセクションで定義したスタイルがあればそれを維持 */
}


/* =======================================
 * 12. 記事内 iframe 埋め込みスタイル
 * ======================================= */

/* 1. レスポンシブコンテナの設定 (アスペクト比を維持してサイズを調整) */
.post-entry-content .iframe-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 のアスペクト比 (9 / 16 * 100 = 56.25%) */
    height: 0;
    overflow: hidden;
    margin: 20px 0;
    max-width: 100%;
    background: #f0f0f0; /* ロード中の背景色 */
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* 2. iframe 自体の配置調整 */
.post-entry-content .iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none; /* frameborder="0" を上書き */
}

/* =======================================
 * 14. Portfolioページ スタイル (.portfolio-grid)
 * ======================================= */

/* ページ全体のコンテナ調整 */
.portfolio-page-content {
    padding: 20px 0;
    margin-bottom: 40px;
}

.portfolio-page-content h2 {
    text-align: center;
    margin-bottom: 10px;
}

.portfolio-page-content .intro-text {
    text-align: center;
    font-size: 1.1em;
    color: #555;
    margin-bottom: 40px;
}

/* ---------------------------------------
 * 3列グリッドレイアウトの定義
 * --------------------------------------- */
.portfolio-grid {
    display: grid;
    /* PC/タブレット向けの基本設定: 3列均等幅 */
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px; /* カード間のスペース */
    padding: 0 15px;
}

/* ---------------------------------------
 * プロジェクトカードのスタイリング
 * --------------------------------------- */
.project-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden; /* 画像の角丸対応のため */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ホバー時の視覚効果 */
.project-card:hover {
    transform: translateY(-5px); /* 少し上に持ち上げる */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* サムネイル画像 */
.project-card .project-thumb {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* 画像がコンテナを埋めるように調整 */
}

/* カード内のテキストエリア */
.project-card .project-title,
.project-card .project-category {
    padding: 0 15px;
}

.project-card .project-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin: 15px 0 5px 0;
}

.project-card .project-category {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 15px;
}

/* 詳細を見るボタン (前回のボタンクラスを使用) */
.project-card .button {
    display: block; /* カード幅いっぱいに広げる */
    text-align: center;
    margin: 0 15px 15px 15px;
    padding: 10px;
    text-decoration: none;
}


/* ---------------------------------------
 * レスポンシブ対応 (モバイル/タブレット)
 * --------------------------------------- */

/* タブレット (幅 992px以下) */
@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* 2列表示に切り替え */
        gap: 20px;
    }
}

/* スマートフォン (幅 576px以下) */
@media (max-width: 576px) {
    .portfolio-grid {
        grid-template-columns: 1fr; /* 1列表示に切り替え */
        gap: 15px;
    }
}