/*
layout.css — サイトの骨格レイアウト

ヘッダー・フッター・サイドバー・記事一覧（アーカイブ）・単一記事・
ページネーションなど、テーマの「型」を構成するスタイル。
トップページ専用の装飾は含まない（page-home.css 参照）。
*/

/* ================================================================
    LAYOUT UTILITIES
================================================================ */
.container {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 32px;
    padding-right: 32px;
}

.layout-1col {
    max-width: 1320px;
    margin: 0 auto;
}

.layout-2col {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    max-width: 1320px;
    margin: 40px auto;
    padding: 0 32px;
}

.content-area { min-width: 0; }

/* ================================================================
    HEADER
================================================================ */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 var(--border), 0 4px 12px rgba(0,0,0,.04);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding-top: 0;
    padding-bottom: 0;
    height: 64px;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.site-title a {
    color: var(--gray-6);
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-title img { max-height: 50px; display: block; }

.site-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 !important;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.site-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-5);
    padding: 6px 14px;
    border-radius: var(--r-sm);
    transition: background .15s, color .15s;
    display: block;
}

.site-nav a:hover {
    background: var(--gray-0);
    color: var(--gray-6);
    text-decoration: none;
}

/* ================================================================
    ARCHIVE / POST LIST
================================================================ */
.archive-title {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

/* ── デフォルト（通常カテゴリー）：元のカードデザイン ── */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 24px 28px;
    transition: border-color .2s, box-shadow .2s;
    position: relative;
}

.post-card + .post-card { margin-top: 16px; }

.post-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--blue-5);
    border-radius: var(--r-sm) 0 0 var(--r-sm);
    opacity: 0;
    transition: opacity .2s;
}

.post-card:hover {
    border-color: var(--blue-1);
    box-shadow: var(--shadow-md);
}

.post-card:hover::before { opacity: 1; }

.post-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.post-card h2 a {
    color: var(--text);
    transition: color .15s;
}

.post-card h2 a:hover {
    color: var(--blue-5);
    text-decoration: none;
}

/* ── コンパクト（子を持つ親カテゴリー）：ドキュメント向けリスト ── */
.post-list--compact {
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.post-list--compact .post-card {
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 10px 16px 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: none;
    transition: background .15s;
}

.post-list--compact .post-card:last-child { border-bottom: none; }
.post-list--compact .post-card + .post-card { margin-top: 0; }

.post-list--compact .post-card::before {
    border-radius: 0;
}

.post-list--compact .post-card:hover {
    background: var(--blue-0);
    border-color: var(--border);
    box-shadow: none;
}

.post-list--compact .post-card h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    letter-spacing: -0.01em;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-list--compact .post-card h2 a {
    color: var(--text);
    transition: color .15s;
}

.post-list--compact .post-card h2 a:hover {
    color: var(--blue-5);
    text-decoration: none;
}

.post-list--compact .post-meta {
    margin-bottom: 0;
    font-size: 0.78rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.7;
}

/* ================================================================
    POST META
================================================================ */
.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--gray-4);
    margin-bottom: 12px;
    font-weight: 500;
}

/* ================================================================
    SINGLE POST
================================================================ */
.single-post {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 40px 48px;
    box-shadow: var(--shadow-sm);
}

.post-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--text);
}

.single-post .post-meta {
    padding-bottom: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.post-content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--gray-6);
}

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 40px 0 14px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}

.post-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 40px 0 14px;
}

.post-content p { margin: 0 0 24px; }

.post-content ul, .post-content ol {
    padding-left: 28px;
    margin: 0 0 24px;
}

.post-content li { margin-bottom: 8px; }

.post-content code {
    font-family: var(--mono);
    font-size: 0.87em;
    background: var(--gray-0);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    color: var(--blue-7);
}

.post-content pre {
    background: var(--gray-6);
    color: #e2e8f0;
    border-radius: var(--r-md);
    padding: 28px 32px;
    overflow-x: auto;
    margin: 0 0 28px;
    font-family: var(--mono);
    font-size: 0.88rem;
    line-height: 1.75;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.post-content blockquote {
    border-left: 4px solid var(--blue-5);
    margin: 0 0 28px;
    padding: 16px 24px;
    background: var(--blue-0);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--gray-5);
    font-style: italic;
}

.post-content a { font-weight: 500; }

/* ================================================================
    PAGINATION
================================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.pagination__numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--white);
    transition: border-color .15s, color .15s, background .15s;
    text-decoration: none;
}

.pagination__num:hover {
    border-color: var(--blue-5);
    color: var(--blue-5);
    background: var(--blue-0);
    text-decoration: none;
}

.pagination__num--current {
    border-color: var(--blue-5);
    background: var(--blue-5);
    color: var(--white);
    font-weight: 700;
    cursor: default;
}

.pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    font-size: 0.88rem;
    color: var(--gray-4);
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--white);
    transition: border-color .15s, color .15s, background .15s;
    text-decoration: none;
}

.pagination__btn:hover {
    border-color: var(--blue-5);
    color: var(--blue-5);
    background: var(--blue-0);
    text-decoration: none;
}

/* ================================================================
    SIDEBAR
================================================================ */
.site-sidebar { min-width: 0; }

.widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.widget h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--gray-4);
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

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

.widget li { margin-bottom: 10px; }
.widget li:last-child { margin-bottom: 0; }

.widget li a {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color .15s, padding-left .15s;
    display: block;
    padding: 4px 0;
}

.widget li a:hover {
    color: var(--blue-5);
    padding-left: 6px;
    text-decoration: none;
}

/* カテゴリー親子ツリー */
.widget-cat-parent > a {
    font-weight: 700;
    color: var(--text);
}

.widget-cat-children {
    list-style: none;
    margin: 6px 0 0;
    padding-left: 20px !important;
    border-left: 1px solid var(--border);
}

.widget-cat-children li { margin-bottom: 6px; }
.widget-cat-children li:last-child { margin-bottom: 0; }

.widget-cat-children a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 2px 0;
}

.widget-cat-children a:hover {
    color: var(--blue-5);
    padding-left: 6px;
}

/* ================================================================
    FOOTER
================================================================ */
.site-footer {
    background: var(--gray-6);
    color: rgba(255,255,255,.85);
    padding: 40px 0 28px;
    text-align: center;
    font-size: 0.9rem;
    border-top: 4px solid var(--blue-5);
    flex-shrink: 0; /* フッターが縮まないようにする */
}

/* フッター内のリンクすべてに強制適用 */
.site-footer a,
.site-footer .footer-nav a {
    color: #ffffff !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* ホバー時の色指定 */
.site-footer a:hover,
.site-footer .footer-nav a:hover {
    color: var(--blue-1) !important;
    text-decoration: underline !important;
}

.footer-nav ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 20px !important;
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-nav a {
    font-size: 0.95rem !important;
}

.site-footer p {
    margin: 0;
    color: rgba(255,255,255,.6) !important;
}

.footer-logo {
    margin-bottom: 20px;
    text-align: center;
}

.footer-logo img {
    max-height: 40px;
    margin: 0 auto;
}

/* ================================================================
    RESPONSIVE
================================================================ */
@media (max-width: 900px) {
    .layout-2col {
        grid-template-columns: 1fr;
        gap: 32px;
        margin: 36px auto;
        padding: 0 20px;
    }

    .site-sidebar { width: 100%; }
    .container { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 640px) {
    .single-post { padding: 28px 20px; }
    .site-header .container { height: 56px; }
    .site-title a::before { width: 22px; height: 22px; }
}