/*
Theme Name: Serenity by Imagined By Design
Theme URI: https://imaginedbydesign.com
Author: Imagined By Design
Author URI: https://imaginedbydesign.com
Description: A calm, botanical block theme for hair and nail salons, day spas, lash and brow studios and barbers. Includes a printed-style services menu, arched photos, three style variations and ready-made pages, all editable in the Site Editor with no page builder or required plugins.
Version: 1.0.0
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: serenity
Tags: full-site-editing, block-patterns, style-variations, wide-blocks, editor-style, one-column, custom-colors, custom-logo, blog, portfolio
*/

/* Only what theme.json can't do. */

html {
	scroll-padding-top: 96px;
}

body {
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

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

body.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

/* Show the Site Title only until a logo is added. */
body:not(.editor-styles-wrapper) .wp-block-site-logo + .wp-block-site-title {
	display: none;
}

.wp-block-site-logo img {
	max-height: 54px;
	width: auto;
}

/* Comfortable tap targets */
.wp-block-navigation .wp-block-navigation-item__content {
	justify-content: center;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	justify-content: center;
	align-items: center;
}

.wp-block-social-links .wp-social-link a {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wp-block-button__link {
	min-height: 52px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Label: small uppercase text with a thin rule */
.is-style-label {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	letter-spacing: 0.22em;
	line-height: 1.3;
	text-transform: uppercase;
}

.is-style-label::before {
	content: "";
	flex: none;
	width: 28px;
	height: 1px;
	background: currentColor;
	opacity: 0.7;
}

/* Link Arrow button */
.wp-block-button.is-style-link-arrow .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--primary);
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	padding: 0 0 3px;
	min-height: 44px;
	letter-spacing: 0;
}

.wp-block-button.is-style-link-arrow .wp-block-button__link::after {
	content: "\2192";
	margin-left: 10px;
	transition: transform 0.3s ease;
}

.wp-block-button.is-style-link-arrow .wp-block-button__link:hover::after {
	transform: translateX(4px);
}

/* Page regions sit flush against each other */
.wp-site-blocks > main,
.wp-site-blocks > .wp-block-template-part {
	margin-block-start: 0;
}

/* Footer */
.serenity-footer .wp-block-separator {
	height: 1px;
	border: 0;
	opacity: 0.25;
}

.serenity-footer .wp-block-social-links {
	margin-left: -12px;
}

@media (min-width: 600px) and (max-width: 781px) {
	.serenity-footer .wp-block-columns:not(.is-not-stacked-on-mobile) {
		flex-wrap: wrap;
	}

	.serenity-footer .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: calc(50% - var(--wp--preset--spacing--50)) !important;
	}
}

/* Header and sticky Book button on phones */
body .wp-block-buttons.serenity-mobile-book {
	display: none;
}

@media (max-width: 599px) {
	body .wp-block-buttons.serenity-header-book {
		display: none;
	}

	body .wp-block-buttons.serenity-mobile-book {
		display: flex;
		position: fixed;
		z-index: 45;
		left: 16px;
		right: 16px;
		bottom: max(16px, env(safe-area-inset-bottom));
		margin: 0;
	}

	.serenity-mobile-book .wp-block-button,
	.serenity-mobile-book .wp-block-button__link {
		width: 100%;
	}

	.serenity-footer {
		padding-bottom: 110px;
	}
}

/* Label also works on headings */
h2.is-style-label,
h3.is-style-label {
	font-family: var(--wp--preset--font-family--body);
	letter-spacing: 0.22em;
}

/* Hero */
.wp-block-cover.serenity-hero {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
}

/* Below 1200px the photo sits on top so the text stays readable */
@media (max-width: 1199px) {
	.wp-block-cover.serenity-hero {
		display: block;
		min-height: 0 !important;
		padding: 0 0 72px;
	}

	.wp-block-cover.serenity-hero .wp-block-cover__image-background {
		position: relative;
		display: block;
		width: 100%;
		height: 58svh;
		min-height: 340px;
		object-position: 80% center;
	}

	.wp-block-cover.serenity-hero .wp-block-cover__background {
		top: 0;
		bottom: auto;
		height: max(58svh, 340px);
		opacity: 1;
		background: linear-gradient(
			180deg,
			transparent 0,
			transparent 55%,
			var(--wp--preset--color--base) 100%
		) !important;
	}

	.wp-block-cover.serenity-hero .wp-block-cover__inner-container {
		position: relative;
		box-sizing: border-box;
		width: 100%;
		padding-inline: clamp(20px, 5vw, 56px);
	}
}

