/*
 * Maria Perlman theme: global and home-page component CSS.
 *
 * What theme.json can say (palette, type, spacing, buttons) lives there. This is
 * the rest, ported from theme/assets/critical.css and the {% stylesheet %}
 * blocks of the Shopify sections. The brush images arrive as --stroke-* and
 * --edge-* custom properties from functions.php.
 */

:root {
	--page-width: 77.5rem;
	--page-margin: 40px;
	--paper: var(--wp--preset--color--paper);
	--paper-light: var(--wp--preset--color--paper-light);
	--ink: var(--wp--preset--color--ink);
	--muted: var(--wp--preset--color--muted);
	--pine: var(--wp--preset--color--pine);
	--olive: var(--wp--preset--color--olive);
	--blue: var(--wp--preset--color--blue);
	--blue-pale: var(--wp--preset--color--blue-pale);
	--rule: var(--wp--preset--color--rule);
	--sold: #b23a2e; /* the gallery's red dot for a sold original */
	--serif: var(--wp--preset--font-family--serif);
	--sans: var(--wp--preset--font-family--sans);
}

/* Base ---------------------------------------------------------------- */

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 92px;
}

body {
	-webkit-font-smoothing: antialiased;
	min-height: 100svh;
}

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100svh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

img,
svg {
	max-width: 100%;
	height: auto;
}

input,
textarea,
select {
	font: inherit;
	border-radius: 0;
}

select {
	background-color: var(--paper-light);
	color: currentcolor;
}

p {
	text-wrap: pretty;
	overflow-wrap: break-word;
}

p:empty {
	display: none;
}

a {
	text-decoration-color: var(--olive);
	text-underline-offset: 4px;
}

:focus-visible {
	outline: 2px solid var(--pine);
	outline-offset: 5px;
}

::selection {
	background: #dfe2d2;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
	margin-block: 0;
}

h2 em,
h1 em {
	color: var(--pine);
}

.section {
	padding-block: 120px;
}

.text-link,
.wp-block-read-more.text-link {
	display: inline-block;
	padding: 2px 0;
	border-bottom: 1px solid var(--olive);
	color: var(--pine);
	font-size: 14px;
	line-height: 1.7;
	text-decoration: none;
}

.wp-block-buttons {
	gap: 12px;
}

.muted {
	color: var(--muted);
}

/* Section heading with an intro column (concept G). */
.section-head {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 24px;
	align-items: end;
	margin-bottom: 60px;
}

.section-head > .section-head__title {
	grid-column: 1 / 8;
	margin: 0;
}

.section-head__intro {
	grid-column: 9 / 13;
	margin: 0;
	color: var(--muted);
	font-size: 15px;
}

/* Maria's handwriting, painted in watercolour: image blocks sized by height. */
.wp-block-image.hw {
	margin: 0 0 18px;
}

.wp-block-image.hw img {
	display: block;
	width: auto;
	height: var(--h, 46px);
	aspect-ratio: var(--ar);
}

.hw--signature { --ar: 3.5; margin: 0; }
.hw--art-that-inspires { --ar: 4.84; }
.hw--atmospheric-watercolour-landscapes { --ar: 9.75; }
.hw--watercolours { --ar: 4.29; }
.hw--about-the-artist { --ar: 6.59; }
.hw--bespoke-art { --ar: 3.15; }
.hw--connect-with-me { --ar: 6.06; }

/* Header --------------------------------------------------------------- */

.wp-site-blocks > header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: color-mix(in srgb, var(--paper) 96%, transparent);
	border-bottom: 1px solid var(--rule);
	backdrop-filter: blur(10px);
}

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

.wp-block-group.site-header__inner {
	min-height: 84px;
	gap: 30px;
	flex-wrap: nowrap;
}

.site-header__logo {
	margin: 0;
	flex: none;
}

.site-header__logo a {
	display: block;
}

.wp-block-image.site-header__logo img {
	display: block;
	width: 200px;
	height: auto;
	margin-block: 4px;
}

.site-header__inner > .site-header__menu {
	margin-left: auto;
	gap: 28px;
}

.site-header__menu .wp-block-navigation__container {
	gap: 28px;
}

