/*
Theme Name: AddSynapse Shop
Theme URI: https://addsynapse.com/theme/
Author: AddSynapse
Author URI: https://addsynapse.com/
Description: A lightweight block theme for online stores and websites, built from ready-made sections (hero, features, products, menu, pricing, FAQ, contact) and twelve switchable styles. Works with or without WooCommerce: shops, local businesses, blogs, restaurants and landing pages. With the AddSynapse Store Assistant the sections can also be filled and edited from a chat, with preview and undo.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 0.2.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: addsynapse-shop
Tags: e-commerce, blog, food-and-drink, full-site-editing, block-patterns, block-styles, style-variations, wide-blocks, one-column, grid-layout, custom-colors, featured-images, threaded-comments, editor-style, translation-ready
*/

/* Section frame shared by every AddSynapse section (adsy-section). Colours come only from theme.json tokens. */
.adsy-section {
	position: relative;
}

/* Sections touch each other and the footer: no root block gap between top-level template areas. */
.wp-site-blocks > * + *,
.entry-content > .adsy-section,
.wp-block-post-content > .adsy-section {
	margin-block-start: 0;
}

/* Bold tones (accent / dark background): links and buttons switch to the readable pair of tokens. */
.adsy-section.has-accent-background-color a:where(:not(.wp-element-button)),
.adsy-section.has-contrast-background-color a:where(:not(.wp-element-button)),
.adsy-announcement-bar a {
	color: inherit;
}
.adsy-section.has-accent-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	background-color: var(--wp--preset--color--accent-contrast);
	color: var(--wp--preset--color--accent);
}
.adsy-section.has-contrast-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link,
.adsy-card--highlight .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* Icons: a CSS mask painted with the accent token, so style variations recolour them. */
.adsy-icon {
	width: 2.5rem;
	height: 2.5rem;
	background-color: var(--wp--preset--color--accent);
	-webkit-mask: var(--adsy-icon) center / contain no-repeat;
	mask: var(--adsy-icon) center / contain no-repeat;
}
.has-accent-background-color .adsy-icon,
.has-contrast-background-color .adsy-icon {
	background-color: currentColor;
}
.adsy-icon--truck { --adsy-icon: url(assets/icons/truck.svg); }
.adsy-icon--return { --adsy-icon: url(assets/icons/return.svg); }
.adsy-icon--lock { --adsy-icon: url(assets/icons/lock.svg); }
.adsy-icon--support { --adsy-icon: url(assets/icons/support.svg); }
.adsy-icon--gift { --adsy-icon: url(assets/icons/gift.svg); }
.adsy-icon--leaf { --adsy-icon: url(assets/icons/leaf.svg); }
.adsy-icon--star { --adsy-icon: url(assets/icons/star.svg); }
.adsy-icon--clock { --adsy-icon: url(assets/icons/clock.svg); }
.adsy-icon--check { --adsy-icon: url(assets/icons/check.svg); }
.adsy-icon--chart { --adsy-icon: url(assets/icons/chart.svg); }
.adsy-icon--pin { --adsy-icon: url(assets/icons/pin.svg); }
.adsy-icon--phone { --adsy-icon: url(assets/icons/phone.svg); }
.adsy-icon--mail { --adsy-icon: url(assets/icons/mail.svg); }
.adsy-icon--calendar { --adsy-icon: url(assets/icons/calendar.svg); }
.adsy-icon--bolt { --adsy-icon: url(assets/icons/bolt.svg); }
.adsy-icon--heart { --adsy-icon: url(assets/icons/heart.svg); }

/* Theme artwork: translucent shapes on a token background, so every style variation recolours it. */
.adsy-art img,
img.adsy-art {
	background-color: var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius--large);
}
.adsy-art.adsy-art--surface img {
	background-color: var(--wp--preset--color--surface);
}
.has-surface-background-color .adsy-art.adsy-art--surface img {
	background-color: var(--wp--preset--color--base);
}
.wp-block-media-text.adsy-art.alignfull img {
	border-radius: 0;
	min-height: 100%;
	object-fit: cover;
}
.adsy-hero__media img {
	width: 100%;
	height: auto;
}

/* Cards (features, pricing, contact, shipping). */
.adsy-card {
	padding: var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--medium);
	background-color: var(--wp--preset--color--surface);
}
.has-surface-background-color .adsy-card:not(.has-background) {
	background-color: var(--wp--preset--color--base);
}
.has-accent-background-color .adsy-card:not(.has-background),
.has-contrast-background-color .adsy-card:not(.has-background) {
	background-color: transparent;
	border: var(--wp--custom--border--width) solid currentColor;
}
.adsy-card--highlight {
	box-shadow: var(--wp--preset--shadow--lifted);
}

