/**
 * Orsozox Liquid Glass — article pages, "premium" pass.
 *
 * Design intent: the article should read as a stack of physical glass panes
 * floating over a lit background, not as a flat white box. Depth comes from
 * three cheap ingredients rather than heavy blur:
 *
 *   1. Layered gradients  — an accent wash above, a neutral falloff below.
 *   2. Edge lighting      — a 1px specular top edge + a soft inner glow.
 *   3. Real shadows       — a wide ambient shadow plus a tight contact one.
 *
 * Performance contract (unchanged from v1, this is what keeps it fast):
 *   - No extra network requests: no icon fonts, no images, no webfonts.
 *   - Animation only on transform / opacity / background-position.
 *   - Every backdrop-filter sits behind @supports AND `html:not(.orsz-lite)`,
 *     so a weak phone gets the same layout with the expensive parts off.
 *   - Assets load on single posts only.
 *
 * @package Orsozox_Core
 */

/* ============================================================
   0. LOCAL TOKENS
   ============================================================ */

.single-post {
	--orsz-pane-radius: 26px;
	--orsz-pane-shadow:
		0 1px 2px rgba(16, 24, 40, 0.04),
		0 12px 28px -14px rgba(16, 24, 40, 0.22),
		0 42px 80px -40px rgba(16, 24, 40, 0.30);
	--orsz-pane-shadow-hover:
		0 1px 2px rgba(16, 24, 40, 0.05),
		0 18px 40px -16px rgba(16, 24, 40, 0.26),
		0 56px 100px -46px rgba(16, 24, 40, 0.34);
}

[data-orsz-theme="dark"] .single-post {
	--orsz-pane-shadow:
		0 1px 2px rgba(0, 0, 0, 0.30),
		0 12px 28px -14px rgba(0, 0, 0, 0.55),
		0 42px 80px -40px rgba(0, 0, 0, 0.65);
	--orsz-pane-shadow-hover:
		0 1px 2px rgba(0, 0, 0, 0.34),
		0 18px 40px -16px rgba(0, 0, 0, 0.60),
		0 56px 100px -46px rgba(0, 0, 0, 0.72);
}

/* ============================================================
   1. THE ARTICLE PANE
   ============================================================ */

.single-post #the-post {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	border-radius: var(--orsz-pane-radius);
	background: var(--orsz-glass-bg);
	box-shadow: var(--orsz-pane-shadow), var(--orsz-glass-inner);
	transition: box-shadow var(--orsz-dur) var(--orsz-ease);
}

/* ---- Layer A: ambient accent wash rising from the top ---- */
.single-post #the-post::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 320px;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(110% 120% at 50% 0%,
			color-mix(in srgb, var(--orsz-accent) 16%, transparent) 0%,
			transparent 62%),
		radial-gradient(80% 100% at 12% 0%,
			color-mix(in srgb, var(--orsz-accent-alt) 13%, transparent) 0%,
			transparent 58%);
}

/* ---- Layer B: neutral falloff so the bottom does not glow ---- */
.single-post #the-post::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	border-radius: inherit;
	background: linear-gradient(
		180deg,
		transparent 0%,
		transparent 45%,
		color-mix(in srgb, var(--orsz-ink) 3%, transparent) 100%
	);
}

/* ---- Layer C: the specular edge. This is what sells "glass". ---- */
.single-post #the-post > .orsz-pane-edge {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(
		160deg,
		rgba(255, 255, 255, 0.90) 0%,
		rgba(255, 255, 255, 0.22) 26%,
		rgba(255, 255, 255, 0.04) 55%,
		color-mix(in srgb, var(--orsz-accent) 26%, transparent) 100%
	);
	-webkit-mask:
		linear-gradient(#000 0 0) content-box,
		linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask:
		linear-gradient(#000 0 0) content-box,
		linear-gradient(#000 0 0);
	mask-composite: exclude;
}

[data-orsz-theme="dark"] .single-post #the-post > .orsz-pane-edge {
	background: linear-gradient(
		160deg,
		rgba(255, 255, 255, 0.30) 0%,
		rgba(255, 255, 255, 0.08) 30%,
		rgba(255, 255, 255, 0.02) 58%,
		color-mix(in srgb, var(--orsz-accent) 40%, transparent) 100%
	);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	html:not(.orsz-lite) .single-post #the-post {
		-webkit-backdrop-filter: blur(var(--orsz-glass-blur)) saturate(var(--orsz-glass-saturate));
		backdrop-filter: blur(var(--orsz-glass-blur)) saturate(var(--orsz-glass-saturate));
	}
}

