/* --- Reset & Basic Settings --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, p, ol, ul {
    margin: 0;
    padding: 0;
    text-align: center;
}

html {
    scroll-behavior: smooth; /* スムーススクロールを有効化 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.8;
    background-color: #E6E4E0; /* ベースカラー */
    color: #2B2721; /* テキストカラー */
    font-size: 16px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

a {
    color: #446E72; /* アクセントカラー */
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}



/* --- Header & Navigation --- */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px; /* ヘッダーの高さ */
}

.site-logo a {
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.global-nav ul {
    display: flex;
    list-style: none;
    margin: 0;  
    padding: 0; 
}

.global-nav li + li {
    margin-left: 25px;
}

.global-nav li {
    margin-bottom: 0px;
}

.global-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.global-nav a:hover {
    opacity: 0.8;
}

/* 既存のヘッダースタイルの調整 */
.site-header {
    padding: 0;
}
.site-header p {
    display: none; /* 既存のpタグを非表示に */
}





/* --- Header & Footer --- */
.site-header, .site-footer {
    background-color: #446E72; /* アクセントカラー */
    color: #E6E4E0;
    padding: 20px 0;
    text-align: center;
}

.site-header h1 {
    color: #fff;
    margin-bottom: 5px;
}

/* --- Article Styles --- */
main {
    padding: 40px 0;
}

.article-header {
    text-align: left;
    margin-bottom: 40px;
}

.article-header h1 {
    font-size: 2.2rem;
    color: #446E72; /* アクセントカラー */
    margin-bottom: 15px;
    line-height: 1.3;
}

/* 記事のメタ情報（日付など） */
.article-meta {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #555;
}

.article-meta .updated-date {
  margin-left: 1em;
}

.article-intro {
    font-size: 1.1rem;
    color: #555;
    text-align: left; /* ★★★ 修正点：中央揃えから左揃えに変更 ★★★ */
}

article section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #dcdad5;
}

article section:last-of-type {
    border-bottom: none;
}

h2 {
    font-size: 1.8rem;
    color: #446E72; /* アクセントカラー */
    border-bottom: 2px solid #446E72;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.4rem;
    color: #2B2721;
    border-left: 5px solid #446E72;
    padding-left: 15px;
    margin: 30px 0 15px;
}

p, ol, ul {
    margin-bottom: 20px;
}

ol, ul {
    padding-left: 10px;
}

li {
    margin-bottom: 10px;
}


/* ▼▼▼ 目次のスタイルを追加 ▼▼▼ */
.toc {
    background-color: #f7f6f4;
    padding: 20px 30px;
    border: 1px solid #dcdad5;
    border-radius: 8px;
    margin-bottom: 50px;
}
.toc-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2B2721;
    text-align: center;
    margin-bottom: 15px;
    border-bottom: none; /* h2のスタイルを上書き */
}
.toc ol {
    padding-left: 20px;
    margin-bottom: 0;
}
.toc li {
    margin-bottom: 8px;
}
.toc a {
    font-weight: 500;
}
/* ▲▲▲ 目次のスタイルを追加 ▲▲▲ */


/* --- Code Block --- */
pre {
    background-color: #2B2721; /* テキストカラーを背景に */
    color: #E6E4E0; /* ベースカラーを文字色に */
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
    position: relative;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
/* インラインコードのスタイル */
p > code, li > code {
    background-color: #dcdad5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* --- Special Sections --- */
.conclusion ul {
    list-style: none;
    padding-left: 0;
}
.conclusion li {
    background-color: #f7f6f4;
    padding: 10px 15px;
    border-left: 4px solid #446E72;
    margin-bottom: 10px;
}

/* --- Copy Button for Code Blocks --- */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #446E72;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, background-color 0.2s;
}
.copy-btn:hover {
    opacity: 1;
}

.copy-btn.copied {
    background-color: #28a745; /* 成功時の緑色 */
}

/* ===== トップページスタイル ===== */

/* === ヒーローセクション === */
.hero {
    background-color: #f7f6f4; /* 少し色味のある白 */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 20px;
    height: 85vh;
    min-height: 500px;
}

.hero-title {
    font-size: 2.8rem;
    color: #2B2721;
    line-height: 1.5;
    margin-bottom: 20px;
}

.hero-title .accent-typing {
    color: #446E72;
}

/* タイピングのカーソル */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 3rem;
    background-color: #446E72;
    animation: blink 0.8s infinite;
    vertical-align: bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto 40px;
}

.cta-button {
    background-color: #446E72;
    color: #fff;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background-color 0.3s, transform 0.2s;
}

