/* ==========================================
   1. 全体設定・リセット（ベースとなるデザイン）
   ========================================== */
* {
    box-sizing: border-box; /* 余白を含めたサイズ計算にする設定 */
}

html {
    scroll-behavior: smooth; /* リンクをクリックした時にするする動くようにする */
}

body {
    margin: 0;
    background: #f6f7fb;
    color: #222;
    line-height: 1.8;
    /* 高級感を出すために、すっきりとした今風の日本語フォントを指定 */
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

a {
    color: inherit;
    text-decoration: none; /* リンクの下線を消す */
}

img {
    display: block;
    max-width: 100%;
}

/* ==========================================
   2. ヘッダー・ナビゲーション
   ========================================== */
.logo {
    padding: 22px 16px;
    font-size: 24px;
    font-weight: 900;
    text-align: center;
    background: #fff;
    border-bottom: 1px solid #e6e8ef;
}

.header {
    display: none; /* スマホ用ヘッダー（PCでは隠す） */
}

#main-nav-pc {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px); /* 後ろが透けてぼやけるおしゃれな効果 */
    border-bottom: 1px solid #e6e8ef;
}

.pc-menu h3 {
    margin: 0;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 999px;
    transition: 0.2s;
}

.pc-menu h3:hover {
    background: #2563eb; /* 青系アクセントに統一 */
    color: #fff;
    transform: translateY(-2px);
}

/* 設定ボタン */
#setting-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: #111827;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

#setting-btn img {
    width: 26px;
    height: 26px;
    margin: auto;
    filter: invert(1);
}

/* ==========================================
   3. メインレイアウト・ヒーローエリア
   ========================================== */
main {
    overflow: hidden;
}

section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px; /* 全体の余白バランスを少し広げてゆったりと */
}

.hero {
    max-width: 1100px;
    margin: 36px auto 28px;
    padding: 54px 34px;
    border-radius: 32px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.55), transparent 38%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(37, 99, 235, 0.86)); /* 青系の綺麗なグラデーション */
    color: white;
    box-shadow: 0 22px 55px rgba(30, 64, 175, 0.25);
}

.hero-label {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1.25;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 680px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 16px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-btn {
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 800;
    background: white;
    color: #111827;
    transition: 0.2s;
}

.hero-btn.sub {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-btn:hover {
    transform: translateY(-3px);
}

/* ==========================================
   4. 各セクションのタイトル（共通デザイン）
   ========================================== */
.section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e6e8ef; /* タイトルの下にうっすら線を引いて綺麗に */
    padding-bottom: 12px;
}

.section-title h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
}

.section-title p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* ==========================================
   5. カテゴリセクション
   ========================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.category-card {
    padding: 22px;
    border-radius: 24px;
    background: white;
    border: 1px solid #e6e8ef;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    transition: 0.2s;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.category-card span {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    background: #eef2ff;
    color: #2563eb; /* 青系に統一 */
}

.category-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.category-card p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* ==========================================
   6. ブログカード共通（最新＆人気のブログ共通化で重複整理）
   ========================================== */
.blog-grid,
.popular-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列に並べる */
    gap: 24px; /* 横幅と隙間のバランスを調整 */
    justify-content: center; /* カード全体をきっちり中央寄せに */
}

/* データがないときのメッセージ表示 */
.blog-grid:empty::before,
.popular-card:empty::before {
    content: "記事データを読み込み中です。";
    display: block;
    grid-column: 1 / -1;
    padding: 24px;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    border: 1px solid #e6e8ef;
    text-align: center;
}

/* 最新ブログのリンク・人気ブログの枠などのデザインを統一 */
.blog-card,
.blog-item,
.popular-wrap,
.popular-item,
.popular-card > a,
.blog-grid > a,
.latest-blog .blog-grid a {
    display: block;
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    border: 1px solid #e6e8ef;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    width: 100%; /* 微妙な左寄りを防ぐため100%に */
}

/* マウスを乗せたときのアニメーション（青系アクセント） */
.blog-card:hover,
.blog-item:hover,
.popular-wrap:hover,
.popular-item:hover,
.popular-card > a:hover,
.blog-grid > a:hover,
.latest-blog .blog-grid a:hover {
    transform: translateY(-6px);
    border-color: #93c5fd; /* 優しく光る青色 */
    box-shadow: 0 22px 40px rgba(37, 99, 235, 0.1);
}