/* ============================================================
   2. HEADER — editorial, with a real hierarchy
   ============================================================ */

.single-post .entry-header {
	position: relative;
	z-index: 2;
	padding-bottom: 6px;
}

/* Category as an overline label. */
.single-post .entry-header .post-cats,
.single-post .entry-header .meta-category {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 14px;
	padding: 6px 16px;
	border-radius: var(--orsz-radius-pill);
	background: linear-gradient(135deg, var(--orsz-accent), var(--orsz-accent-alt));
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: 0 10px 24px -10px var(--orsz-accent);
}

.single-post .entry-header .post-title,
.single-post #the-post .post-title {
	margin-bottom: 6px;
	font-weight: 800;
	letter-spacing: -0.5px;
	line-height: 1.42;
}

/* Two-tone rule that animates open under the title. */
.single-post .entry-header > .post-title::after,
.single-post .entry-header .post-title::after {
	content: "";
	display: block;
	width: 96px;
	height: 5px;
	margin: 20px 0 0;
	border-radius: var(--orsz-radius-pill);
	background: linear-gradient(90deg, var(--orsz-accent) 0%, var(--orsz-accent-alt) 100%);
	box-shadow: 0 6px 18px -6px var(--orsz-accent);
	transform-origin: 0 50%;
	animation: orsz-rule-in 700ms var(--orsz-ease-out) both;
}

[dir="rtl"] .single-post .entry-header .post-title::after {
	transform-origin: 100% 50%;
}

@keyframes orsz-rule-in {
	from { transform: scaleX(0); opacity: 0; }
	to   { transform: scaleX(1); opacity: 1; }
}

/* ---- Meta row: a single quiet line, not a tray of buttons ----
 * The previous chip-per-item treatment turned the byline into a row of
 * heavy grey pills. It now reads as one understated line: gold icon,
 * muted label, thin separators. Nothing competes with the title.
 */

.single-post .entry-header .post-meta,
.single-post .entry-header .meta-extra {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid color-mix(in srgb, var(--orsz-accent) 20%, transparent);
}

.single-post .entry-header .post-meta > *,
.single-post .entry-header .post-meta .meta-item,
.single-post .entry-header .post-meta .date,
.single-post .entry-header .post-meta .post-author,
.single-post .entry-header .post-meta .meta-comment,
.single-post .entry-header .post-meta .tie-views,
.single-post .entry-header .post-meta a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 0;
	margin-inline-end: 20px;
	background: none;
	border: 0;
	box-shadow: none;
	border-radius: 0;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.7;
	color: var(--orsz-ink-mute);
	text-decoration: none;
	transition: color var(--orsz-dur-fast) var(--orsz-ease);
}

/* Gold icon in front of every meta entry. */
.single-post .entry-header .post-meta > *::before,
.single-post .entry-header .post-meta .meta-item::before {
	color: var(--orsz-accent);
	font-size: 14px;
	opacity: 0.95;
}

/* Thin divider between entries instead of a box around each. */
.single-post .entry-header .post-meta > * + *::after {
	content: "";
	position: relative;
	inset-inline-start: -10px;
	width: 1px;
	height: 13px;
	background: color-mix(in srgb, var(--orsz-ink) 16%, transparent);
}

.single-post .entry-header .post-meta > *:last-child {
	margin-inline-end: 0;
}

.single-post .entry-header .post-meta a:hover,
.single-post .entry-header .post-meta > *:hover {
	color: var(--orsz-accent);
}

.single-post .entry-header .post-meta a:hover {
	background: none;
	transform: none;
}

/* ---- Share row: outlined circles, brand colour only on hover ---- */

