/*
 * Single blog post — reading layout (every post, never the shop).
 *
 * Enqueued by inc/blog-scripts.php on is_singular('post') only (?ver = file mtime) and
 * kept out of WP Rocket RUCSS there. It is a file, not an inline <style>, because RUCSS
 * empties inline blocks. Every rule starts with body.single-post.
 *
 * Palette = the category guides' (.tcf in inc/hub-guide-base-css.php): purple
 * #2e0c64, blue #1e73be, ink #111, text #333, muted #5f6368 (6:1 on white, AA),
 * line #dcdfe3, tint #f2f4f7.
 *
 * Content written for posts:
 *   .adp-fig      full-width photo + caption
 *   .adp-picks    two products side by side (image, name, one-line caption)
 *   .adp-cta      <p class="adp-cta"><a>…</a></p>: button to a shop list (as the guides' .tcf-btn)
 *   .adp-toc      «Σε αυτόν τον οδηγό» box
 *   .adp-note     tip / warning box
 *   .adp-check    checklist
 *   .adp-table    plain data table (bootstrap .table tables in older posts are left alone)
 */

body.single-post {
	--bp-measure: 44rem; /* 704px: ~67 Greek characters per line at 17px Manrope */
	--bp-pu: #2e0c64;
	--bp-bl: #1e73be;
	--bp-ink: #111;
	--bp-txt: #333;
	--bp-mut: #5f6368;
	--bp-line: #dcdfe3;
	--bp-tint: #f2f4f7;
}

/* 1. One centred reading column.
   .container stays 1400px (blog-scripts.php) so header and footer line up with the rest
   of the site; only the article narrows. The breadcrumb follows the column, so it sits
   above the title instead of hundreds of pixels to its left on a wide screen. */
body.single-post .site-single .post-each-single,
body.single-post .site-single .comments-wrapper,
body.single-post .banner .banner-content {
	max-width: var(--bp-measure);
	margin-left: auto;
	margin-right: auto;
}

/* 16px side gutters on phones (bootstrap gives 15). */
@media (max-width: 767px) {
	body.single-post .banner > .container,
	body.single-post #primary.site-single > .container {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* Bootstrap wrappers some posts put inside their content (.container .row .col-lg-8):
   no second gutter inside the column, and a centred narrow column fills it — 8/12 of a
   704px column would squeeze the power-bank calculator to 470px. */
body.single-post .post-content .container {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}
body.single-post .post-content .container > .row {
	margin-left: 0;
	margin-right: 0;
}
body.single-post .post-content .row.justify-content-center > [class*="col-lg-"] {
	flex: 0 0 100%;
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}
body.single-post .post-content > .container.my-5:first-of-type {
	margin-top: 0 !important; /* .my-5 is !important in bootstrap */
}

/* 2. Title and meta. */
body.single-post h1.adp-post-title,
body.single-post .post-content h1 {
	font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--bp-pu);
	font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.375rem);
	font-weight: 800;
	line-height: 1.18;
	letter-spacing: -0.015em;
	margin: 0.15em 0 0.45em;
}
body.single-post .post-meta {
	margin-bottom: 1.5rem;
}
/* Theme greys here are 2.5–4:1, below AA at 13–14px; the guides' muted grey is 6:1. */
body.single-post .post-meta li,
body.single-post .post-meta li span,
body.single-post .post-meta li a,
body.single-post .banner .main-breadcrumb a,
body.single-post .banner .main-breadcrumb span,
body.single-post .single-post-pagination .rtin-item .rtin-content .rtin-date,
body.single-post .single-post-pagination .rtin-item .rtin-content a.rtin-link {
	color: var(--bp-mut);
}
body.single-post .post-meta li a:hover,
body.single-post .banner .main-breadcrumb a:hover,
body.single-post .single-post-pagination .rtin-item .rtin-content a.rtin-link:hover {
	color: var(--bp-pu);
}
body.single-post .post-meta .adp-meta-sep {
	padding: 0 4px; /* category separator, content-single.php */
}
/* Touch: 44px targets for the small links around the article. */
@media (pointer: coarse) {
	body.single-post .post-meta li a,
	body.single-post .banner .main-breadcrumb a,
	body.single-post .single-post-pagination .rtin-item .rtin-content a.rtin-link {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 44px;
		min-width: 44px;
	}
	/* Meta links: even 9px sides instead of a centred 44px box, so «USB · Τεχνολογία»
	   stays symmetric around the dot (a 3–4 letter word still comes out ~44px wide). */
	body.single-post .post-meta li a {
		min-width: 0;
		padding: 0 9px;
	}
	/* Each meta item moves to the next line whole («Blog · Tips» stays together). */
	body.single-post .post-meta li {
		display: inline-flex;
		flex-wrap: wrap;
		align-items: center;
	}
	body.single-post .post-meta .adp-meta-sep {
		padding: 0;
	}
}

