/*
Theme Name: Serenity Press
Theme URI: https://theserenitypress.com
Author: Serenity Press
Author URI: https://theserenitypress.com
Description: A 12-step oriented recovery publication and WooCommerce store. Editorial content by CBT practitioners, recovery coaches, and people in long-term sobriety. Books, journals, workbooks, and recovery gifts. For addicts, alcoholics, and anyone in a 12-step program.
Version: 0.0.3.4.2
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: serenity-press
Tags: blog, e-commerce, full-site-editing, block-patterns, woocommerce, editorial, wide-blocks, flexible-header, custom-colors, custom-typography
*/

/* ==========================================================================
   Base resets
   ========================================================================== */

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

body {
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--primary-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var(--wp--preset--color--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ==========================================================================
   Skip link
   ========================================================================== */

.skip-link {
	position: absolute;
	top: -100%;
	left: 1rem;
	padding: 0.5rem 1.5rem;
	background: var(--wp--preset--color--accent);
	color: #fff;
	border-radius: 100px;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	z-index: 9999;
	text-decoration: none;
	transition: top 0.1s;
}

.skip-link:focus {
	top: 0.5rem;
}

/* ==========================================================================
   Site header
   ========================================================================== */

.site-header {
	z-index: 100;
	box-shadow: 0 1px 0 var(--wp--preset--color--border);
}

.site-header .wp-block-image a,
.site-header .wp-block-site-title a {
	text-decoration: none;
}

.site-header .wp-block-navigation a {
	text-decoration: none;
	transition: color 0.15s ease;
}

.site-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--accent);
}

.site-header .wp-block-search__input {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 100px;
	padding: 0.35rem 1rem;
	font-size: var(--wp--preset--font-size--sm);
	background: var(--wp--preset--color--muted-surface);
	transition: border-color 0.15s ease;
	min-width: 0;
}

.site-header .wp-block-search__input:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px rgba(26, 189, 212, 0.15);
}

.site-header .wp-block-search__button {
	border-radius: 100px;
	background: var(--wp--preset--color--accent);
	color: #fff;
	border: none;
	padding: 0.35rem 0.85rem;
}

.header-account-link {
	font-size: 1.1rem;
	text-decoration: none;
	opacity: 0.6;
	transition: opacity 0.15s ease;
	line-height: 1;
}

.header-account-link:hover {
	opacity: 1;
}

/* ==========================================================================
   Global pill buttons
   ========================================================================== */

.wp-block-button__link,
.wp-element-button {
	border-radius: 100px !important;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
}

/* ==========================================================================
   Pill chip component  (.sp-chip)
   ========================================================================== */

.sp-chip {
	display: inline-block;
	padding: 0.3em 1em;
	border-radius: 100px;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.5;
	background: var(--wp--preset--color--muted-surface);
	color: var(--wp--preset--color--primary-text);
	border: 1px solid var(--wp--preset--color--border);
	cursor: default;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sp-chip a {
	color: inherit;
	text-decoration: none;
}

.sp-chip:hover,
.sp-chip a:hover {
	background: var(--wp--preset--color--accent);
	color: #fff;
	border-color: var(--wp--preset--color--accent);
}

.sp-chip--sm {
	font-size: 0.72rem;
	padding: 0.22em 0.85em;
}

.sp-chip--teal {
	background: var(--wp--preset--color--accent-light);
	color: #0A7A8F;
	border-color: #A8E4EE;
}

.sp-chip--teal:hover,
.sp-chip--teal a:hover {
	background: var(--wp--preset--color--accent);
	color: #fff;
	border-color: var(--wp--preset--color--accent);
}

.sp-chip--filled {
	background: var(--wp--preset--color--accent);
	color: #fff;
	border-color: var(--wp--preset--color--accent);
}

.sp-chip--filled a { color: #fff; }

/* ==========================================================================
   Specialty tag pills  (.sp-tag)
   ========================================================================== */

.sp-tag {
	display: inline-block;
	padding: 0.28em 0.9em;
	border-radius: 100px;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.5;
	background: var(--wp--preset--color--accent-light);
	color: #0A7A8F;
	border: 1px solid #A8E4EE;
}

/* ==========================================================================
   Topic chips section
   ========================================================================== */

.topic-chips-section {
	width: 100%;
}

/* ==========================================================================
   Equal-height article grid
   ========================================================================== */

.equal-height-grid > li,
.wp-block-post-template.equal-height-grid > li {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.article-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
	box-shadow: 0 8px 28px rgba(43, 48, 56, 0.1);
	transform: translateY(-3px);
}

.article-card .wp-block-post-featured-image img {
	transition: transform 0.3s ease;
	width: 100%;
	object-fit: cover;
}

.article-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

.article-card .wp-block-post-title a {
	text-decoration: none;
}

.article-card .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent);
}