.single-post .share-buttons a,
.single-post .post-share-buttons a {
	background: transparent;
	border: 1px solid color-mix(in srgb, var(--orsz-accent) 32%, transparent);
	box-shadow: none;
	color: var(--orsz-ink-soft);
}

.single-post .share-buttons a:hover,
.single-post .post-share-buttons a:hover {
	background: var(--orsz-accent);
	border-color: var(--orsz-accent);
	color: #1a1408;
	transform: translateY(-3px);
	box-shadow: 0 12px 26px -12px var(--orsz-accent);
}

/* ============================================================
   3. READING SURFACE
   ============================================================ */

.single-post .entry-content {
	position: relative;
	z-index: 2;
	font-size: 18.5px;
	line-height: 2.1;
	color: var(--orsz-ink-soft);
}

.single-post .entry-content p {
	margin-bottom: 1.4em;
}

.single-post .entry-content strong {
	color: var(--orsz-ink);
	font-weight: 700;
}

/* ---- Drop cap ----
 * Disabled. A boxed gold initial fights Arabic letter joining and reads as
 * a stray block rather than as an editorial flourish. The property is kept
 * so the admin switch still reports the original intent, but the rule is
 * inert; a gentle first-line emphasis replaces it.
 */
.single-post .entry-content > p:first-of-type {
	font-size: 1.045em;
}

.single-post .entry-content > p:first-of-type::first-letter {
	float: none;
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
	color: inherit;
	background: none;
	box-shadow: none;
	border: 0;
}

/* ---- Headings with an accent rail ---- */
.single-post .entry-content h2,
.single-post .entry-content h3 {
	position: relative;
	margin-top: 2em;
	margin-bottom: 0.7em;
	padding-inline-start: 20px;
	font-weight: 800;
	color: var(--orsz-ink);
	line-height: 1.55;
}

.single-post .entry-content h2::before,
.single-post .entry-content h3::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.24em;
	bottom: 0.24em;
	width: 6px;
	border-radius: var(--orsz-radius-pill);
	background: linear-gradient(180deg, var(--orsz-accent), var(--orsz-accent-alt));
	box-shadow: 0 0 18px -3px var(--orsz-accent);
}

/* ---- Blockquote as a lit glass slab ---- */
.single-post .entry-content blockquote {
	position: relative;
	margin: 2em 0;
	padding: 26px 30px 26px 34px;
	border: 1px solid var(--orsz-glass-border);
	border-radius: var(--orsz-radius);
	background: var(--orsz-glass-bg-weak);
	box-shadow:
		var(--orsz-glass-inner),
		0 20px 44px -26px rgba(16, 24, 40, 0.34);
	font-style: normal;
	font-size: 1.04em;
	color: var(--orsz-ink);
}

[dir="rtl"] .single-post .entry-content blockquote {
	padding: 26px 34px 26px 30px;
}

.single-post .entry-content blockquote::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 18px;
	bottom: 18px;
	width: 5px;
	border-radius: var(--orsz-radius-pill);
	background: linear-gradient(180deg, var(--orsz-accent), var(--orsz-accent-alt));
}

/* ---- Images: lifted, rounded, with a glass frame ---- */
.single-post .entry-content img {
	height: auto;
	border-radius: var(--orsz-radius);
	box-shadow:
		0 0 0 1px var(--orsz-glass-border),
		0 24px 50px -24px rgba(16, 24, 40, 0.40);
	transition: transform var(--orsz-dur-slow) var(--orsz-ease-out),
	            box-shadow var(--orsz-dur-slow) var(--orsz-ease-out);
}

.single-post .entry-content img:hover {
	transform: translateY(-4px) scale(1.012);
	box-shadow:
		0 0 0 1px var(--orsz-accent),
		0 32px 62px -26px rgba(16, 24, 40, 0.46);
}

/* ---- Lists ---- */
.single-post .entry-content ul,
.single-post .entry-content ol {
	padding-inline-start: 1.4em;
}

.single-post .entry-content li {
	margin-bottom: 0.6em;
}

.single-post .entry-content ul li::marker {
	color: var(--orsz-accent);
	font-size: 1.15em;
}