.site-header__menu a {
	border-bottom: 1px solid transparent;
	font-size: 14px;
	text-decoration: none;
}

.site-header__menu a:hover,
.site-header__menu a[aria-current] {
	border-color: var(--olive);
}

/* Basket: "Basket" and a ringed count, in place of WooCommerce's cart icon. */
.site-header__cart {
	flex: none;
	padding: 8px 0 8px 26px;
	border-left: 1px solid var(--rule);
	font-size: 14px;
}

.site-header__cart .wc-block-mini-cart__button {
	padding: 0;
	background: none;
	color: inherit;
	font-size: 14px;
	text-decoration: none;
}

.site-header__cart .wc-block-mini-cart__button:hover {
	opacity: 1;
	background: none;
}

.site-header__cart .wc-block-mini-cart__quantity-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.site-header__cart .wc-block-mini-cart__icon {
	display: none;
}

.site-header__cart .wc-block-mini-cart__badge {
	position: static;
	display: inline-grid;
	place-items: center;
	min-width: 24px;
	height: 24px;
	margin: 0;
	padding: 0 4px;
	border: 1px solid var(--pine);
	border-radius: 50%;
	background: none !important;
	color: var(--pine) !important;
	font-size: 13px;
	line-height: 1;
	transform: none;
}

.site-header__cart .wc-block-mini-cart__badge[hidden] {
	display: none;
}

/* Footer --------------------------------------------------------------- */

.site-footer {
	padding-block: 50px 35px;
}

.wp-block-group.site-footer__top {
	gap: 40px;
	align-items: flex-start;
}

.site-footer__signature {
	--h: 66px;
	margin-bottom: 10px;
}

.site-footer__tagline,
.site-footer__bottom {
	font-size: 12px;
}

.site-footer__tagline {
	margin: 0;
}

.site-footer__links {
	gap: 22px;
	font-size: 14px;
}

.site-footer__links .wp-block-navigation__container {
	gap: 22px;
}

.site-footer__links a {
	text-decoration: underline;
}

.site-footer__bottom {
	margin-top: 50px;
	padding-top: 48px;
	background: var(--stroke-1) no-repeat center top / 100% auto;
	color: var(--muted);
}

.site-footer__bottom p {
	margin: 0;
}

/* Hero ----------------------------------------------------------------- */

.hero {
	position: relative;
	padding-top: 76px;
}

/* A large painting fading into the paper behind the title page. */
.hero > .hero__backdrop {
	position: absolute;
	z-index: 0;
	inset: 0 0 auto;
	width: 100%;
	max-width: none;
	height: 640px;
	margin: 0 !important;
	overflow: hidden;
	pointer-events: none;
}

