/* ==========================================================================
   Crispy Dough Co — theme styles
   Design canvas: 1920px. Values are exact at 1920 and scale down with clamp().
   Tokens live in theme.json (--wp--preset--*); this file only adds what
   theme.json cannot express (layout grids, pseudo-element icons, motion).
   ========================================================================== */

html,
body {
	overflow-x: clip;
}

body {
	background: var(--wp--preset--gradient--page) #9d3923;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img {
	max-width: 100%;
	height: auto;
}

.screen-reader-text:not(:focus) {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

/* Buttons: colour change only, no movement. */
.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* ==========================================================================
   Header
   1920 spec: nav x181, links 18px/400 white, gap 25px · logo 242×153 at x837 y38
   · phone icon 19×25 + 9px gap + number · CTA 227×64 pill ending x1735.
   ========================================================================== */

.cdc-header {
	position: relative;
	z-index: 50;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	column-gap: 24px;
}

.cdc-header > * {
	margin-block: 0;
}

.cdc-header__nav {
	justify-self: start;
	min-width: 0;
	position: relative;
	top: 0.5px; /* optical: matches design baseline */
	letter-spacing: -0.005em;
	font-weight: 300;
}

.cdc-header__nav .wp-block-navigation-item,
.cdc-header__nav .wp-block-navigation-item__content {
	white-space: nowrap;
	line-height: 1.2;
}

/* Animated underline: draws in left → right on hover (nav + footer links). */
.cdc-header__nav .wp-block-navigation-item__content,
.cdc-footer__links a {
	text-decoration: none !important;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
	transition: background-size 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

.cdc-header__nav .wp-block-navigation-item__content:hover,
.cdc-header__nav .wp-block-navigation-item__content:focus-visible,
.cdc-header__nav .current-menu-item > .wp-block-navigation-item__content,
.cdc-footer__links a:hover,
.cdc-footer__links a:focus-visible {
	background-size: 100% 1.5px;
}

/* Overlay menu (mobile): no underline, and the CTA keeps its own pill. */
.cdc-header .is-menu-open .wp-block-navigation-item__content { background-size: 0 0 !important; }
.cdc-header .is-menu-open .cdc-nav-cta .wp-block-navigation-item__content { background: var(--wp--preset--color--white) !important; }

.cdc-header__logo {
	justify-self: center;
	line-height: 0;
}

.cdc-header__logo img,
.cdc-header__logo .custom-logo {
	width: clamp(120px, calc(169.4px + 3.78vw), 242px) !important;
	height: auto !important;
	aspect-ratio: 242 / 153;
}

.cdc-header__actions {
	justify-self: end;
	gap: clamp(16px, 2.083vw, 40px);
}

.cdc-header__actions > * {
	margin: 0;
}

/* Phone number with icon (icon is CSS so the text stays editable). */
.cdc-phone {
	margin: 0;
	white-space: nowrap;
	line-height: 1;
	font-weight: 300;
	letter-spacing: -0.07em; /* design numerals are narrower than THICCCBOI; -0.07em keeps digits from touching */
	position: relative;
	top: 2px;
}

.cdc-phone a {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: inherit;
}

.cdc-phone a::before {
	content: "";
	flex: none;
	width: 19.25px;
	height: 24.7px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0.85 0.7 19.25 24.72'%3E%3Cpath d='M10.6 9.32 8.66 11.06C8.92 11.93 9.27 12.78 9.73 13.57 10.2 14.36 10.77 15.09 11.42 15.73L13.93 14.96C15.33 14.53 16.87 14.97 17.8 16.08L19.23 17.79C19.81 18.47 20.1 19.35 20.04 20.24 19.98 21.14 19.58 21.97 18.91 22.57 16.58 24.7 12.99 25.42 10.3 23.31 7.94 21.45 5.94 19.17 4.41 16.58 2.87 14.01 1.84 11.16 1.37 8.2.86 4.87 3.3 2.2 6.34 1.29 8.15.75 10.09 1.68 10.75 3.42L11.54 5.47C12.06 6.82 11.69 8.34 10.6 9.32Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0.85 0.7 19.25 24.72'%3E%3Cpath d='M10.6 9.32 8.66 11.06C8.92 11.93 9.27 12.78 9.73 13.57 10.2 14.36 10.77 15.09 11.42 15.73L13.93 14.96C15.33 14.53 16.87 14.97 17.8 16.08L19.23 17.79C19.81 18.47 20.1 19.35 20.04 20.24 19.98 21.14 19.58 21.97 18.91 22.57 16.58 24.7 12.99 25.42 10.3 23.31 7.94 21.45 5.94 19.17 4.41 16.58 2.87 14.01 1.84 11.16 1.37 8.2.86 4.87 3.3 2.2 6.34 1.29 8.15.75 10.09 1.68 10.75 3.42L11.54 5.47C12.06 6.82 11.69 8.34 10.6 9.32Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cdc-header__cta .wp-block-button__link {
	white-space: nowrap;
}

/* Mobile-only nav items (phone + CTA) live inside the overlay menu. */
.cdc-header .cdc-nav-mobile-only {
	display: none;
}

.cdc-header .is-menu-open .cdc-nav-mobile-only {
	display: flex;
}

/* Hamburger + overlay */
.cdc-header .wp-block-navigation__responsive-container-open,
.cdc-header .wp-block-navigation__responsive-container-close {
	width: 44px;
	height: 44px;
	justify-content: center;
	align-items: center;
	color: var(--wp--preset--color--white);
}

.cdc-header .wp-block-navigation__responsive-container-open svg,
.cdc-header .wp-block-navigation__responsive-container-close svg {
	width: 32px;
	height: 32px;
}

.cdc-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 24px clamp(16px, 5vw, 48px);
	background: var(--wp--preset--gradient--brand) !important;
}

.cdc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 72px;
	gap: 22px;
}

.cdc-header .is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(26px, 6vw, 36px);
	font-weight: 800;
}

