/*
====================================
 1. CSS Reset & Base Styles
====================================
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* フォント：日本語は読みやすいゴシック体（サンセリフ）を使用 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f8f8; /* わずかにグレーの背景 */
    color: #333; /* 文字は濃いグレーで目に優しく */
    line-height: 1.8; /* 行間を広くとり、可読性を向上 */
    font-size: 16px;
    -webkit-font-smoothing: antialiased; /* フォントを滑らかに */
}

a {
    color: #1a73e8; /* リンク色を青系に */
    text-decoration: none;
}

a:hover {
    opacity: 0.8;
}

h1, h2, h3 {
    line-height: 1.4;
    font-weight: bold;
    color: #222;
}

h2 {
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 20px;
}

h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

/* 共通のコンテナ設定 */
.container {
    max-width: 960px; /* コンテンツの最大幅を設定 */
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}


.post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* サムネ hover 演出 */
.post-thumbnail {
  overflow: hidden; /* 拡大してもはみ出さない */
}

.post-thumbnail img {
  transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.08);
}

/* カード全体も少し浮かせる */
.post-card {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/*
====================================
 2. Header & Navigation
====================================
*/
#header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

.site-title a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 900;
    color: #333;
}

.site-title a::before {
    content: "";
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    background-image: url("/favicon-192.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 500;
}

/*
====================================
 3. Main Content & Article List
====================================
*/
#main-content {
    padding: 40px 16px;   /* ← 左右16pxを明示 */
    display: flex;
    justify-content: center;
}

/* 記事カードのレイアウト */
.post-card {
    background-color: #fff;
    border: 1px solid #eee;
    margin-bottom: 30px;
    padding: 20px;
    display: flex;
    align-items: flex-start; /* サムネイルとコンテンツを上端に揃える */
}

.post-thumbnail {
    flex-shrink: 0;
    width: 160px;
    aspect-ratio: 16 / 9;
    height: auto;
    margin-right: 20px;
    overflow: hidden;
    background-color: #e0e0e0;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    flex-grow: 1;
}

.post-category {
    display: inline-block;
    font-size: 12px;
    color: #1a73e8;
    font-weight: bold;
    margin-bottom: 5px;
}

.post-kind {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border: 1px solid #d7dde5;
    border-radius: 999px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
}

.post-title a {
    font-size: 18px;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.archive-title {
    font-size: 28px;
    margin: 0 0 24px;
    color: #222;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.post-meta {
    font-size: 13px;
    color: #999;
}

.home-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.9fr);
    gap: 28px;
    align-items: start;
}

.featured-article,
.latest-panel {
    background-color: #fff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
}

.featured-article {
    overflow: hidden;
}

.featured-media {
    display: block;
    aspect-ratio: 16 / 9;
    background-color: #e9eef5;
    overflow: hidden;
}

.featured-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-article:hover .featured-media img {
    transform: scale(1.03);
}

.featured-content {
    padding: 24px;
}

.featured-title {
    margin: 8px 0 10px;
    font-size: 28px;
}

.featured-title a,
.latest-title a {
    color: #222;
}

.featured-excerpt {
    margin-top: 18px;
    color: #555;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    margin-top: 16px;
    font-weight: 700;
}

.read-more-link::after {
    content: ">";
    margin-left: 8px;
    font-size: 13px;
}

.latest-panel {
    padding: 18px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0;
    font-size: 20px;
}

.section-heading a {
    font-size: 13px;
    font-weight: 700;
}

.latest-list {
    display: grid;
    gap: 14px;
}

.latest-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf0f2;
}

.latest-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.latest-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background-color: #e9eef5;
}

.latest-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.latest-title {
    margin: 2px 0 6px;
    font-size: 15px;
}

.latest-title a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-excerpt {
    margin-top: 8px;
    color: #666;
    font-size: 14px;
}

/*
====================================
 4. Profile Widget
====================================
*/
.profile-widget {
    margin-top: 40px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #eee;
    text-align: center;
}

.profile-widget h2 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 10px;
}

.author-name {
    font-weight: bold;
    margin-bottom: 10px;
}

.author-bio {
    font-size: 14px;
    color: #666;
}

/*
====================================
 5. Footer
====================================
*/
#footer {
    border-top: 1px solid #eee;
    padding: 20px 0;
    text-align: center;
    background-color: #fff;
}

.copyright {
    font-size: 13px;
    color: #999;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 13px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
}

.footer-links a:hover {
    color: #111;
    text-decoration: underline;
}

