/* --- Reset & Basic Settings --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, p, ol, ul {
    margin: 0;
    padding: 0;
}

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: 1200px;
    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; /* 成功時の緑色 */
}

/* ===== 表のスタイル ===== */
.excel-summary-table {
  margin: 2em 0; /* 上下の余白 */
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  overflow: scroll;
}

.excel-summary-table table {
  width: 100%; /* 幅を親要素いっぱいに */
  border-collapse: collapse; /* ボーダーを重ねる */
  border: 1px solid #ddd; /* 外枠 */
  font-size: 16px; /* 文字サイズ */
  white-space: nowrap;
}

/* --- ヘッダー --- */
.excel-summary-table thead th {
  background-color: #446E72; /* Excelっぽい青色 */
  color: #ffffff; /* 文字色を白に */
  padding: 12px 15px;
  text-align: center;
  font-weight: bold;
}

/* --- ボディ --- */
.excel-summary-table tbody td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd; /* 行の下線 */
  vertical-align: middle; /* 上下中央揃え */
  text-align: center;
}

/* --- 交互に色を変える --- */
.excel-summary-table tbody tr:nth-of-type(even) {
  background-color: #f9f9f9; /* 偶数行の背景色 */
}

.excel-summary-table tbody tr:hover {
  background-color: #f1f1f1; /* ホバー時の背景色 */
}

/* --- コード部分のスタイル --- */
.excel-summary-table code {
  background-color: #e7e7e7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 0.95em;
}

.excel-summary-table small {
    color: #555;
}

/*関連記事　connection*/
.connection {
    background-color: #ffffff;
    border: 3px, solid, #446E72;
    max-height: 250px;
    margin-top: 10px;
}

.connection a {
    color : inherit;
    text-decoration : none;
}

.right {
    max-width: 80px;
    max-height: 25px;
    text-align: center;
    margin: 0 0 0 auto;
    font-size: small;
    background-color: #446E72;
    color: #ffffff;
}

.right p {
    margin: 0;
}

.connection2 {
    display: flex;
    align-items: center;
}

.connection2 img {
    max-width: 130px;
    max-height: 130px;
    border-radius: 0;
    margin: 0 30px 25px 30px;
}

.connection2 p {
    font-weight: 500;
    padding-right: 15px;
}


/* ===== 関連記事 パターン2：コンパクトなカードグリッド ===== */
.article-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.article-card-vertical {
    display: block;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card-vertical:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-image-vertical img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-content-vertical {
    padding: 15px;
}

.card-title-vertical {
    font-size: 1rem;
    line-height: 1.5;
    color: #446E72; /* アクセントカラー */
    border: none;
    padding: 0;
}


/* --- 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までは画面ずれない**/