/**
 * Recipe Filters Block Styles
 * Styles for the Recipe Filters custom block
 *
 * @package made-to-thrive-2026-base
 * @since 1.0.0
 */

/* Main Container */
.recipe-filters-block {
	width: 100%;
	margin: 0 auto;
}

.recipe-filters-container {
	display: flex;
	gap: 40px;
	align-items: flex-start;
	max-width: 1320px;
	margin: 30px auto;
	padding: 0;
	width: 97%;
}

/* Left Sidebar: Filter Panel */
.recipe-filters-sidebar {
	width: 305px;
	flex-shrink: 0;
	position: sticky;
	top: 30px;
	align-self: flex-start;
	border-radius: 25px;
	background: var(--LEMON-LIGHT, #FEFAC8);
	padding: 52px 50px;
	box-sizing: border-box;
}

.recipe-filters-sidebar-title {
	color: var(--wp--preset--color--smoked, #6D240B);
	margin: 0 0 35px 0;
	font-family: "Perfectly Nineties";
	font-size: 26px;
	font-style: normal;
	font-weight: 300;
	line-height: 120%; /* 31.2px */
	letter-spacing: 0px;
	text-transform: capitalize;
}
.recipe-filters-shortcode-wrapper h3 {
	font-family: "Perfectly Nineties";
	font-size: 26px;
	font-style: normal;
	font-weight: 300;
	line-height: 120%; /* 31.2px */
	letter-spacing: 0;
	margin: 10px 0 13px;
}
.recipe-filters-shortcode-wrapper .facetwp-display-value {
    padding-right: 5px;
    font-family: "Google Sans Flex";
    font-size: 15px;
    font-style: normal;
    font-weight: 800;
    line-height: 140%;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.recipe-filters-shortcode-wrapper .facetwp-counter {
	display:none;
}
.recipe-filters-shortcode-wrapper {
	margin-bottom: 2rem;
}

.recipe-filters-shortcode-wrapper:last-child {
	margin-bottom: 0;
}

/* FacetWP Checkbox Styles */
.facetwp-checkbox {
	background-image: url('../../assets/images/empty-checkbox.png')!important;
	margin-bottom: 13px!important;
	background-size: 18px 18px!important;
	padding-left: 28px!important;
}

.facetwp-checkbox.checked,
.facetwp-checkbox:checked,
input.facetwp-checkbox[checked],
.facetwp-checkbox.active {
	background-image: url('../../assets/images/filled-checkbox.png')!important;
}

/* Right Content: Recipe Grid */
.recipe-filters-content {
	flex: 1;
	min-width: 0;
	outline:none!important;
}

.recipe-filters-grid-wrapper {
	margin-bottom: 3rem;
}

/* Ensure FacetWP template output uses archive grid styles */
.recipe-filters-grid-wrapper .archive-posts-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-bottom: 0;
	padding: 0;
}

/* Pagination */
.recipe-filters-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin: 3rem 0;
	flex-wrap: wrap;
}

.recipe-filters-pagination .page-numbers, .recipe-filters-pagination .facetwp-page {
	min-width: 30px;
	text-decoration: none;
	transition: all 0.2s ease;
	border-radius: 100px;
	border: 2px solid var(--SMOKED, #6D240B);
	display: flex;
	width: 30px;
	height: 30px;
	padding: 7px 0;
	justify-content: center;
	align-items: center;
	color: var(--SMOKED, #6D240B);
	font-family: "Google Sans Flex";
	font-size: 12px;
	font-style: normal;
	font-weight: 800;
	line-height: 130%; /* 15.6px */
	letter-spacing: 0;
	text-transform: uppercase;
	box-sizing: border-box;
	text-align: center;
	justify-content: center;
	margin: 0;
}
.recipe-filters-pagination .facetwp-pager {
	display:flex;
	justify-content:center;
	gap:10px;
}
.facetwp-reset {
	color: var(--SMOKED, #6D240B);
    font-family: "Google Sans Flex";
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    line-height: 130%;
    letter-spacing: 2.4px;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: auto;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
    text-underline-position: from-font;
    text-transform: uppercase;
}
.facetwp-selections .facetwp-selection-label {
	display: none;
}
.facetwp-selections ul {
	margin: 0;
    padding: 0;
}
.facetwp-selections li span {
    display: inline-block;
    line-height: 1;
    border-radius: 50px;
    border: 2px solid var(--SMOKED, #6D240B);
    background: var(--Yolk, #FFC856);
    display: flex;
    padding: 2px 3px 2px 13px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: var(--SMOKED, #6D240B);
    text-align: center;
    font-family: "Google Sans Flex";
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    line-height: 130%;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}
.recipe-filters-chips-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 35px;
}
.recipe-filters-chips-wrapper .facetwp-facet-reset {
	margin-bottom:0;
}
.recipe-filters-chips-wrapper .facetwp-selections .facetwp-selection-value {
    display: inline-block;
    margin-right: 10px;
    cursor: pointer;
    padding-right: 41px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' viewBox='0 0 25 25' fill='none'%3E%3Crect x='1' y='1' width='23' height='23' rx='11.5' fill='%23FFC856'/%3E%3Crect x='1' y='1' width='23' height='23' rx='11.5' stroke='%236D240B' stroke-width='2'/%3E%3Cpath d='M8.59375 16.4064L16.4062 8.59396' stroke='%236D240B' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M8.59375 8.59375L16.4062 16.4062' stroke='%236D240B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 25px 25px;
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.facetwp-selections li span {
    padding: 8px 14px 8px;
}
.recipe-filters-pagination .page-numbers.current, .recipe-filters-pagination .facetwp-page.active {
	background-color: #FFC856;
	cursor: default;
}

.recipe-filters-pagination .page-numbers.dots {
	border: none;
	cursor: default;
}

.recipe-filters-pagination .page-numbers.dots:hover,
.recipe-filters-pagination .page-numbers.dots:focus {
	background-color: transparent;
	color: var(--wp--preset--color--smoked, #6D240B);
}

/* Previous button with SVG icon */
.recipe-filters-pagination .facetwp-page.prev {
	width: 32px;
	height: 32px;
	min-width: 32px;
	padding: 0;
	border: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none'%3E%3Cg clip-path='url(%23clip0_274_1423)'%3E%3Cpath d='M16 1.45499C7.96672 1.45499 1.4545 7.96721 1.4545 16.0004C1.4545 24.0337 7.96672 30.5459 16 30.5459C24.0332 30.5459 30.5454 24.0337 30.5454 16.0004C30.5454 7.96721 24.0332 1.45499 16 1.45499Z' fill='%23FFC856'/%3E%3Cpath d='M16 10.1823L10.1818 16.0004L16 21.8186' fill='%23FFC856'/%3E%3Cpath d='M16 10.1823L10.1818 16.0004M10.1818 16.0004L16 21.8186M10.1818 16.0004L21.8181 16.0004M1.4545 16.0004C1.4545 7.96721 7.96672 1.45499 16 1.45499C24.0332 1.45499 30.5454 7.96721 30.5454 16.0004C30.5454 24.0337 24.0332 30.5459 16 30.5459C7.96672 30.5459 1.4545 24.0337 1.4545 16.0004Z' stroke='%236D240B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_274_1423'%3E%3Crect width='32' height='32' fill='white' transform='translate(32 32) rotate(-180)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 32px 32px;
	text-indent: -9999px;
	overflow: hidden;
}

.recipe-filters-pagination .facetwp-page.prev:hover,
.recipe-filters-pagination .facetwp-page.prev:focus {
	opacity: 0.8;
	transform: scale(1.05);
}

/* Next button with SVG icon */
.recipe-filters-pagination .facetwp-page.next {
	width: 32px;
	height: 32px;
	min-width: 32px;
	padding: 0;
	border: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none'%3E%3Cg clip-path='url(%23clip0_274_1436)'%3E%3Cpath d='M16 30.545C24.0333 30.545 30.5455 24.0328 30.5455 15.9996C30.5455 7.96632 24.0333 1.4541 16 1.4541C7.96681 1.4541 1.45459 7.96632 1.45459 15.9996C1.45459 24.0328 7.96681 30.545 16 30.545Z' fill='%23FFC856'/%3E%3Cpath d='M16 21.8177L21.8182 15.9996L16 10.1814' fill='%23FFC856'/%3E%3Cpath d='M16 21.8177L21.8182 15.9996M21.8182 15.9996L16 10.1814M21.8182 15.9996H10.1819M30.5455 15.9996C30.5455 24.0328 24.0333 30.545 16 30.545C7.96681 30.545 1.45459 24.0328 1.45459 15.9996C1.45459 7.96632 7.96681 1.4541 16 1.4541C24.0333 1.4541 30.5455 7.96632 30.5455 15.9996Z' stroke='%236D240B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_274_1436'%3E%3Crect width='32' height='32' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 32px 32px;
	text-indent: -9999px;
	overflow: hidden;
}

.recipe-filters-pagination .facetwp-page.next:hover,
.recipe-filters-pagination .facetwp-page.next:focus {
	opacity: 0.8;
	transform: scale(1.05);
}

/* Toggle bar: hidden by default (shown at 1080px) */
.recipe-filters-toggle-bar {
	display: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 0;
	font: inherit;
	text-align: left;
}


@media (max-width: 1200px) {
	.recipe-filters-container {
		gap: 30px;
	}
	
	.recipe-filters-sidebar {
		width: 280px;
	}
	
	.recipe-filters-grid-wrapper .archive-posts-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Responsive Design */
@media (max-width: 1080px) {
	.recipe-filters-container {
		flex-direction: column;
		gap: 0;
		align-items: stretch;
		max-width: 100%;
		margin: 0 auto;
		width: 100%;
	}

	.recipe-filters-grid-wrapper .archive-posts-grid {
		padding: 0 20px;
	}

	.recipe-filters-sidebar-wrapper {
		width: 100%;
		position: relative;
	}

	/* Toggle bar: gold header, full width */
	.recipe-filters-toggle-bar {
		display: flex;
		align-items: center;
		gap: 12px;
		width: 100%;
		padding: 18px 24px;
		color: var(--SMOKED, #6D240B);
		font-family: "Google Sans Flex", sans-serif;
		font-size: 16px;
		font-weight: 800;
		line-height: 1.2;
		letter-spacing: 2.4px;
		text-transform: uppercase;
		border: none;
		box-sizing: border-box;
		cursor: pointer;
		transition: background 0.2s ease;
		border-top: 2px solid var(--SMOKED, #6D240B);
		border-bottom: 2px solid var(--SMOKED, #6D240B);
		background: var(--Yolk, #FFC856);
		text-align: center;
		justify-content: center;
	}

	.recipe-filters-toggle-bar {
		position: relative;
	}

	.recipe-filters-toggle-bar-icon {
		display: flex;
		align-items: center;
		justify-content: center;
		color: inherit;
	}

	.recipe-filters-toggle-bar-icon svg {
		width: 24px;
		height: 24px;
	}

	/* Sidebar panel: collapsed by default, opens below bar */
	.recipe-filters-sidebar {
		width: 100%;
		position: relative;
		top: 0;
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		padding: 0 50px;
		margin: 0;
		border-radius: 0 0 25px 25px;
		background: #FEFAC8;
		box-sizing: border-box;
		transition: max-height 0.3s ease, opacity 0.2s ease;
		border-radius: 0 0 20px 20px;
		border-right: 2px solid var(--SMOKED, #6D240B);
		border-bottom: 2px solid var(--SMOKED, #6D240B);
		border-left: 2px solid var(--SMOKED, #6D240B);
		background: var(--LEMON-LIGHT, #FEFAC8);
	}

	.recipe-filters-sidebar.is-open {
		max-height: 80vh;
		overflow-y: auto;
		opacity: 1;
		padding: 32px 50px 40px;
	}

	.recipe-filters-sidebar.is-open .recipe-filters-sidebar-title {
		margin-top: 0;
	}

	/* Two-column layout for filter options when open */
	.recipe-filters-sidebar.is-open .recipe-filters-shortcode-wrapper {
		display: inline-block;
		vertical-align: top;
		width: calc(50% - 1rem);
		margin-bottom: 1.5rem;
	}

	.recipe-filters-sidebar.is-open .recipe-filters-shortcode-wrapper:nth-child(odd) {
		padding-right: 1rem;
	}

	.recipe-filters-sidebar.is-open .recipe-filters-shortcode-wrapper:nth-child(even) {
		padding-left: 0;
	}
		.recipe-filters-chips-wrapper {
				justify-content: center;
					padding-top: 30px;
		}
}

@media (max-width: 968px) {
	.recipe-filters-container {
		flex-direction: column;
		gap: 2rem;
	}
	
	.recipe-filters-sidebar {
		width: 100%;
		position: relative;
		top: 0;
	}
	
	.recipe-filters-grid-wrapper .archive-posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 15px;
	}
}

@media (max-width: 768px) {
	.recipe-filters-sidebar-title {
		font-size: 22px;
	}
	
	.recipe-filters-grid-wrapper .archive-posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 15px;
	}
	
	.recipe-filters-pagination .page-numbers {
		min-width: 36px;
		height: 36px;
		padding: 0 10px;
		font-size: 14px;
	}
}

/* Stick toggle bar just below header when it would bump into it (JS adds .is-stuck) */
@media (max-width: 600px) {
	.recipe-filters-toggle-bar-slot {
		/* Height set by JS when bar is stuck so layout doesn’t jump */
	}
	.recipe-filters-toggle-bar.is-stuck {
		position: fixed;
		top: 80px;
		left: 0;
		right: 0;
		width: 100%;
		z-index: 999;
		box-sizing: border-box;
		padding: 10px 24px;
	}
	/* When open, keep panel fixed below the bar so it doesn't scroll away */
	.recipe-filters-sidebar.is-open {
		position: fixed;
		top: calc(80px + var(--recipe-filters-bar-height, 54px));
		left: 0;
		right: 0;
		width: 100%;
		max-height: calc(100vh - 80px - var(--recipe-filters-bar-height, 54px));
		z-index: 998;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	}
}

@media (max-width: 500px) {
	.recipe-filters-container {
			flex-direction: column;
			gap: 0;
		}
.recipe-filters-sidebar-title {
		display: none;
	}
	.recipe-filters-sidebar.is-open {
				padding: 20px 25px 4px;
	}
		.recipe-filters-pagination {
				margin: 20px 0;
		}
				.recipe-filters-grid-wrapper .archive-posts-grid {
					padding:0;
				}
}

/* Accessibility: Ensure proper focus states */
.recipe-filters-sidebar:focus-within {
	outline: 2px solid var(--wp--preset--color--cornflower, #5B66C6);
	outline-offset: 2px;
}

.recipe-filters-content:focus-within {
	outline: 2px solid var(--wp--preset--color--cornflower, #5B66C6);
	outline-offset: 2px;
}

/* Screen Reader Text (if needed) */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