/* Team: portraits at a reasonable size. */
.adsy-team .adsy-slot-image img {
	max-width: 14rem;
}

/* Category tiles: image + label below (labels never sit on top of product photos with baked-in text). */
.adsy-tile img {
	border-radius: var(--wp--custom--radius--medium);
}
.adsy-tile h3 a {
	color: inherit;
	text-decoration: none;
}
.adsy-tile h3 a:hover,
.adsy-tile h3 a:focus-visible {
	text-decoration: underline;
}

/* Hero (centered): readable line length; flex layout gets no root padding from core, so add it. */
.adsy-hero-centered {
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}
.adsy-hero-centered > .adsy-slot-heading {
	max-width: 18ch;
}
.adsy-hero-centered > .adsy-slot-text {
	max-width: 40rem;
}

/* Lists: plain (opening hours) and check marks (pricing). */
.is-style-adsy-plain,
.adsy-checklist {
	list-style: none;
	padding-left: 0;
}
.adsy-checklist li {
	padding-left: 1.6em;
	position: relative;
	margin-block: 0.4em;
}
.adsy-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1em;
	height: 1em;
	background-color: currentColor;
	-webkit-mask: url(assets/icons/check.svg) center / contain no-repeat;
	mask: url(assets/icons/check.svg) center / contain no-repeat;
}

/* Menu (restaurant): dotted line between dish and price. */
.adsy-menu-title {
	padding-bottom: var(--wp--preset--spacing--20);
	border-bottom: 2px solid var(--wp--preset--color--accent);
}
.adsy-dish {
	margin-block-start: var(--wp--preset--spacing--40);
}
.adsy-dish .adsy-slot-name {
	font-size: var(--wp--preset--font-size--large);
	margin: 0;
}
.adsy-dish .adsy-slot-price {
	margin: 0;
	white-space: nowrap;
}

/* Quotes inside testimonial cards. */
.adsy-testimonials .wp-block-quote {
	height: 100%;
	margin: 0;
	padding: var(--wp--preset--spacing--40);
	border-left: 0;
	border-radius: var(--wp--custom--radius--medium);
	background-color: var(--wp--preset--color--base);
}
.adsy-testimonials:not(.has-background) .wp-block-quote {
	background-color: var(--wp--preset--color--surface);
}

/* Logos: neutral, same size. */
.adsy-logo {
	flex: 0 0 auto;
	margin: 0;
}
.adsy-logo img {
	opacity: 0.6;
}
.has-contrast-background-color .adsy-logo img {
	filter: invert(1);
}

/* Header (centered): three equal columns, title in the middle; collapses to two on phones. */
.adsy-header-centered__row {
	align-items: center;
}
@media (max-width: 600px) {
	.adsy-header-centered__row {
		grid-template-columns: auto 1fr auto !important;
	}
	.adsy-header-centered__row .wp-block-site-title {
		font-size: var(--wp--preset--font-size--large) !important;
	}
}

/* Post grids: cards line up even when a post has no featured image. */
.wp-block-post-template.is-layout-grid > li {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}
.wp-block-post-template.is-layout-grid > li > * {
	margin-block: 0;
}

/* Visible focus on every interactive element (accessibility). */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}
.has-contrast-background-color :where(a, button, input, select, textarea, summary):focus-visible,
.has-accent-background-color :where(a, button, input, select, textarea, summary):focus-visible {
	outline-color: currentColor;
}

/* FAQ: a visible marker for the open/closed state. */
.wp-block-details summary {
	font-weight: 600;
	cursor: pointer;
}

/* Pricing: full-width buttons at the bottom of each card. */
.adsy-pricing-tiers .adsy-card {
	display: flex;
	flex-direction: column;
}
.adsy-pricing-tiers .adsy-card > .wp-block-buttons {
	margin-top: auto;
}
.adsy-pricing-tiers .wp-block-button,
.adsy-pricing-tiers .wp-block-button__link {
	width: 100%;
}

/* Long product / post titles (e.g. Greek uppercase) wrap instead of overflowing. */
.wp-block-post-title {
	overflow-wrap: break-word;
	hyphens: auto;
}

/* Header search: icon only, same weight as the account/cart icons. */
header .wp-block-search__button-only .wp-block-search__button {
	background: transparent;
	color: inherit;
	padding: 0.25rem;
}

/* Slider (adsy-slider): the slides sit in one scroll-snap row, so swiping works even without the script.
   assets/js/slider.js adds arrows, dots, the pause button and the automatic change. */
