/* ========== 基本スタイル ========== */
:root {
    --primary-color: #005a9b; /* 信頼感のある濃い青 */
    --secondary-color: #e0f0ff; /* 明るい青（ヒーロー背景など） */
    --text-color: #333;
    --light-gray: #f8f8f8;
    --border-color: #ddd;
    --link-color: #007bff;
    --link-hover-color: #0056b3;
    --button-bg: var(--link-color);
    --button-hover-bg: var(--link-hover-color);
    --container-width: 1140px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    margin: 0;
    background-color: #fff; /* 白背景 */
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.3;
    font-weight: 600; /* 少し太めに */
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; color: var(--primary-color); border-bottom: 2px solid var(--secondary-color); padding-bottom: 0.3em;}
h3 { font-size: 1.4rem; color: #444; }
p { margin-top: 0; margin-bottom: 1em; }

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ========== コンテナ ========== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* ========== ヘッダー ========== */
header {
    background-color: #fff;
    padding: 1em 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    flex-direction: column; /* Mobile: stack title and nav */
    align-items: center;
    text-align: center;
}

header h1 {
    margin: 0 0 0.5em 0;
    font-size: 1.8rem;
}
header h1 a {
    color: var(--primary-color);
    text-decoration: none;
}
header h1 a:hover {
    text-decoration: none;
    opacity: 0.8;
}

header nav ul {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    justify-content: center;
}

header nav li {
    margin: 0.3em 0.8em;
}

header nav a {
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.5em;
    text-decoration: none;
}
header nav a:hover {
    color: var(--link-hover-color);
    background-color: var(--light-gray);
    border-radius: 4px;
    text-decoration: none;
}

/* ========== ヒーローセクション ========== */
.hero {
    background-color: var(--secondary-color);
    padding: 3em 1em;
    text-align: center;
    margin-bottom: 2em;
    color: var(--primary-color); /* Darker text on light blue */
}

.hero h1 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 1.5em;
    opacity: 0.9;
}

/* ========== CTAボタン ========== */
.cta-button {
    display: inline-block;
    background-color: var(--button-bg);
    color: white !important; /* Override link color */
    padding: 0.9em 1.8em;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: var(--button-hover-bg);
    color: white !important;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ========== メインコンテンツエリア ========== */
main {
    padding: 1em 0; /* Removed side padding, handled by container */
}

.content-section {
    margin-bottom: 2.5em;
    padding: 1.5em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
}

.introduction {
    background-color: var(--light-gray); /* 少し背景色を変える */
    border: none;
}

.introduction h2 {
    border-bottom: none; /* Introduction doesn't need the border */
    text-align: center;
    margin-bottom: 1em;
}

/* ========== コンテンツグリッド ========== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 column */
    gap: 1.5em;
    margin-top: 1.5em;
}

.grid-item {
    border: 1px solid #eee;
    padding: 1.2em;
    background-color: var(--light-gray);
    border-radius: 6px;
    transition: box-shadow 0.2s ease;
}
.grid-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.grid-item h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1.2rem;
}
.grid-item h3 a {
    text-decoration: none;
}
.grid-item h3 a:hover {
    text-decoration: underline;
}
.grid-item p {
    margin-bottom: 0;
    font-size: 0.95em;
    color: #555;
}

/* 主要コンテンツの横並び用 (Tablet以上) */
.main-content-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Mobile default */
    gap: 2em;
}

/* ========== フッター ========== */
footer {
    background-color: #f0f0f0;
    padding: 2em 0 1em 0;
    text-align: center;
    margin-top: 3em;
    font-size: 0.9em;
    color: #555;
    border-top: 1px solid var(--border-color);
}

footer nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1em;
}

footer nav li {
    margin: 0.3em 1em;
}

footer nav a {
    color: #555;
}
footer nav a:hover {
    color: var(--primary-color);
}

footer p {
    margin-bottom: 0.5em;
    font-size: 0.85em;
}
footer p:last-child {
    margin-top: 1em;
    font-style: italic;
    color: #777;
}

/* ========== レスポンシブ設定 ========== */

/* Tablet (幅768px以上) */
@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    header .container {
        flex-direction: row; /* 横並びにする */
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    header h1 {
        margin-bottom: 0; /* Remove bottom margin */
    }

    header nav {
         margin-top: 0; /* Remove top margin */
    }
    header nav ul {
        justify-content: flex-end; /* Nav items to the right */
    }
    header nav li {
       margin: 0 0 0 1.5em; /* Adjust spacing */
    }


    .hero h1 {
        font-size: 3rem;
    }
    .hero p {
        font-size: 1.2rem;
    }

    /* グリッドを2カラムに */
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 主要コンテンツ（終活・相続）を横並びに */
    .main-content-wrapper {
        grid-template-columns: 1fr 1fr;
    }

    /* その他の情報も2カラムに */
    .other-contents .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (幅1024px以上) */
@media (min-width: 1024px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    h3 { font-size: 1.6rem; }

    .hero h1 {
        font-size: 3.5rem;
    }
    .hero p {
        font-size: 1.3rem;
    }

    /* グリッドのカラム数を調整 (auto-fitで自動調整も良い) */
    /* 例: 終活・相続の内部グリッド */
    #shukatsu .content-grid, #sozoku .content-grid {
         grid-template-columns: repeat(2, 1fr); /* Keep 2 columns for main sections */
    }
    /* 例: その他の情報のグリッド */
     .other-contents .content-grid {
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); /* Flexible columns */
    }
}