/*
Theme Name: Sweet Studio
Theme URI: https://sweetstudio.example.com
Author: Sweet Studio
Description: A warm, handmade-feeling candy shop theme inspired by Gumroad's creator-first aesthetic. Soft cream backgrounds, chocolate brown text, caramel accents, and dusty rose call-to-actions create an intimate, approachable confectionery experience.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sweet-studio
Tags: block-patterns, full-site-editing, wide-blocks, custom-colors, custom-fonts, e-commerce, food-and-drink
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ---------- Foundation resets ---------- */

:root,
body,
.wp-site-blocks {
	overflow: visible;
}

/* Remove default WP margin on first/last children of site-blocks */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* ---------- Sticky header ---------- */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}

/* Backdrop pseudo for scrolled-state background */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}

.wp-site-blocks > header.wp-block-template-part::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	transition: background 0.4s ease, box-shadow 0.4s ease;
}

body.is-scrolled .wp-site-blocks > header.wp-block-template-part::before {
	background: var(--wp--preset--color--cream-light);
	box-shadow: 0 1px 0 var(--wp--preset--color--caramel);
}

/* ---------- Typography polish ---------- */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Headings – Fraunces optical sizing and letterspacing */
h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-site-title {
	letter-spacing: -0.02em;
	font-variation-settings: "opsz" 40;
}

h1 {
	letter-spacing: -0.03em;
}

/* Paragraph measure control inside constrained containers */
.is-layout-constrained > p,
.is-layout-constrained > .wp-block-list {
	max-width: 70ch;
}

/* Small / caption text */
.has-small-font-size {
	letter-spacing: 0.01em;
	line-height: 1.5;
}

/* ---------- Link styles ---------- */

a {
	transition: color 0.2s ease;
}

/* Content links get a subtle underline */
.entry-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content),
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content) {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--caramel);
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
	transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.entry-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):hover,
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):hover {
	text-decoration-color: var(--wp--preset--color--rose);
}

/* ---------- Button styles ---------- */

.wp-block-button__link,
.wp-element-button {
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
	letter-spacing: 0.01em;
	line-height: 1.4;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(44, 24, 16, 0.12);
}

.wp-block-button__link:active,
.wp-element-button:active {
	transform: translateY(0);
	box-shadow: none;
}

/* Outline button variant */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 2px solid var(--wp--preset--color--rose);
	color: var(--wp--preset--color--rose);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--rose);
	color: var(--wp--preset--color--cream-light);
	border-color: var(--wp--preset--color--rose);
}

/* ---------- Image treatments ---------- */

.wp-block-image img,
.wp-block-cover img {
	transition: transform 0.5s ease;
}

.wp-block-image:hover img {
	transform: scale(1.02);
}

.wp-block-image {
	overflow: hidden;
	border-radius: 8px;
}

/* Gumroad-inspired bordered image cards */
.wp-block-image.is-style-default figcaption {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	margin-top: var(--wp--preset--spacing--20);
	text-align: center;
}

/* ---------- Navigation ---------- */

.wp-block-navigation .wp-block-navigation-item__content {
	transition: color 0.2s ease;
	position: relative;
}

.wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: var(--wp--preset--color--caramel);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.25s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover::after {
	transform: scaleX(1);
}

/* Navigation CTA button style in header */
.wp-block-navigation .wp-block-button__link {
	border-radius: 999px;
}

/* ---------- Mobile hamburger overlay ---------- */

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: var(--wp--preset--spacing--40);
	align-items: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--large);
}

/* ---------- Site title ---------- */

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

/* ---------- Separator / divider ---------- */

.wp-block-separator {
	opacity: 1;
}

.wp-block-separator:not(.is-style-dots) {
	border-top-color: var(--wp--preset--color--caramel);
}

.wp-block-separator.is-style-dots::before {
	color: var(--wp--preset--color--caramel);
}

/* ---------- Quote ---------- */

.wp-block-quote {
	padding-left: var(--wp--preset--spacing--30);
}

.wp-block-quote cite {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	color: var(--wp--preset--color--muted);
}

/* ---------- Cover block overlays – warm tinting ---------- */

.wp-block-cover {
	border-radius: 8px;
	overflow: hidden;
}

.wp-block-cover.alignfull {
	border-radius: 0;
}

/* ---------- Columns / cards with surface background ---------- */

.has-surface-background-color {
	border-radius: 12px;
}

/* Product-card-style hover lift for groups with surface bg */
.wp-block-group.has-surface-background-color {
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-group.has-surface-background-color:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(44, 24, 16, 0.08);
}

/* ---------- Post template cards ---------- */

.wp-block-post-template .wp-block-post-featured-image img {
	border-radius: 8px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.wp-block-post-template .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--text);
	transition: color 0.2s ease;
}

.wp-block-post-template .wp-block-post-title a:hover {
	color: var(--wp--preset--color--rose);
}

/* ---------- Media & Text (alternating product sections) ---------- */

.wp-block-media-text {
	border-radius: 8px;
	overflow: hidden;
}

.wp-block-media-text .wp-block-media-text__media img {
	border-radius: 0;
}

/* ---------- Gumroad-inspired dotted border accent ---------- */

.wp-block-group.has-border-color {
	border-style: dotted;
}

/* ---------- Selection highlight ---------- */

::selection {
	background: var(--wp--preset--color--caramel);
	color: var(--wp--preset--color--text);
}

/* ---------- Focus styles (accessibility) ---------- */

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

.wp-block-button__link:focus-visible {
	outline-offset: 3px;
}

/* ---------- Scrollbar styling ---------- */

::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: var(--wp--preset--color--background);
}

::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--caramel);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--wp--preset--color--muted);
}

/* ---------- Loop layout utilities ---------- */

/* Horizontal scrollable rail */
.wp-block-query.is-style-loop-rail .wp-block-post-template {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: var(--wp--preset--spacing--20);
}
.wp-block-query.is-style-loop-rail .wp-block-post-template > * {
	flex: 0 0 320px;
	scroll-snap-align: start;
}

/* Compact list with hairline row dividers */
.wp-block-query.is-style-loop-list .wp-block-post-template > * {
	border-bottom: 1px solid var(--wp--preset--color--caramel);
	padding-block: var(--wp--preset--spacing--30);
}
.wp-block-query.is-style-loop-list .wp-block-post-template > *:last-child {
	border-bottom: 0;
}

/* Zigzag — flip the columns inside every even entry */
.wp-block-query.is-style-loop-zigzag .wp-block-post-template > *:nth-child(even) .wp-block-columns {
	flex-direction: row-reverse;
}

/* Timeline — vertical line with node markers per entry */
.wp-block-query.is-style-loop-timeline .wp-block-post-template {
	position: relative;
	padding-inline-start: 2.5rem;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template::before {
	content: '';
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0.5rem;
	width: 2px;
	background: var(--wp--preset--color--caramel);
	opacity: 0.35;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template > * {
	position: relative;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template > *::before {
	content: '';
	position: absolute;
	inset-inline-start: -2.25rem;
	inset-block-start: 0.6rem;
	width: 1rem;
	height: 1rem;
	border: 2px solid var(--wp--preset--color--caramel);
	border-radius: 50%;
	background: var(--wp--preset--color--background);
}

/* Magazine — first child spans 2 columns of the grid */
.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
	grid-column: span 2;
}
@media (max-width: 600px) {
	.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
		grid-column: auto;
	}
}