/* ===== 固定ページ・投稿ページ共通スタイル ===== */
.page-content,
.post-content {
    padding: 100px 0 80px;
    min-height: calc(100vh - 300px);
    background: #fff;
}

.page-container,
.post-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.page-header,
.post-header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.page-title,
.post-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.3;
    color: #333;
    margin: 0;
}

/* アイキャッチ画像 */
.post-thumbnail {
    margin-bottom: 50px;
    text-align: center;
}

.post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 本文エリア */
.page-body,
.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 60px;
}

/* 本文内の要素スタイリング */
.page-body h2,
.post-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 40px 0 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #009944;
}

.page-body h3,
.post-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 15px;
    color: #333;
}

.page-body p,
.post-body p {
    margin-bottom: 20px;
}

.page-body ul,
.post-body ul,
.page-body ol,
.post-body ol {
    margin: 20px 0 20px 20px;
    padding-left: 20px;
}

.page-body li,
.post-body li {
    margin-bottom: 10px;
}

.page-body blockquote,
.post-body blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background: #f8f8f8;
    border-left: 4px solid #009944;
    font-style: italic;
}

.page-body table,
.post-body table {
    width: 100%;
    margin: 30px 0;
    border-collapse: collapse;
}

.page-body th,
.post-body th,
.page-body td,
.post-body td {
    padding: 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.page-body th,
.post-body th {
    background: #f8f8f8;
    font-weight: 600;
}

.page-body img,
.post-body img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 4px;
}

/* 画像の配置クラス */
.page-body .alignleft,
.post-body .alignleft {
    float: left;
    margin-right: 20px;
}

.page-body .alignright,
.post-body .alignright {
    float: right;
    margin-left: 20px;
}

.page-body .aligncenter,
.post-body .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ボタンエリア */
.page-back-button,
.post-navigation {
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.btn-back-home,
.btn-back {
    display: inline-block;
    padding: 15px 40px;
    background: #009944;
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 211, 122, 0.3);
}

.btn-back-home:hover,
.btn-back:hover {
    background: #00B968;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 211, 122, 0.4);
    color: #fff;
}

/* ===== ページタイトル非表示時の調整 ===== */
.page-body.no-title {
    margin-top: 0;
}

.hide-page-title .page-header {
    display: none;
}

.hide-page-title .page-content {
    padding-top: 60px;
}

/* ===== 投稿ページ専用スタイル ===== */

/* 投稿ページのヘッダーを左揃えに変更 */
.post-header {
    text-align: left;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 30px;
}

/* 投稿タイトルの下マージンを増やす */
.post-title {
    margin-bottom: 30px;
}

/* SNSシェアボタン */
.sns-share {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #fff;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #fff;
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

/* 各SNSボタンの色 */
.share-x {
    background-color: #000;
}

.share-x:hover {
    background-color: #333;
}

.share-facebook {
    background-color: #1877f2;
}

.share-facebook:hover {
    background-color: #166fe5;
}

.share-instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.share-instagram:hover {
    background: linear-gradient(45deg, #e6683c, #dc2743, #cc2366, #bc1888, #9c1478);
}

.share-note {
    background-color: #41c9b4;
}

.share-note:hover {
    background-color: #3ab5a3;
}

/* 投稿メタ情報 */
.post-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.meta-separator {
    margin: 0 10px;
}

/* H2スタイルを上書き - 薄緑背景に緑文字 */
.post-body h2 {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-bottom: none;
    border-radius: 5px;
}

/* H3スタイルを上書き - 左端にアクセント */
.post-body h3 {
    padding-left: 20px;
    position: relative;
}

.post-body h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 80%;
    background-color: #4caf50;
    border-radius: 3px;
}

/* タグ */
.post-tags {
    padding: 20px 0;
    border-top: 1px solid #eee;
    margin-bottom: 30px;
}

.tag-label {
    font-weight: bold;
    margin-right: 10px;
}

.post-tags a {
    display: inline-block;
    padding: 5px 12px;
    background-color: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 3px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.post-tags a:hover {
    background-color: #4caf50;
    color: #fff;
}

/* ホームに戻るボタンエリアの調整 */
.page-back-button {
    margin-top: 30px;
}

/* YouTube埋め込み動画のレスポンシブ対応 */
.page-body .wp-block-embed.is-type-video,
.page-body .wp-block-embed-youtube {
    margin: 30px 0;
    clear: both;
}

.page-body .wp-block-embed__wrapper {
    position: relative;
}

.page-body .wp-block-embed__wrapper iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    display: block;
}

/* モバイル時の調整 */
@media (max-width: 768px) {
    .page-body .wp-block-embed.is-type-video,
    .page-body .wp-block-embed-youtube {
        margin: 20px 0;
    }
}

/* YouTube動画のコンテナ */
.page-body .wp-block-embed,
.post-body .wp-block-embed,
.page-body .wp-block-embed__wrapper,
.post-body .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9のアスペクト比 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
}

