.ffw-custom-post {
	--ffw-ink: #171717;
	--ffw-link: #74441f;
	--ffw-body: #4f4f4f;
	--ffw-muted: #6f6f6f;
	--ffw-line: #e3e3e3;
	--ffw-soft: #f7f7f7;
	--ffw-accent: #2f2f2f;
	--ffw-white: #fff;
	--ffw-sand: #f1efec;
}

.ffw-custom-post #main,
.ffw-custom-post .page-wrapper,
.ffw-custom-post .vamtam-main,
.ffw-custom-post .limit-wrapper,
.ffw-custom-post .limit-wrapper.vamtam-box-outer-padding {
	max-width: none;
	padding: 0;
	margin: 0;
}

.ffw-post-page,
.ffw-post-page *,
.ffw-post-page *::before,
.ffw-post-page *::after {
	box-sizing: border-box;
}

.ffw-post-page {
	max-width: 1360px;
	margin: 0 auto;
	padding: 0 clamp(20px, 5vw, 48px) clamp(56px, 8vw, 104px);
	color: var(--ffw-body);
}

/* ---------- Breadcrumb ---------- */

.ffw-post-crumbs {
	padding: clamp(18px, 3vw, 28px) 0 0;
	color: var(--ffw-muted);
	font-size: 13px;
	letter-spacing: .01em;
}

.ffw-post-crumbs p {
	margin: 0;
}

.ffw-post-crumbs a {
	color: var(--ffw-muted) !important;
	text-decoration: none !important;
	transition: color .2s ease;
}

.ffw-post-crumbs a:hover,
.ffw-post-crumbs a:focus-visible {
	color: var(--ffw-ink) !important;
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

/* The page you are on carries the weight; the trail behind it stays quiet. */
.ffw-post-crumbs .last {
	color: var(--ffw-ink);
	font-weight: 500;
}

.ffw-post-crumbs .separator {
	margin: 0 10px;
	opacity: .4;
}

/* ---------- Header ---------- */

.ffw-post-header {
	padding: clamp(22px, 4vw, 34px) 0 clamp(30px, 4vw, 46px);
}

/* Title column on the left, featured image on the right. */
.ffw-post-header.has-media {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(28px, 4vw, 56px);
	align-items: center;
}

.ffw-post-title {
	margin: 0 !important;
	color: var(--ffw-ink) !important;
	font-size: clamp(28px, 4vw, 44px) !important;
	font-weight: 500 !important;
	letter-spacing: -.03em !important;
	line-height: 1.15 !important;
	text-transform: none !important;
}

.ffw-post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 18px;
	align-items: center;
	margin-top: 20px;
	color: var(--ffw-muted);
	font-size: 13px;
}

.ffw-post-author {
	display: inline-flex;
	gap: 10px;
	align-items: center;
}

.ffw-post-author .ffw-post-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

.ffw-post-author-name {
	color: var(--ffw-ink);
	font-weight: 600;
}

.ffw-post-meta-item {
	display: inline-flex;
	gap: 10px;
	align-items: center;
}

.ffw-post-meta-item::before {
	content: "";
	display: inline-block;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	opacity: .45;
}

.ffw-post-updated {
	font-style: italic;
}

/* ---------- Hero ---------- */

.ffw-post-hero {
	overflow: hidden;
	margin: 0;
	border-radius: 14px;
	background: var(--ffw-sand);
	aspect-ratio: 3 / 2;
}

.ffw-post-hero .ffw-post-hero-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- Layout ---------- */

