/* ==========================================================================
   Blog (Phase 12.4): article list, category / tag pages and the article search (12.4.1).
   Loaded only on those views and single posts (inc/assets.php). The blog card + grid live in
   components.css (shared with the home page).
   ========================================================================== */

/* ---- Category pills (12.4.1): one row that scrolls sideways on small screens. ---- */
.pgs-blog-cats {
	margin-bottom: clamp(24px, 4vw, 32px);
}

.pgs-blog-cats__list {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 0 0 4px;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
}

.pgs-blog-cats__list::-webkit-scrollbar {
	display: none;
}

/* Phones / tablets: the row runs to the screen edges while it scrolls. */
@media (max-width: 767px) {
	.pgs-blog-cats__list {
		margin-inline: -16px;
		padding-inline: 16px;
	}
}

.pgs-blog-cats__list li {
	flex: 0 0 auto;
}

.pgs-blog-cats__pill {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--pgs-border-strong);
	border-radius: var(--pgs-radius-pill);
	background: var(--pgs-surface);
	color: var(--pgs-text);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition:
		border-color var(--pgs-duration) var(--pgs-ease),
		background-color var(--pgs-duration) var(--pgs-ease);
}

.pgs-blog-cats__pill:hover {
	border-color: var(--pgs-green);
	background: var(--pgs-tint-green);
}

.pgs-blog-cats__pill.is-active {
	border-color: var(--pgs-navy);
	background: var(--pgs-navy);
	color: #fff;
}

/* ==========================================================================
   Blog article (12.4.2–12.4.4; editorial layout, no banner — 2026-10-28).
   ========================================================================== */

/* ---- Reading progress: a thin green line at the very top of the screen (post.js sets the
   scale). Above the sticky header, under the WordPress admin bar. ---- */
.pgs-read-progress {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	z-index: 90;
	width: 100%;
	height: 3px;
	pointer-events: none;
}

@media (max-width: 600px) {
	.pgs-read-progress {
		top: 0; /* the admin bar scrolls away on phones */
	}
}

.pgs-read-progress__bar {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--pgs-grad-green);
	transform: scaleX(0);
	transform-origin: left center;
}

/* ---- Page: breadcrumb above two columns — article (≈70%) + sidebar (≈30%) from 1024px;
   one column below (sidebar after the article). ---- */
.pgs-post-page {
	padding-top: clamp(20px, 3vw, 32px);
}

.pgs-post-page .pgs-breadcrumb {
	margin-bottom: clamp(16px, 2.5vw, 28px);
}

.pgs-post-grid {
	display: grid;
	gap: 48px;
	align-items: start;
}

@media (min-width: 1024px) {
	.pgs-post-grid {
		grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
		gap: clamp(32px, 4vw, 56px);
		align-items: start;
	}
}

.pgs-post {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

/* ---- Article header: cover, category, H1, summary, author row. ---- */
.pgs-post-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.pgs-post-cover {
	width: 100%;
	margin-bottom: 8px;
}

.pgs-post-cover__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border-radius: var(--pgs-radius);
	background: var(--pgs-surface-2);
	object-fit: cover;
}

a.pgs-post-head__cat {
	text-decoration: none;
	transition: border-color var(--pgs-duration) var(--pgs-ease);
}

a.pgs-post-head__cat:hover {
	border-color: var(--pgs-green);
}

.pgs-post-head__title {
	margin: 0;
	color: var(--pgs-text);
	font-size: clamp(1.875rem, 1.45rem + 1.6vw, 2.75rem);
	line-height: 1.18;
	letter-spacing: -.02em;
	overflow-wrap: anywhere;
}

.pgs-post-head__summary {
	margin: 0;
	color: var(--pgs-text-body);
	font-size: clamp(1.0625rem, 1rem + .25vw, 1.1875rem);
	line-height: 1.6;
}

.pgs-post-head__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding-top: 18px;
	border-top: 1px solid var(--pgs-border);
}

.pgs-post-head__avatar {
	display: inline-grid;
	flex: 0 0 auto;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--pgs-navy);
	color: #fff;
	font-size: 14px;
	font-weight: 800;
}

.pgs-post-head__byline {
	display: grid;
	gap: 2px;
	font-size: var(--pgs-fs-small);
}

.pgs-post-head__author {
	color: var(--pgs-text);
	font-weight: 700;
}

.pgs-post-head__details {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
	color: var(--pgs-text-muted);
}

.pgs-post-head__updated {
	display: inline-flex;
	gap: 6px;
}

/* The text uses the whole main column. From 1024px paragraphs and list items are justified with
   automatic hyphenation (client, 2026-10-28); phones / tablets stay left-aligned (even spacing). */
