/**
 * Article Content CSS
 * 記事コンテンツ用の共通スタイル
 * columnや他の記事投稿タイプで使用
 *
 * 注意: .article-styled クラスは新規入稿ページにのみ付与される
 * 移行済みHTML（device_content_*メタあり）には適用されない
 *
 * スコープ: コンテンツエリア（#ContentsBody, #CommonBox）内のみ適用
 * サイドバー等には影響しないよう限定
 */

/* ==========================================================================
   コンテンツエリアの定義
   ========================================================================== */

/* コンテンツブロックのセレクタを変数的に使用 */
/* #ContentsBody, #CommonBox 内のみに適用 */

.article-styled #ContentsBody,
.article-styled #CommonBox,
.article-styled .entry-content {
    line-height: 1.8;
    color: #333;
}

/* ==========================================================================
   見出し（h1-h5）- コンテンツエリア内のみ
   ========================================================================== */

/* WordPressブロック見出し */
.article-styled .wp-block-heading {
    font-weight: bold;
}

.article-styled h1.wp-block-heading,
.article-styled #ContentsBody h1,
.article-styled #CommonBox h1 {
    font-size: 1.8em;
    font-weight: bold;
    margin: 1.5em 0 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 3px solid #003366;
    color: #003366;
}

.article-styled h2.wp-block-heading,
.article-styled #ContentsBody h2,
.article-styled #CommonBox h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 1.5em 0 0.8em;
    padding: 0.5em 0.8em;
    background: #003366;
    color: #fff;
    border-radius: 4px;
}

.article-styled h3.wp-block-heading,
.article-styled #ContentsBody h3,
.article-styled #CommonBox h3 {
    font-size: 1.3em;
    font-weight: bold;
    margin: 1.3em 0 0.6em;
    padding: 0.4em 0;
    padding-left: 0.8em;
    border-left: 4px solid #003366;
    color: #003366;
}

.article-styled h4.wp-block-heading,
.article-styled #ContentsBody h4,
.article-styled #CommonBox h4 {
    font-size: 1.15em;
    font-weight: bold;
    margin: 1.2em 0 0.5em;
    color: #333;
}

.article-styled h5.wp-block-heading,
.article-styled #ContentsBody h5,
.article-styled #CommonBox h5 {
    font-size: 1em;
    font-weight: bold;
    margin: 1em 0 0.4em;
    color: #555;
}

/* ==========================================================================
   段落（p）- コンテンツエリア内のみ
   ========================================================================== */

.article-styled p.wp-block-paragraph,
.article-styled #ContentsBody p,
.article-styled #CommonBox p {
    margin: 1em 0;
    line-height: 1.8;
}

/* ==========================================================================
   リスト（ul, ol）- コンテンツエリア内のみ
   既存CSSのlist-style:noneを上書きするため !important を使用
   ========================================================================== */

/* WordPressブロックエディタで作成されたリスト */
.article-styled ul.wp-block-list,
.article-styled #ContentsBody ul,
.article-styled #CommonBox ul {
    margin: 1em 0 !important;
    padding-left: 1.5em !important;
    list-style-type: disc !important;
    list-style-position: outside !important;
}

.article-styled ol.wp-block-list,
.article-styled #ContentsBody ol,
.article-styled #CommonBox ol {
    margin: 1em 0 !important;
    padding-left: 1.5em !important;
    list-style-type: decimal !important;
    list-style-position: outside !important;
}

.article-styled .wp-block-list li,
.article-styled #ContentsBody li,
.article-styled #CommonBox li {
    margin: 0.5em 0 !important;
    padding-left: 0.3em;
    line-height: 1.6;
    list-style: inherit !important;
    display: list-item !important;
}

/* ネストしたリスト */
.article-styled .wp-block-list ul,
.article-styled .wp-block-list ol,
.article-styled #ContentsBody ul ul,
.article-styled #ContentsBody ol ol,
.article-styled #CommonBox ul ul,
.article-styled #CommonBox ol ol {
    margin: 0.3em 0 !important;
    padding-left: 1.5em !important;
}

.article-styled .wp-block-list ul,
.article-styled #ContentsBody ul ul,
.article-styled #CommonBox ul ul {
    list-style-type: circle !important;
}

