/* ============================================================
   [pf_blog_feed] — blog listing + post modal.

   A faithful port of the punjabi-fitness-site/blog.html reference.
   Every selector is namespaced `pfb-` and every custom property is
   scoped to `.pfb` rather than `:root`, because the reference used
   generic names (.post, .grid, .cat, .modal, .sheet, --pill) that
   collide with Astra and WooCommerce.
   ============================================================ */

.pfb {
	--pfb-yellow: #ffcd04;
	--pfb-yellow-deep: #e6b800;
	--pfb-ink: #1d1d1f;
	--pfb-ink-2: #0a0a0b;
	--pfb-grey: #86868b;
	--pfb-grey-2: #6e6e73;
	--pfb-card: #ffffff;
	--pfb-pill: #e9e9ef;
	--pfb-radius: 22px;
	--pfb-radius-lg: 26px;
	--pfb-ease: cubic-bezier( .16, 1, .3, 1 );

	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var( --pfb-ink );
	-webkit-font-smoothing: antialiased;
}

.pfb,
.pfb *,
.pfb *::before,
.pfb *::after {
	box-sizing: border-box;
}

.pfb img {
	display: block;
	max-width: 100%;
}

/* ------------------------------------------------------------------
 * Category chips
 * --------------------------------------------------------------- */

.pfb-cats {
	display: flex;
	gap: 9px;
	flex-wrap: wrap;
	margin: 8px 0 26px;
}

.pfb-cat {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	color: var( --pfb-grey-2 );
	background: var( --pfb-pill );
	border: none;
	border-radius: 980px;
	padding: 9px 17px;
	cursor: pointer;
	font-family: inherit;
	transition: all .2s var( --pfb-ease );
}

.pfb-cat:hover {
	background: #dcdce3;
}

.pfb-cat.is-on {
	background: var( --pfb-ink-2 );
	color: #fff;
}

/* ------------------------------------------------------------------
 * Featured (latest) post
 * --------------------------------------------------------------- */

.pfb-feat {
	display: grid;
	grid-template-columns: 1.1fr .9fr;
	gap: 0;
	border-radius: var( --pfb-radius-lg );
	overflow: hidden;
	cursor: pointer;
	box-shadow: 0 20px 50px -28px rgba( 0, 0, 0, .4 );
	margin-bottom: 26px;
	background: var( --pfb-card );
	transition: transform .4s var( --pfb-ease );
}

.pfb-feat:hover {
	transform: translateY( -4px );
}

.pfb-feat .pfb-cover {
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 90px;
	position: relative;
	overflow: hidden;
}

.pfb-feat .pfb-body {
	padding: 34px;
}

.pfb-feat .pfb-pill {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .05em;
	text-transform: uppercase;
	padding: 6px 12px;
	border-radius: 980px;
	color: #fff;
}

.pfb-feat h2 {
	font-size: clamp( 24px, 2.8vw, 34px );
	font-weight: 800;
	letter-spacing: -.03em;
	line-height: 1.1;
	margin: 14px 0 0;
	color: var( --pfb-ink );
}

.pfb-feat p {
	font-size: 16px;
	color: var( --pfb-grey-2 );
	margin: 12px 0 0;
	line-height: 1.5;
}

.pfb-feat .pfb-meta {
	margin-top: 18px;
	font-size: 13px;
	color: var( --pfb-grey );
	font-weight: 600;
	display: flex;
	gap: 14px;
	align-items: center;
}

.pfb-feat .pfb-read {
	color: var( --pfb-ink-2 );
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* ------------------------------------------------------------------
 * Grid
 * --------------------------------------------------------------- */

.pfb-grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 20px;
}

.pfb-post {
	background: var( --pfb-card );
	border-radius: var( --pfb-radius );
	overflow: hidden;
	cursor: pointer;
	box-shadow: 0 14px 38px -26px rgba( 0, 0, 0, .32 );
	transition: transform .35s var( --pfb-ease ), box-shadow .35s var( --pfb-ease );
	display: flex;
	flex-direction: column;
}

.pfb-post:hover {
	transform: translateY( -6px );
	box-shadow: 0 26px 54px -30px rgba( 0, 0, 0, .42 );
}

.pfb-post .pfb-cover {
	height: 172px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 60px;
	position: relative;
	color: #fff;
	overflow: hidden;
}