.wp-block-image.hero__backdrop img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.3;
	filter: blur(2px) saturate(0.7);
	-webkit-mask-image: radial-gradient(ellipse 60% 70% at 70% 40%, #000 20%, transparent 75%);
	mask-image: radial-gradient(ellipse 60% 70% at 70% 40%, #000 20%, transparent 75%);
}

.hero__inner {
	position: relative;
	z-index: 1;
}

.hero__title {
	max-width: 960px;
	margin-left: 7%;
}

.hero__kicker {
	--h: 50px;
}

.hero h1 {
	margin-bottom: 32px;
	line-height: 0.99;
	letter-spacing: -0.047em;
}

/* The soft olive wash behind the italic word. */
.hero h1 em {
	position: relative;
	display: inline-block;
	white-space: nowrap;
	z-index: 0;
}

.hero h1 em::before {
	content: "";
	position: absolute;
	z-index: -1;
	width: 112%;
	height: 120%;
	left: -5%;
	top: -8%;
	background: var(--olive);
	opacity: 0.16;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 130' preserveAspectRatio='none'%3E%3Cpath d='M8 77C83 34 157 45 216 53s113 4 176-18c-18 34-5 63-31 73-73 13-153-8-225 2-51 7-92 3-128-33Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 130' preserveAspectRatio='none'%3E%3Cpath d='M8 77C83 34 157 45 216 53s113 4 176-18c-18 34-5 63-31 73-73 13-153-8-225 2-51 7-92 3-128-33Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.hero__intro {
	max-width: 520px;
	margin: 0 0 38px 34%;
	font: 20px/1.65 var(--serif);
}

.hero__action {
	margin-left: 34%;
}

.hero .hero__plate {
	margin-top: 76px;
	margin-bottom: 0;
}

.wp-block-image.hero__plate img {
	width: 100%;
	max-width: none;
	height: min(62vw, 690px);
	min-height: 400px;
	object-fit: cover;
	object-position: center 53%;
}

.wp-block-group.hero__signature {
	gap: 18px;
	margin-top: 32px;
	color: var(--muted);
	font: italic 14px var(--serif);
}

.hero__signature p {
	margin: 0;
}

.hero__signature-mark {
	--h: 50px;
}

/* Featured paintings --------------------------------------------------- */

.featured-paintings {
	background: var(--stroke-1) no-repeat center top / min(100%, 1100px) auto;
	margin-top: 70px;
}

/* Christmas cards (seasonal home feature) ------------------------------ */

.cards-feature {
	position: relative;
}

.cards-feature__layout {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 28px;
	align-items: center;
}

.cards-feature__main {
	grid-column: 1 / 6;
}

.cards-feature__cards {
	grid-column: 7 / 13;
}

.cards-feature__kicker {
	margin: 0 0 14px;
	color: var(--pine);
	font: italic 21px/1.3 var(--serif);
}

.cards-feature h2 {
	margin-bottom: 24px;
}

.cards-feature__text {
	max-width: 440px;
	margin: 0 0 22px;
	font: 20px/1.65 var(--serif);
}

.cards-feature__cutoff {
	max-width: 440px;
	margin: 0 0 8px;
	color: var(--muted);
	font-size: 14px;
}

.cards-feature__action {
	margin-top: 32px;
}

/* About ---------------------------------------------------------------- */

/* A painted wash edge rises from the section into the paper above. */
.about {
	position: relative;
}

.about::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(100% - 1px);
	height: clamp(40px, 6vw, 90px);
	pointer-events: none;
	background: var(--paper-light);
	-webkit-mask: var(--edge-1) no-repeat center / 100% 100%;
	mask: var(--edge-1) no-repeat center / 100% 100%;
}

.about__layout {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 28px;
}

.about__title {
	grid-column: 1 / 5;
}

.about__copy {
	grid-column: 6 / 12;
	padding-top: 10px;
}

.about__copy > p {
	margin: 0 0 1em;
	font: 21px/1.75 var(--serif);
}

.wp-block-group.about__signoff {
	gap: 20px;
	margin-top: 35px;
	padding-top: 22px;
	background: var(--stroke-2) no-repeat left top / 100% auto;
}

.about__signature {
	--h: 70px;
}

.about__note {
	max-width: 220px;
	margin: 0;
	color: var(--muted);
	font-size: 11px;
	text-align: right;
}

/* Bespoke -------------------------------------------------------------- */

/* Painted wash edges above and below; the lower one is the other brush edge, flipped. */
.bespoke {
	position: relative;
}

.bespoke::before,
.bespoke::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: clamp(40px, 6vw, 90px);
	pointer-events: none;
	background: var(--blue-pale);
	-webkit-mask: var(--edge) no-repeat center / 100% 100%;
	mask: var(--edge) no-repeat center / 100% 100%;
}

.bespoke::before {
	--edge: var(--edge-2);
	bottom: calc(100% - 1px);
}

.bespoke::after {
	--edge: var(--edge-1);
	top: calc(100% - 1px);
	transform: scale(-1, -1);
}

.bespoke__layout {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 28px;
	align-items: start;
}

.bespoke__main {
	grid-column: 1 / 8;
}

.bespoke__kicker {
	--h: 48px;
}

.bespoke h2 {
	margin-bottom: 24px;
}

.bespoke__text {
	max-width: 570px;
	margin: 0;
	font: 20px/1.65 var(--serif);
}

.bespoke__details {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	max-width: 570px;
	margin: 42px 0 0;
}

.bespoke__term {
	margin: 0;
	padding-top: 14px;
	background: var(--stroke-3) no-repeat left top / 100% auto;
	font: italic 17px var(--serif);
}

.bespoke__detail {
	margin: 4px 0 0;
	color: var(--muted);
	font-size: 13px;
}