/* 3. Body type: 17px / 1.7, guide-style headings. */
body.single-post .post-content {
	font-size: 17px;
	line-height: 1.7;
	color: var(--bp-txt);
	overflow-wrap: break-word;
}
body.single-post .post-content p {
	margin: 0 0 1.1em;
}
body.single-post .post-content h2,
body.single-post .post-content h3,
body.single-post .post-content h4 {
	font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--bp-ink);
	font-weight: 800;
	letter-spacing: -0.01em;
	scroll-margin-top: 16px;
}
body.single-post .post-content h2 {
	font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
	line-height: 1.25;
	margin: 2em 0 0.6em;
}
body.single-post .post-content h3 {
	font-size: 1.1875rem;
	line-height: 1.3;
	margin: 1.6em 0 0.5em;
}
body.single-post .post-content h4 {
	font-size: 1.0625rem;
	line-height: 1.35;
	margin: 1.4em 0 0.4em;
}
body.single-post .post-content strong,
body.single-post .post-content b {
	color: var(--bp-ink);
	font-weight: 700;
}

/* Links in running text are underlined: blue on #333 is only 2.5:1, so colour alone
   does not mark them (WCAG 1.4.1). */
body.single-post .post-content a {
	color: var(--bp-bl);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: rgba(30, 115, 190, 0.45);
}
body.single-post .post-content a:hover,
body.single-post .post-content a:focus-visible {
	text-decoration-color: currentColor;
}

/* Lists. */
body.single-post .post-content ul,
body.single-post .post-content ol {
	padding-left: 1.4em;
	margin: 0 0 1.2em;
}
body.single-post .post-content li {
	margin: 0 0 0.45em;
}
body.single-post .post-content li::marker {
	color: var(--bp-pu);
}

/* 4. Images. Imagify wraps <img> in <picture> and moves the img's class onto it, so
   sizing rules name a container and both shapes (… picture, … img), never `> img`. */
body.single-post .post-content .wp-block-image {
	margin: 1.75em 0;
}
body.single-post .post-content .wp-block-image img {
	max-width: 100%;
	height: auto;
}
body.single-post .post-content figcaption,
body.single-post .post-content .wp-caption-text {
	font-size: 14px;
	line-height: 1.45;
	color: var(--bp-mut);
	margin-top: 0.6em;
	text-align: left;
}

body.single-post .post-content .adp-fig {
	margin: 1.75em 0 2em;
}
body.single-post .post-content .adp-fig picture,
body.single-post .post-content .adp-fig img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

/* Two products side by side, on every width. */
body.single-post .post-content .adp-picks {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 1.5em 0 2em;
	padding: 0;
	list-style: none;
}
body.single-post .post-content .adp-pick {
	margin: 0;
	border: 1px solid var(--bp-line);
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
body.single-post .post-content .adp-pick > a {
	display: block;
	color: var(--bp-ink);
	text-decoration: none;
	padding: 12px 12px 0;
}
body.single-post .post-content .adp-pick picture,
body.single-post .post-content .adp-pick img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
}
body.single-post .post-content .adp-pick__name {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	margin-top: 10px;
	color: var(--bp-ink);
}
body.single-post .post-content .adp-pick > a:hover .adp-pick__name,
body.single-post .post-content .adp-pick > a:focus-visible .adp-pick__name {
	color: var(--bp-bl);
	text-decoration: underline;
}
body.single-post .post-content .adp-pick figcaption {
	font-size: 14px;
	line-height: 1.4;
	margin: 4px 0 0;
	padding: 0 12px 12px;
}

