/*--------------------------------------------------------------
# Single-Post Article Content
--------------------------------------------------------------*/
.post-article__content
{
	/* Headings */
	h2, h3, h4, h5, h6 {
		padding-bottom: 12px;
	}
	h2, h3 {
    	margin-block-start: calc(var(--space-l, var(--flow-spacing, initial)) * 1);
	}
	h4, h5, h6 {
		margin-block-start: calc(var(--space-m, var(--flow-spacing, initial)) * 0.9);
	}
	h2 {
		font-size: calc(var(--h2) * 0.86);
	}
	h3 {
		font-size: calc(var(--h3) * 0.9);
	}
	h4 {
		font-size: calc(var(--h4) * 0.96);
	}
	h5 {
		font-size: calc(var(--h5) * 0.96);
	}
	h6 {
		font-size: calc(var(--h6) * 0.96);
	}

	/* General */
	p {
		margin: 1rem 0;
		line-height: 1.5;
	}
	cite {
    	font-style: italic;
	}
	sup {
		font-size: 0.7em;
		line-height: 0;
		position: relative;
		vertical-align: baseline;
		top: -0.5em;
	}

	/* List */
	ul, ol {
		padding: 0;
	}
	ul li, ol li {
		margin: 0 0 12px 24px;
	}

	/* Blockquote */
  	blockquote, q, cite {
		quotes: none;
		font-size: calc(var(--text-m) * 0.92);
	}
	blockquote {
		display: block;
		background-color: #F4F5F7;
		border: 1px dashed #CCC;
		padding: 8px 10px;
		margin: 16px 20px;
	}
	q {
    	display: inline;
	}
	q:before {
    	content: open-quote;
	}
	q:after {
    	content: close-quote;
	}

	/* Image */
	img {
		object-fit: cover;
		object-position: center;
	}
	.img-border img {
		border: 1px solid var(--accent-light);
		border-radius: 4px;
		padding: 2px;
		box-shadow: 0 2px 6px rgba(0,0,0,0.2);
		transition: all 0.3s ease;
	}
	.img-border img:hover {
		transform: scale(1.02);
		box-shadow: 0 5px 12px rgba(0,0,0,0.3);
	}
	.img-comparison {
		display: flex;
		justify-content: center;
		gap: 10px;
		flex-wrap: wrap;
		margin: 12px 0;
	}
	.img-comparison img {
		max-height: 320px;
		max-width: 320px;
		object-fit: contain;
		padding: 4px;
		box-sizing: border-box;
		box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	}

    /* Table Style */
    table {
        border: 1px solid var(--accent);
        border-collapse: collapse;
        th {
            border: 1px solid var(--accent);
            font-weight: bold;
            padding: 4px 10px;
            text-align: center;
        }
        thead th {
            background-color: #d2e8ff;
        }
        thead tbody {
            background-color: #F5F1F5;
        }
        td {
            height: 50px;
            border: 1px solid var(--accent);
            text-align: left;
            padding: 4px;
        }
    }

    /* Code */
    pre code {
        font-size: 1.5rem;
    }
}

.post-article__content .wp-block-footnotes
{
    margin-top: var(--space-xl);
    padding-top: var(--space-l);
    margin-bottom: var(--space-xl);
    border-top: 2px solid #e5e7eb;
    font-size: calc(var(--text-m) * 0.88);
    line-height: 1.6;
    color: #6b7280;

    li {
        margin-bottom: 0.8rem;
        padding-left: 0.5rem;
    }
    li::marker {
        color: #3b82f6;
        font-weight: 600;
    }
    a {
        color: #3b82f6;
        text-decoration: none;
        border-bottom: 1px dotted #3b82f6;
        transition: all 0.2s ease;
    }
    a:hover {
        color: #1d4ed8;
        border-bottom-color: #1d4ed8;
    }
    a[href^="#"]:last-child {
        font-size: calc(var(--text-m) * 0.88);
        margin-left: 0.5rem;
        padding: 0.2rem 0.4rem;
        background-color: #f3f4f6;
        border-radius: 0.25rem;
        border: none;
    }
    a[href^="#"]:last-child:hover {
        background-color: #e5e7eb;
    }
}

@media (max-width: 768px) {
    .post-article__content .img-comparison img {
 		max-height: 260px;
		max-width: 260px;
    }
}

@media (max-width: 480px) {
    .post-article__content .img-comparison {
        flex-direction: column;
    }

    .post-article__content .img-comparison img {
        max-height: 240px;
		max-width: 240px;
    }
}

@media (max-width: 768px) {
    article.single-post .wp-block-footnotes {
        margin-top: 2rem;
        padding: 1.5rem 1rem;
 		font-size: calc(var(--text-m) * 0.7);
    }

    article.single-post .wp-block-footnotes::before {
        font-size: calc(var(--text-m) * 0.8);
        margin-bottom: 1rem;
    }

    article.single-post .wp-block-footnotes li {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
}

/* Custom Link */
.single-post__ref-posts .historical-today a,
.single-post__ref-posts .related-post-list a
{
    color: var(--link-primary);
    transition: color 0.2s ease;
}

.single-post__ref-posts .historical-today a,
.single-post__ref-posts .related-post-list a
{
    color: var(--link-hover);
}

.single-post__ref-posts .historical-today a,
.single-post__ref-posts .related-post-list a
{
    color: var(--link-visited);
}

.single-post__ref-posts .historical-today a,
.single-post__ref-posts .related-post-list a
{
    color: var(--link-active);
}

/* ext reference */
.wp-block-group.ext-reference {
    display: flex;
    background: var(--accent-ultra-light);
    margin-top: var(--space-xl);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ext-reference ul {
    padding: 0 !important;
}

.ext-reference ul li {
    font-size: calc(var(--text-m) * 0.9);
}

.ext-reference h3 {
    margin-top: 0;
    font-size: calc(var(--h3) * 0.96);
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.ext-reference h3:before {
    content: "※";
    left: 0;
    color: var(--accent-dark);
    letter-spacing: 0.4em;
}

/* Gutenberg Override */
.wp-block-image,
.wp-block-video,
figcaption,
figure {
    margin: 8px 0;
    width: 100%;
}