.cta-button:hover {
    background-color: #3a5c60;
    transform: translateY(-3px);
}

/* === 共通セクションスタイル === */
.section-title {
    text-align: center;
    font-size: 2rem;
    color: #446E72;
    margin-bottom: 50px;
}

.about, .latest-articles {
    padding: 80px 0;
}

/* === サイト紹介セクション === */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: #fff;
    padding: 40px 30px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}
.feature-title {
    font-size: 1.4rem;
    color: #446E72;
    margin-bottom: 10px;
    border: none;
    padding: 0;
}

/* === 最新記事セクション === */
.latest-articles {
    background-color: #f7f6f4;
}

.view-all-container {
    text-align: center;
    margin-top: 50px;
}
.view-all-button {
    background-color: transparent;
    border: 2px solid #446E72;
    color: #446E72;
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}
.view-all-button:hover {
    background-color: #446E72;
    color: #fff;
}

/* === スクロールアニメーション用スタイル === */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .typing-cursor {
        height: 2.2rem;
    }
}




/* ===== 記事一覧ページスタイル ===== */

.article-gallery {
    display: grid;
    /* 画面幅に応じて列数を自動調整 */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px; /* カード間の余白 */
    margin-top: 40px;
}

.article-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden; /* 角丸を画像にも適用 */
    text-decoration: none;
    color: inherit; /* 親要素の文字色を継承 */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px); /* 少し浮き上がる動き */
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.article-card .card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.article-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像の比率を保ったままトリミング */
    margin: 0;
    border-radius: 0; /* 親要素で角丸を指定しているのでリセット */
    box-shadow: none; /* 親要素で影を指定しているのでリセット */
    transition: transform 0.3s ease;
}

.article-card:hover .card-image img {
    transform: scale(1.05); /* ホバー時に画像を少し拡大 */
}

.article-card .card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* 高さを揃えるための設定 */
}

.article-card .card-title {
    font-size: 1.1rem;
    color: #446E72; /* アクセントカラー */
    margin: 0 0 10px 0;
    border: none; /* h3の既存スタイルをリセット */
    padding: 0;
}

.article-card .card-excerpt {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 15px;
    flex-grow: 1; /* 高さを揃えるための設定 */
}

.article-card .card-date {
    font-size: 0.8rem;
    color: #888;
    text-align: right;
    margin-bottom: 0;
}


/* ===== お問い合わせフォームスタイル ===== */

.contact-form {
    max-width: 800px;
    margin: 40px auto;
    background-color: #fdfcfb;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2B2721;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #dcdad5;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #446E72;
    box-shadow: 0 0 0 3px rgba(68, 110, 114, 0.2);
}

/* textareaのサイズ変更を縦方向のみに制限 */
textarea.form-control {
    resize: vertical;
}

.required-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background-color: #c84a4a;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: normal;
}

.submit-button-container {
    text-align: center;
    margin-top: 30px;
}

.submit-btn {
    background-color: #446E72; /* アクセントカラー */
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 50px; /* 角を丸くする */
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.submit-btn:hover {
    background-color: #3a5c60; /* 少し濃い色 */
    transform: scale(1.02);
}

/* ===== お問い合わせフォームのステータス表示 ===== */
#form-status {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    min-height: 1.5em; /* メッセージがないときも高さを確保 */
}

/* ===== プロフィールページスタイル ===== */

.profile-container {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 50px;
    padding: 30px;
    background-color: #f7f6f4;
    border-radius: 8px;
}

.profile-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* 画像を円形にする */
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.profile-text {
    flex: 1;
}

.profile-name {
    font-size: 1.8rem;
    color: #446E72;
    margin: 0 0 10px 0;
    border: none;
}

.profile-bio {
    margin-bottom: 15px;
    line-height: 1.7;
    text-align: left;
}

.profile-social-links a {
    display: inline-block;
    font-weight: bold;
    text-decoration: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .profile-container {
        flex-direction: column; /* 縦並びにする */
        text-align: center;
    }
}

/*プライバシーポリシー*/
.privacy-policy {
    padding: 80px 50px 0 50px;
    text-align: left;
}

/* ===== プロフィールページの本文を左寄せにする ===== */

.profile-container + section p,
.profile-container + section ul {
    text-align: left;
}





/* --- Responsive Design --- */
@media (max-width: 768px) {
    .article-header h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 460px) {
    .container.header-container a {
        font-size: 0.8rem;
    }
}

@media (max-width: 380px) {
    .global-nav li + li {
    margin-left: 10px;
}
    .container.header-container a {
        font-size: 0.8rem;
    }
} /**330pxまでは画面ずれない**/