/*
 * Blog listing and post styles
 */

/* Blog listing items (blog/index.php) */
.blog-post {
	display: flex;
	flex-direction: column-reverse;
	margin-block-end: 1rem;
}

@media (min-width: 576px) {
	.blog-post {
		flex-direction: row;
		gap: 1rem;
		margin-block-end: 1.5rem;
	}
}

.blog-post-text {
	flex: 1;
}

.blog-post-text h3 {
	margin-block-end: 0;
}

.blog-post-image {
	margin-block-end: 0.5rem;
}

@media (min-width: 576px) {
	.blog-post-image {
		width: 25%;
		flex-shrink: 0;
		margin-block-end: 0;
		padding: 0;
	}
}

.blog-post-image img {
	width: 100%;
	height: auto;
	border-radius: 0.25rem;
}

/* Blog header image (outside .wrapper, full-bleed on mobile) */
.blog-header-image {
	padding-block-start: 52px;
}

.blog-header-image img {
	width: 100%;
	height: auto;
}

@media (min-width: 576px) {
	.blog-header-image {
		padding-block-start: 5rem;
		max-width: 50%;
		margin-inline: auto;
	}

	.blog-header-image img {
		border-radius: 0.25rem;
	}
}

/* Blog listing header image */
section#blog-listing .img-centered img {
	width: 100%;
	border-radius: 0.25rem;
}

/* Prevent horizontal scroll on blog post pages
   Using clip instead of hidden to avoid creating a scroll container,
   which would break CSS scroll-target-group / :target-current */
.article.flow {
	overflow-x: clip;
}

/* Blog post content (post_template) */
#blog-content {
	margin-block: 1.5rem;
	overflow-wrap: break-word;
	min-width: 0;
}

#blog-content img {
	max-width: 100%;
	height: auto;
	border-radius: 0.25rem;
}

/* Centered image in blog content (50% on desktop, full on mobile) */
#blog-content .img-centered {
	margin-block-end: 0.5rem;
}

#blog-content .img-centered img {
	width: 100%;
	height: auto;
}

@media (min-width: 576px) {
	#blog-content .img-centered {
		width: 50%;
		margin-inline: auto;
	}
}

/* Float-start image in blog content */
.blog-img-float-start {
	margin-block-end: 0.5rem;
}

@media (min-width: 576px) {
	.blog-img-float-start {
		float: left;
		width: 42%;
		margin-inline-end: 1rem;
		margin-block-end: 0.5rem;
	}
}

.blog-img-float-start img {
	width: 100%;
	height: auto;
}

/* Float-end image in blog content */
.blog-img-float-end {
	margin-block-end: 0.5rem;
}

@media (min-width: 576px) {
	.blog-img-float-end {
		float: right;
		width: 50%;
		margin-inline-start: 1rem;
		margin-block-end: 0.5rem;
	}
}

.blog-img-float-end img {
	width: 100%;
	height: auto;
}

/* Float-end figure in blog content */
.blog-figure-float-end {
	margin-block-end: 0.75rem;
}

@media (min-width: 576px) {
	.blog-figure-float-end {
		float: right;
		width: 50%;
		margin-inline-start: 1rem;
		margin-block-end: 0.75rem;
	}
}

@media (min-width: 768px) {
	.blog-figure-float-end {
		width: 42%;
	}
}

@media (min-width: 992px) {
	.blog-figure-float-end {
		width: 33%;
	}
}

.blog-figure-float-end img {
	width: 100%;
	height: auto;
}

.blog-figure-float-end figcaption {
	font-size: 0.875rem;
	color: #6c757d;
	margin-block-start: 0.25rem;
}

/* Table styles */
#blog-content .table-responsive {
	overflow-x: auto;
}

#blog-content table {
	width: 100%;
	border-collapse: collapse;
	margin-block-end: 1rem;
}

#blog-content th,
#blog-content td {
	padding: 0.5rem;
	border-bottom: 1px solid #dee2e6;
	vertical-align: top;
}

#blog-content thead th {
	border-bottom-width: 2px;
	font-weight: 700;
}

#blog-content tbody tr:nth-child(odd) {
	background-color: rgba(0, 0, 0, 0.03);
}

/* Utility: font-weight (used in blog meta) */
.fw-light { font-weight: 300; }
.fw-bold  { font-weight: 700; }
