/**
 * WordPress Legacy Styles
 * Handles WordPress post content formatting, image alignment, floats, and legacy markup
 *
 * @package LocalMerchant
 */

/* WordPress Content Alignment */
.alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.alignnone {
	float: none;
	margin: 0;
}

/* WordPress Image Alignment */
img.alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
}

img.alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
}

img.aligncenter {
	display: block;
	margin: 0 auto 1rem;
}

img.alignnone {
	float: none;
	margin: 0 0 1rem;
	display: block;
}

/* WordPress Captions */
.wp-caption {
	max-width: 100%;
	margin-bottom: 1rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: .5rem;
	padding: .5rem;
}

.wp-caption img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0;
}

.wp-caption-text {
	margin: .5rem 0 0;
	padding: .5rem 0 0;
	font-size: .875rem;
	color: var(--color-text);
	text-align: center;
	border-top: 1px solid var(--color-border);
}

.wp-caption.alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
}

.wp-caption.alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
}

.wp-caption.aligncenter {
	display: block;
	margin: 0 auto 1rem;
}

.wp-caption.alignnone {
	float: none;
	margin: 0 0 1rem;
}

/* WordPress Galleries */
.wp-block-gallery,
.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin: 1rem 0;
	list-style: none;
	padding: 0;
}

.gallery-item {
	margin: 0;
}

.gallery-item img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: .5rem;
}

.gallery-caption {
	margin-top: .5rem;
	font-size: .875rem;
	color: var(--color-text);
	text-align: center;
}

/* WordPress Blockquote */
blockquote {
	margin: 1.5rem 0;
	padding: 1rem 1.5rem;
	border-left: 4px solid var(--color-primary);
	background: rgba(27,102,214,0.05);
	font-style: italic;
}

blockquote p {
	margin-bottom: 0.5rem;
}

blockquote p:last-child {
	margin-bottom: 0;
}

blockquote cite {
	display: block;
	margin-top: 0.75rem;
	font-size: 0.875rem;
	font-style: normal;
	color: var(--color-text);
}

blockquote cite::before {
	content: '— ';
}

/* WordPress Post Content */
.entry-content img {
	max-width: 100%;
	height: auto;
}

.entry-content p {
	margin-bottom: 1rem;
}

.entry-content ul,
.entry-content ol {
	margin: 0 0 1rem 1.5rem;
	padding: 0;
}

.entry-content ul {
	list-style-type: disc;
}

.entry-content ol {
	list-style-type: decimal;
}

.entry-content li {
	margin-bottom: 0.5rem;
}

.entry-content li ul,
.entry-content li ol {
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
	margin-top: 2rem;
	margin-bottom: 1rem;
}

.entry-content h1:first-child,
.entry-content h2:first-child,
.entry-content h3:first-child,
.entry-content h4:first-child,
.entry-content h5:first-child,
.entry-content h6:first-child {
	margin-top: 0;
}

.entry-content table {
	width: 100%;
	margin: 1rem 0;
	border-collapse: collapse;
	border: 1px solid var(--color-border);
}

.entry-content table th,
.entry-content table td {
	padding: 0.75rem;
	border: 1px solid var(--color-border);
	text-align: left;
}

.entry-content table th {
	background: var(--color-bg);
	font-weight: 600;
}

.entry-content pre {
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: .5rem;
	padding: 1rem;
	overflow-x: auto;
	margin: 1rem 0;
	font-family: monospace;
	font-size: 0.875rem;
	line-height: 1.6;
}

.entry-content code {
	background: var(--color-bg);
	padding: 0.125rem 0.375rem;
	border-radius: .25rem;
	font-family: monospace;
	font-size: 0.875rem;
}

.entry-content pre code {
	background: transparent;
	padding: 0;
}

/* WordPress Widgets */
.widget {
	margin-bottom: 2rem;
}

.widget-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 1rem;
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.widget ul li {
	margin-bottom: 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--color-border);
}

.widget ul li:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

/* WordPress Comments */
.comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment {
	margin-bottom: 2rem;
	padding: 1rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: .5rem;
}

.comment-meta {
	margin-bottom: 0.75rem;
	font-size: 0.875rem;
	color: var(--color-text);
}

.comment-author {
	font-weight: 600;
	color: var(--color-heading);
}

.comment-content {
	margin-top: 0.75rem;
}

/* WordPress Screen Reader Text */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.screen-reader-text:focus {
	clip: auto !important;
	background-color: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: .25rem;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	color: var(--color-text);
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 0.75rem 1rem;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* Clear Floats */
.clearfix::after,
.clear::after,
.entry-content::after {
	content: '';
	display: table;
	clear: both;
}

/* WordPress Embeds */
.wp-embed-responsive {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	height: 0;
	max-width: 100%;
}

.wp-embed-responsive iframe,
.wp-embed-responsive object,
.wp-embed-responsive embed {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* WordPress Blocks Support */
.wp-block-image {
	margin: 1.5rem 0;
}

.wp-block-image img {
	width: 100%;
	height: auto;
}

.wp-block-image.alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
}

.wp-block-image.alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
}

.wp-block-image.aligncenter {
	display: block;
	margin: 0 auto 1rem;
}

.wp-block-quote {
	margin: 1.5rem 0;
	padding: 1rem 1.5rem;
	border-left: 4px solid var(--color-primary);
	background: rgba(27,102,214,0.05);
}

.wp-block-separator {
	margin: 2rem 0;
	border: none;
	border-top: 2px solid var(--color-border);
}

/* Responsive Image Alignment */
@media (max-width: 640px) {
	.alignleft,
	.alignright,
	img.alignleft,
	img.alignright,
	.wp-caption.alignleft,
	.wp-caption.alignright,
	.wp-block-image.alignleft,
	.wp-block-image.alignright {
		float: none;
		display: block;
		margin: 0 auto 1rem;
	}
}