.bespoke__aside {
	grid-column: 9 / 13;
}

/* Newsletter ----------------------------------------------------------- */

.newsletter {
	padding-block: 85px;
	background: var(--stroke-3) no-repeat center bottom / min(80%, 900px) auto;
}

.newsletter__layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10%;
	align-items: end;
}

.newsletter h2 {
	margin-bottom: 12px;
	font-size: clamp(34px, 4vw, 50px);
}

.newsletter__text {
	max-width: 480px;
	margin: 0;
	font-size: 14px;
}

/* Basic templates ------------------------------------------------------ */

.posts-list {
	list-style: none;
	margin: 40px 0;
	padding: 0;
}

.posts-list > li {
	margin-bottom: 36px;
}

.wp-block-search__input {
	border: 0;
	border-bottom: 1px solid var(--ink);
	background: transparent;
	color: var(--ink);
}

.wp-block-query-pagination {
	margin-top: 60px;
	gap: 14px;
}

/* Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
	.hero__title {
		margin-left: 0;
	}

	.hero__intro,
	.hero__action {
		margin-left: 22%;
	}

	.about__copy {
		grid-column: 5 / 13;
	}

	.cards-feature__main,
	.cards-feature__cards {
		grid-column: 1 / -1;
	}

	.cards-feature__cards {
		margin-top: 20px;
	}

	.bespoke__main {
		grid-column: 1 / 7;
	}

	.bespoke__aside {
		grid-column: 7 / 13;
	}

	.bespoke__details {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.bespoke__detail {
		margin-bottom: 14px;
	}
}

@media (max-width: 650px) {
	html body {
		font-size: 16px;
	}

	.section {
		padding-block: 78px;
	}

	.section-head {
		display: block;
		margin-bottom: 40px;
	}

	.section-head > .section-head__title {
		margin-bottom: 22px;
	}

	.section-head__intro {
		margin: 0;
	}

	/* Header: the menu drops to its own scrollable row, with 44px-tall tap targets. */
	.wp-block-group.site-header__inner {
		min-height: 64px;
		flex-wrap: wrap;
		gap: 0 16px;
		padding-block: 10px;
	}

	.site-header__inner > .site-header__cart {
		margin-left: auto;
		padding-left: 0;
		border-left: 0;
	}

	.site-header__inner > .site-header__menu {
		order: 3;
		width: 100%;
		margin: 2px 0 -10px;
		gap: 22px;
		overflow-x: auto;
		white-space: nowrap;
	}

	.site-header__menu .wp-block-navigation__container {
		width: 100%;
		justify-content: space-between;
		gap: 22px;
	}

	.site-header__menu a {
		display: flex;
		align-items: center;
		min-height: 44px;
		font-size: 15px;
	}

	.wp-block-image.site-header__logo img {
		width: 160px;
	}

	.site-footer__top,
	.site-footer__bottom {
		display: block;
	}

	.site-footer__links {
		margin-top: 22px;
	}

	.hero {
		padding-top: 48px;
	}

	/* The one-line phrase fills the column, keeping its proportions. */
	.wp-block-image.hero__kicker img {
		width: 100%;
		height: auto;
	}

	/* Beside "Originals & photo prints" the signature has about 145px. */
	.hero__signature-mark {
		--h: 40px;
	}

	.hero h1 {
		font-size: clamp(40px, 11.5vw, 58px);
		line-height: 1.03;
	}

	.hero__intro,
	.hero__action {
		margin-left: 10%;
	}

	.hero__intro {
		font-size: 18px;
	}

	.hero .hero__plate {
		margin-top: 52px;
	}

	.wp-block-image.hero__plate img {
		min-height: 0;
		height: 64vh;
		max-height: 520px;
	}

	.about__layout,
	.bespoke__layout {
		display: block;
	}

	.about__title {
		margin-bottom: 35px;
	}

	.about__copy > p {
		font-size: 19px;
	}

	.bespoke__text {
		font-size: 18px;
	}

	.bespoke__aside {
		margin-top: 50px;
	}

	.newsletter__layout {
		grid-template-columns: 1fr;
		gap: 35px;
	}
}

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

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}

/* Search */
.wp-block-search {
	margin: 24px 0 30px;
}