/* Button to a shop list, like the guides' .tcf-btn: full width on phones, inline from 768px. */
body.single-post .post-content .adp-cta {
	margin: 1.5em 0 2em;
}
body.single-post .post-content .adp-cta a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px 20px;
	border-radius: 10px;
	border-bottom: 3px solid #1a0640;
	background: var(--bp-pu);
	color: #fff;
	font-weight: 800;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
}
body.single-post .post-content .adp-cta a:hover,
body.single-post .post-content .adp-cta a:focus-visible {
	background: #1a0640;
	color: #fff;
	text-decoration: none;
}
@media (min-width: 768px) {
	body.single-post .post-content .adp-cta a {
		display: inline-flex;
	}
}

/* 5. Boxes. */
body.single-post .post-content .adp-toc {
	background: var(--bp-tint);
	border-radius: 12px;
	padding: 16px 20px;
	margin: 0 0 2em;
}
body.single-post .post-content .adp-toc__title {
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bp-mut);
	margin: 0 0 6px;
}
body.single-post .post-content .adp-toc ol {
	margin: 0;
	padding-left: 1.4em;
}
body.single-post .post-content .adp-toc li {
	margin: 0;
	padding: 2px 0;
	line-height: 1.5;
}
body.single-post .post-content .adp-toc a {
	text-decoration: none;
}
/* Brand blue is 4.5:1 on white but 4.48:1 on the tint; one shade darker inside boxes. */
body.single-post .post-content .adp-toc a,
body.single-post .post-content .adp-note a,
body.single-post .post-content .adp-check a {
	color: #1b6bb0;
}
body.single-post .post-content .adp-toc a:hover {
	text-decoration: underline;
}
@media (min-width: 768px) {
	body.single-post .post-content .adp-toc ol {
		columns: 2;
		column-gap: 32px;
	}
	body.single-post .post-content .adp-toc li {
		break-inside: avoid;
	}
}
/* Touch: every in-text link list gets 44px rows. */
@media (pointer: coarse) {
	body.single-post .post-content .adp-toc li {
		padding: 0;
	}
	body.single-post .post-content .adp-toc a {
		display: flex;
		align-items: center;
		min-height: 44px;
	}
}

body.single-post .post-content .adp-note {
	background: var(--bp-tint);
	border-left: 4px solid var(--bp-pu);
	border-radius: 0 12px 12px 0;
	padding: 14px 18px;
	margin: 1.5em 0;
	font-size: 16px;
	line-height: 1.6;
}
body.single-post .post-content .adp-note p:last-child {
	margin-bottom: 0;
}

body.single-post .post-content ul.adp-check {
	list-style: none;
	padding: 16px 20px;
	background: var(--bp-tint);
	border-radius: 12px;
	margin: 1em 0 1.5em;
}
body.single-post .post-content ul.adp-check li {
	position: relative;
	padding-left: 32px;
	margin: 0 0 0.55em;
}
body.single-post .post-content ul.adp-check li:last-child {
	margin-bottom: 0;
}
body.single-post .post-content ul.adp-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2em;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--bp-pu);
}
body.single-post .post-content ul.adp-check li::after {
	content: "";
	position: absolute;
	left: 7px;
	top: calc(0.2em + 4px);
	width: 6px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* 6. Tables: scroll inside their own box on a phone, never the page. */
body.single-post .post-content .wp-block-table {
	margin: 1.5em 0 1.75em;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
body.single-post .post-content table.adp-table {
	width: 100%;
	border-collapse: collapse;
	border: 0;
	font-size: 15px;
	line-height: 1.45;
	color: var(--bp-txt);
}
body.single-post .post-content table.adp-table th,
body.single-post .post-content table.adp-table td {
	padding: 10px 12px;
	border: 0; /* the theme draws a box around every cell */
	border-bottom: 1px solid var(--bp-line);
	text-align: left;
	vertical-align: top;
}
body.single-post .post-content table.adp-table td:nth-child(2) {
	white-space: nowrap; /* «A / B, 100–120 V» on one line */
}
body.single-post .post-content table.adp-table thead th {
	background: var(--bp-tint);
	color: var(--bp-ink);
	font-weight: 800;
	border-bottom-color: #c9ced4;
}
body.single-post .post-content table.adp-table td:first-child {
	color: var(--bp-ink);
	font-weight: 600;
}
@media (max-width: 479px) {
	body.single-post .post-content table.adp-table th,
	body.single-post .post-content table.adp-table td {
		padding: 9px 8px;
		font-size: 14px;
	}
}
