/*
Theme Name: Jollof Factory
Description: Bold, playful block theme built for Jollof Factory, a pepper-forward African sauce brand. Includes a sticky header with an editable call-to-action button, editable footer navigation menus, a Recipe post type with a filterable recipe archive, and styled WooCommerce shop, cart and checkout pages. The neo-brutalist look (pepper orange and golden yellow, Archivo Black headlines, hard offset shadows) is managed from theme.json and the Site Editor.
Author: Jollof Factory
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.5.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jollof-factory
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations, e-commerce, food-and-drink, custom-colors, custom-logo, editor-style, featured-images
*/

/* WordPress inserts a margin-block-start equal to the block gap (24px unless
   theme.json sets styles.spacing.blockGap) between the template's top-level
   sections (header part, main, footer part) — a gap that exists even when no
   markup asks for it. Zero it so sections butt edge-to-edge and own their
   vertical rhythm via padding; this does not affect block gaps inside nested
   layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main carries its own vertical padding so templates this
   theme does not author (WooCommerce shop, product, cart…) still clear the
   header and footer. A descendant selector, not a child one: WooCommerce wraps
   the single-product main in an extra group. Templates built from full-bleed
   sections opt out with is-flush and let the sections own the rhythm. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* === design tokens === */
:root {
	--neo: 4px 4px 0 var(--wp--preset--color--dark);
	--neo-lg: 8px 8px 0 var(--wp--preset--color--dark);
	--neo-xl: 12px 12px 0 var(--wp--preset--color--dark);
	--neo-white: 4px 4px 0 #ffffff;
	--jf-border: 2px solid var(--wp--preset--color--dark);
	--jf-border-white: 2px solid #ffffff;
}

/* === buttons: translate into the hard shadow === */
.wp-element-button {
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.wp-element-button:hover {
	transform: translate(2px, 2px);
	box-shadow: 2px 2px 0 var(--wp--preset--color--dark);
}
.wp-element-button:active {
	transform: translate(4px, 4px);
	box-shadow: none;
}
.on-dark .wp-element-button {
	box-shadow: var(--neo-white);
}
.on-dark .wp-element-button:hover {
	box-shadow: 2px 2px 0 #ffffff;
}

/* === sticky header band === */
.site-header {
	position: sticky;
	top: 0;
	z-index: 99;
	border-bottom: var(--jf-border);
}
.site-header .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--archivo-black);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	font-size: 0.9375rem;
}
.site-header .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--primary);
}
.site-header .wp-block-navigation__container {
	gap: 2rem;
}
.site-header .wp-block-site-logo img {
	transition: transform 0.3s ease;
}
.site-header .wp-block-site-logo:hover img {
	transform: rotate(-3deg);
}

/* === neo card === */
.is-style-jollof-card {
	position: relative;
	z-index: 1;
	background-color: #ffffff;
	border: var(--jf-border);
	box-shadow: var(--neo);
	padding: 24px;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.is-style-jollof-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--neo-lg);
}

/* === sticker badge === */
.is-style-jollof-sticker {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--dark);
	border: var(--jf-border);
	box-shadow: var(--neo);
	padding: 8px 16px;
	transform: rotate(-2deg);
	transition: transform 0.3s ease;
}
.is-style-jollof-sticker:hover {
	transform: rotate(2deg);
}

/* === ghost numeral (behind a card) === */
.is-style-jollof-ghost {
	position: relative;
	z-index: 0;
	text-align: center;
	font-size: clamp(6rem, 12vw, 10rem);
	line-height: 0.8;
	color: rgba(255, 255, 255, 0.45);
	user-select: none;
	margin-bottom: -2.5rem;
}

/* === marker quote === */
.is-style-jollof-quote {
	font-family: var(--wp--preset--font-family--permanent-marker);
	font-weight: 400;
}
.is-style-jollof-quote strong {
	color: var(--wp--preset--color--primary);
	font-weight: 400;
}

/* === lead paragraph with color bar === */
.is-style-jollof-lead {
	border-left: 4px solid var(--wp--preset--color--secondary);
	padding-left: 24px;
	font-weight: 700;
}

