/**
 * ヨガキャリア動的コンテンツ表示用CSS
 */

/* Google Fonts - Noto Sans JP & Noto Serif JP */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@300;400;500;700&display=swap');

/* post-content-area を全幅にするためのスタイル */
#post-content-area {
  width: 100%;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: none;
  box-sizing: border-box;
}

.blog-content-area {
    margin: 2rem 0;
    padding: 1rem;
}

.blog-post-content {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.blog-hero-image {
    width: 100%;
    margin-bottom: 1.5rem;
}

.blog-hero-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.publish-date span {
    color: #666;
    font-size: 0.9rem;
}

.blog-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-thumbnail {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.blog-content {
    padding: 2rem;
    line-height: 1.8;
    color: #333;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    margin: 2rem 0 1rem 0;
    color: #2c3e50;
}

.blog-content h1 {
    font-size: 2rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.blog-content h2 {
    background: #d7c7976d;
    font-size: 28px;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin: 35px 0px 35px 0px;
    padding: 15px 20px;
}

.blog-content h3 {
    border-bottom: 1px solid #3f9cd7ff;
    border-left: 5px solid #3f9cd7ff;
    border-right: 0px solid #3f9cd7ff;
    border-top: 0px solid #3f9cd7ff;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 35px 0px 35px 0px;
    padding: 15px 20px;
}

.blog-content p {
    margin: 1rem 0;
    text-align: justify;
}

.blog-content ul,
.blog-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.blog-content li {
    margin: 0.5rem 0;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.blog-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    font-style: italic;
}

.blog-content code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.blog-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

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

.error-message {
    margin: 2rem 0;
    padding: 2rem;
    text-align: center;
}

.error-message h3 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-message p {
    margin: 0.5rem 0;
}

.error-message a {
    color: #3498db;
    text-decoration: none;
}

.error-message a:hover {
    text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #post-content-area {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .blog-content-area {
        margin: 1rem 0;
        padding: 0.5rem;
    }
    
    .blog-post-content {
        margin: 0 0.5rem;
    }
    
    .blog-meta {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .blog-content {
        padding: 1rem;
    }
    
    .blog-content h1 {
        font-size: 1.6rem;
    }
    
    .blog-content h2 {
        font-size: 1.4rem;
    }
}

/* アニメーション */
.blog-content-area.appear {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ローディング状態 */
.blog-content-loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.blog-content-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Article コンテンツ専用スタイル */
[data-article-content="true"] {
    width: 100%;
    max-width: 100%;
    min-width: 0; /* フレックスボックス内での縮小を許可 */
    overflow: hidden; /* 両方向のオーバーフローを防止 */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto; /* 自動ハイフネーション */
    box-sizing: border-box;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
}

/* Article内の画像レスポンシブ対応 */
[data-article-content="true"] img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

/* Article内のテーブルレスポンシブ対応 */
[data-article-content="true"] .table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
}

[data-article-content="true"] table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

/* Article内のiframeレスポンシブ対応 */
[data-article-content="true"] .iframe-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 1rem 0;
}

[data-article-content="true"] .iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Article内のh2スタイル（既存のblog-contentスタイルを継承） */
[data-article-content="true"] h2 {
    background: #d7c7976d;
    font-size: 28px;
    font-family: 'Noto Serif JP', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin: 35px 0px 35px 0px;
    padding: 15px 20px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Article内のh3スタイル（既存のblog-contentスタイルを継承） */
[data-article-content="true"] h3 {
    border-bottom: 1px solid #3f9cd7ff;
    border-left: 5px solid #3f9cd7ff;
    border-right: 0px solid #3f9cd7ff;
    border-top: 0px solid #3f9cd7ff;
    font-family: 'Noto Serif JP', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 35px 0px 35px 0px;
    padding: 15px 20px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Article内のテキスト要素の改行対応 */
[data-article-content="true"] p,
[data-article-content="true"] div,
[data-article-content="true"] span,
[data-article-content="true"] td,
[data-article-content="true"] th {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

[data-article-content="true"] strong {
    font-family: inherit;
}

/* Article内の全要素のオーバーフロー防止 */
[data-article-content="true"] * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Article内の長いURLやコードブロックの対応 */
[data-article-content="true"] pre,
[data-article-content="true"] code {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Article内のリストの調整 */
[data-article-content="true"] ul,
[data-article-content="true"] ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

/* Article内のブロック要素の調整 */
[data-article-content="true"] blockquote {
    margin: 1rem 0;
    padding: 1rem;
    border-left: 4px solid #ddd;
    background: #f9f9f9;
    overflow-wrap: break-word;
}