/* Arched photos */
.is-style-arch img {
	border-radius: 240px 240px 18px 18px;
}

.is-style-arch-down img {
	border-radius: 18px 18px 240px 240px;
}

/* Promises */
.serenity-promise {
	border-top: 1px solid var(--wp--preset--color--border);
	padding-top: var(--wp--preset--spacing--40);
}

.serenity-promise > .wp-block-image {
	flex: none;
	margin-top: 4px;
}

/* Printed menu */
.is-style-printed-menu {
	position: relative;
	border: var(--wp--custom--card--border);
	border-radius: var(--wp--custom--card--radius);
	padding: clamp(28px, 5vw, 72px);
	box-shadow: var(--wp--preset--shadow--soft);
}

.is-style-printed-menu::before {
	content: "";
	position: absolute;
	inset: 14px;
	border: 1px solid var(--wp--preset--color--border);
	outline: 1px solid var(--wp--preset--color--border);
	outline-offset: -6px;
	border-radius: 2px;
	pointer-events: none;
}

.is-style-printed-menu > * {
	position: relative;
}

.is-style-menu-row > .wp-block-group:first-child > p:first-child {
	order: 0;
}

.is-style-menu-row > .wp-block-group:first-child::after {
	content: "";
	order: 1;
	flex: 1;
	min-width: 20px;
	border-bottom: 1px dotted var(--wp--preset--color--muted);
	transform: translateY(-5px);
}

.is-style-menu-row > .wp-block-group:first-child > p:last-child {
	order: 2;
	white-space: nowrap;
}

.is-style-menu-row > .wp-block-group:last-child > p:last-child {
	white-space: nowrap;
}

/* Steps with a thin timeline */
.serenity-steps {
	position: relative;
}

.serenity-steps::before {
	content: "";
	position: absolute;
	left: 6px;
	top: 12px;
	bottom: 12px;
	width: 1px;
	background: var(--wp--preset--color--decor);
	opacity: 0.35;
}

.serenity-step {
	position: relative;
	padding-left: 44px;
}

.serenity-step::before {
	content: "";
	position: absolute;
	left: 0;
	top: 10px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: var(--wp--preset--color--deep);
	border: 1px solid var(--wp--preset--color--decor);
}

/* Staggered gallery */
.wp-block-columns.is-style-staggered {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: clamp(14px, 2vw, 26px);
	align-items: start;
}

.wp-block-columns.is-style-staggered > .wp-block-column {
	min-width: 0;
	flex-basis: auto !important;
}

.is-style-staggered > :nth-child(1) { grid-column: 1 / span 4; }
.is-style-staggered > :nth-child(2) { grid-column: 5 / span 4; margin-top: 90px; }
.is-style-staggered > :nth-child(3) { grid-column: 9 / span 4; margin-top: 20px; }
.is-style-staggered > :nth-child(4) { grid-column: 2 / span 5; margin-top: -40px; }
.is-style-staggered > :nth-child(5) { grid-column: 7 / span 4; margin-top: 40px; }

.is-style-staggered .wp-block-image {
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	margin: 0;
}

.is-style-staggered .wp-block-image img {
	transition: transform 1.1s ease;
}

.is-style-staggered .wp-block-image:hover img {
	transform: scale(1.04);
}

.is-style-staggered .wp-element-caption {
	position: absolute;
	left: 14px;
	bottom: 14px;
	margin: 0;
	padding: 8px 14px;
	border-radius: 4px;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 94%, transparent);
	color: var(--wp--preset--color--ink);
	font-weight: 500;
}

/* Offset team cards */
.wp-block-columns.is-style-offset {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: clamp(18px, 2.4vw, 34px);
}

.wp-block-columns.is-style-offset > .wp-block-column {
	min-width: 0;
	flex-basis: auto !important;
}

.is-style-offset > :nth-child(even) {
	margin-top: 60px;
}

/* Large quote */
.wp-block-quote.is-style-large-quote {
	border: 0;
	padding: 0;
}

.wp-block-quote.is-style-large-quote::before {
	content: "\201C";
	display: block;
	height: 0.5em;
	margin-bottom: 0.05em;
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(6rem, 10vw, 9rem);
	line-height: 1;
	color: var(--wp--preset--color--decor);
}

.wp-block-quote.is-style-large-quote p {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--heading-medium);
	font-weight: 500;
	line-height: 1.2;
}

/* Space between a section heading and the columns under it */
.has-global-padding > .wp-block-heading + .wp-block-columns {
	margin-top: var(--wp--preset--spacing--50);
}