/* === band helpers === */
.jollof-dots-bg {
	background-image: radial-gradient(rgba(18, 18, 18, 0.08) 1.5px, transparent 1.5px);
	background-size: 14px 14px;
}

/* === designed bands butt edge-to-edge === */
.entry-content.is-layout-constrained > .alignfull {
	margin-block-start: 0;
}

/* === shop: deterministic grid + neo product cards === */
.wp-block-woocommerce-product-image-gallery .woocommerce-product-gallery.images {
	width: 100%;
}
.wp-block-woocommerce-product-image-gallery .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: auto;
}
.wc-block-product-template.columns-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 781px) {
	.wc-block-product-template.columns-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 599px) {
	.wc-block-product-template.columns-3 {
		grid-template-columns: minmax(0, 1fr);
	}
}
.wc-block-product {
	background-color: #ffffff;
	border: var(--jf-border);
	box-shadow: var(--neo);
	padding: 16px;
}
.wc-block-product-template .wp-block-post-title a {
	text-decoration: none;
}

/* === headings linking to content stay clean === */
.wp-block-heading a {
	text-decoration: none;
}

/* === WP core sets width:100% on nav containers and button links; inside flex
   layouts that collapses the flex item to min-content (vertical text). === */
/* === WP core sets width:100% on nav containers and button links; inside flex
   layouts that collapses the flex item to min-content (vertical text). === */
.site-header .is-layout-flex > .wp-block-group {
	flex-grow: 1;
}
.site-header .is-layout-flex > .wp-block-navigation {
	flex-grow: 1;
}
@media (min-width: 782px) {
	.site-header .is-layout-flex.wp-block-group-is-layout-flex {
		flex-wrap: nowrap;
	}
}
.site-header .wp-block-navigation__responsive-container-content {
	justify-content: flex-end;
}
.wp-block-buttons.is-layout-flex .wp-block-button__link {
	width: auto;
}

/* === hero === */
/* === hero: keep content above the cover's dim overlay === */
.jollof-hero .wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
}
/* === hero: opaque orange with the grayscale photo ghosted on top === */
.jollof-hero .wp-block-cover__background {
	opacity: 1;
}
.jollof-hero img.wp-block-cover__image-background {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	/* WP core pins cover images at z-index 0 with a high-specificity selector;
	   the photo must paint above the opaque orange overlay. */
	z-index: 1 !important;
	filter: grayscale(1);
	mix-blend-mode: multiply;
}
.jollof-hero-title {
	text-shadow: 4px 4px 0 #121212;
}
.jollof-hero-copy {
	background: rgba(18, 18, 18, 0.25);
}

/* === marquee === */
.jollof-marquee {
	overflow: hidden;
	background-color: var(--wp--preset--color--secondary);
	border-top: var(--jf-border);
	border-bottom: var(--jf-border);
	padding: 10px 0;
}
.jollof-marquee__track {
	display: flex;
	flex-wrap: nowrap;
	gap: 4rem;
	width: max-content;
	animation: jollof-marquee 25s linear infinite;
}
.jollof-marquee__item {
	font-family: var(--wp--preset--font-family--archivo-black);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 1.25rem;
	color: var(--wp--preset--color--dark);
	white-space: nowrap;
}
.jollof-marquee__item em {
	font-style: normal;
	color: var(--wp--preset--color--primary);
}
@keyframes jollof-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

/* === bouncing sticker === */
.jollof-bounce {
	animation: jollof-bounce 2s ease-in-out infinite;
}
@keyframes jollof-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-8px); }
}

/* === grayscale photography === */
.jollof-gray img {
	filter: grayscale(1) contrast(1.05);
	transition: filter 0.5s ease;
}
.jollof-gray:hover img {
	filter: none;
}