.ffw-post-layout {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

/* Fills its column so the text lines up with the right edge of the header image. */
.ffw-post-body {
	max-width: none;
}

/* ---------- Share rail ---------- */

.ffw-post-share {
	position: sticky;
	top: 96px;
}

.admin-bar .ffw-post-share {
	top: 128px;
}

.ffw-post-share-label {
	margin: 0 0 14px;
	color: var(--ffw-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
}

.ffw-post-share-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ffw-post-page .ffw-post-share-btn {
	display: inline-flex;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--ffw-line);
	border-radius: 50%;
	background: var(--ffw-white);
	color: var(--ffw-ink) !important;
	cursor: pointer;
	min-height: 0;
	min-width: 0;
	box-shadow: none;
	font-size: 0;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none !important;
	transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.ffw-post-page .ffw-post-share-btn:hover,
.ffw-post-page .ffw-post-share-btn:focus-visible {
	border-color: var(--ffw-ink);
	background: var(--ffw-ink);
	color: var(--ffw-white) !important;
}

.ffw-post-page .ffw-post-share-btn.is-copied {
	border-color: var(--ffw-ink);
	background: var(--ffw-ink);
	color: var(--ffw-white) !important;
}

.ffw-post-share-icon {
	flex: 0 0 auto;
}

/* ---------- Contents box ---------- */

.ffw-post-toc {
	margin: 0 0 clamp(28px, 4vw, 40px);
	padding: clamp(18px, 3vw, 26px) clamp(20px, 3vw, 28px);
	border: 1px solid var(--ffw-line);
	border-radius: 12px;
	background: var(--ffw-soft);
}

/* A plain button on desktop, the accordion handle on phones. The two-class selector
   and the resets below keep Elementor's global button styling off it. */
.ffw-post-page .ffw-post-toc-title {
	display: flex;
	box-sizing: border-box;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--ffw-ink) !important;
	cursor: default;
	min-height: 0;
	box-shadow: none;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -.01em;
	line-height: 1.3;
	text-align: left;
	text-transform: none;
}

.ffw-post-toc-title::after {
	content: "";
	display: none;
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	margin-left: 12px;
	border-right: 1.5px solid var(--ffw-muted);
	border-bottom: 1.5px solid var(--ffw-muted);
	transform: rotate(-135deg) translate(-2px, -2px);
	transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}

/* 0fr to 1fr animates to the list's natural height without measuring it in script. */
.ffw-post-toc-panel {
	display: grid;
	grid-template-rows: 1fr;
}

.ffw-post-toc.is-ready .ffw-post-toc-panel {
	transition: grid-template-rows .45s cubic-bezier(.22, 1, .36, 1);
}

.ffw-post-toc-panel > * {
	overflow: hidden;
	min-height: 0;
}

.ffw-post-toc-list {
	margin: 0;
	padding: 18px 0 0 20px;
	counter-reset: none;
}

.ffw-post-toc-list.is-plain {
	padding-left: 0;
	list-style: none;
}

.ffw-post-toc-item {
	margin: 0 0 10px;
	color: var(--ffw-muted);
	font-size: 14px;
	line-height: 1.5;
}

.ffw-post-toc-item:last-child {
	margin-bottom: 0;
}

.ffw-post-toc-item.is-nested {
	margin-left: 14px;
	font-size: 13px;
}

.ffw-post-toc-item a {
	color: var(--ffw-body) !important;
	text-decoration: none !important;
}

.ffw-post-toc-item a:hover,
.ffw-post-toc-item a:focus-visible {
	color: var(--ffw-ink) !important;
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

.ffw-post-toc-item.is-active > a {
	color: var(--ffw-ink) !important;
	font-weight: 600;
}

/* ---------- Article content ---------- */

.ffw-post-content {
	font-size: clamp(17px, 1.35vw, 19px);
	line-height: 1.7;
}

.ffw-post-content > *:first-child {
	margin-top: 0;
}

.ffw-post-content p {
	margin: 0 0 22px;
}

.ffw-post-content h2,
.ffw-post-content h3,
.ffw-post-content h4 {
	color: var(--ffw-ink) !important;
	font-weight: 500 !important;
	letter-spacing: -.02em !important;
	text-transform: none !important;
	scroll-margin-top: 110px;
}

.ffw-post-content h2 {
	margin: 44px 0 16px !important;
	font-size: clamp(22px, 2.6vw, 28px) !important;
	line-height: 1.25 !important;
}

.ffw-post-content h3 {
	margin: 36px 0 14px !important;
	font-size: clamp(19px, 2.2vw, 22px) !important;
	line-height: 1.3 !important;
}

.ffw-post-content h4 {
	margin: 28px 0 12px !important;
	font-size: 17px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
}

/* Links carry their own colour rather than extra weight, so a paragraph full of
   them still reads as one even line of text. */
.ffw-post-content a {
	color: var(--ffw-link) !important;
	font-weight: inherit !important;
	text-decoration: none !important;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color .2s ease;
}

/* No rule at rest, but the underline comes back on hover and on keyboard focus so a
   link is still identifiable to anyone not going by colour alone. */
.ffw-post-content a:hover,
.ffw-post-content a:focus-visible {
	color: #55310f !important;
	text-decoration: underline !important;
}

/* The editor wraps some link text in <mark> or a coloured span, which would otherwise
   paint its own colour straight over the link. */
.ffw-post-content a mark,
.ffw-post-content a span[style*="color"],
.ffw-post-content a font {
	color: inherit !important;
	text-decoration: inherit !important;
	background-color: transparent !important;
}

.ffw-post-content ul,
.ffw-post-content ol {
	margin: 0 0 22px;
	padding-left: 22px;
}

.ffw-post-content li {
	margin-bottom: 10px;
}

.ffw-post-content img {
	border-radius: 10px;
}

.ffw-post-content figure {
	margin: 32px 0;
}

.ffw-post-content figcaption {
	margin-top: 10px;
	color: var(--ffw-muted);
	font-size: 13px;
	text-align: center;
}

.ffw-post-content blockquote {
	margin: 32px 0;
	padding: 4px 0 4px 22px;
	border-left: 2px solid var(--ffw-ink);
	color: var(--ffw-ink);
	font-size: 18px;
	font-style: normal;
	line-height: 1.6;
}

.ffw-post-content blockquote p:last-child {
	margin-bottom: 0;
}

.ffw-post-content .wp-block-table,
.ffw-post-content .wp-block-embed {
	overflow-x: auto;
}

.ffw-post-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.ffw-post-content th,
.ffw-post-content td {
	padding: 12px 14px;
	border: 1px solid var(--ffw-line);
	text-align: left;
}

.ffw-post-content th {
	background: var(--ffw-soft);
	color: var(--ffw-ink);
	font-weight: 600;
}

.ffw-post-content hr {
	margin: 40px 0;
	border: 0;
	border-top: 1px solid var(--ffw-line);
}

/* ---------- Footer link ---------- */

.ffw-post-footer {
	margin-top: clamp(36px, 5vw, 52px);
	padding-top: 24px;
	border-top: 1px solid var(--ffw-line);
}

.ffw-post-back {
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 0 22px;
	border: 1px solid var(--ffw-line);
	border-radius: 999px;
	color: var(--ffw-ink) !important;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-decoration: none !important;
	text-transform: uppercase;
	transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.ffw-post-back:hover,
.ffw-post-back:focus-visible {
	border-color: var(--ffw-ink);
	background: var(--ffw-ink);
	color: var(--ffw-white) !important;
}

/* ---------- Related ---------- */

.ffw-post-related {
	margin-top: clamp(56px, 8vw, 88px);
	padding-top: clamp(36px, 5vw, 48px);
	border-top: 1px solid var(--ffw-line);
}

.ffw-post-related-title {
	margin: 0 0 clamp(24px, 3vw, 32px) !important;
	color: var(--ffw-ink) !important;
	font-size: clamp(20px, 2.4vw, 26px) !important;
	font-weight: 500 !important;
	letter-spacing: -.02em !important;
	text-transform: none !important;
}

.ffw-post-related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px 24px;
}

.ffw-post-card-media {
	display: block;
	overflow: hidden;
	border-radius: 8px;
	background: var(--ffw-sand);
	aspect-ratio: 4 / 3;
}

.ffw-post-card-media .ffw-post-card-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}

.ffw-post-card:hover .ffw-post-card-image {
	transform: scale(1.04);
}

.ffw-post-card-body {
	padding-top: 14px;
}

.ffw-post-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0 0 8px;
	color: var(--ffw-muted);
	font-size: 12px;
}