.cdc-header .is-menu-open .cdc-nav-cta .wp-block-navigation-item__content {
	margin-top: 12px;
	padding: 16px 36px;
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 18px;
	font-weight: 600;
}

/* Laptop → tablet: hamburger takes over below 1200px. */
@media (max-width: 1199.98px) {
	.cdc-header {
		display: flex;
		justify-content: space-between;
		gap: 16px;
	}

	.cdc-header__logo {
		order: -1;
		margin-right: auto;
	}

	.cdc-header__nav {
		order: 2;
	}

	.cdc-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.cdc-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}

	.cdc-phone {
		display: none;
	}

	.cdc-header__logo img,
	.cdc-header__logo .custom-logo {
		width: clamp(110px, 15vw, 180px) !important;
	}
}

/* Small phones: CTA moves into the overlay menu. */
@media (max-width: 479.98px) {
	.cdc-header .cdc-header__cta {
		display: none;
	}
}

/* ==========================================================================
   Motion — header entrance (CSS only) + scroll reveal (assets/js/reveal.js)
   ========================================================================== */

@keyframes cdc-fade-down {
	from { opacity: 0; transform: translateY(-16px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
	.cdc-header > * {
		/* "backwards" so no transform lingers afterwards (it would trap the fixed mobile overlay). */
		animation: cdc-fade-down 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
	}

	.cdc-header > :nth-child(2) { animation-delay: 0.1s; }
	.cdc-header > :nth-child(3) { animation-delay: 0.2s; }

	.js .cdc-reveal-init {
		opacity: 0;
		transform: translateY(32px);
		transition: opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
		transition-delay: var(--cdc-reveal-delay, 0s);
	}

	.js .cdc-reveal-init.is-revealed {
		opacity: 1;
		transform: none;
	}
}

/* ==========================================================================
   Header overlay — the header floats over the top of every page.
   --cdc-header-h mirrors its real height (padding + logo height).
   ========================================================================== */

:root {
	--cdc-header-h: calc(clamp(16px, 2.005vw, 38.5px) + clamp(16px, 1.98vw, 38px) + clamp(120px, calc(169.4px + 3.78vw), 242px) * 0.6322);
}

@media (max-width: 1199.98px) {
	:root {
		--cdc-header-h: calc(clamp(16px, 2.005vw, 38.5px) + clamp(16px, 1.98vw, 38px) + clamp(110px, 15vw, 180px) * 0.6322);
	}
}

.wp-site-blocks {
	position: relative;
}

.wp-site-blocks > header.wp-block-template-part {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
}

.wp-site-blocks > .cdc-main {
	margin-block-start: 0;
	padding-top: var(--cdc-header-h);
}

/* Pages that open with a full-bleed hero let it run under the header. */
.wp-site-blocks > .cdc-main:has(> .wp-block-post-content > .cdc-hero:first-child) {
	padding-top: 0;
}

.cdc-main > .wp-block-post-content > .cdc-hero:first-child {
	margin-block-start: 0;
}

/* Full-bleed sections sit flush against each other and the footer. */
.cdc-main > .wp-block-post-content > .alignfull,
.wp-site-blocks > footer.wp-block-template-part {
	margin-block: 0;
}

@keyframes cdc-fade-up {
	from { opacity: 0; transform: translateY(24px); }
	to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Back-to-top button (bottom right)
   ========================================================================== */

.cdc-to-top {
	--p: 0;
	position: fixed;
	right: clamp(16px, 2vw, 32px);
	bottom: clamp(16px, 2vw, 32px);
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--white);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s, background-color 0.2s ease;
}

.cdc-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease, visibility 0s, background-color 0.2s ease;
}

.cdc-to-top:hover,
.cdc-to-top:focus-visible {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

.cdc-to-top:focus-visible {
	outline: 2px solid var(--wp--preset--color--white);
	outline-offset: 3px;
}

/* Scroll-progress ring around the back-to-top button (--p: 0 → 1). */
.cdc-to-top__ring {
	position: absolute;
	inset: -5px;
	width: calc(100% + 10px);
	height: calc(100% + 10px);
	transform: rotate(-90deg);
	pointer-events: none;
}

.cdc-to-top__ring circle {
	fill: none;
	stroke-width: 3;
}

.cdc-to-top__ring .cdc-ring-track { stroke: rgba(255, 255, 255, 0.25); }

.cdc-to-top__ring .cdc-ring-fill {
	stroke: var(--wp--preset--color--white);
	stroke-linecap: round;
	stroke-dasharray: 100;
	stroke-dashoffset: calc(100 - var(--p) * 100);
}

/* ==========================================================================
   Fire hover — every button. Flames rise from the bottom and flicker
   (two blurred layers drifting in opposite directions). CSS only.
   ========================================================================== */

.wp-block-button__link {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transition: color 0.3s ease 0.1s, text-shadow 0.3s ease;
}

.wp-block-button__link::before,
.wp-block-button__link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: calc(100% + 80px);
	height: 0;
	z-index: -1;
	pointer-events: none;
	transition: height 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Outer flames: deep red → orange tongues. */
.wp-block-button__link::before {
	background:
		radial-gradient(ellipse 50% 92% at 50% 100%, #ff8a1f 0 38%, #f0461d 58%, rgba(214, 38, 22, 0.85) 66%, transparent 74%) 0 100% / 40px 100% repeat-x,
		linear-gradient(to top, #d9261a 0 38%, rgba(232, 60, 28, 0) 78%);
	filter: blur(5px);
	transform-origin: 50% 100%;
}

/* Inner flames: hot yellow cores. */
.wp-block-button__link::after {
	left: -40px;
	background: radial-gradient(ellipse 45% 80% at 50% 100%, #fff4b8 0 16%, #ffd23f 40%, rgba(255, 150, 30, 0.8) 58%, transparent 70%) 0 100% / 28px 100% repeat-x;
	filter: blur(3.5px);
	opacity: 0.95;
	transform-origin: 50% 100%;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
	color: var(--wp--preset--color--white) !important;
	text-shadow: 0 0 8px rgba(120, 20, 0, 0.55);
}

.wp-block-button__link:hover::before,
.wp-block-button__link:focus-visible::before { height: 175%; }

.wp-block-button__link:hover::after,
.wp-block-button__link:focus-visible::after { height: 95%; }

@keyframes cdc-flame-a {
	0% { transform: translateX(0) scaleY(1); }
	25% { transform: translateX(-10px) scaleY(1.12); }
	50% { transform: translateX(-20px) scaleY(0.94); }
	75% { transform: translateX(-30px) scaleY(1.08); }
	100% { transform: translateX(-40px) scaleY(1); }
}

@keyframes cdc-flame-b {
	0% { transform: translateX(0) scaleY(1); }
	33% { transform: translateX(9px) scaleY(1.18); }
	66% { transform: translateX(19px) scaleY(0.9); }
	100% { transform: translateX(28px) scaleY(1); }
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-button__link:hover::before,
	.wp-block-button__link:focus-visible::before { animation: cdc-flame-a 0.7s linear infinite; }

	.wp-block-button__link:hover::after,
	.wp-block-button__link:focus-visible::after { animation: cdc-flame-b 0.5s linear infinite; }
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-button__link::before,
	.wp-block-button__link::after { transition: none; }
}