/* A real featured image / video poster fills the gradient cover. */
.pfb-cover-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.pfb-cover > .pfb-badge,
.pfb-cover > .pfb-play {
	z-index: 2;
}

.pfb-cover-emoji {
	position: relative;
	z-index: 1;
	line-height: 1;
}

.pfb-post .pfb-badge {
	position: absolute;
	top: 13px;
	left: 13px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .05em;
	text-transform: uppercase;
	background: rgba( 0, 0, 0, .34 );
	color: #fff;
	padding: 5px 11px;
	border-radius: 980px;
	-webkit-backdrop-filter: blur( 5px );
	backdrop-filter: blur( 5px );
	display: flex;
	align-items: center;
	gap: 5px;
}

.pfb-post .pfb-play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate( -50%, -50% );
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba( 255, 255, 255, .92 );
	display: grid;
	place-items: center;
	box-shadow: 0 8px 22px rgba( 0, 0, 0, .3 );
}

.pfb-post .pfb-play svg {
	width: 22px;
	height: 22px;
	margin-left: 3px;
	fill: var( --pfb-ink-2 );
}

.pfb-post .pfb-body {
	padding: 18px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.pfb-post .pfb-pill {
	display: inline-block;
	align-self: flex-start;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	padding: 5px 10px;
	border-radius: 980px;
	color: #fff;
}

.pfb-post h3 {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -.015em;
	line-height: 1.25;
	margin: 12px 0 0;
	color: var( --pfb-ink );
}

.pfb-post p {
	font-size: 14px;
	color: var( --pfb-grey-2 );
	margin: 8px 0 0;
	line-height: 1.45;
	flex: 1;
}

.pfb-post .pfb-meta {
	margin-top: 14px;
	font-size: 12.5px;
	color: var( --pfb-grey );
	font-weight: 600;
	display: flex;
	gap: 12px;
	align-items: center;
}

.pfb-empty {
	grid-column: 1 / -1;
	padding: 40px 0;
	text-align: center;
	color: var( --pfb-grey );
	font-size: 15px;
}

/* Hidden by the category filter. */
.pfb-post[hidden],
.pfb-feat[hidden] {
	display: none;
}

/* ------------------------------------------------------------------
 * Modal
 * --------------------------------------------------------------- */

.pfb-modal {
	position: fixed;
	inset: 0;
	z-index: 200000;
	display: none;
}

/*
 * Flex centring, not absolute + translate(-50%,-50%).
 *
 * The reference centred the sheet absolutely and capped it at 92vh. On mobile
 * `vh` resolves against the LARGEST viewport (URL bar retracted), so the sheet
 * was laid out taller than the visible area and centred on that taller box —
 * its top and bottom ended up off-screen with no way to scroll to them, because
 * the sheet's own scrollbar only covers its inner content, not the part of the
 * sheet pushed past the viewport edge. Flex centring inside a padded, fixed
 * container cannot overflow, and `dvh` tracks the URL bar as it moves.
 */
.pfb-modal.is-open {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.pfb-modal .pfb-scrim {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, .55 );
	-webkit-backdrop-filter: blur( 3px );
	backdrop-filter: blur( 3px );
	animation: pfb-fade .3s;
}

@keyframes pfb-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.pfb-sheet {
	position: relative;
	z-index: 1;
	width: min( 760px, 100% );
	max-height: calc( 100vh - 40px );
	max-height: calc( 100dvh - 40px );
	overflow-y: auto;
	overscroll-behavior: contain;   /* Don't chain the scroll to the page behind. */
	background: var( --pfb-card );
	border-radius: 24px;
	box-shadow: 0 40px 90px -30px rgba( 0, 0, 0, .6 );
	animation: pfb-sheet .4s var( --pfb-ease );
}

@keyframes pfb-sheet {
	from { opacity: 0; transform: translateY( 18px ) scale( .985 ); }
	to   { opacity: 1; transform: none; }
}

/*
 * Close button — solid ink on a light ring so it reads against a dark video
 * poster as well as a pale featured image. The reference's rgba(0,0,0,.06)
 * disappeared entirely over dark hero art.
 */
.pfb-sheet .pfb-x {
	position: sticky;
	top: 14px;
	float: right;
	margin: 14px 14px 0;
	z-index: 3;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: var( --pfb-ink-2 );
	color: #fff;
	cursor: pointer;
	display: grid;
	place-items: center;
	padding: 0;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, .4 ), 0 0 0 2px rgba( 255, 255, 255, .9 );
	transition: transform .2s var( --pfb-ease ), background .2s var( --pfb-ease );
}