.pgs-post .pgs-post-body__content {
	max-width: none;
}

@media (min-width: 1024px) {
	.pgs-post .pgs-post-body__content :is(p, li) {
		text-align: justify;
		-webkit-hyphens: auto;
		hyphens: auto;
	}
}

/* ---- Recommended course strip (12.4.4, after the text): picture · label, title, class ·
   subjects · price · button; on phones the button goes full width under it. ---- */
.pgs-course-strip {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 12px 16px;
	align-items: center;
	padding: 16px;
	border: 1px solid var(--pgs-accent-border);
	border-left: 4px solid var(--pgs-green);
	border-radius: var(--pgs-radius-sm);
	background: var(--pgs-tint-green);
}

@media (min-width: 640px) {
	.pgs-course-strip {
		grid-template-columns: 140px minmax(0, 1fr) auto;
		padding: 16px 20px 16px 16px;
	}
}

.pgs-course-strip__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	object-fit: cover;
}

.pgs-course-strip__body {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.pgs-course-strip__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--pgs-accent);
	font-size: var(--pgs-fs-eyebrow);
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.pgs-course-strip__label .pgs-icon {
	width: 15px;
	height: 15px;
}

.pgs-course-strip .pgs-related-course__title {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.35;
}

.pgs-course-strip .pgs-related-course__title a {
	color: var(--pgs-text);
	text-decoration: none;
}

.pgs-course-strip .pgs-related-course__title a:hover {
	color: var(--pgs-accent);
}

.pgs-course-strip .pgs-related-course__meta {
	margin: 0;
	color: var(--pgs-text-body);
	font-size: var(--pgs-fs-small);
}

.pgs-course-strip .pgs-related-course__price {
	margin-left: 4px;
}

.pgs-course-strip .pgs-related-course__price::before {
	content: "·";
	margin-right: 6px;
}

.pgs-course-strip .pgs-related-course__price strong {
	color: var(--pgs-text);
}

.pgs-course-strip .pgs-related-course__price del {
	margin-left: 4px;
	color: var(--pgs-text-muted);
}

.pgs-course-strip__cta {
	grid-column: 1 / -1;
	justify-content: center;
}

@media (min-width: 640px) {
	.pgs-course-strip__cta {
		grid-column: auto;
	}
}

/* ---- Table of contents ---- */
.pgs-toc__details {
	border: 1px solid var(--pgs-border);
	border-radius: var(--pgs-radius);
	background: var(--pgs-bg-alt);
}

.pgs-toc__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	padding: 0 18px;
	color: var(--pgs-text);
	font-weight: 700;
	list-style: none;
	cursor: pointer;
}

.pgs-toc__summary::-webkit-details-marker {
	display: none;
}

.pgs-toc__title {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.pgs-toc__title .pgs-icon {
	width: 18px;
	height: 18px;
	color: var(--pgs-accent);
}

.pgs-toc__chevron {
	width: 18px;
	height: 18px;
	transition: transform var(--pgs-duration) var(--pgs-ease);
}

.pgs-toc__details[open] .pgs-toc__chevron {
	transform: rotate(180deg);
}

.pgs-toc__list {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0 10px 14px;
	list-style: none;
}

.pgs-toc__link {
	display: block;
	padding: 8px 10px;
	border-left: 2px solid transparent;
	border-radius: 0 var(--pgs-radius-sm) var(--pgs-radius-sm) 0;
	color: var(--pgs-text-body);
	font-size: var(--pgs-fs-small);
	line-height: 1.45;
	text-decoration: none;
	transition: color var(--pgs-duration) var(--pgs-ease), background-color var(--pgs-duration) var(--pgs-ease);
}

.pgs-toc__item--h3 .pgs-toc__link {
	padding-left: 24px;
}

.pgs-toc__link:hover {
	background: var(--pgs-tint-green);
	color: var(--pgs-text);
}

.pgs-toc__link[aria-current] {
	border-left-color: var(--pgs-green);
	background: var(--pgs-surface);
	color: var(--pgs-text);
	font-weight: 700;
}

/* ---- Share buttons: a row at the end of the article. ---- */
.pgs-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	padding-top: 24px;
	border-top: 1px solid var(--pgs-border);
}

.pgs-share__title {
	margin: 0;
	color: var(--pgs-text);
	font-weight: 700;
}

.pgs-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgs-share__list li[hidden] {
	display: none;
}