.wp-block-query-title {
	margin-bottom: 24px;
}

/* Product image carousel (inc/shop-cards.php) ------------------------- */

.mp-carousel {
	position: relative;
}

.mp-carousel__track {
	display: flex;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	list-style: none;
	aspect-ratio: var(--mp-ratio, 1);
}

.mp-carousel__track::-webkit-scrollbar {
	display: none;
}

.mp-carousel__slide {
	flex: 0 0 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
	scroll-snap-align: start;
}

.mp-carousel__slide a {
	display: block;
	height: 100%;
}

/* Every image is shown whole in the painting's shape. The framed mock-ups are square
   on a charcoal wall, so the space around them is filled with the wall's own light
   (lighter at the top) and the frame is never cut.
   .mp-carousel in front: the card's .painting-card__image img rule loads later. */
.mp-carousel .mp-carousel__slide img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	object-fit: contain;
}

.mp-carousel__slide + .mp-carousel__slide {
	background: linear-gradient(#3e3e3c, #30302f);
}

.mp-carousel__slide + .mp-carousel__slide,
.mp-carousel__slide + .mp-carousel__slide a {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* The mock-up keeps its own (square) box, so its edges can be feathered into
   that fill and no seam shows. */
.mp-carousel .mp-carousel__slide + .mp-carousel__slide img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(transparent, #000 10%, #000 90%, transparent);
	-webkit-mask-composite: source-in;
	mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(transparent, #000 10%, #000 90%, transparent);
	mask-composite: intersect;
}

/* Arrows and dots need the script; without it the track still scrolls. */
.mp-carousel:not(.is-ready) .mp-carousel__nav,
.mp-carousel:not(.is-ready) .mp-carousel__dots {
	display: none;
}

.mp-carousel__nav {
	position: absolute;
	top: calc(50% - 30px);
	width: 38px;
	height: 38px;
	padding: 0 0 3px;
	border: 0;
	border-radius: 50%;
	background: color-mix(in srgb, var(--paper-light) 88%, transparent);
	color: var(--ink);
	font: 24px/1 var(--serif);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s;
}

.mp-carousel__nav--prev {
	left: 8px;
}

.mp-carousel__nav--next {
	right: 8px;
}

.mp-carousel:hover .mp-carousel__nav,
.mp-carousel__nav:focus-visible {
	opacity: 1;
}

.mp-carousel .mp-carousel__nav[disabled] {
	opacity: 0;
	pointer-events: none;
}

.mp-carousel__dots {
	display: flex;
	justify-content: center;
	gap: 2px;
	margin-top: 8px;
}

.mp-carousel__dot {
	width: 17px;
	height: 17px;
	padding: 5px;
	border: 0;
	border-radius: 50%;
	background: var(--rule);
	background-clip: content-box;
	cursor: pointer;
}

.mp-carousel__dot[aria-current] {
	background-color: var(--ink);
}

@media (hover: none) {
	.mp-carousel__nav {
		opacity: 1;
	}
}

/* A sold Original (inc/shop-cards.php): red dot on the image and under the title. */

.mp-sold {
	position: relative;
}

.mp-sold__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: var(--sold-size, 104px);
	aspect-ratio: 360 / 338;
	padding-bottom: 1%;
	background: var(--sold-dot) no-repeat center / contain;
	color: var(--paper-light);
	line-height: 1;
	text-align: center;
	text-shadow: 0 1px 2px rgb(90 15 10 / 0.35);
	transform: rotate(-9deg);
	pointer-events: none;
}

.mp-sold__small {
	padding-left: 0.16em; /* balances the letter-spacing after the last letter */
	font-size: calc(var(--sold-size, 104px) * 0.1);
	line-height: 1;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

/* Nudged left a little: the italic leans right. */
.mp-sold__word {
	margin: 0.04em 0.08em 0 0;
	font: italic calc(var(--sold-size, 104px) * 0.38) / 0.8 var(--serif);
}

/* Larger on the painting's page. */
.painting__media .mp-sold {
	--sold-size: 150px;
}

.painting__sold::before {
	content: "";
	flex: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--sold);
}

.painting__sold {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: -6px 0 20px;
	color: var(--sold);
	font-size: 14px;
	letter-spacing: 0.02em;
}