.article-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.article-card__body .wp-block-post-date {
	margin-top: auto;
}

/* ==========================================================================
   Featured post card (blog index + archives)
   ========================================================================== */

.featured-post-card {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	border-radius: 20px;
	overflow: hidden;
}

.featured-post-card .wp-block-post-featured-image {
	flex: 0 0 50%;
	min-width: 260px;
}

.featured-post-card .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 20px 0 0 20px;
}

.featured-post-body {
	flex: 1;
	min-width: 260px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

@media (max-width: 680px) {
	.featured-post-card .wp-block-post-featured-image {
		flex: 0 0 100%;
		min-width: unset;
	}

	.featured-post-card .wp-block-post-featured-image img {
		border-radius: 20px 20px 0 0;
		height: 220px;
	}

	.featured-post-body {
		min-width: unset;
	}
}

/* ==========================================================================
   Discovery grid overlay card
   ========================================================================== */

.discovery-card {
	position: relative;
	border-radius: 20px;
	overflow: hidden;
	min-height: 460px;
}

.discovery-card .wp-block-post-featured-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.discovery-card .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 20px;
}

.discovery-card__overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(27, 32, 40, 0.92) 0%, rgba(27, 32, 40, 0.55) 55%, transparent 100%);
	border-radius: 0 0 20px 20px;
	padding: 2rem;
}

.discovery-card__overlay .wp-block-post-title a {
	color: #fff;
	text-decoration: none;
}

.discovery-card__overlay .wp-block-post-excerpt p {
	color: rgba(255, 255, 255, 0.75);
	margin-bottom: 1rem;
}

/* ==========================================================================
   Author spotlight
   ========================================================================== */

.author-circle-photo,
.author-circle-photo img {
	border-radius: 50% !important;
	object-fit: cover;
}

.author-photo-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ==========================================================================
   Notable works book cards
   ========================================================================== */

.notable-works-row {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.notable-works-row::-webkit-scrollbar {
	display: none;
}

.book-card {
	flex-shrink: 0;
	min-width: 220px;
	max-width: 280px;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.book-card:hover {
	box-shadow: 0 8px 24px rgba(43, 48, 56, 0.1);
	transform: translateY(-2px);
}

/* ==========================================================================
   Author cards (homepage featured authors)
   ========================================================================== */

.author-card-v2 {
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	text-align: center;
}

.author-card-v2:hover {
	box-shadow: 0 12px 32px rgba(43, 48, 56, 0.1);
	transform: translateY(-3px);
}

/* ==========================================================================
   Authors page profile rows
   ========================================================================== */

.author-profile-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--50);
}

.author-profile-photo-col {
	flex: 0 0 200px;
	text-align: center;
}

@media (max-width: 640px) {
	.author-profile-row {
		flex-direction: column;
	}

	.author-profile-photo-col {
		flex: unset;
		width: 100%;
	}
}

/* ==========================================================================
   Archive header
   ========================================================================== */

.archive-header .wp-block-query-title,
.archive-header h1 {
	color: #fff !important;
}

.archive-header .wp-block-term-description p {
	color: rgba(255, 255, 255, 0.8);
	margin: 0;
}

/* ==========================================================================
   Product cards
   ========================================================================== */

.product-card {
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	overflow: hidden;
	border-radius: 16px;
	display: flex;
	flex-direction: column;
}

.product-card:hover {
	box-shadow: 0 8px 28px rgba(43, 48, 56, 0.1);
	transform: translateY(-3px);
}

.product-card .wp-block-woocommerce-product-image,
.product-card .wp-block-post-featured-image {
	width: 100%;
	display: block;
	flex-shrink: 0;
}

.product-card .wp-block-woocommerce-product-image img,
.product-card .wp-block-post-featured-image img {
	width: 100%;
	display: block;
	object-fit: cover;
}

.product-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.product-card .wp-block-post-title a {
	text-decoration: none;
}

.product-card .wp-block-button {
	width: 100%;
	margin-top: auto;
}

.product-card .wp-block-button__link {
	width: 100%;
	text-align: center;
	justify-content: center;
}