/* ---- Tables scroll instead of breaking the pane ---- */
.single-post .entry-content table {
	display: block;
	width: 100%;
	overflow-x: auto;
	border-radius: var(--orsz-radius-sm);
	-webkit-overflow-scrolling: touch;
}

/* ---- Inline links with a sliding underline ---- */
.single-post .entry-content a:not(.orsz-btn):not(.wp-block-button__link) {
	color: var(--orsz-accent);
	text-decoration: none;
	background-image: linear-gradient(var(--orsz-accent), var(--orsz-accent));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0% 2px;
	transition: background-size var(--orsz-dur) var(--orsz-ease);
}

.single-post .entry-content a:not(.orsz-btn):not(.wp-block-button__link):hover {
	background-size: 100% 2px;
}

/* ============================================================
   4. COMPONENTS BELOW THE ARTICLE
   ============================================================ */

.single-post .post-components {
	display: flex;
	flex-direction: column;
	gap: 22px;
	margin-top: 28px;
}

.single-post .post-components > * {
	border-radius: var(--orsz-pane-radius);
}

.single-post .post-components .container-wrapper,
.single-post .related-posts .container-wrapper,
.single-post .post-next-prev {
	position: relative;
	overflow: hidden;
	border-radius: var(--orsz-pane-radius);
	background: var(--orsz-glass-bg);
	border: 1px solid var(--orsz-glass-border);
	box-shadow: var(--orsz-pane-shadow), var(--orsz-glass-inner);
}

/* Their heading gets the same rail treatment as article headings. */
.single-post .post-components .block-head h3,
.single-post .post-components .block-head h2 {
	position: relative;
	padding-inline-start: 18px;
	font-weight: 800;
	color: var(--orsz-ink);
}

.single-post .post-components .block-head h3::before,
.single-post .post-components .block-head h2::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.2em;
	bottom: 0.2em;
	width: 5px;
	border-radius: var(--orsz-radius-pill);
	background: linear-gradient(180deg, var(--orsz-accent), var(--orsz-accent-alt));
}

/* ---- Share buttons: circular glass buttons with brand hover ---- */
.single-post .share-buttons,
.single-post .post-share-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* Geometry only: colour and border come from the outlined-circle rule. */
.single-post .share-buttons a,
.single-post .post-share-buttons a {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: var(--orsz-radius-pill);
	transition: transform var(--orsz-dur) var(--orsz-ease-spring),
	            background var(--orsz-dur) var(--orsz-ease),
	            border-color var(--orsz-dur) var(--orsz-ease),
	            color var(--orsz-dur) var(--orsz-ease);
}

/* ============================================================
   5. MOBILE — the "new phone" pass
   ============================================================ */

@media (max-width: 782px) {

	.single-post {
		--orsz-pane-radius: 20px;
	}

	/* Near-full-bleed pane with a visible margin, like a native card. */
	.single-post #the-post {
		margin: 0 8px;
		border-radius: var(--orsz-pane-radius);
	}

	/* Comfortable reading measure and size. */
	.single-post .entry-content {
		font-size: 17.5px;
		line-height: 2.15;
		padding-inline: 2px;
	}

	/* The drop cap is too cramped on a narrow screen. */
	.single-post .entry-content > p:first-of-type::first-letter {
		float: none;
		margin: 0;
		padding: 0;
		font-size: inherit;
		line-height: inherit;
		color: inherit;
		background: none;
		box-shadow: none;
	}

	/* Larger tap targets. */
	.single-post .entry-header .post-meta > *,
	.single-post .entry-header .post-meta .meta-item {
		font-size: 12.5px;
		padding: 8px 15px;
	}

	.single-post .share-buttons a,
	.single-post .post-share-buttons a {
		width: 48px;
		height: 48px;
	}

	/* Component panes line up with the article pane. */
	.single-post .post-components .container-wrapper {
		margin-inline: 8px;
	}

	/* Less vertical noise between panes. */
	.single-post .post-components {
		gap: 16px;
	}

	.orsz-read-bar {
		display: flex;
	}
}