/* === icon tile (SVG glyphs baked as background images) === */
.jollof-icon-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	background-color: var(--wp--preset--color--primary);
	border: var(--jf-border-white);
	box-shadow: var(--neo-white);
	transition: transform 0.3s ease;
}
.jollof-icon-tile::before {
	content: "";
	width: 40px;
	height: 40px;
	background: var(--jf-icon) center / contain no-repeat;
}
.jollof-icon-tile:hover {
	transform: rotate(12deg);
}
.jollof-icon-tile-soft {
	background-color: var(--wp--preset--color--background);
	border-color: var(--wp--preset--color--dark);
	box-shadow: var(--neo);
}
.jollof-icon-flame {
	--jf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E");
}
.jollof-icon-utensils {
	--jf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2'/%3E%3Cpath d='M7 2v20'/%3E%3Cpath d='M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3zm0 0v7'/%3E%3C/svg%3E");
}
.jollof-icon-timer {
	--jf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='10' x2='14' y1='2' y2='2'/%3E%3Cline x1='12' x2='15' y1='14' y2='11'/%3E%3Ccircle cx='12' cy='14' r='8'/%3E%3C/svg%3E");
}
.jollof-icon-check {
	--jf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpath d='m9 11 3 3L22 4'/%3E%3C/svg%3E");
}
.jollof-icon-tile-soft.jollof-icon-heart {
	--jf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF4D00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E");
}
.jollof-icon-tile-soft.jollof-icon-clock {
	--jf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF4D00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}
.jollof-icon-tile-soft.jollof-icon-globe {
	--jf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF4D00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20'/%3E%3Cpath d='M2 12h20'/%3E%3C/svg%3E");
}
.jollof-icon-tile-soft.jollof-icon-shield {
	--jf-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF4D00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}

/* === recipe time tick === */
.jollof-frame {
	position: relative;
}
.jollof-time-tick {
	position: absolute;
	right: -10px;
	bottom: 24px;
	background-color: var(--wp--preset--color--primary);
	color: #ffffff;
	border: var(--jf-border);
	box-shadow: var(--neo);
	padding: 8px 16px;
	font-family: var(--wp--preset--font-family--archivo-black);
	text-transform: uppercase;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
}

/* === rotated frames === */
.tilt-r { transform: rotate(2deg); }
.tilt-l { transform: rotate(-2deg); }

/* === small label badge (dark) === */
.jf-label-badge {
	background-color: var(--wp--preset--color--dark);
	padding: 6px 14px;
}
.jf-label-badge p {
	margin: 0;
}

/* === green badge (product highlight) === */
.jf-badge {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--secondary);
	border: var(--jf-border);
	box-shadow: var(--neo);
	padding: 10px 18px;
}
.jf-badge p {
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* === outlined display word === */
.jf-stroke {
	-webkit-text-stroke: 1px var(--wp--preset--color--dark);
	color: var(--wp--preset--color--primary);
}

/* === accent words inside headings === */
.jf-accent-word {
	color: var(--wp--preset--color--accent);
}
.jf-hero-echo {
	color: var(--wp--preset--color--secondary);
}

/* === starred list === */
.jollof-stars {
	list-style: none;
	padding-left: 0;
}
.jollof-stars li {
	padding-left: 32px;
	position: relative;
}
.jollof-stars li::before {
	content: "★";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--wp--preset--color--secondary);
	-webkit-text-stroke: 1px var(--wp--preset--color--dark);
}

/* === circular NEW STAPLE sticker === */
.jollof-sticker-new {
	position: absolute;
	top: -28px;
	right: -28px;
	z-index: 2;
	width: 96px;
	height: 96px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--wp--preset--color--primary);
	color: #ffffff;
	border: var(--jf-border);
	border-radius: 50%;
	box-shadow: var(--neo);
}
.jollof-sticker-new p {
	margin: 0;
}

/* === value cards (dark band) === */
.jollof-value {
	border: var(--jf-border-white);
	padding: 32px;
	transition: background-color 0.3s ease, color 0.3s ease;
}
.jollof-value:hover {
	background-color: #ffffff;
	color: var(--wp--preset--color--dark);
}
.jollof-value:hover h3,
.jollof-value:hover p {
	color: var(--wp--preset--color--dark);
}

/* === section heading with underline (recipe cards) === */
.jf-rule-head {
	font-family: var(--wp--preset--font-family--archivo-black);
	text-transform: uppercase;
	border-bottom: var(--jf-border);
	padding-bottom: 8px;
	margin-bottom: 16px;
}

