/*
 * O2O Soft Framework content styles.
 * Structural safety only: authored typography, sizes and plugin markup are not
 * redesigned here.
 */

.o2o-entry-content {
	min-width: 0;
	line-height: var(--o2o-content-line-height, 1.75);
	overflow-wrap: break-word;
}

.o2o-entry-content::after {
	content: "";
	display: table;
	clear: both;
}

/* Match the user's existing workflow: no automatic paragraph spacing. */
.o2o-zero-content-paragraph-margin .o2o-entry-content > p,
.o2o-zero-content-paragraph-margin .entry-content > p,
.o2o-zero-content-paragraph-margin .post-content > p {
	margin: 0 !important;
	margin-block: 0 !important;
	padding: 0;
}

/* Do not let first/last element browser margins create container whitespace. */
.o2o-entry-content > :first-child {
	margin-top: 0;
	margin-block-start: 0;
}

.o2o-entry-content > :last-child {
	margin-bottom: 0;
	margin-block-end: 0;
}

/* Korean text wrapping preference used in the existing snippets. */
.o2o-korean-word-break .o2o-entry-content {
	word-break: keep-all;
	overflow-wrap: break-word;
}

/* Media safety: never enlarge. Keep authored width and aspect ratio. */
.o2o-preserve-content-image-size .o2o-entry-content img,
.o2o-preserve-content-image-size .o2o-entry-content video {
	max-width: 100% !important;
	height: auto !important;
	box-sizing: border-box;
}

.o2o-entry-content > :where(figure, .wp-caption),
.o2o-entry-content > p > :where(figure, .wp-caption) {
	max-width: 100%;
}

.o2o-entry-content :where(.wp-caption-text, figcaption) {
	font-size: 0.875em;
	line-height: 1.5;
}

/* WordPress alignment classes. */
.o2o-entry-content :where(.aligncenter) {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.o2o-entry-content :where(.alignleft) {
	float: left;
	margin-right: 1.5em;
}

.o2o-entry-content :where(.alignright) {
	float: right;
	margin-left: 1.5em;
}

.o2o-entry-content > :where(.alignwide) {
	width: min(var(--o2o-site-width), calc(100vw - (var(--o2o-gutter) * 2)));
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.o2o-entry-content > :where(.alignfull) {
	width: 100vw;
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

/* Large content must stay inside the viewport. */
.o2o-entry-content > .wp-block-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.o2o-entry-content > .wp-block-table table,
.o2o-entry-content > table {
	max-width: 100%;
	border-collapse: collapse;
}

.o2o-entry-content > pre {
	max-width: 100%;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.o2o-entry-content > :where(pre, code, kbd, samp) {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.o2o-entry-content > :where(iframe, embed, object),
.o2o-entry-content > p > :where(iframe, embed, object),
.o2o-entry-content > .wp-block-embed {
	max-width: 100%;
}

@media (max-width: 767px) {
	.o2o-entry-content :where(.alignleft, .alignright) {
		float: none;
		margin-left: 0;
		margin-right: 0;
	}
}