/* カード内の画像設定 */
.blog-card img,
.blog-item img,
.popular-card img,
.popular-wrap img,
.popular-item img,
.blog-thumb,
.blog-thumb-img,
.blog-image,
.popular-img,
.latest-blog .blog-grid img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.blog-card:hover img,
.blog-item:hover img,
.popular-wrap:hover img,
.popular-item:hover img,
.popular-card > a:hover img,
.blog-grid > a:hover img,
.latest-blog .blog-grid a:hover img {
    transform: scale(1.04); /* 画像が少しズームアップするおしゃれな演出 */
}

/* カード内のテキスト余白を統一 */
.blog-info,
.blog-card-content,
.popular-info,
.popular-content,
.thumb-wrapper + div,
.latest-blog .blog-grid .blog-title,
.latest-blog .blog-grid .blog-date {
    padding: 18px;
}

/* カードのタイトル文字 */
.blog-info h3,
.blog-card h3,
.blog-item h3,
.popular-card h3,
.popular-wrap h3,
.popular-title,
.latest-blog .blog-grid h3 {
    margin: 0 0 10px;
    padding: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.6;
    letter-spacing: -0.01em;
    color: #111827;
    transition: color 0.2s ease;
    
    /* 2行を超えたら自動で「...」にする設定 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ホバー時にタイトルを青文字にする */
.blog-card:hover h3,
.blog-item:hover h3,
.popular-wrap:hover h3,
.popular-item:hover h3,
.popular-card > a:hover h3,
.blog-grid > a:hover h3,
.latest-blog .blog-grid a:hover h3 {
    color: #2563eb;
}

/* 投稿日時 */
.blog-date,
.popular-date,
.latest-blog .blog-grid p {
    margin: 0;
    padding: 0;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

/* ==========================================
   7. 「人気のブログ」専用の特別デザイン（中央・高級感）
   ========================================== */
.popular-section .section-title {
    display: flex;
    flex-direction: column;
    align-items: center; /* 中央に集める */
    justify-content: center;
    text-align: center;
    margin-bottom: 36px;
    border-bottom: none; /* 下線を消して、中央のアクセント線に切り替え */
    padding-bottom: 0;
}

.popular-section .section-title h2 {
    position: relative;
    margin: 0;
    font-size: clamp(24px, 4vw, 32px); /* 大きすぎず小さすぎない高級感あるサイズ */
    font-weight: 900;
    letter-spacing: 0.05em; /* 文字の間隔を少し広げて高級感をプラス */
    color: #111827;
}

/* 人気のブログタイトルの下にある青いデコレーション線 */
.popular-section .section-title h2::after {
    content: "";
    display: block;
    width: 40px; /* 線を少しスマートに */
    height: 4px;
    margin: 12px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #2563eb); /* 美しい青グラデーション */
}

.popular-section .section-title p {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    letter-spacing: 0.04em;
}

/* 人気カードのグリッド調整（中身が1つでもきれいに真ん中に配置する設定） */
.popular-section .popular-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 1100px;
    margin: 0 auto;
    gap: 24px;
    justify-content: center; /* 記事が少ないときも中央に寄せる */
    width: 100%;
}

/* 記事が1つだけのときに巨大化するのを防ぎ、真ん中配置にする */
.popular-section .popular-card > a,
.popular-section .popular-wrap {
    width: 100%;
    max-width: 380px; /* カードの最大幅を固定 */
    margin: 0 auto;   /* 固定されたカードを中央に置く */
}

/* バッジ付き特別カード（.popular-wrap）の中身の調整 */
.popular-wrap {
    padding: 14px;
    text-align: center;
}

.popular-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    padding: 7px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #facc15, #f59e0b); /* 金色のゴージャスなバッジ */
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.popular-wrap img {
    border-radius: 20px;
    margin: 0 auto 16px;
}

.popular-title {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 900;
}

/* ==========================================
   8. お問い合わせ・アバウト・フッター
   ========================================== */
#contact {
    max-width: 900px;
    margin: 28px auto;
    padding: 30px 24px;
    border-radius: 28px;
    background: white;
    border: 1px solid #e6e8ef;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

#contact h1 {
    margin: 0 0 8px;
    text-align: center;
}

#contact p {
    text-align: center;
    color: #6b7280;
}

#contact-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #d7dce5;
    font-size: 15px;
    background: #f9fafb;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    background: white;
}

textarea {
    resize: vertical;
}

#contact-form button {
    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    background: #2563eb;
    color: white;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s;
}

#contact-form button:hover {
    transform: translateY(-2px);
    background: #1d4ed8;
}

.about {
    max-width: 900px;
    margin: 18px auto 0;
    padding: 30px;
    border-radius: 28px;
    background: #fff;
    border: 1px solid #e6e8ef;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.about h1 {
    margin: 0 0 12px;
}

.about p {
    margin: 0;
    color: #4b5563;
}