.pgs-share__btn {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--pgs-border-strong);
	border-radius: 50%;
	background: var(--pgs-surface);
	color: var(--pgs-navy);
	cursor: pointer;
	transition:
		border-color var(--pgs-duration) var(--pgs-ease),
		background-color var(--pgs-duration) var(--pgs-ease),
		color var(--pgs-duration) var(--pgs-ease);
}

.pgs-share__btn .pgs-icon {
	width: 18px;
	height: 18px;
}

.pgs-share__btn:hover {
	border-color: var(--pgs-green);
	background: var(--pgs-green);
	color: var(--pgs-navy-deep);
}

.pgs-share__btn.is-copied {
	border-color: var(--pgs-navy);
	background: var(--pgs-navy);
	color: #fff;
}

.pgs-share__status {
	flex-basis: 100%;
	margin: 0;
	color: var(--pgs-accent);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
}

.pgs-share__status:empty {
	display: none;
}

/* ---- Sidebar (2026-10-28): Related Articles + "Need guidance?" in one card style; from 1024px
   the whole sidebar stays in view while reading. ---- */
.pgs-post-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

/* Tablets (sidebar under the article): the two cards side by side. */
@media (min-width: 640px) and (max-width: 1023px) {
	.pgs-post-sidebar {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: stretch;
	}
}

@media (min-width: 1024px) {
	.pgs-post-sidebar {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 104px);
		align-self: start;
		max-height: calc(100vh - 128px);
		overflow-y: auto;
		scrollbar-width: thin;
	}
}

.pgs-widget {
	padding: 20px;
	border: 1px solid var(--pgs-border);
	border-radius: var(--pgs-radius);
	background: var(--pgs-surface);
	box-shadow: 0 2px 10px rgba(0, 19, 56, .04);
}

.pgs-widget__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--pgs-border);
}

.pgs-widget__title {
	position: relative;
	margin: 0;
	color: var(--pgs-text);
	font-size: 1.125rem;
	line-height: 1.3;
}

/* Green bar under the title, on the line below the head. */
.pgs-widget__head .pgs-widget__title::after {
	content: "";
	position: absolute;
	bottom: -14px;
	left: 0;
	width: 100%;
	height: 2px;
	background: var(--pgs-green);
}

.pgs-widget__more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 32px;
	color: var(--pgs-link);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
	text-decoration: none;
}

.pgs-widget__more .pgs-icon {
	width: 14px;
	height: 14px;
}

.pgs-widget__more:hover {
	text-decoration: underline;
}

/* Related Articles: small picture + title + date; the whole row is clickable. */
.pgs-widget-posts {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgs-widget-posts__item {
	position: relative;
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	padding-block: 14px;
}

.pgs-widget-posts__item:first-child {
	padding-top: 0;
}

.pgs-widget-posts__item:last-child {
	padding-bottom: 0;
}

.pgs-widget-posts__item + .pgs-widget-posts__item {
	border-top: 1px solid var(--pgs-border);
}

.pgs-widget-posts__thumb {
	display: grid;
	place-items: center;
	overflow: hidden;
	aspect-ratio: 16 / 11;
	border-radius: 8px;
	background: var(--pgs-grad-navy, var(--pgs-navy));
}

.pgs-widget-posts__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s var(--pgs-ease);
}

.pgs-widget-posts__thumb img[width="40"] {
	width: 40px;
	height: 40px;
}

.pgs-widget-posts__item:hover .pgs-widget-posts__thumb img {
	transform: scale(1.06);
}

.pgs-widget-posts__text {
	display: grid;
	gap: 4px;
}

.pgs-widget-posts__link {
	display: -webkit-box;
	overflow: hidden;
	color: var(--pgs-text);
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.pgs-widget-posts__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.pgs-widget-posts__item:hover .pgs-widget-posts__link {
	color: var(--pgs-accent);
}

.pgs-widget-posts__date {
	color: var(--pgs-text-muted);
	font-size: var(--pgs-fs-small);
}

/* Need guidance? — navy card: icon + title in one row, short text, WhatsApp button. */
.pgs-widget--help {
	display: flex;
	flex-direction: column;
	gap: 12px;
	border-color: transparent;
	background: var(--pgs-navy);
	color: #fff;
}

.pgs-widget--help__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.pgs-widget--help .pgs-widget__title {
	color: #fff;
}

.pgs-widget--help__icon {
	display: inline-grid;
	flex: 0 0 auto;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .1);
	color: var(--pgs-lime);
}

.pgs-widget--help__icon .pgs-icon {
	width: 20px;
	height: 20px;
}

.pgs-widget--help__text {
	margin: 0;
	color: rgba(255, 255, 255, .85);
	font-size: var(--pgs-fs-small);
	line-height: 1.6;
}
