@charset "UTF-8";

/* -----------------------------------------------
   CSS変数（カラーパレット）
----------------------------------------------- */
:root {
    --color-primary:   #003399;
    --color-accent:    #0066cc;
    --color-highlight: #ffcc00;
    --color-white:     #ffffff;
    --color-text:      #000000;
    --color-border:    #b3b3b3;
    --color-nav-item:  rgba(255, 255, 255, 0.1);
    --shadow-sm:       0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md:       0 6px 10px rgba(0, 0, 0, 0.15);
    --shadow-lg:       0 6px 12px rgba(0, 0, 0, 0.3);
    --radius-nav:      12px;
    --width-container: 950px;
    --width-side:      235px;
    --width-content:   680px;
    --width-nav:       300px;
}

/* -----------------------------------------------
   ボックスモデル統一（追加）
----------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* -----------------------------------------------
   見出しの配色
----------------------------------------------- */
#content h1 { background: var(--color-white); }
#content h2 { border-bottom: 1px dashed blue; }
#content h3 { border-left: 4px solid var(--color-border); }

/* -----------------------------------------------
   ヘッダー
----------------------------------------------- */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--color-white);
    border-bottom: 2px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
    max-width: var(--width-container);
    margin: 0 auto;
}

#header .logo-container {
    display: flex;
    align-items: center;
}

#header .logo {
    height: 50px;
    margin-right: 15px;
}

#header .office-name {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-primary);
    /* white-space: nowrap; ← 削除：スマホで折り返せるように */
}

#header .office-details {
    text-align: right;
    font-size: 16px;
}

#header .office-details span {
    display: block;
}

#header .office-details span:first-child {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-text);
}

#header .office-details span:nth-child(2) {
    color: blue;
    font-weight: bold;
}

#header .office-details span:nth-child(3) {
    color: red;
    font-weight: bold;
}

/* -----------------------------------------------
   ナビゲーション
----------------------------------------------- */
#nav ul {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    background: linear-gradient(to bottom, var(--color-accent), var(--color-primary));
    border-radius: var(--radius-nav);
    box-shadow: var(--shadow-md);
    width: var(--width-nav);
    max-width: 100%;
}

#nav ul#mainNav1 { display: block; }

#nav ul#mainNav1 li {
    margin: 5px 0;
    text-align: center;
}

#nav ul#mainNav1 li a {
    display: block;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    color: var(--color-white);
    text-decoration: none;
    border-radius: var(--radius-nav);
    background: var(--color-nav-item);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

#nav ul#mainNav1 li a:hover,
#nav a.current {
    background: var(--color-highlight);
    color: var(--color-text);
    box-shadow: var(--shadow-lg);
    transform: scale(1.05);
}

/* -----------------------------------------------
   レイアウト
----------------------------------------------- */
#container {
    width: var(--width-container);
    max-width: 100%; /* 追加：950px超の画面でも安全 */
    margin: 10px auto 30px;
    overflow: auto;
    padding: 0 10px; /* 追加：両端の余白を常時確保 */
}

#visual { margin-bottom: 10px; }

#side {
    float: left;
    width: var(--width-side);
    margin: 30px 0;
}

#content {
    float: right;
    width: var(--width-content);
    margin: 0 0 30px;
}

/* -----------------------------------------------
   レスポンシブ（スマートフォン）768px以下
----------------------------------------------- */
@media screen and (max-width: 768px) {

    /* ヘッダー：縦積み・中央寄せ */
    #header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px 10px;
        gap: 10px; /* 追加：logo-containerとoffice-detailsの間隔 */
    }

    #header .logo-container {
        flex-direction: column; /* 追加：ロゴと事務所名を縦積みに */
        align-items: center;
    }

    #header .logo {
        margin-right: 0;
        margin-bottom: 8px; /* 追加 */
    }

    #header .office-name {
        font-size: 18px; /* 縮小 */
        text-align: center;
    }

    #header .office-details {
        text-align: center; /* 右寄せ→中央に */
        font-size: 14px;
    }

    #header .office-details span:first-child {
        font-size: 15px;
    }

    /* コンテナ */
    #container {
        width: 100%;
        padding: 0 12px;
    }

    /* サイドバーをコンテンツの後ろに移動（フロート解除＋順序入れ替え） */
    #container {
        display: flex;
        flex-direction: column;
    }

    #visual {
        order: 0;
    }

    #content {
        order: 1; /* コンテンツを先に */
        float: none;
        width: 100%;
        margin: 0 0 20px;
    }

    #side {
        order: 2; /* ナビを後に */
        float: none;
        width: 100%;
        margin: 0 0 20px;
    }

    /* ナビゲーション：横並びグリッドに */
    #nav ul {
        width: 100%;
        border-radius: 8px;
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2列表示 */
        gap: 6px;
        padding: 8px;
    }

    #nav ul#mainNav1 li {
        margin: 0;
    }

    #nav ul#mainNav1 li a {
        padding: 12px 8px;
        font-size: 14px; /* スマホ向けに縮小 */
        border-radius: 8px;
    }
}

/* -----------------------------------------------
   レスポンシブ（タブレット）769px〜949px
----------------------------------------------- */
@media screen and (min-width: 769px) and (max-width: 949px) {
    #container {
        width: 100%;
        padding: 0 15px;
    }

    #side {
        width: 200px;
    }

    #content {
        width: calc(100% - 220px); /* サイド幅＋余白を引いた残り */
    }

    #nav ul {
        width: 100%;
    }
}