/* ============================================================
   6. STICKY MOBILE READING BAR
   ============================================================ */

.orsz-read-bar {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 9990;
	display: none;
	align-items: center;
	gap: 12px;
	padding: 11px 16px calc(11px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--orsz-glass-border);
	background: var(--orsz-glass-bg-strong);
	box-shadow: 0 -14px 40px -18px rgba(16, 24, 40, 0.42);
	transform: translateY(102%);
	transition: transform var(--orsz-dur) var(--orsz-ease-out);
	will-change: transform;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	html:not(.orsz-lite) .orsz-read-bar {
		-webkit-backdrop-filter: blur(22px) saturate(190%);
		backdrop-filter: blur(22px) saturate(190%);
	}
}

.orsz-read-bar.is-visible {
	transform: translateY(0);
}

.orsz-read-bar__track {
	flex: 1;
	height: 7px;
	border-radius: var(--orsz-radius-pill);
	background: color-mix(in srgb, var(--orsz-ink) 13%, transparent);
	box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.18);
	overflow: hidden;
}

.orsz-read-bar__fill {
	height: 100%;
	width: 0%;
	border-radius: var(--orsz-radius-pill);
	background: linear-gradient(90deg, var(--orsz-accent), var(--orsz-accent-alt));
	box-shadow: 0 0 14px -2px var(--orsz-accent);
	transition: width 120ms linear;
}

.orsz-read-bar__label {
	flex: none;
	min-width: 46px;
	font-size: 13px;
	font-weight: 800;
	color: var(--orsz-ink);
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.orsz-read-bar__top {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: var(--orsz-radius-pill);
	border: 1px solid var(--orsz-glass-border);
	background: var(--orsz-glass-bg-weak);
	color: var(--orsz-ink);
	cursor: pointer;
	transition: transform var(--orsz-dur) var(--orsz-ease-spring);
}

.orsz-read-bar__top:active {
	transform: scale(0.9);
}

.orsz-read-bar__top svg {
	width: 19px;
	height: 19px;
}

/* ============================================================
   7. TABLET / DESKTOP
   ============================================================ */

@media (min-width: 783px) {
	.single-post #the-post {
		padding-inline: 40px;
		padding-block: 8px;
	}

	.single-post .entry-content {
		font-size: 18.5px;
	}
}

/* ============================================================
   8. PER-FEATURE OPT-OUT
   ============================================================ */

.orsz-no-dropcap .single-post .entry-content > p:first-of-type::first-letter {
	float: none;
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
	color: inherit;
	background: none;
	box-shadow: none;
}

.orsz-no-read-bar .orsz-read-bar {
	display: none !important;
}

.orsz-no-article-glass .single-post #the-post {
	background: transparent;
	border: 0;
	box-shadow: none;
	border-radius: 0;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

.orsz-no-article-glass .single-post #the-post::before,
.orsz-no-article-glass .single-post #the-post::after,
.orsz-no-article-glass .single-post #the-post > .orsz-pane-edge {
	display: none;
}

/* ============================================================
   9. LOW-POWER DEVICES — same look, none of the cost
   ============================================================ */

html.orsz-lite .single-post #the-post,
html.orsz-lite .orsz-read-bar {
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
	background: var(--orsz-glass-bg-strong) !important;
}

/* Keep the edge light: it is a cheap gradient, not a filter. But drop the
   large accent wash, which costs paint time on a big pane. */
html.orsz-lite .single-post #the-post::before {
	height: 180px;
	opacity: 0.75;
}

html.orsz-lite .single-post .entry-header .post-title::after {
	animation: none;
}

html.orsz-lite .single-post .entry-content img {
	transition: none;
}

html.orsz-lite .orsz-read-bar__fill {
	transition: none;
}

/* ============================================================
   10. PRINT
   ============================================================ */

@media print {
	.single-post #the-post {
		background: #fff !important;
		border: 0 !important;
		box-shadow: none !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
	}

	.single-post #the-post::before,
	.single-post #the-post::after,
	.single-post #the-post > .orsz-pane-edge,
	.orsz-read-bar {
		display: none !important;
	}
}
