/* ==== 固定ページ (page.php) ==== */

.page-header-wrap {
    margin-bottom: 6rem;
}

.page-header {
    position: relative;
    padding: 4rem 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: center;
    color: #fff;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media screen and (max-width: 768px) {
    .page-header {
        padding: 2.5rem 0;
        min-height: 150px;
    }

    .page-header .page-subtitle {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }

    .page-header .page-title {
        font-size: 1.7rem;
    }
}

.page-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* 文字を読みやすくするための暗いオーバーレイ */
    z-index: 1;
}

.page-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.page-header .page-subtitle {
    order: -1;
    /* タイトルの上に表示 */
    font-size: 1.2rem;
    /* PCのデフォルトサイズ */
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    /* margin: 0 0 1.2rem 0; content1 と同じ間隔 */
    color: #e0e0e0;
}

.page-header .page-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.02em;
    margin: 0;
    color: #fff;
}

.page-header-desc {
    width: 100%;
    padding: 1.6rem 0;
    background: #f5f5f5;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.8;
    text-align: left;
}

.page-header-desc .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-body {
    max-width: 1000px;
    margin: 0 auto 4rem;
    padding: 0 20px;
}

.page-body.full-width {
    max-width: none;
    padding: 0;
}

/* 個別投稿ページ・ヘッダー画像のないアーカイブページ: パンくず直下にヘッダー画像がないため上余白を追加 */
.single .page-body,
.page-body.no-header-image {
    padding-top: 4rem;
}

/* 個別投稿ページ・ヘッダー画像のないアーカイブ: 記事/アーカイブヘッダー */
.single .entry-header,
.no-header-image .entry-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #000;
}

.single .entry-meta {
    font-size: 0.9rem;
    font-weight: bold;
    color: #888;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.single .entry-title,
.no-header-image .entry-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    /* color はPHPでインラインスタイルとして適用（メインカラー） */
}

.single .entry-content {
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

/* ヘッダー画像のないアーカイブでのリストとタイトルの余白 */
.no-header-image .archive-content {
    margin-top: 2rem;
}

/* 個別投稿ページ: 記事ナビゲーション */
.post-navigation {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.post-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    color: #111;
    border: 1px solid currentColor;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    text-align: center;
    min-width: 0;
}

.post-nav-btn:hover {
    text-decoration: none;
}

/* 非活性ボタン */
.post-nav-btn.is-disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

/* chevron 矢印 */
.post-nav-arrow {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    flex-shrink: 0;
}

.post-nav-arrow--prev {
    transform: rotate(-135deg);
}

.post-nav-arrow--next {
    transform: rotate(45deg);
}

/* 真ん中の一覧ボタンは左右より少し抑えめ */
.post-nav-archive {
    flex-shrink: 0;
}

@media screen and (max-width: 768px) {
    .post-navigation {
        flex-direction: column;
        align-items: stretch;
    }

    .post-nav-btn {
        justify-content: center;
    }
}

.page-breadcrumbs {
    width: 100%;
    font-size: 0.85rem;
    /* background-color is set inline via PHP (main color) */
}

.page-breadcrumbs-inner {
    display: flex;
    align-items: center;
    padding: 0.5rem 20px;
    flex-wrap: wrap;
}

.page-breadcrumbs a {
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.page-breadcrumbs a:hover {
    opacity: 1;
    text-decoration: none;
}

.page-breadcrumbs .separator {
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.page-breadcrumbs .current {
    color: #fff;
    opacity: 0.85;
}

/* ==== アーカイブページ (archive.php, home.php) ==== */
/* アーカイブ記事リストは固定ページと同じ .page-header クラスで装飾されるため追加記述は最小限 */
.archive-content {
    margin-top: 1rem;
}

.archive-post-item .entry-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.archive-post-item .entry-title a {
    color: #111;
    text-decoration: none;
    transition: color 0.3s ease;
}

.archive-post-item .entry-title a:hover {
    color: #0073aa;
}

.archive-post-item .entry-summary {
    color: #555;
    line-height: 1.6;
}

/*==== ページネーション ====*/
.archive-pagination {
    margin: 4rem 0 2rem;
    text-align: center;
}

.archive-pagination .page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.archive-pagination .page-numbers li {
    margin: 0;
}

.archive-pagination .page-numbers a,
.archive-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.archive-pagination .page-numbers a:hover {
    border-color: #333;
    background-color: #f9f9f9;
}

.archive-pagination .page-numbers span.current {
    background-color: #111;
    color: #fff;
    border-color: #111;
}


/* ==== Gutenberg テーブルブロック ==== */

.wp-block-table {
    width: 100%;
    margin: 0 0 2.5rem;
    overflow-x: auto;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 1rem;
    line-height: 1.8;
    table-layout: fixed;
}

.wp-block-table th,
.wp-block-table td {
    padding: 1.2rem 1.6rem;
    text-align: left;
    vertical-align: middle;
    word-break: break-word;
}

/* ラベル列（th） */
.wp-block-table th {
    width: 22%;
    background-color: #666;
    font-weight: bold;
    font-size: 0.95rem;
    color: #fff;
}

/* 値列（td） */
.wp-block-table td {
    background-color: #fff;
    color: #333;
    font-size: 0.98rem;
}

@media screen and (max-width: 768px) {
    .wp-block-table th {
        width: 30%;
        font-size: 0.85rem;
        padding: 0.9rem 1rem;
    }

    .wp-block-table td {
        font-size: 0.9rem;
        padding: 0.9rem 1rem;
    }
}

/* ==== Gutenberg カラムブロック（モバイルで逆順） ==== */
@media screen and (max-width: 781px) {
    .wp-block-columns.is-mobile-stack-reverse {
        display: flex !important;
        flex-direction: column-reverse !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        /* gap は column-reverse で逆方向に作用するためリセット */
    }

    .wp-block-columns.is-mobile-stack-reverse>.wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        /* column-reverse では「後ろの要素が上」になるため、margin-bottom で間隔を管理 */
        margin-bottom: 1.5em !important;
    }

    /* column-reverse では :last-child が視覚上の先頭なので margin 不要 */
    .wp-block-columns.is-mobile-stack-reverse>.wp-block-column:last-child {
        margin-bottom: 0 !important;
    }
}