/*
 * Stirred By Grace - post extras (single posts + devotionals).
 * Quote callout (core/pullquote), "In this post" box, Pinterest Save pill.
 * Loaded by wp-content/novamira-sandbox/sbg-post-extras.php, also in the
 * block editor so the callout previews while editing.
 * See claude/post-extras.md.
 */

body.sbg-post,
.editor-styles-wrapper {
	--px-paper: #F7F3EA;
	--px-cream: #F1EDE3;
	--px-olive: #4B5A2E;
	--px-sage: #6B7550;
	--px-ink: #211E19;
	--px-soft: #5A554B;
	--px-stone: #D9D2C1;
	--px-head: "Bricolage Grotesque", sans-serif;
	--px-quote: "Cormorant Garamond", Georgia, serif;
	--px-sprig: url("/wp-content/uploads/sbg-flair/sprig.svg");
}

/* =====================================================================
   1. Quote callout - the Pullquote block
   ===================================================================== */

body.sbg-post .entry-content .wp-block-pullquote,
.editor-styles-wrapper .wp-block-pullquote {
	position: relative;
	max-width: 680px;
	margin: 48px auto !important;
	padding: 52px 40px 36px !important;
	border: 1px solid var(--px-stone) !important;
	border-radius: 18px;
	background: var(--px-paper);
	text-align: center;
	color: var(--px-ink);
}

/* Sprig sitting on the top edge. */
body.sbg-post .entry-content .wp-block-pullquote::before,
.editor-styles-wrapper .wp-block-pullquote::before {
	content: "";
	position: absolute;
	top: -15px;
	left: 50%;
	width: 64px;
	height: 30px;
	margin-left: -32px;
	background: var(--px-paper);
	box-shadow: 0 0 0 6px var(--px-paper);
	-webkit-mask: none;
}
body.sbg-post .entry-content .wp-block-pullquote::after,
.editor-styles-wrapper .wp-block-pullquote::after {
	content: "";
	position: absolute;
	top: -13px;
	left: 50%;
	width: 56px;
	height: 26px;
	margin-left: -28px;
	background-color: var(--px-sage);
	-webkit-mask: var(--px-sprig) no-repeat center / contain;
	mask: var(--px-sprig) no-repeat center / contain;
}

body.sbg-post .entry-content .wp-block-pullquote blockquote,
.editor-styles-wrapper .wp-block-pullquote blockquote {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
}
body.sbg-post .entry-content .wp-block-pullquote blockquote::before,
.editor-styles-wrapper .wp-block-pullquote blockquote::before { content: none !important; }

body.sbg-post .entry-content .wp-block-pullquote p,
.editor-styles-wrapper .wp-block-pullquote p {
	margin: 0 !important;
	font-family: var(--px-quote) !important;
	font-style: italic;
	font-weight: 500;
	font-size: clamp(24px, 2.6vw, 30px) !important;
	line-height: 1.32 !important;
	letter-spacing: 0;
	color: var(--px-ink);
}

/* Sage rule between the words and the name. */
body.sbg-post .entry-content .wp-block-pullquote cite,
.editor-styles-wrapper .wp-block-pullquote cite {
	display: block;
	margin-top: 22px;
	font-family: var(--px-head);
	font-style: normal;
	font-size: 12px !important;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--px-sage);
}
body.sbg-post .entry-content .wp-block-pullquote cite::before,
.editor-styles-wrapper .wp-block-pullquote cite::before {
	content: "";
	display: block;
	width: 44px;
	height: 2px;
	margin: 0 auto 14px;
	border-radius: 2px;
	background: var(--px-sage);
	opacity: .55;
}
body.sbg-post .entry-content .wp-block-pullquote cite:empty,
.editor-styles-wrapper .wp-block-pullquote cite:empty { display: none; }

@media (max-width: 767px) {
	body.sbg-post .entry-content .wp-block-pullquote {
		margin: 40px 0 !important;
		padding: 44px 22px 28px !important;
	}
	body.sbg-post .entry-content .wp-block-pullquote p { font-size: 23px !important; }
}

/* =====================================================================
   2. "In this post"
   ===================================================================== */

body.sbg-post .sbg-toc {
	max-width: 680px;
	margin: 32px auto 40px;
	padding: 24px 28px 14px;
	border: 1px solid var(--px-stone);
	border-radius: 18px;
	background: var(--px-paper);
}

body.sbg-post .sbg-toc__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px !important;
	font-family: var(--px-head);
	font-size: 12px !important;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--px-sage);
}
body.sbg-post .sbg-toc__title::before {
	content: "";
	width: 26px;
	height: 14px;
	background-color: var(--px-sage);
	-webkit-mask: var(--px-sprig) no-repeat center / contain;
	mask: var(--px-sprig) no-repeat center / contain;
}