/* ==========================================================================
   Category cards (shop)
   ========================================================================== */

.category-card {
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	border-radius: 16px;
}

.category-card:hover {
	box-shadow: 0 8px 28px rgba(43, 48, 56, 0.1);
	transform: translateY(-2px);
}

/* ==========================================================================
   Shop archive
   ========================================================================== */

.shop-archive-hero {
	width: 100%;
}

@media (max-width: 900px) {
	.shop-product-grid .wp-block-woocommerce-product-collection {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 560px) {
	.shop-product-grid .wp-block-woocommerce-product-collection {
		grid-template-columns: 1fr !important;
	}
}

/* ==========================================================================
   My Account page
   ========================================================================== */

.account-nav-link {
	display: block;
	padding: 0.5em 0.85em;
	border-radius: 10px;
	color: var(--wp--preset--color--primary-text);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	transition: background 0.15s ease, color 0.15s ease;
}

.account-nav-link:hover {
	background: var(--wp--preset--color--muted-surface);
	color: var(--wp--preset--color--accent);
}

.account-nav-link--logout {
	color: var(--wp--preset--color--secondary-text);
	font-weight: 400;
}

.account-content-area .woocommerce-MyAccount-navigation {
	display: none;
}

.account-content-area .woocommerce {
	width: 100%;
}

/* ==========================================================================
   Single article
   ========================================================================== */

.article-content-body {
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.8;
	color: var(--wp--preset--color--primary-text);
}

.article-content-body h2,
.article-content-body h3 {
	font-family: var(--wp--preset--font-family--serif);
	margin-top: 2em;
	margin-bottom: 0.65em;
}

.article-content-body p {
	margin-bottom: 1.4em;
}

.article-content-body a {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.article-content-body blockquote {
	border-left: 3px solid var(--wp--preset--color--accent);
	padding-left: 1.25rem;
	margin-left: 0;
	color: var(--wp--preset--color--secondary-text);
	font-style: italic;
}

/* ==========================================================================
   Editorial callout (inline product/article cross-links)
   ========================================================================== */

.editorial-callout {
	border-left: 3px solid var(--wp--preset--color--accent);
	border-radius: 0 12px 12px 0;
	transition: box-shadow 0.2s ease;
}

.editorial-callout:hover {
	box-shadow: 0 4px 16px rgba(26, 189, 212, 0.12);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	width: 100%;
}

.site-footer a {
	text-decoration: none;
	transition: color 0.15s ease;
}

.site-footer a:hover {
	color: var(--wp--preset--color--accent) !important;
}

.site-footer .wp-block-navigation a {
	color: rgba(255, 255, 255, 0.65);
	text-decoration: none;
}

.site-footer .wp-block-navigation a:hover {
	color: var(--wp--preset--color--accent) !important;
}

.site-footer .wp-block-separator {
	border: none;
}

/* ==========================================================================
   Footer CTA pre-footer band
   ========================================================================== */

.footer-cta-band {
	width: 100%;
}

/* ==========================================================================
   Read more link button
   ========================================================================== */

.wp-block-read-more {
	display: inline-block;
	padding: 0.35em 1.1em;
	border-radius: 100px;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

/* ==========================================================================
   Responsive: navigation mobile
   ========================================================================== */

@media (max-width: 768px) {
	.site-header .wp-block-navigation__responsive-container-open {
		display: flex;
	}
}

/* ==========================================================================
   Accessibility helpers
   ========================================================================== */

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* ==========================================================================
   0.0.3.1 additions
   ========================================================================== */

/* ------------------------------------------------------------------
   Enforce equal-height cards across all query loop grids
   ------------------------------------------------------------------ */

/* Grid items stretch to fill row height */
.wp-block-post-template {
	align-items: stretch !important;
}

.wp-block-post-template > li {
	display: flex !important;
	flex-direction: column !important;
	height: 100% !important;
}

/* Cards fill the li */
.article-card,
.product-card,
.category-card,
.author-card-v2,
.book-card {
	height: 100%;
	flex: 1 1 auto;
}

/* Card body pushes date/price to bottom */
.article-card__body,
.product-card__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.article-card__body .wp-block-post-date,
.article-card__body .wp-block-post-terms,
.product-card__body .wp-block-woocommerce-product-price {
	margin-top: auto;
}

/* WooCommerce columns grid — equal height */
ul.products.columns-3,
ul.products.columns-4 {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
	align-items: stretch !important;
}

ul.products.columns-3 > li,
ul.products.columns-4 > li {
	height: 100% !important;
	display: flex !important;
	flex-direction: column !important;
}

/* ------------------------------------------------------------------
   Breadcrumbs — styled teal bar on product pages
   ------------------------------------------------------------------ */

.site-main.single-product .woocommerce-breadcrumb,
.breadcrumb-bar .wp-block-woocommerce-breadcrumbs {
	font-size: var(--wp--preset--font-size--xs);
	color: rgba(255, 255, 255, 0.75);
}

.breadcrumb-bar {
	background-color: var(--wp--preset--color--accent);
}

.breadcrumb-bar .woocommerce-breadcrumb {
	color: rgba(255, 255, 255, 0.75);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
}

.breadcrumb-bar .woocommerce-breadcrumb a {
	color: rgba(255, 255, 255, 0.85);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.15s ease;
}

.breadcrumb-bar .woocommerce-breadcrumb a:hover {
	color: #fff;
}

/* Breadcrumb separator */
.breadcrumb-bar .woocommerce-breadcrumb .breadcrumb-separator,
.breadcrumb-bar .woocommerce-breadcrumb::before {
	color: rgba(255, 255, 255, 0.45);
}

/* ------------------------------------------------------------------
   Return to top button
   ------------------------------------------------------------------ */

.sp-return-top {
	position: fixed;
	bottom: 2rem;
	right: 1.75rem;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.15s ease;
	box-shadow: 0 2px 12px rgba(26, 189, 212, 0.35);
}

.sp-return-top:hover {
	background: var(--wp--preset--color--accent-dark);
}

.sp-return-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.sp-return-top svg {
	width: 18px;
	height: 18px;
	stroke: #fff;
	fill: none;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ------------------------------------------------------------------
   Newsletter — teal background (replaces dark footer-bg)
   ------------------------------------------------------------------ */

.homepage-newsletter {
	background-color: var(--wp--preset--color--accent-dark) !important;
}

/* Ensure the newsletter CTA sits flush at bottom of page content — no gap */
.front-page .homepage-newsletter {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------
   Footer — smaller logo, more top breathing room
   ------------------------------------------------------------------ */

.site-footer .wp-block-image img {
	max-width: 90px !important;
	width: 90px !important;
	height: auto !important;
}

/* ------------------------------------------------------------------
   Footer navigation — style to match header weight
   ------------------------------------------------------------------ */

.site-footer .wp-block-navigation .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--sm);
	color: rgba(255, 255, 255, 0.6);
	padding: 0;
}

.site-footer .wp-block-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--accent);
}

/* ------------------------------------------------------------------
   CTA cards with images — editorial callout image treatment
   ------------------------------------------------------------------ */

.editorial-callout-card {
	overflow: hidden;
	border-radius: 16px;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.editorial-callout-card:hover {
	box-shadow: 0 8px 28px rgba(43, 48, 56, 0.1);
	transform: translateY(-3px);
}

.editorial-callout-card .wp-block-image {
	display: block;
	width: 100%;
}

.editorial-callout-card .wp-block-image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

/* ==========================================================================
   0.0.3.2 — Blog sidebar filter system
   ========================================================================== */

/* Two-column blog layout */
.blog-sidebar-layout {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--60);
}

.sp-filter-sidebar {
	flex: 0 0 260px;
	min-width: 220px;
	position: sticky;
	top: 88px;
}

.blog-content-col {
	flex: 1 1 0;
	min-width: 0;
}

@media (max-width: 900px) {
	.sp-filter-sidebar {
		flex: 0 0 100%;
		position: static;
	}
}

/* Sidebar header */
.sp-filter-sidebar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.sp-filter-sidebar__title {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--wp--preset--color--accent);
}