.adsy-slider {
	overflow: hidden;
}
.adsy-slider > .adsy-slot-slides {
	display: flex;
	gap: 0;
	max-width: none;
	margin: 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}
.adsy-slider > .adsy-slot-slides::-webkit-scrollbar {
	display: none;
}
.adsy-slider > .adsy-slot-slides > .adsy-item {
	flex: 0 0 100%;
	max-width: none;
	margin: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}
.adsy-slider .adsy-item > .wp-block-cover {
	height: 100%;
	margin: 0;
	padding-left: max(var(--wp--style--root--padding-left, 1.5rem), 4.5rem);
	padding-right: max(var(--wp--style--root--padding-right, 1.5rem), 4.5rem);
	padding-bottom: 4rem;
}
/* Core gives a positioned cover an auto-width, margin-less inner container (doubled class): same weight + ours, so the texts line up with the site's wide width. */
.adsy-slider .adsy-item > .wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container,
.adsy-slider .wp-block-cover .wp-block-cover__inner-container {
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-left: auto;
	margin-right: auto;
}
/* The constrained layout centres its children with !important: the slide texts stay at the start of the line. */
.adsy-slider .wp-block-cover__inner-container > * {
	max-width: 36rem;
	margin-left: 0 !important;
	margin-right: auto !important;
}
.adsy-slider .wp-block-cover .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.adsy-slider__arrow,
.adsy-slider__dot,
.adsy-slider__pause {
	appearance: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	font: inherit;
}
.adsy-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 2.75rem;
	height: 2.75rem;
	transform: translateY(-50%);
	border-radius: 50%;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--preset--shadow--soft);
}
.adsy-slider__arrow::before {
	content: "";
	display: block;
	width: 0.6rem;
	height: 0.6rem;
	margin: auto;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: translateX(-15%) rotate(45deg);
}
.adsy-slider__arrow--prev {
	left: 0.75rem;
}
.adsy-slider__arrow--prev::before {
	transform: translateX(15%) rotate(-135deg);
}
.adsy-slider__arrow--next {
	right: 0.75rem;
}
.adsy-slider__controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 1rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
}
/* Dots and pause: a 24px target (WCAG 2.5.8) around a small mark. */
.adsy-slider__dot,
.adsy-slider__pause {
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	background: transparent;
	color: var(--wp--preset--color--base);
}
.adsy-slider__dot::before {
	content: "";
	width: 0.65rem;
	height: 0.65rem;
	border: 2px solid currentColor;
	border-radius: 50%;
	box-sizing: border-box;
}
.adsy-slider__dot[aria-current="true"]::before {
	background-color: currentColor;
}
.adsy-slider__pause::before {
	content: "";
	width: 0.6rem;
	height: 0.7rem;
	border-left: 0.2rem solid currentColor;
	border-right: 0.2rem solid currentColor;
	box-sizing: border-box;
}
.adsy-slider__pause.is-paused::before {
	width: 0;
	height: 0;
	border: 0.4rem solid transparent;
	border-left: 0.65rem solid currentColor;
	border-right: 0;
}
.adsy-slider :where(.adsy-slider__arrow, .adsy-slider__dot, .adsy-slider__pause, .adsy-slot-slides):focus-visible {
	outline: 2px solid var(--wp--preset--color--base);
	outline-offset: -4px;
	box-shadow: 0 0 0 2px var(--wp--preset--color--contrast);
}
@media (max-width: 600px) {
	.adsy-slider .adsy-item > .wp-block-cover {
		min-height: 420px !important;
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}
	.adsy-slider .adsy-slot-heading {
		font-size: var(--wp--preset--font-size--x-large) !important;
	}
	.adsy-slider .adsy-slot-text {
		font-size: var(--wp--preset--font-size--medium) !important;
	}
	.adsy-slider__arrow {
		top: auto;
		bottom: 0.6rem;
		width: 2.25rem;
		height: 2.25rem;
		transform: none;
	}
}
@media (prefers-reduced-motion: reduce) {
	.adsy-slider > .adsy-slot-slides {
		scroll-behavior: auto;
	}
}

/* Free section (adsy-free): built from standard blocks by the Store Assistant; the same frame as every section. */
.adsy-free > .alignwide {
	margin-left: auto;
	margin-right: auto;
}

/* Shop with filters (adsy-shop-layout): filters beside the products, above them on phones. */
.adsy-shop-layout > .adsy-shop-filters {
	position: sticky;
	top: 1rem;
	align-self: flex-start;
}
@media (max-width: 781px) {
	.adsy-shop-layout > .adsy-shop-filters {
		position: static;
	}
}