.pfb-sheet .pfb-x:hover {
	background: #2c2c2e;
	transform: scale( 1.06 );
}

.pfb-sheet .pfb-x:focus-visible {
	outline: 3px solid var( --pfb-yellow );
	outline-offset: 2px;
}

.pfb-sheet .pfb-x svg {
	width: 18px;
	height: 18px;
	stroke: #fff;
}

.pfb-sheet .pfb-hero {
	height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 80px;
	color: #fff;
	position: relative;
	overflow: hidden;
}

.pfb-sheet .pfb-content {
	padding: 28px 34px 34px;
}

.pfb-sheet .pfb-pill {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .05em;
	text-transform: uppercase;
	padding: 6px 12px;
	border-radius: 980px;
	color: #fff;
}

.pfb-sheet h2 {
	font-size: clamp( 24px, 3vw, 32px );
	font-weight: 800;
	letter-spacing: -.03em;
	line-height: 1.12;
	margin: 14px 0 0;
	color: var( --pfb-ink );
}

.pfb-sheet .pfb-meta {
	margin-top: 12px;
	font-size: 13px;
	color: var( --pfb-grey );
	font-weight: 600;
}

.pfb-article {
	margin-top: 20px;
}

.pfb-article p {
	font-size: 16.5px;
	line-height: 1.65;
	color: var( --pfb-ink );
	margin: 14px 0 0;
}

.pfb-article h2,
.pfb-article h3,
.pfb-article h4 {
	font-size: 18px;
	font-weight: 800;
	margin: 24px 0 0;
	letter-spacing: -.01em;
	color: var( --pfb-ink );
}
.pfb-article h4{
	margin: 0 !important;
}
.pfb-article ul,
.pfb-article ol {
	margin: 14px 0 0;
	padding-left: 22px;
	font-size: 16.5px;
	line-height: 1.65;
}

.pfb-article li {
	margin-top: 6px;
}

.pfb-article img {
	border-radius: 14px;
	margin-top: 18px;
	height: auto;
}

.pfb-article a {
	color: #0a84ff;
	text-decoration: underline;
}

.pfb-article blockquote {
	margin: 18px 0 0;
	padding-left: 16px;
	border-left: 3px solid var( --pfb-yellow );
	color: var( --pfb-grey-2 );
}

/* Media embed — YouTube/Vimeo iframe or a self-hosted <video>. */
.pfb-embed {
	position: relative;
	padding-top: 56.25%;
	border-radius: 16px;
	overflow: hidden;
	margin-top: 20px;
	background: #000;
}

.pfb-embed iframe,
.pfb-embed video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* ------------------------------------------------------------------
 * Reactions
 * --------------------------------------------------------------- */

.pfb-reacts {
	display: flex;
	gap: 10px;
	margin-top: 26px;
	padding-top: 22px;
	border-top: 1px solid rgba( 0, 0, 0, .08 );
}

.pfb-react {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var( --pfb-pill );
	border: none;
	border-radius: 980px;
	padding: 9px 15px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	color: var( --pfb-ink );
	transition: all .2s var( --pfb-ease );
}

.pfb-react:hover {
	transform: translateY( -2px );
}

.pfb-react.is-on {
	background: #fff1e0;
	color: #e85d2a;
}

.pfb-react[disabled] {
	opacity: .6;
	cursor: default;
	transform: none;
}

/* ------------------------------------------------------------------
 * Comments
 * --------------------------------------------------------------- */

.pfb-comments {
	margin-top: 26px;
}

.pfb-comments h4 {
	font-size: 17px;
	font-weight: 800;
	margin: 0;
	color: var( --pfb-ink );
}

.pfb-cbox {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 14px;
	background: #f7f7fb;
	border-radius: 16px;
	padding: 16px;
}

.pfb-cbox input,
.pfb-cbox textarea {
	border: 1.5px solid rgba( 0, 0, 0, .1 );
	border-radius: 11px;
	padding: 12px 14px;
	font-size: 15px;
	font-family: inherit;
	outline: none;
	background: #fff;
	color: var( --pfb-ink );
	width: 100%;
	transition: border-color .18s;
}

.pfb-cbox input:focus,
.pfb-cbox textarea:focus {
	border-color: var( --pfb-yellow );
	box-shadow: none;
}