.sp-filter-clear {
	font-size: 0.75rem;
	color: var(--wp--preset--color--secondary-text);
	text-decoration: none;
	padding: 3px 10px;
	border-radius: 100px;
	border: 1px solid var(--wp--preset--color--border);
	transition: all 0.15s ease;
}

.sp-filter-clear:hover {
	background: var(--wp--preset--color--accent);
	color: #fff;
	border-color: var(--wp--preset--color--accent);
}

/* Active filter pills */
.sp-filter-active {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 1rem;
}

.sp-filter-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 100px;
	font-size: 0.72rem;
	font-weight: 600;
	background: var(--wp--preset--color--accent);
	color: #fff;
}

.sp-filter-pill__remove {
	color: rgba(255,255,255,0.8);
	text-decoration: none;
	font-size: 0.9rem;
	line-height: 1;
	margin-left: 2px;
	transition: color 0.1s;
}

.sp-filter-pill__remove:hover { color: #fff; }

/* Filter group */
.sp-filter-group {
	border-bottom: 1px solid var(--wp--preset--color--border);
	margin-bottom: 0;
}

.sp-filter-group:last-child { border-bottom: none; }

.sp-filter-group__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.85rem 0;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary-text);
	text-align: left;
}

.sp-filter-group__toggle:hover { color: var(--wp--preset--color--accent); }