/*
====================================
 6. Single Post Specific Styles
====================================
*/
.post-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.post-page-title {
    font-size: 32px;
    margin: 10px 0 15px;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body ul {
    list-style: disc;
    margin-left: 2em;
    margin-bottom: 20px;
    padding-left: 0;
}


/* 1. 注目・強調ボックス (黄色系) */
.box-attention {
    padding: 15px;
    margin: 20px 0;
    background-color: #fffbe6; /* 薄い黄色 */
    border-left: 5px solid #ffcc00; /* 左に強調ライン */
    border-radius: 4px;
    font-size: 15px;
}

/* 2. 筆者主張・自分の意見ボックス (青系/グレー系) */
.box-mine {
    padding: 15px;
    margin: 20px 0;
    background-color: #f7f9fb; /* 非常に薄い青/グレー */
    border: 1px solid #e3e6e9;
    border-radius: 4px;
    font-size: 15px;
}

/* 3. 引用ブロック */
.custom-quote {
    padding: 20px;
    margin: 20px 0;
    background-color: #f5f5f5; /* グレーの背景 */
    border-left: 4px solid #aaa;
    font-style: italic;
    color: #666;
}

/* 記事下部のCTA（行動喚起） */
.cta-section {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    background-color: #e6f7ff; /* 目立つ薄い背景色 */
    border-radius: 5px;
}

.cta-button {
    display: inline-block;
    background-color: #1a73e8;
    color: #fff;
    padding: 12px 25px;
    margin-top: 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s;
}

    .cta-button:hover {
        background-color: #0d47a1;
    }

    /* お問い合わせフォーム */
.contact-form {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    border: 1px solid #eee;
    background-color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit; /* フォントを継承 */
}

.form-group textarea {
    resize: vertical;
}

.contact-form .cta-button {
    /* cta-buttonのスタイルを再利用 */
    width: 100%;
    text-align: center;
}

/* ====================================
   Markdownコンテンツのはみ出し防止・整形
==================================== */

/* 1. 画像が枠からはみ出さないようにする */
.post-body img {
    max-width: 100%;  /* 親要素の幅を超えない */
    height: auto;     /* 縦横比を維持 */
    display: block;   /* インライン要素の隙間を消す */
    margin: 20px auto;/* 上下に余白、左右中央寄せ */
}

/* 2. コードブロック(pre)が長すぎる時に横スクロールさせる */
.post-body pre {
    max-width: 100%;
    overflow-x: auto; /* 枠を超えたらスクロールバーを出す */
    background-color: #f6f8fa; /* 薄いグレー背景（任意） */
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 3. 長いURLや英単語を強制的に折り返す */
.post-body {
    overflow-wrap: break-word;
}

/* 4. 表(table)が崩れないようにする */
.post-body table {
    display: block;      /* スマホで横スクロールさせるために必要 */
    overflow-x: auto;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.post-body th,
.post-body td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    white-space: nowrap; /* 好みによります：勝手に改行させない */
}

/* ====================================
   ▼▼ スマホ対応（768px以下）▼▼
===================================== */
@media screen and (max-width: 768px) {

    /* コンテナ幅を広くする */
     .container {
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    /* ヘッダー：メニューを中央寄せ・折り返し */
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .main-nav li {
        margin-left: 0;
    }

    .main-nav a {
        font-size: 13px;
    }

    /* タイトル縮小 */
    .site-title a {
        font-size: 20px;
    }

    /* メインコンテンツを縦方向に */
    #main-content {
        padding: 20px 12px;
        flex-direction: column;
    }

    .home-article-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .featured-content,
    .latest-panel {
        padding: 16px;
    }

    .featured-title {
        font-size: 22px;
    }

    /* 記事カード → 縦並びにする */
    .post-card {
        flex-direction: column;
        padding: 15px;
    }

    .post-thumbnail {
        width: 100%;
        height: 180px;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .post-title a {
        font-size: 17px;
    }

    /* 記事タイトル */
    .post-page-title {
        font-size: 24px;
        line-height: 1.4;
    }

    /* 見出し調整 */
    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }

    .latest-item {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    /* プロフィールボックス */
    .profile-widget {
        padding: 15px;
        margin-top: 30px;
    }

    .author-bio {
        font-size: 13px;
    }

    /* CTA */
    .cta-section {
        padding: 20px;
    }

    .cta-button {
        width: 100%;
        padding: 14px;
        font-size: 18px;
    }
}

/* ====================================
   ▼▼ さらに小さい画面（480px以下）▼▼
===================================== */
@media screen and (max-width: 480px) {

    .site-title a {
        font-size: 18px;
    }

    .post-page-title {
        font-size: 20px;
    }

    .post-thumbnail {
        height: 150px;
    }

    .main-nav a {
        font-size: 12px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 16px;
    }

    .latest-item {
        grid-template-columns: 76px minmax(0, 1fr);
    }
}