.pfb-cbox textarea {
	min-height: 62px;
	resize: vertical;
}

.pfb-cbox button {
	align-self: flex-end;
	background: var( --pfb-ink-2 );
	color: #fff;
	border: none;
	border-radius: 11px;
	padding: 11px 20px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	width: auto;
	transition: transform .2s var( --pfb-ease );
}

.pfb-cbox button:hover:not( [disabled] ) {
	transform: translateY( -2px );
}

.pfb-cbox button[disabled] {
	opacity: .6;
	cursor: default;
}

.pfb-cnote {
	font-size: 13px;
	font-weight: 600;
	margin: 0;
	color: var( --pfb-grey-2 );
}

.pfb-cnote.is-error {
	color: #d0342c;
}

.pfb-cnote.is-success {
	color: #1a7f4b;
}

.pfb-clist {
	margin-top: 18px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pfb-cmt {
	display: flex;
	gap: 12px;
}

.pfb-cmt .pfb-av {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	flex: none;
	display: grid;
	place-items: center;
	font-weight: 800;
	color: #fff;
	font-size: 15px;
}

.pfb-cmt .pfb-c b {
	font-size: 14px;
	font-weight: 700;
}

.pfb-cmt .pfb-c .pfb-t {
	font-size: 11px;
	color: var( --pfb-grey );
	font-weight: 600;
	margin-left: 8px;
}

.pfb-cmt .pfb-c p {
	font-size: 14.5px;
	color: var( --pfb-ink );
	margin: 4px 0 0;
	line-height: 1.45;
}

.pfb-cempty {
	color: var( --pfb-grey );
	font-size: 14px;
	margin: 0;
}

/* Loading state while the modal fetches the post. */
.pfb-loading {
	padding: 60px 0;
	text-align: center;
	color: var( --pfb-grey );
	font-size: 15px;
}

/* ------------------------------------------------------------------
 * Load more
 * --------------------------------------------------------------- */

.pfb-more {
	display: flex;
	justify-content: center;
	margin-top: 28px;
}

.pfb-more button {
	background: var( --pfb-ink-2 );
	color: #fff;
	border: none;
	border-radius: 980px;
	padding: 13px 26px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: transform .2s var( --pfb-ease );
}

.pfb-more button:hover:not( [disabled] ) {
	transform: translateY( -2px );
}

.pfb-more button[disabled] {
	opacity: .6;
	cursor: default;
}

/* ------------------------------------------------------------------
 * Responsive — matches the reference breakpoints
 * --------------------------------------------------------------- */

@media ( max-width: 860px ) {
	.pfb-feat {
		grid-template-columns: 1fr;
	}

	.pfb-feat .pfb-cover {
		min-height: 200px;
		font-size: 70px;
	}

	.pfb-grid {
		grid-template-columns: 1fr 1fr;
	}

	.pfb-sheet .pfb-content {
		padding: 22px;
	}
}

@media ( max-width: 560px ) {
	.pfb-grid {
		grid-template-columns: 1fr;
	}

	.pfb-feat .pfb-body {
		padding: 24px;
	}

	/* Reclaim the gutter — on a 375px screen 20px each side is a lot of sheet. */
	.pfb-modal.is-open {
		padding: 12px;
	}

	.pfb-sheet {
		max-height: calc( 100vh - 24px );
		max-height: calc( 100dvh - 24px );
		border-radius: 18px;
	}

	.pfb-sheet .pfb-hero {
		height: 168px;
		font-size: 60px;
	}

	.pfb-sheet .pfb-content {
		padding: 18px 18px 26px;
	}

	.pfb-reacts {
		flex-wrap: wrap;
	}

	/* Full-width tap target beats a 100px button pinned to the right edge. */
	.pfb-cbox button {
		align-self: stretch;
		padding: 13px 20px;
	}
}

/*
 * Landscape phones: 100dvh is ~380px, so the 200px hero would eat half the
 * sheet before a single line of the article showed.
 */
@media ( max-height: 520px ) and ( orientation: landscape ) {
	.pfb-sheet .pfb-hero {
		height: 120px;
		font-size: 46px;
	}

	.pfb-sheet .pfb-content {
		padding: 16px 22px 24px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.pfb *,
	.pfb-modal * {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}

	.pfb-feat:hover,
	.pfb-post:hover,
	.pfb-react:hover {
		transform: none;
	}
}