.about a {
    color: #2563eb;
    font-weight: 800;
}

.privacy-link {
    display: block;
    width: fit-content;
    margin: 20px auto;
    color: #2563eb;
    font-weight: 800;
}

footer {
    margin-top: 40px;
    padding: 32px 20px;
    text-align: center;
    background: #111827;
    color: white;
}

.copyright {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

/* 設定モーダル */
#setting-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    padding: 18px;
}

#setting-modal {
    width: min(420px, 100%);
    padding: 26px;
    border-radius: 24px;
    background: white;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

#setting-modal h2 {
    margin-top: 0;
}

.setting-item a {
    color: #2563eb;
    font-weight: 800;
}

#setting-close {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: #111827;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

/* ==========================================
   9. レスポンシブ対応（画面サイズによる調整）
   ========================================== */

/* タブレットサイズ（画面幅 1000px 以下） */
@media (max-width: 1000px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr); /* 2列にする */
    }

    .blog-grid,
    .popular-card {
        grid-template-columns: repeat(2, 1fr); /* 2列にする */
        gap: 18px;
    }
}

/* スマホサイズ（画面幅 700px 以下） */
@media (max-width: 700px) {
    .logo {
        padding: 16px 12px;
        font-size: 18px;
        line-height: 1.4;
    }

    .header {
        display: block;
        position: sticky;
        top: 0;
        z-index: 60;
        background: white;
        border-bottom: 1px solid #e6e8ef;
    }

    .hamburger {
        width: 100%;
        padding: 12px;
        border: none;
        background: white;
        font-size: 25px;
        cursor: pointer;
    }

    .nav {
        display: none;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 16px 16px;
    }

    .nav.active {
        display: grid;
    }

    .nav a {
        padding: 12px;
        border-radius: 14px;
        background: #f3f4f6;
        font-weight: 800;
    }

    #main-nav-pc {
        display: none;
    }

    #setting-btn {
        right: 14px;
        bottom: 14px;
        width: 48px;
        height: 48px;
    }

    .hero {
        margin: 18px 12px 14px;
        padding: 32px 20px;
        border-radius: 24px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 14px;
    }

    .hero-buttons {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero-btn {
        text-align: center;
    }

    section {
        padding: 24px 14px; /* スマホ用のほどよい余白 */
    }

    /* スマホ時のタイトル調整 */
    .section-title {
        display: block;
        margin-bottom: 16px;
    }

    .section-title h2 {
        font-size: 22px;
    }

    .section-title p {
        margin-top: 4px;
        font-size: 13px;
    }

    /* スマホ時はすべて1列にきれいに並べる */
    .category-grid,
    .blog-grid,
    .popular-card {
        grid-template-columns: 1fr; /* 1列にする */
        gap: 16px;
    }

    .category-card {
        padding: 18px;
        border-radius: 20px;
    }

    .category-card h3 {
        font-size: 18px;
    }

    /* カード内の文字サイズや余白のスマホ調整 */
    .blog-info h3,
    .blog-card h3,
    .blog-item h3,
    .popular-card h3,
    .popular-wrap h3,
    .popular-title,
    .latest-blog .blog-grid h3,
    .latest-blog .blog-grid .blog-title {
        font-size: 15px;
        line-height: 1.5;
    }

    .blog-info,
    .blog-card-content,
    .popular-info,
    .popular-content,
    .thumb-wrapper + div,
    .latest-blog .blog-grid .blog-title,
    .latest-blog .blog-grid .blog-date {
        padding: 14px;
    }

    .blog-card img,
    .blog-item img,
    .popular-card img,
    .popular-wrap img,
    .popular-item img,
    .blog-thumb,
    .blog-thumb-img,
    .blog-image,
    .popular-img,
    .latest-blog .blog-grid img {
        height: 160px; /* スマホで縦長になりすぎない高さ */
    }

    /* 人気ブログセクションのスマホ特別調整 */
    .popular-section .section-title {
        margin-bottom: 24px;
    }

    .popular-section .section-title h2 {
        font-size: 24px;
    }

    #contact {
        margin: 18px 12px;
        padding: 24px 16px;
        border-radius: 22px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .about {
        padding: 22px 18px;
        border-radius: 22px;
    }
}

/* 超小型スマホサイズ（画面幅 390px 以下） */
@media (max-width: 390px) {
    .hero h1 {
        font-size: 24px;
    }

    .blog-card img,
    .blog-item img,
    .popular-card img,
    .popular-wrap img,
    .popular-item img,
    .blog-thumb,
    .blog-thumb-img,
    .blog-image,
    .popular-img,
    .latest-blog .blog-grid img {
        height: 145px;
    }
}