.article-styled .wp-block-list ul ul,
.article-styled #ContentsBody ul ul ul,
.article-styled #CommonBox ul ul ul {
    list-style-type: square !important;
}

/* ==========================================================================
   テーブル（table）- コンテンツエリア内のみ
   ========================================================================== */

.article-styled .wp-block-table,
.article-styled #ContentsBody table,
.article-styled #CommonBox table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.article-styled .wp-block-table th,
.article-styled #ContentsBody th,
.article-styled #CommonBox th {
    padding: 0.8em 1em;
    background: #003366;
    color: #fff;
    font-weight: bold;
    text-align: left;
    border: 1px solid #003366;
}

.article-styled .wp-block-table td,
.article-styled #ContentsBody td,
.article-styled #CommonBox td {
    padding: 0.8em 1em;
    border: 1px solid #ddd;
    vertical-align: top;
}

.article-styled .wp-block-table tr:nth-child(even),
.article-styled #ContentsBody tr:nth-child(even),
.article-styled #CommonBox tr:nth-child(even) {
    background: #f9f9f9;
}

.article-styled .wp-block-table tr:hover,
.article-styled #ContentsBody tr:hover,
.article-styled #CommonBox tr:hover {
    background: #f0f5ff;
}

/* ==========================================================================
   引用（blockquote）- コンテンツエリア内のみ
   ========================================================================== */

.article-styled .wp-block-quote,
.article-styled #ContentsBody blockquote,
.article-styled #CommonBox blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: #f5f5f5;
    border-left: 4px solid #003366;
    font-style: italic;
    color: #555;
}

.article-styled .wp-block-quote p,
.article-styled #ContentsBody blockquote p,
.article-styled #CommonBox blockquote p {
    margin: 0.5em 0;
}

/* ==========================================================================
   水平線（hr）- コンテンツエリア内のみ
   ========================================================================== */

.article-styled .wp-block-separator,
.article-styled #ContentsBody hr,
.article-styled #CommonBox hr {
    margin: 2em 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* ==========================================================================
   リンク（a）- コンテンツエリア内のみ
   ========================================================================== */

.article-styled #ContentsBody a,
.article-styled #CommonBox a {
    color: #0066cc;
    text-decoration: underline;
}

.article-styled #ContentsBody a:hover,
.article-styled #CommonBox a:hover {
    color: #003366;
    text-decoration: none;
}

/* ==========================================================================
   インラインスタイル - コンテンツエリア内のみ
   ========================================================================== */

.article-styled #ContentsBody strong,
.article-styled #CommonBox strong {
    font-weight: bold;
    color: #c00;
}

.article-styled #ContentsBody em,
.article-styled #CommonBox em {
    font-style: italic;
}

.article-styled .wp-block-code,
.article-styled #ContentsBody code,
.article-styled #CommonBox code {
    padding: 0.2em 0.4em;
    background: #f0f0f0;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.article-styled #ContentsBody small,
.article-styled #CommonBox small {
    font-size: 0.85em;
    color: #666;
}

/* ==========================================================================
   画像 - コンテンツエリア内のみ
   ========================================================================== */

.article-styled .wp-block-image,
.article-styled #ContentsBody img,
.article-styled #CommonBox img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
}

/* ==========================================================================
   SP版（レスポンシブ）
   ========================================================================== */

@media screen and (max-width: 768px) {
    .article-styled h1.wp-block-heading,
    .article-styled #ContentsBody h1,
    .article-styled #CommonBox h1 {
        font-size: 1.5em;
    }

    .article-styled h2.wp-block-heading,
    .article-styled #ContentsBody h2,
    .article-styled #CommonBox h2 {
        font-size: 1.3em;
    }

    .article-styled h3.wp-block-heading,
    .article-styled #ContentsBody h3,
    .article-styled #CommonBox h3 {
        font-size: 1.15em;
    }

    .article-styled .wp-block-table,
    .article-styled #ContentsBody table,
    .article-styled #CommonBox table {
        font-size: 0.9em;
    }

    .article-styled .wp-block-table th,
    .article-styled .wp-block-table td,
    .article-styled #ContentsBody th,
    .article-styled #ContentsBody td,
    .article-styled #CommonBox th,
    .article-styled #CommonBox td {
        padding: 0.5em;
    }
}
