/* Sugar & Bloom — base theme styles */
:root {
	--sb-primary: #d9727f;
	--sb-primary-dark: #b4505e;
	--sb-accent: #d8a657;
	--sb-heading: #4a2e2a;
	--sb-text: #7a5a54;
	--sb-bg: #fff8f3;
	--sb-soft: #f8dfe0;
	--sb-white: #ffffff;
	--sb-serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--sb-sans: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
	--sb-script: "Dancing Script", "Brush Script MT", cursive;
	--sb-radius: 20px;
	--sb-shadow: 0 14px 44px rgba(74, 46, 42, 0.12);
	--sb-ease: cubic-bezier(.22, 1, .36, 1);
	--sb-header-h: 78px;
}

/* Follow Elementor → Site Settings → Global Colors / Fonts (after "Apply Bakery Colors & Fonts") */
.sb-kit {
	--sb-heading: var(--e-global-color-primary, #4a2e2a);
	--sb-primary-dark: var(--e-global-color-secondary, #b4505e);
	--sb-text: var(--e-global-color-text, #7a5a54);
	--sb-primary: var(--e-global-color-accent, #d9727f);
	--sb-accent: var(--e-global-color-sbgold, #d8a657);
	--sb-soft: var(--e-global-color-sbsoft, #f8dfe0);
	--sb-bg: var(--e-global-color-sbcream, #fff8f3);
	--sb-serif: var(--e-global-typography-primary-font-family, "Playfair Display"), Georgia, serif;
	--sb-sans: var(--e-global-typography-text-font-family, "Nunito Sans"), "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* scroll-padding keeps anchor targets and keyboard focus clear of the sticky header */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--sb-header-h) + 16px); }
body {
	margin: 0;
	font-family: var(--sb-sans);
	font-size: 17px;
	line-height: 1.65;
	color: var(--sb-text);
	background: var(--sb-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 {
	font-family: var(--sb-serif);
	color: var(--sb-heading);
	line-height: 1.15;
	margin: 0 0 .5em;
	font-weight: 700;
}
p { margin: 0 0 1em; }
a { color: var(--sb-primary-dark); }
img, svg, video { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--sb-primary); outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sb-skip-link:focus {
	clip: auto; width: auto; height: auto; margin: 0; z-index: 1000; top: 10px; left: 10px;
	padding: 10px 18px; background: var(--sb-white); color: var(--sb-heading); border-radius: 8px;
}

/* ---------- Buttons (shared with widgets) ---------- */
/* White button text sits on --sb-primary-dark (4.9:1); plain --sb-primary is only 3.1:1 with white. */
.sb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
	padding: 14px 30px; border-radius: 999px; border: 2px solid var(--sb-primary);
	font: 700 1rem/1.2 var(--sb-sans); cursor: pointer; text-decoration: none;
	background: transparent; color: var(--sb-primary-dark);
	transition: transform .25s var(--sb-ease), background-color .25s, color .25s, border-color .25s, box-shadow .25s;
	-webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sb-btn:hover { transform: translateY(-2px); background: var(--sb-primary-dark); border-color: var(--sb-primary-dark); color: var(--sb-white); }
.sb-btn--primary { background: var(--sb-primary-dark); border-color: var(--sb-primary-dark); color: var(--sb-white); box-shadow: 0 10px 26px rgba(180, 80, 94, .32); }
.sb-btn--primary:hover { background: var(--sb-heading); border-color: var(--sb-heading); }
.sb-btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.sb-btn[disabled], .sb-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Effects (Customizer → Sugar & Bloom Theme → Effects) ---------- */
/* Shimmer sweep across buttons on hover (21st.dev "shimmer button" style) */
.sb-fx .sb-btn, .sb-fx .elementor-button { position: relative; overflow: hidden; isolation: isolate; }
.sb-fx .sb-btn--primary::before, .sb-fx .elementor-button::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .34) 50%, transparent 65%);
	transform: translateX(-130%); transition: transform .9s var(--sb-ease);
}
.sb-fx .sb-btn--primary:hover::before, .sb-fx .elementor-button:hover::before { transform: translateX(130%); }
/* Press ripple from the pointer position (added by theme.js) */
.sb-ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); pointer-events: none; animation: sbRipple .6s ease-out forwards; }
@keyframes sbRipple { to { transform: scale(1); opacity: 0; } }
/* Shimmer over small labels (21st.dev "text shimmer"); base color stays the label's own color */
.sb-fx .sb-shimmer {
	color: inherit; -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
	background-image: linear-gradient(90deg, transparent calc(50% - 2.2em), rgba(255, 255, 255, .55), transparent calc(50% + 2.2em)), linear-gradient(currentColor, currentColor);
	background-size: 250% 100%, auto; background-repeat: no-repeat; animation: sbTextShimmer 3.2s linear infinite;
}
@keyframes sbTextShimmer { from { background-position: 100% center, 0 0; } to { background-position: 0% center, 0 0; } }
.sb-ico { width: 1.25em; height: 1.25em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.sb-header {
	position: relative; z-index: 100; width: 100%;
	background: rgba(255, 248, 243, .96);
	transition: background-color .35s, box-shadow .35s, transform .35s var(--sb-ease);
}
.sb-header-sticky .sb-header { position: sticky; top: 0; }
.admin-bar.sb-header-sticky .sb-header { top: 32px; }
.sb-header-transparent .sb-header { position: fixed; top: 0; left: 0; background: transparent; }
.admin-bar.sb-header-transparent .sb-header { top: 32px; }
.sb-header-transparent:not(.sb-header-sticky) .sb-header { position: absolute; }
.sb-header.is-scrolled { background: rgba(255, 248, 243, .94); box-shadow: 0 4px 24px rgba(74, 46, 42, .08); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sb-header__inner {
	max-width: 1240px; margin: 0 auto; padding: 0 24px; height: var(--sb-header-h);
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.sb-brand__name { font-family: var(--sb-serif); font-size: 1.6rem; font-weight: 700; color: var(--sb-heading); text-decoration: none; letter-spacing: -.01em; }
.sb-brand .custom-logo { max-height: 54px; width: auto; display: block; }
.sb-nav { display: flex; align-items: center; gap: 30px; }
.sb-menu { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.sb-menu li { position: relative; }
.sb-menu a { color: var(--sb-heading); text-decoration: none; font-weight: 700; font-size: .96rem; position: relative; padding: 6px 0; }
.sb-menu > li > a::after {
	content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
	background: var(--sb-primary); transform: scaleX(0); transform-origin: right; transition: transform .3s var(--sb-ease);
}
.sb-menu > li > a:hover::after, .sb-menu > .current-menu-item > a::after { transform: scaleX(1); transform-origin: left; }
.sb-menu .sub-menu {
	position: absolute; top: 100%; left: -16px; min-width: 200px; list-style: none; margin: 10px 0 0; padding: 10px 0;
	background: var(--sb-white); border-radius: 14px; box-shadow: var(--sb-shadow);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .25s var(--sb-ease);
}
.sb-menu li:hover > .sub-menu, .sb-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.sb-menu .sub-menu a { display: block; padding: 8px 18px; }
.sb-header__cta { padding: 10px 22px; font-size: .92rem; }
.sb-nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.sb-nav-toggle__bar { display: block; width: 24px; height: 2px; background: var(--sb-heading); margin: 5px auto; border-radius: 2px; transition: transform .3s, opacity .3s; }
.sb-nav-toggle[aria-expanded="true"] .sb-nav-toggle__bar:nth-child(2) { transform: translateY(7px) rotate(45deg); }
.sb-nav-toggle[aria-expanded="true"] .sb-nav-toggle__bar:nth-child(3) { opacity: 0; }
.sb-nav-toggle[aria-expanded="true"] .sb-nav-toggle__bar:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
	.sb-nav-toggle { display: block; }
	.sb-nav {
		position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
		background: var(--sb-bg); box-shadow: 0 16px 30px rgba(74, 46, 42, .12);
		max-height: 0; overflow: hidden; transition: max-height .45s var(--sb-ease);
	}
	.sb-nav.is-open { max-height: 80vh; overflow-y: auto; }
	.sb-menu { flex-direction: column; gap: 0; padding: 8px 0; }
	.sb-menu a { display: block; padding: 14px 24px; }
	.sb-menu > li > a::after { display: none; }
	.sb-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: transparent; padding: 0 0 0 16px; margin: 0; }
	.sb-header__cta { margin: 6px 24px 20px; }
}
@media (max-width: 782px) {
	.admin-bar.sb-header-sticky .sb-header, .admin-bar.sb-header-transparent .sb-header { top: 46px; }
}

/* ---------- Footer ---------- */
.sb-footer { background: var(--sb-heading); color: rgba(255, 255, 255, .78); text-align: center; padding: 60px 24px 40px; }
.sb-footer__brand { font-family: var(--sb-serif); font-size: 1.9rem; font-weight: 700; color: var(--sb-white); text-decoration: none; }
.sb-footer__tagline { font-family: var(--sb-serif); font-style: italic; margin: 8px 0 18px; }
.sb-footer__menu { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.sb-footer__menu a { color: var(--sb-white); text-decoration: none; font-weight: 600; }
.sb-footer__copy { font-size: .9rem; opacity: .7; margin: 0; }

/* ---------- Regular pages & posts ---------- */
.sb-page { max-width: 860px; margin: 0 auto; padding: 60px 24px 80px; }
.sb-header-transparent .sb-page { padding-top: calc(var(--sb-header-h) + 60px); }
/* Space the hero leaves for a transparent header sitting on top of it */
.sb-header-transparent { --sb-hero-offset: var(--sb-header-h); }
.sb-page__title { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.sb-page__meta { font-size: .9rem; opacity: .8; }
.sb-page__thumb img { border-radius: var(--sb-radius); margin: 20px 0 30px; }
.sb-page__content > * { margin-bottom: 1.2em; }
.sb-post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; margin-top: 30px; }
.sb-post-card { background: var(--sb-white); border-radius: var(--sb-radius); overflow: hidden; box-shadow: var(--sb-shadow); }
.sb-post-card__thumb img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.sb-post-card__body { padding: 22px; }
.sb-post-card__title { font-size: 1.3rem; }
.sb-post-card__title a { color: inherit; text-decoration: none; }

/* Elementor pages: let sections touch the header when it's transparent */
.sb-main { display: block; }
.sb-header-sticky:not(.sb-header-transparent) .sb-main { min-height: 50vh; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
