/*
Theme Name: Nozaki Sidebar Layout
Description: Noto Serif統一・テーブルレイアウト完全版
Version: 3.1
*/

/* 1. フォントの読み込み */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400&family=Noto+Serif+JP:wght@400;700&display=swap');

:root {
    --width-sidebar: 320px; /* サイドバーの幅 */
    --color-text: #333;
    --font-main: "Noto Serif", "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
    --font-gothic: "Noto Sans JP", sans-serif;
}

body {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-main);
    background-color: #fff;
    line-height: 2.0;
    font-feature-settings: "palt";
}

a {
    color: var(--color-text);
    text-decoration: none;
    transition: opacity 0.3s;
}
a:hover { opacity: 0.6; }

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* --- レイアウト構造 --- */
.site-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 左サイドバー */
.sidebar {
    width: var(--width-sidebar);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 70px 50px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-right: none; /* 線なし */
}

/* 右コンテンツ */
.main-content {
    margin-left: var(--width-sidebar);
    flex: 1;
    padding: 80px 100px;
    box-sizing: border-box;
}

/* --- サイドバーの中身 --- */
.logo-area a {
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
    margin-bottom: 100px;
    letter-spacing: 0.05em;
    white-space: nowrap; /* 改行禁止 */
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 35px;
}

.sidebar-nav a {
    font-size: 1.0rem; 
    text-transform: none; 
    letter-spacing: 0.05em;
    font-weight: 400;
}

.copyright {
    margin-top: auto;
    font-size: 0.7rem;
    color: #999;
    font-family: var(--font-main);
    letter-spacing: 0.05em;
}

/* --- 実績リスト --- */
.works-feed h2 {
    font-size: 1.1rem;
    font-weight: 400;
    margin-top: 15px;
    line-height: 1.6;
}

/* --- 会社概要（テーブルデザイン修正版） --- */
.company-table {
    width: 100%;
    border-collapse: collapse; /* 隙間をなくす */
}

.company-table th {
    /* 左側の項目：改行させない＆上揃え */
    width: 1px; /* 裏技：コンテンツ幅に合わせて最小になる */
    white-space: nowrap; /* 文字の折り返しを禁止 */
    padding-right: 60px; /* 右側との距離 */
    padding-bottom: 15px; /* 下の行との距離 */
    text-align: left;
    font-weight: 400;
    vertical-align: top; /* 上揃え */
}

.company-table td {
    /* 右側の内容 */
    padding-bottom: 15px;
    vertical-align: top; /* 上揃え */
}

/* 年号の補足 */
.small-text {
    font-size: 0.85em;
    margin-left: 5px;
}

/* 空白行の高さ */
.spacer-row td {
    height: 40px;
}


/* =========================================
   スマートフォン用レイアウト (幅768px以下)
   修正版：メニュー強制表示＆レイアウト最適化
   ========================================= */
@media screen and (max-width: 768px) {

    /* 1. 全体のレイアウトを縦並びにする */
    .site-wrapper {
        flex-direction: column;
    }

    /* 2. サイドバー全体の設定 */
    .sidebar {
        width: 100%;
        height: auto;       /* 高さを自動に */
        position: relative; /* 固定を解除 */
        padding: 20px 0;    /* 上下の余白 */
        text-align: center; /* 中央寄せ */
        border-right: none;
        border-bottom: 1px solid #eee;
        background: #fff;
        z-index: 100;
    }

    /* ロゴの調整 */
    .logo-area a {
        margin-bottom: 15px; /* 下の余白を減らす */
        white-space: normal;
    }

    /* 3. ナビゲーションメニューの強制表示エリア */
    .sidebar-nav {
        display: block !important; /* ★ここが重要！強制的に表示 */
        width: 100%;
        margin-bottom: 15px;
    }

    /* 4. メニューリストを横並びにする */
    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px; /* メニュー同士の間隔 */
        padding: 0;
        margin: 0;
    }

    .sidebar-nav li {
        margin-bottom: 0; /* リセット */
    }

    /* リンク文字の設定 */
    .sidebar-nav a {
        display: inline-block;
        font-size: 0.9rem;
        color: #333;
        text-decoration: none;
    }

    /* 5. メインコンテンツエリアの調整 */
    .main-content {
        margin-left: 0; /* 左の余白を消す */
        width: 100%;
        padding: 40px 20px;
    }

    /* 6. フォントサイズ調整 */
    h1 { font-size: 1.5rem !important; }
    p, td, th, li { font-size: 0.95rem !important; }

    /* 7. テーブルのスマホ化（縦積み） */
    .company-table, 
    .company-table tbody, 
    .company-table tr, 
    .company-table th, 
    .company-table td {
        display: block;
        width: 100%;
    }
    
    .company-table tr {
        margin-bottom: 20px;
        border-bottom: 1px solid #eee;
    }
    
    .company-table th {
        width: 100%;
        background: #f9f9f9;
        padding: 10px;
        margin-top: 20px;
        text-align: left;
    }
    
    .company-table td {
        width: 100%;
        padding: 10px 10px 20px 10px;
        text-align: left;
    }

    /* 8. 画像調整 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 9. コピーライト */
    .copyright {
        display: block;
        margin-top: 10px;
        font-size: 0.7rem;
    }
    
    /* Worksのリスト調整 */
    .work-item {
        width: 100%;
    }
    
    /* 詳細ページ（記事本文）のデザイン */
    .post-content img {
        max-width: 100%;
        height: auto;
        border-radius: 4px;
    }
    .post-content .wp-block-gallery {
        margin-bottom: 30px;
    }
    .post-content p {
        line-height: 1.8;
        margin-bottom: 20px;
    }
}

/* PC用の詳細ページ設定（スマホ設定の外側に追加） */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}
.post-content .wp-block-gallery {
    margin-bottom: 30px;
}
.post-content p {
    line-height: 1.8;
    margin-bottom: 20px;
}