.page-body .wp-block-embed iframe,
.post-body .wp-block-embed iframe,
.page-body .wp-block-embed__wrapper iframe,
.post-body .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* カスタムHTMLブロック内の動画 */
.page-body .wp-block-html iframe[src*="youtube"],
.post-body .wp-block-html iframe[src*="youtube"] {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    margin: 20px 0;
}

/* 蛍光ペン風マーカー */
.marker-green {
    background: linear-gradient(transparent 60%, #a8e6a3 60%);
    padding: 0 2px;
}

.marker-yellow {
    background: linear-gradient(transparent 60%, #fff59d 60%);
    padding: 0 2px;
}

.marker-pink {
    background: linear-gradient(transparent 60%, #ffcdd2 60%);
    padding: 0 2px;
}

/* エディタ内でも同じスタイルを適用 */
.editor-styles-wrapper .marker-green,
.block-editor-block-list__layout .marker-green {
    background: linear-gradient(transparent 60%, #a8e6a3 60%);
}

.editor-styles-wrapper .marker-yellow,
.block-editor-block-list__layout .marker-yellow {
    background: linear-gradient(transparent 60%, #fff59d 60%);
}

.editor-styles-wrapper .marker-pink,
.block-editor-block-list__layout .marker-pink {
    background: linear-gradient(transparent 60%, #ffcdd2 60%);
}

/* WordPress標準のクラスサポート */
.wp-caption {
    max-width: 100%;
    margin: 20px 0;
}

.wp-caption-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.gallery {
    margin: 30px 0;
}

.gallery-item {
    display: inline-block;
    text-align: center;
    vertical-align: top;
    margin: 10px;
}

/* カラム対応 */
.wp-block-columns {
    display: flex;
    gap: 30px;
    margin: 30px 0;
}

.wp-block-column {
    flex: 1;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .page-content,
    .post-content {
        padding: 80px 0 60px;
    }
    
    .page-header,
    .post-header {
        margin-bottom: 40px;
        padding-bottom: 20px;
    }
    
    .page-body,
    .post-body {
        font-size: 1rem;
        margin-bottom: 40px;
    }
    
    .page-body h2,
    .post-body h2 {
        font-size: 1.5rem;
        margin: 30px 0 15px;
    }
    
    .page-body h3,
    .post-body h3 {
        font-size: 1.3rem;
        margin: 25px 0 12px;
    }
    
    .page-back-button,
    .post-navigation {
        margin-top: 40px;
        padding-top: 30px;
    }
    
    .btn-back-home,
    .btn-back {
        padding: 12px 30px;
        font-size: 0.95rem;
    }
    
    .hide-page-title .page-content {
        padding-top: 40px;
    }
    
    .post-meta {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    .sns-share {
        justify-content: flex-start;
    }
    
    .share-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .share-btn span {
        display: none;
    }
    
    .wp-block-columns {
        flex-direction: column;
    }
}