body.sbg-post .sbg-toc__list {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

body.sbg-post .sbg-toc__item {
	margin: 0 !important;
	padding: 0 !important;
	border-top: 1px solid var(--px-stone);
}
body.sbg-post .sbg-toc__item:first-child { border-top: 0; }
body.sbg-post .sbg-toc__item::marker { content: none; }

body.sbg-post .sbg-toc__item a {
	display: flex;
	align-items: baseline;
	gap: 14px;
	padding: 12px 0;
	color: var(--px-ink) !important;
	text-decoration: none !important;
	font-family: var(--px-head);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.35;
}

body.sbg-post .sbg-toc__num {
	flex: 0 0 auto;
	min-width: 26px;
	font-family: var(--px-quote);
	font-style: italic;
	font-size: 20px;
	color: var(--px-olive);
}

body.sbg-post .sbg-toc__label { flex: 1 1 auto; }

body.sbg-post .sbg-toc__arrow {
	flex: 0 0 auto;
	align-self: center;
	width: 16px;
	height: 16px;
	background-color: var(--px-olive);
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M8 3v10M3.5 8.5 8 13l4.5-4.5'/></svg>") no-repeat center / contain;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M8 3v10M3.5 8.5 8 13l4.5-4.5'/></svg>") no-repeat center / contain;
	opacity: .45;
	transition: transform .25s ease, opacity .25s ease;
}

body.sbg-post .sbg-toc__item a:hover .sbg-toc__label,
body.sbg-post .sbg-toc__item a:focus-visible .sbg-toc__label {
	color: var(--px-olive);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}
body.sbg-post .sbg-toc__item a:hover .sbg-toc__arrow,
body.sbg-post .sbg-toc__item a:focus-visible .sbg-toc__arrow {
	opacity: 1;
	transform: translateY(2px);
}

/* The recipe row is the strong exit. */
body.sbg-post .sbg-toc__item--recipe a {
	margin: 4px 0 10px;
	padding: 11px 18px;
	justify-content: space-between;
	border-radius: 999px;
	background: var(--px-olive);
	color: var(--px-cream) !important;
	font-weight: 600;
	font-size: 15px;
}
body.sbg-post .sbg-toc__item--recipe { border-top: 0; padding-top: 6px !important; }
body.sbg-post .sbg-toc__item--recipe .sbg-toc__arrow { background-color: var(--px-cream); opacity: .9; }
body.sbg-post .sbg-toc__item--recipe a:hover .sbg-toc__label { color: var(--px-cream); text-decoration: none; }
body.sbg-post .sbg-toc__item--recipe a:hover { background: #3E4B25; }

/* Section headings land below the header, not under it. */
body.sbg-post .entry-content h2[id],
body.sbg-post .wprm-recipe-container { scroll-margin-top: 96px; }

@media (max-width: 767px) {
	body.sbg-post .sbg-toc { margin: 24px 0 32px; padding: 20px 18px 10px; }
	body.sbg-post .sbg-toc__item a { font-size: 16px; gap: 12px; }
}

/* =====================================================================
   3. Pinterest Save pill
   ===================================================================== */

.sbg-pin-host { position: relative; }

.sbg-pin-save {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3;
	display: inline-flex !important;
	flex-direction: row !important;
	align-items: center;
	white-space: nowrap;
	gap: 7px;
	height: 36px;
	padding: 0 14px 0 9px;
	border-radius: 999px;
	background: #FFFFFF;
	border: 1px solid rgba(33, 30, 25, .08);
	color: #211E19 !important;
	font-family: "Bricolage Grotesque", sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity .2s ease, transform .2s ease;
}
.sbg-pin-save span { display: inline !important; }
.sbg-pin-save img {
	display: inline-block !important;
	width: 20px !important;
	height: 20px !important;
	margin: 0 !important;
	border-radius: 0 !important;
}

.sbg-pin-host:hover .sbg-pin-save,
.sbg-pin-save:focus-visible {
	opacity: 1;
	transform: none;
}
.sbg-pin-save:focus-visible { outline: 2px solid #4B5A2E; outline-offset: 2px; }

/* Touch screens have no hover: always show it, a little smaller. */
@media (hover: none) {
	.sbg-pin-save {
		opacity: 1;
		transform: none;
		top: 10px;
		left: 10px;
		height: 32px;
		padding: 0 12px 0 7px;
		font-size: 13px;
	}
	.sbg-pin-save img { width: 18px !important; height: 18px !important; }
}

/* The tall pin image is for Pinterest only. */
.sbg-pin-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.sbg-pin-save,
	body.sbg-post .sbg-toc__arrow { transition: none; }
}