/* === recipe direction steps === */
ol.jollof-steps {
	list-style: none;
	padding-left: 0;
	counter-reset: jf-step;
}
ol.jollof-steps > li {
	counter-increment: jf-step;
	position: relative;
	padding-left: 48px;
	margin-bottom: 16px;
}
ol.jollof-steps > li::before {
	content: counter(jf-step);
	position: absolute;
	left: 0;
	top: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--dark);
	border: var(--jf-border);
	font-family: var(--wp--preset--font-family--archivo-black);
	font-size: 1rem;
}

/* === recipes grid === */
.jf-recipes-grid {
	display: grid;
	gap: var(--wp--preset--spacing--md);
	margin-block: var(--wp--preset--spacing--lg);
	align-items: start;
	box-sizing: border-box;
	max-width: calc(1280px - 2 * var(--wp--style--root--padding-left, 24px));
	margin-inline: auto;
}
@media (min-width: 1100px) {
	.jf-recipes-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (min-width: 760px) and (max-width: 1099px) {
	.jf-recipes-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
.jf-recipe-card {
	height: 100%;
}
.jf-recipe-card .jollof-frame {
	margin-bottom: var(--wp--preset--spacing--md);
}
.jf-recipe-photo {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
	border: var(--jf-border);
}
.jf-recipe-title {
	font-family: var(--wp--preset--font-family--archivo-black);
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
	font-size: 1.75rem;
	line-height: 1.1;
	margin: 0 0 12px;
}
.jf-recipe-excerpt {
	font-weight: 700;
	margin: 0 0 var(--wp--preset--spacing--md);
}
.jf-recipe-list {
	padding-left: 24px;
}
.jf-rule-head-directions {
	margin-top: var(--wp--preset--spacing--md);
}
.jf-recipes-grid [id] {
	scroll-margin-top: 120px;
}

/* === story page === */
.jf-polaroid {
	padding: 12px;
}
.jf-polaroid img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: 50% 0;
}
.jf-highlight {
	background-color: var(--wp--preset--color--secondary);
	padding: 0 4px;
}
.jf-word-primary {
	color: var(--wp--preset--color--primary);
}
.jf-card-yellow {
	background-color: var(--wp--preset--color--secondary);
	padding: 40px;
}
.jf-card-dark {
	background-color: var(--wp--preset--color--dark);
	color: var(--wp--preset--color--background);
	border-color: var(--wp--preset--color--dark);
	padding: 40px;
}
.jf-bridge {
	border-left: 8px solid var(--wp--preset--color--primary);
	padding-left: 40px;
}
.jf-promise .wp-block-column {
	text-align: center;
}
.jf-promise .jollof-icon-tile {
	margin-inline: auto;
	margin-bottom: 16px;
}

/* === footer links === */
.wp-block-social-links {
	list-style: none;
	padding-left: 0;
}
.site-footer a {
	color: var(--wp--preset--color--background);
	text-decoration: none;
}
.site-footer a:hover {
	color: var(--wp--preset--color--primary);
}
.site-footer .wp-block-heading a,
.site-footer p a {
	color: var(--wp--preset--color--background);
}
.site-footer .wp-block-social-links a {
	color: var(--wp--preset--color--background);
}
.site-footer .wp-block-separator {
	color: var(--wp--preset--color--dark);
	border-color: var(--wp--preset--color--dark);
	opacity: 1;
}

/* === footer menu === */
.site-footer .footer-menu .wp-block-navigation__container {
	gap: 1.5rem;
}
.site-footer .footer-menu .wp-block-navigation-item__content {
	text-decoration: none;
}

/* === reduced motion === */
@media (prefers-reduced-motion: reduce) {
	.jollof-marquee__track,
	.jollof-bounce {
		animation: none;
	}
	.wp-element-button,
	.is-style-jollof-card,
	.is-style-jollof-sticker,
	.jollof-gray img,
	.jollof-icon-tile {
		transition: none;
	}
	html {
		scroll-behavior: auto;
	}
}