.sp-filter-chevron {
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
	flex-shrink: 0;
	color: var(--wp--preset--color--secondary-text);
}

.sp-filter-group__toggle[aria-expanded="false"] .sp-filter-chevron {
	transform: rotate(-90deg);
}

/* Filter list (categories/authors) */
.sp-filter-list {
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
}

.sp-filter-list.is-collapsed { display: none; }

.sp-filter-item { margin-bottom: 2px; }

.sp-filter-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--wp--preset--color--primary-text);
	font-size: 0.85rem;
	transition: background 0.15s ease, color 0.15s ease;
}

.sp-filter-link:hover {
	background: var(--wp--preset--color--muted-surface);
	color: var(--wp--preset--color--accent);
}

.sp-filter-item.is-active .sp-filter-link {
	background: var(--wp--preset--color--accent-light);
	color: var(--wp--preset--color--accent-dark);
	font-weight: 600;
}

/* Checkbox indicator */
.sp-filter-check {
	width: 18px;
	height: 18px;
	border-radius: 5px;
	border: 1.5px solid var(--wp--preset--color--border);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.15s ease;
	background: var(--wp--preset--color--surface);
}

.sp-filter-check svg {
	width: 10px;
	height: 10px;
	opacity: 0;
	stroke: #fff;
	transition: opacity 0.15s ease;
}

.sp-filter-item.is-active .sp-filter-check {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
}

.sp-filter-item.is-active .sp-filter-check svg { opacity: 1; }

.sp-filter-name {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sp-filter-count {
	font-size: 0.72rem;
	color: var(--wp--preset--color--secondary-text);
	background: var(--wp--preset--color--muted-surface);
	padding: 1px 7px;
	border-radius: 100px;
	flex-shrink: 0;
}

.sp-filter-item.is-active .sp-filter-count {
	background: rgba(14,142,163,0.15);
	color: var(--wp--preset--color--accent-dark);
}

/* Tag chips (multiselect) */
.sp-filter-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-bottom: 0.75rem;
}

.sp-filter-tags.is-collapsed { display: none; }

.sp-tag-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 100px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary-text);
	font-size: 0.75rem;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.15s ease;
}

.sp-tag-chip:hover {
	background: var(--wp--preset--color--muted-surface);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

.sp-tag-chip.is-active {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: #fff;
}

.sp-tag-chip__count {
	font-size: 0.65rem;
	opacity: 0.7;
}

/* Topic chips row (used in hero chip bar) */
.sp-topic-chips-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.sp-topic-chips-label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--wp--preset--color--secondary-text);
	white-space: nowrap;
}

/* ==========================================================================
   0.0.3.2 — Product related articles (auto-matched)
   ========================================================================== */

.product-related-articles {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--border);
}

.product-related-articles__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--wp--preset--spacing--40);
	margin: var(--wp--preset--spacing--40) 0;
}

.product-related-article-card {
	display: flex;
	flex-direction: column;
	border-radius: 12px;
	border: 1px solid var(--wp--preset--color--border);
	overflow: hidden;
	background: var(--wp--preset--color--muted-surface);
	text-decoration: none;
	color: var(--wp--preset--color--primary-text);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-related-article-card:hover {
	box-shadow: 0 6px 20px rgba(43,48,56,0.1);
	transform: translateY(-2px);
}

.product-related-article-card__image {
	width: 100%;
	aspect-ratio: 16/9;
	overflow: hidden;
}

.product-related-article-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.product-related-article-card:hover .product-related-article-card__image img {
	transform: scale(1.04);
}

.product-related-article-card__body {
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.product-related-article-card__cat {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--accent);
}

.product-related-article-card__title {
	font-family: Georgia, serif;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--wp--preset--color--primary-text);
	margin: 0;
}