/* Tighter top spacing directly under a page title */
.wp-block-post-content > :first-child:not(.has-background),
.wp-block-post-content > :first-child + :not(.has-background) {
	padding-top: var(--wp--preset--spacing--30) !important;
}

/* Phone menu: large centered links */
.wp-block-navigation__responsive-container.is-menu-open {
	--navigation-layout-justification-setting: center;
	--navigation-layout-justify: center;
	--navigation-layout-align: center;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: center;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	align-items: center !important;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.75rem, 8vw, 2.2rem);
	font-weight: 500;
}

/* Soft card shadow */
.serenity-card {
	border: var(--wp--custom--card--border);
	border-radius: var(--wp--custom--card--radius);
	box-shadow: var(--wp--preset--shadow--soft);
}

/* FAQ */
.serenity-faq {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-bottom: var(--wp--preset--spacing--30);
}

.serenity-faq summary {
	display: list-item;
	min-height: 44px;
	padding-block: 8px;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--heading-small);
	font-weight: 600;
	line-height: 1.25;
}

/* Hours table */
.serenity-hours table {
	border-collapse: collapse;
}

.serenity-hours td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 10px 0;
}

.serenity-hours td:last-child {
	text-align: right;
	color: var(--wp--preset--color--muted);
}

@media (max-width: 1060px) {
	.wp-block-columns.is-style-offset {
		grid-template-columns: repeat(2, 1fr);
	}

	.is-style-offset > :nth-child(even) {
		margin-top: 40px;
	}
}

@media (max-width: 781px) {
	.wp-block-columns.is-style-staggered {
		grid-template-columns: 1fr 1fr;
	}

	.is-style-staggered > :nth-child(n) {
		grid-column: auto;
		margin-top: 0;
	}

	.is-style-staggered > :nth-child(even) {
		margin-top: 36px;
	}

	.is-style-staggered > :nth-child(5) {
		grid-column: 1 / -1;
	}

	.is-style-staggered .wp-element-caption {
		left: 8px;
		bottom: 8px;
		padding: 6px 10px;
		font-size: 0.78rem;
	}
}

/* Gentle fade-in on scroll, where the browser supports it */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		body:not(.editor-styles-wrapper) main > .wp-block-group.alignfull > * {
			animation: serenity-rise linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 35%;
		}
	}
}

@keyframes serenity-rise {
	from {
		opacity: 0;
		transform: translateY(26px);
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* Coming Soon page fills the screen */
.serenity-coming-soon {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Breathing room when a page ends in ordinary text */
body.page .wp-block-post-content > :last-child:not(.alignfull) {
	margin-bottom: var(--wp--preset--spacing--70);
}

/* Blog posts: headings stay smaller than the post title */
body.single-post .wp-block-post-content h2 {
	font-size: var(--wp--preset--font-size--heading-medium);
}

body.single-post .wp-block-post-content h3 {
	font-size: var(--wp--preset--font-size--heading-small);
}

/* The header Book button stays on one line */
.serenity-header-book {
	flex-shrink: 0;
}

.serenity-header-book .wp-block-button__link {
	white-space: nowrap;
}

/* Form fields follow the active style variation */
.wp-block-search__input,
.comment-form input:not([type="submit"], [type="checkbox"]),
.comment-form textarea {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 4px;
	color: var(--wp--preset--color--ink);
}

/* Style Guide swatches */
.serenity-swatch {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 4px;
}

/* Blog posts: room above each heading */
body.single-post .wp-block-post-content :is(h2, h3) {
	margin-top: var(--wp--preset--spacing--50);
}

/* Back to top button: appears after scrolling */
html {
	scroll-behavior: smooth;
}

body .wp-block-buttons.serenity-back-to-top {
	position: fixed;
	z-index: 44;
	right: 16px;
	bottom: max(16px, env(safe-area-inset-bottom));
	margin: 0;
}

.serenity-back-to-top .wp-block-button__link {
	min-height: 44px;
	padding: 0.5rem 1rem;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0;
}

.serenity-back-to-top .wp-block-button__link:hover {
	background: var(--wp--preset--color--alt);
	color: var(--wp--preset--color--ink);
}

@media (max-width: 599px) {
	body .wp-block-buttons.serenity-back-to-top {
		bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px);
	}
}

@supports (animation-timeline: scroll()) {
	body:not(.editor-styles-wrapper) .serenity-back-to-top {
		animation: serenity-show-top linear both;
		animation-timeline: scroll(root);
		animation-range: 300px 500px;
	}
}

@keyframes serenity-show-top {
	from {
		opacity: 0;
		visibility: hidden;
	}

	to {
		opacity: 1;
		visibility: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