.ffw-post-card-meta > * + *::before {
	content: "";
	display: inline-block;
	width: 3px;
	height: 3px;
	margin-right: 8px;
	border-radius: 50%;
	background: currentColor;
	opacity: .45;
	vertical-align: middle;
}

.ffw-post-card-cat {
	color: var(--ffw-ink);
	font-weight: 600;
}

.ffw-post-card-title {
	margin: 0 !important;
	font-size: 17px !important;
	font-weight: 500 !important;
	letter-spacing: -.01em !important;
	line-height: 1.35 !important;
	text-transform: none !important;
}

.ffw-post-card-title a {
	color: var(--ffw-ink) !important;
	text-decoration: none !important;
}

.ffw-post-card-title a:hover,
.ffw-post-card-title a:focus-visible {
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

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

.ffw-post-comments {
	max-width: none;
	margin: clamp(48px, 7vw, 72px) 0 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	/* The contents box becomes an accordion here, closed until it is asked for. */
	.ffw-post-page .ffw-post-toc-title {
		cursor: pointer;
	}

	.ffw-post-toc-title::after {
		display: block;
	}

	.ffw-post-toc:not(.is-open) .ffw-post-toc-panel {
		grid-template-rows: 0fr;
	}

	.ffw-post-toc:not(.is-open) .ffw-post-toc-title::after {
		transform: rotate(45deg) translate(-2px, -2px);
	}

	.ffw-post-header.has-media {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.ffw-post-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 26px;
	}

	.ffw-post-body {
		max-width: none;
	}

	.ffw-post-share {
		position: static;
		display: flex;
		flex-wrap: wrap;
		gap: 12px;
		align-items: center;
		padding-bottom: 22px;
		border-bottom: 1px solid var(--ffw-line);
	}

	.ffw-post-share-label {
		margin: 0;
	}

	.ffw-post-share-list {
		flex-direction: row;
	}

	.ffw-post-related-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	/* The h1 repeats immediately below, so the trail stops at the category. */
	.ffw-post-crumbs .last,
	.ffw-post-crumbs .separator:nth-last-of-type(2) {
		display: none;
	}

	.ffw-post-title {
		max-width: none;
	}

	.ffw-post-hero {
		border-radius: 10px;
		aspect-ratio: 4 / 3;
	}

	.ffw-post-related-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ffw-post-card-image,
	.ffw-post-toc-title::after {
		transition: none;
	}

	.ffw-post-card:hover .ffw-post-card-image {
		transform: none;
	}
}