.product-related-article-card:hover .product-related-article-card__title {
	color: var(--wp--preset--color--accent);
}

.product-related-article-card__date {
	font-size: 0.72rem;
	color: var(--wp--preset--color--secondary-text);
	margin: 4px 0 0;
}

.product-related-articles__more {
	display: inline-block;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
	margin-top: var(--wp--preset--spacing--20);
}

.product-related-articles__more:hover {
	color: var(--wp--preset--color--accent-dark);
	text-decoration: underline;
}

/* ==========================================================================
   0.0.3.3 — Footer flush + sidebar scrollbar
   ========================================================================== */

/* Remove any gap between last page section and footer */
.site-footer {
	margin-top: 0 !important;
}

/* Kill default block gap before footer */
.site-main + footer.wp-block-group,
.site-main > *:last-child {
	margin-bottom: 0 !important;
}

/* WordPress sometimes adds spacing between wp:group blocks */
.entry-content + .site-footer,
body > footer {
	margin-top: 0 !important;
}

/* Sidebar — scrollable when taller than viewport */
.sp-filter-sidebar {
	max-height: calc(100vh - 108px);
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--border) transparent;
	padding-right: 4px;
}

.sp-filter-sidebar::-webkit-scrollbar {
	width: 4px;
}

.sp-filter-sidebar::-webkit-scrollbar-track {
	background: transparent;
}

.sp-filter-sidebar::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--border);
	border-radius: 4px;
}

.sp-filter-sidebar::-webkit-scrollbar-thumb:hover {
	background: var(--wp--preset--color--accent);
}

/* Tags section: limit height and scroll within group */
.sp-filter-tags {
	max-height: 200px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--border) transparent;
}

/* ==========================================================================
   0.0.3.4 — Account icon + avatar upload UI
   ========================================================================== */

/* ------------------------------------------------------------------
   Account avatar upload section (My Account → Account Details)
   ------------------------------------------------------------------ */

.sp-avatar-section {
	margin-bottom: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.sp-avatar-section__label {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--secondary-text);
	margin-bottom: 1rem;
}

.sp-avatar-wrap {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	flex-wrap: wrap;
}

/* Preview circle */
.sp-avatar-preview {
	position: relative;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--wp--preset--color--muted-surface);
	border: 3px solid var(--wp--preset--color--accent-light);
	cursor: pointer;
}

.sp-avatar-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.sp-avatar-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--border);
}

/* Upload overlay — appears on hover */
.sp-avatar-overlay {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: rgba(14, 142, 163, 0.85);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0;
	transition: opacity 0.2s ease;
	cursor: pointer;
}

.sp-avatar-preview:hover .sp-avatar-overlay {
	opacity: 1;
}

.sp-avatar-overlay svg {
	width: 20px;
	height: 20px;
	stroke: #fff;
}

/* Action buttons */
.sp-avatar-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sp-avatar-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 20px;
	border-radius: 100px;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	text-decoration: none;
	border: none;
	white-space: nowrap;
}

.sp-avatar-btn--primary {
	background: var(--wp--preset--color--accent);
	color: #fff;
}

.sp-avatar-btn--primary:hover {
	background: var(--wp--preset--color--accent-dark);
	color: #fff;
}

.sp-avatar-btn--ghost {
	background: transparent;
	color: var(--wp--preset--color--secondary-text);
	border: 1px solid var(--wp--preset--color--border);
}

.sp-avatar-btn--ghost:hover {
	border-color: #c0392b;
	color: #c0392b;
	background: rgba(192, 57, 43, 0.05);
}

/* Status messages */
.sp-avatar-status {
	font-size: 0.8rem;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 8px;
	margin-top: 4px;
}

.sp-avatar-status--success {
	background: rgba(61, 122, 111, 0.12);
	color: var(--wp--preset--color--success);
}

.sp-avatar-status--error {
	background: rgba(192, 57, 43, 0.1);
	color: #c0392b;
}

.sp-avatar-status--loading {
	background: var(--wp--preset--color--muted-surface);
	color: var(--wp--preset--color--secondary-text);
}

/* Hint text */
.sp-avatar-hint {
	font-size: 0.75rem;
	color: var(--wp--preset--color--secondary-text);
	margin-top: 0.75rem;
	margin-bottom: 0;
}

/* Custom avatar rendered via get_avatar filter */
.sp-custom-avatar {
	border-radius: 50%;
	object-fit: cover;
}
