/* ==========================================================================
   Oasis Dry Fruits: single blog post layout (child theme)
   Loaded only on single posts. Visual only: no content, headings, links or
   SEO elements are changed.

   Why: Ecomus adds .content-sidebar to every post and reserves a 74% column
   for the article, but this site shows the sidebar in a pop-out panel
   ("icon" layout). The result was an article pinned left with an empty right
   quarter. The article now uses a centred reading column.
   ========================================================================== */

body.single-post {
	--odf-read-w: 760px;
	--odf-wide-w: 960px;
	--odf-blog-body: 17px;
	--odf-blog-h2: 26px;
	--odf-blog-h3: 21px;
	--odf-blog-h4: 18px;
}

/* Full-width content area, centred column inside */
body.single-post .site-content .site-content-container {
	display: block;
}

body.single-post .site-content .content-area,
body.single-post.content-sidebar .content-area,
body.single-post.sidebar-content .content-area {
	flex: none;
	width: 100%;
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

body.single-post .site-content article.post {
	max-width: var(--odf-wide-w);
	margin-left: auto;
	margin-right: auto;
}

/* Header: category, title, meta centred above the article */
body.single-post .entry-header {
	max-width: var(--odf-read-w);
	margin: 0 auto 28px;
	text-align: center;
}

body.single-post .entry-header .entry-category,
body.single-post.content-sidebar .entry-category {
	display: flex;
	justify-content: center;
	margin-bottom: 14px;
}

body.single-post .entry-header .entry-title,
body.single-post.content-sidebar .entry-title,
body.single-post.content-sidebar .entry-meta {
	text-align: center;
}

body.single-post .entry-header .entry-title {
	margin: 0 0 12px;
	font-size: 36px;
	line-height: 1.2;
	letter-spacing: -0.01em;
	overflow-wrap: break-word;
}

body.single-post .entry-header .entry-meta {
	color: var(--odf-muted, #6B625B);
	font-size: 14px;
}

/* Featured image: same width as the wide column, rounded */
/* An older Additional CSS rule caps this box at 150px on phones, which
   chopped the image into a thin strip. The box now fits the image; very tall
   images are trimmed neatly with object-fit instead. */
body.single-post .entry-thumbnail {
	max-width: var(--odf-wide-w);
	max-height: none;
	margin: 0 auto 24px;
	overflow: hidden;
	border-radius: 14px;
}

/* Ecomus draws this box as a fixed-ratio square (.em-ratio) with the photo
   pinned to the top, which left a large empty gap under wide photos. The box
   now takes the photo's own height. */
body.single-post .entry-thumbnail.em-ratio,
body.single-post .entry-thumbnail {
	display: block;
	height: auto;
}

body.single-post .entry-thumbnail.em-ratio::before {
	display: none;
	padding-bottom: 0;
}

body.single-post .entry-thumbnail img,
body.single-post .entry-thumbnail.em-ratio img {
	position: static;
	display: block;
	width: 100%;
	height: auto;
	max-height: 540px;
	object-fit: cover;
	border-radius: 14px;
}

/* --------------------------------------------------------------------------
   Article body: comfortable reading column
   -------------------------------------------------------------------------- */
body.single-post .entry-content {
	max-width: var(--odf-read-w);
	margin-left: auto;
	margin-right: auto;
	font-size: var(--odf-blog-body);
	line-height: 1.75;
	color: var(--odf-text, #29231F);
	overflow-wrap: break-word;
}

body.single-post .entry-content > * {
	max-width: 100%;
}

body.single-post .entry-content p {
	margin: 0 0 1.1em;
}

/* Headings: tags untouched. !important only to outrank the older
   "Blog Page - Heading Size Fix" rules in Additional CSS, which use it. */
body.single-post .entry-content h2 {
	margin: 1.8em 0 .55em !important;
	font-size: var(--odf-blog-h2) !important;
	font-weight: 700 !important;
	line-height: 1.3;
	color: var(--odf-brown, #3C2315);
}

body.single-post .entry-content h3 {
	margin: 1.5em 0 .5em !important;
	font-size: var(--odf-blog-h3) !important;
	font-weight: 700 !important;
	line-height: 1.35;
	color: var(--odf-brown, #3C2315);
}

body.single-post .entry-content :is(h4, h5, h6) {
	margin: 1.3em 0 .4em !important;
	font-size: var(--odf-blog-h4) !important;
	font-weight: 600 !important;
	line-height: 1.4;
	color: var(--odf-text, #29231F);
}

body.single-post .entry-content > :first-child {
	margin-top: 0 !important;
}

/* Lists */
body.single-post .entry-content :is(ul, ol) {
	margin: 0 0 1.2em;
	padding-left: 1.4em;
}

body.single-post .entry-content li {
	margin: 0 0 .45em;
}

body.single-post .entry-content li::marker {
	color: var(--odf-brown, #3C2315);
}

/* Links inside the article */
body.single-post .entry-content a:not(.wp-block-button__link):not(.em-button) {
	color: var(--odf-green-dk, #2F7D36);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Images and figures: never wider than the column */
body.single-post .entry-content :is(img, video, iframe, embed, object) {
	max-width: 100%;
	height: auto;
}

body.single-post .entry-content img {
	border-radius: 12px;
}

body.single-post .entry-content figure {
	max-width: 100%;
	margin: 1.6em auto;
}

body.single-post .entry-content figcaption {
	margin-top: 8px;
	font-size: 13.5px;
	text-align: center;
	color: var(--odf-muted, #6B625B);
}

/* Wide/full blocks stay inside the page instead of breaking out */
body.single-post .site-content .entry-content > :is(.alignwide, .alignfull) {
	width: auto;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Blockquotes */
body.single-post .entry-content blockquote {
	margin: 1.6em 0;
	padding: 18px 22px;
	border: 0;
	border-left: 3px solid var(--odf-green, #4AB151);
	border-radius: 0 10px 10px 0;
	background: var(--odf-ivory, #F8F5EF);
	box-shadow: none;
	font-size: 1em;
	font-style: normal;
	font-weight: 400;
	color: var(--odf-text, #29231F);
}

body.single-post .entry-content blockquote::before,
body.single-post .entry-content blockquote::after {
	display: none;
}

/* Tables: tidy borders, ivory header, scroll inside their own box when wide */
body.single-post .entry-content :is(table, .wp-block-table) {
	margin: 1.6em 0;
}

body.single-post .entry-content .wp-block-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

body.single-post .entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.5;
}

body.single-post .entry-content .wp-block-table table {
	margin: 0;
}

body.single-post .entry-content :is(th, td) {
	padding: 10px 12px;
	border: 1px solid var(--odf-border, #E7E1D9);
	text-align: left;
	vertical-align: top;
}

body.single-post .entry-content :is(thead th, thead td, th) {
	background: var(--odf-ivory, #F8F5EF);
	font-weight: 600;
	color: var(--odf-brown, #3C2315);
}

/* Code / preformatted text scrolls instead of widening the page */
body.single-post .entry-content pre {
	max-width: 100%;
	overflow-x: auto;
	white-space: pre;
}

/* Share bar, post navigation, comments line up with the reading column */
body.single-post .entry-footer,
body.single-post .post-navigation,
body.single-post .comments-area {
	max-width: var(--odf-read-w);
	margin-left: auto;
	margin-right: auto;
}

/* Related posts keep a wider grid */
body.single-post .ecomus-posts-related {
	max-width: 1140px;
	margin-left: auto;
	margin-right: auto;
}

/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	body.single-post {
		--odf-read-w: 720px;
		--odf-blog-h2: 24px;
		--odf-blog-h3: 20px;
	}

	body.single-post .entry-header .entry-title {
		font-size: 30px;
	}
}

/* --------------------------------------------------------------------------
   Phones
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
	body.single-post {
		--odf-blog-body: 16px;
		--odf-blog-h2: 21px;
		--odf-blog-h3: 18px;
		--odf-blog-h4: 16.5px;
	}

	body.single-post .entry-header {
		margin-bottom: 20px;
	}

	body.single-post .entry-thumbnail {
		margin-bottom: 20px;
		border-radius: 12px;
	}

	body.single-post .entry-thumbnail img,
	body.single-post .entry-thumbnail.em-ratio img {
		max-height: 280px;
		border-radius: 12px;
	}

	body.single-post .entry-header .entry-title {
		font-size: 24px;
		line-height: 1.25;
	}

	body.single-post .entry-content {
		line-height: 1.7;
	}

	body.single-post .entry-content table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		font-size: 14px;
	}

	body.single-post .entry-content .wp-block-table table {
		display: table;
		min-width: 520px;
	}

	body.single-post .entry-content :is(th, td) {
		padding: 8px 10px;
	}

	body.single-post .entry-footer .entry-tags,
	body.single-post .entry-footer .entry-meta__share {
		width: 100%;
	}
}
