/*
Theme Name: Creative Expressions by AP
Theme URI: https://creativeexpressionsbyap.com
Author: Creative Expressions by AP
Description: A warm, editorial block theme for a hand-painted sign studio. Colors, fonts and spacing are locked in theme.json; all text and photos are edited in the normal WordPress editor.
Version: 1.0.3
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: creative-expressions
*/

/* Small, mobile-first additions that theme.json can't express. */

:root {
	--ce-hairline: rgba(43, 38, 34, 0.18);
	--ce-paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 0 0.15 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	--ce-linen-weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 .5h6M0 3.5h6' stroke='%23826a4f' stroke-opacity='.07'/%3E%3Cpath d='M.5 0v6M3.5 0v6' stroke='%23826a4f' stroke-opacity='.05'/%3E%3C/svg%3E");
}

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

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

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

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	overflow: hidden;
	position: absolute !important;
	width: 1px;
}

/* ---------- Textures (Group block style: "Linen texture") ---------- */

.is-style-linen {
	background-color: var(--wp--preset--color--linen);
	background-image: var(--ce-paper-grain), var(--ce-linen-weave);
}

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

.ce-header {
	border-bottom: 1px solid var(--ce-hairline);
}

.ce-header .wp-block-site-title a:hover {
	color: var(--wp--preset--color--clay);
}

.ce-header .wp-block-navigation-item__content[aria-current="page"],
.ce-header .current-menu-item > a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
}

/* ---------- Small labels ("eyebrows") ---------- */

.ce-eyebrow {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---------- Section rhythm ---------- */

/* Coloured bands sit flush against each other and against the footer. */
.wp-block-post-content > .alignfull + .alignfull,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Default pages: line narrow text up with the left edge of the title instead of centring it. */
.ce-page-body > :where(:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright)) {
	margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
}

.ce-section {
	padding-bottom: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--60);
}

.wp-block-post-content > .ce-section + .ce-section:not(.alignfull) {
	padding-top: 0;
}

.ce-measure > * {
	max-width: 36rem;
}

.ce-hello {
	font-style: italic;
}

.ce-section-head {
	margin-bottom: var(--wp--preset--spacing--40);
}

.ce-section-head > * {
	margin: 0;
}

.ce-facts,
.ce-plain-list {
	list-style: none;
	padding-left: 0;
}

.ce-facts li {
	border-bottom: 1px solid var(--ce-hairline);
	padding: 0.55rem 0;
}

.ce-plain-list li + li {
	margin-top: 0.5rem;
}

.ce-big-email {
	overflow-wrap: anywhere;
}

/* ---------- Hero: photo bleeds off the left edge, text sits low on the right ---------- */

.ce-hero,
.ce-hero-cols.wp-block-columns {
	margin-top: 0;
	margin-bottom: 0;
}

.ce-hero-cols.wp-block-columns {
	gap: 0;
}

.ce-hero-photo .wp-block-image {
	height: 100%;
	margin: 0;
}

.ce-hero-photo .wp-block-image img {
	aspect-ratio: 4 / 4.4;
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.ce-hero-text {
	padding: var(--wp--preset--spacing--50) 1rem var(--wp--preset--spacing--50);
}

.ce-hero h1 {
	max-width: 13ch;
}

@media (min-width: 782px) {
	/* Fixed height, whatever shape the photo is, so the headline always sits inside the first screen. */
	.ce-hero-photo .wp-block-image img {
		aspect-ratio: auto;
		height: min(84vh, 52rem);
	}

	/* On wide screens the photo stops widening, so tall photos aren't cropped into a letterbox strip. */
	.ce-hero-cols > .ce-hero-photo.wp-block-column {
		flex: 0 0 min(55%, calc(min(84vh, 52rem) * 0.95)) !important;
	}

	/* Headline scales with the screen so it never wraps into a tall tower beside the photo. */
	.ce-hero h1 {
		font-size: clamp(2.2rem, 3.4vw, 4.25rem);
	}

	.ce-hero-cols > .ce-hero-text.wp-block-column {
		flex: 1 1 0 !important;
		min-width: 0;
	}

	.ce-hero-text > * {
		max-width: 34rem;
	}

	.ce-hero-text {
		padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50) var(--wp--preset--spacing--50);
	}
}

/* Tablets and small laptops: a narrower photo and a slightly smaller headline so the button stays on screen. */
@media (min-width: 782px) and (max-width: 1199px) {
	.ce-hero-cols > .ce-hero-photo.wp-block-column {
		flex-basis: min(48%, calc(min(84vh, 52rem) * 0.95)) !important;
	}

	.ce-hero-text.wp-block-column {
		padding-top: var(--wp--preset--spacing--40);
	}

	.ce-hero h1 {
		font-size: clamp(2.2rem, 4.2vw, 3rem);
	}
}

/* ---------- Full-width photo ---------- */

.ce-fullbleed img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
}

@media (min-width: 782px) {
	.ce-fullbleed img {
		aspect-ratio: 21 / 9;
	}
}

.ce-fullbleed figcaption {
	margin-left: auto;
	margin-right: auto;
	max-width: 76rem;
	padding: 0 1rem;
	text-align: left;
}

/* ---------- Studio photos laid out like prints on a table ---------- */

.ce-table-prints.wp-block-gallery {
	--wp--style--unstable-gallery-gap: 2rem;
	gap: 2rem;
	margin-top: var(--wp--preset--spacing--50);
}

.ce-table-prints .wp-block-image {
	background: var(--wp--preset--color--white);
	box-shadow: 0 1px 2px rgba(43, 38, 34, 0.12), 0 6px 14px -8px rgba(43, 38, 34, 0.25);
	padding: 0.6rem 0.6rem 1.4rem;
}

.ce-table-prints .wp-block-image:nth-child(3n + 1) { transform: rotate(-1.8deg); }
.ce-table-prints .wp-block-image:nth-child(3n + 2) { transform: rotate(1.1deg) translateY(0.8rem); }
.ce-table-prints .wp-block-image:nth-child(3n + 3) { transform: rotate(-0.6deg); }

/* ---------- Single gallery piece ---------- */

.ce-piece-photo img {
	width: 100%;
}

@media (min-width: 782px) {
	.ce-piece-text {
		align-self: flex-start;
		position: sticky;
		top: 2rem;
	}
}

/* One button + a plain text link, not two pills. */
.ce-textlink a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
}

/* ---------- Photo "prints": gallery cards, tilted like they're on a table ---------- */

.ce-print,
.is-style-print img {
	background: var(--wp--preset--color--white);
	box-shadow: 0 1px 2px rgba(43, 38, 34, 0.12), 0 6px 14px -8px rgba(43, 38, 34, 0.25);
}

.ce-print {
	padding: 0.6rem 0.6rem 0.9rem;
	transition: transform 0.25s ease;
}

.is-style-print img {
	padding: 0.6rem;
	transform: rotate(-1.2deg);
}

.ce-prints > li:nth-child(4n + 1) .ce-print { transform: rotate(-1.4deg); }
.ce-prints > li:nth-child(4n + 2) .ce-print { transform: rotate(0.9deg) translateY(0.4rem); }
.ce-prints > li:nth-child(4n + 3) .ce-print { transform: rotate(-0.5deg); }
.ce-prints > li:nth-child(4n + 4) .ce-print { transform: rotate(1.6deg) translateY(-0.3rem); }

.ce-prints > li .ce-print:hover,
.ce-prints > li .ce-print:focus-within {
	transform: rotate(0deg) translateY(-2px);
}

.ce-print .wp-block-post-featured-image {
	margin: 0;
}

.ce-print .wp-block-post-featured-image img {
	display: block;
	height: auto;
	width: 100%;
}

/* Masonry: every photo keeps its own shape, like prints of different sizes on a table. */
.ce-prints.wp-block-post-template {
	column-gap: 1.5rem;
	columns: 2;
	display: block;
}

.ce-prints.wp-block-post-template > li {
	break-inside: avoid;
	margin: 0 0 1.75rem;
	padding: 0.4rem 0.3rem 0;
}

@media (min-width: 782px) {
	.ce-prints.wp-block-post-template {
		column-gap: 2.25rem;
		columns: 3;
	}

	.ce-prints.wp-block-post-template > li {
		margin-bottom: 2.5rem;
	}
}

.ce-print .wp-block-post-title {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.3;
	margin-top: 0.7rem;
}

.ce-print .wp-block-post-terms {
	font-size: var(--wp--preset--font-size--small);
	margin-top: 0.15rem;
	opacity: 0.75;
}

.ce-print .wp-block-post-terms a {
	text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
	.ce-print { transition: none; }
}

/* ---------- Gallery filter row ---------- */

.ce-gallery .ce-filter {
	margin-bottom: var(--wp--preset--spacing--40);
}

.ce-filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ce-filter a {
	display: inline-block;
	padding: 0.35rem 0;
	text-decoration: none;
}

.ce-filter a[aria-current="page"] {
	border-bottom: 2px solid var(--wp--preset--color--clay);
}

.ce-filter a:hover {
	color: var(--wp--preset--color--clay);
}

/* ---------- Numbered steps (Custom Orders) ---------- */

.ce-step {
	border-top: 1px solid var(--ce-hairline);
	padding-top: var(--wp--preset--spacing--40);
}

.ce-step-num {
	color: var(--wp--preset--color--clay);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--xx-large);
	font-style: italic;
	line-height: 1;
}

/* ---------- Price table ---------- */

.ce-prices table {
	border-collapse: collapse;
	width: 100%;
}

.ce-prices td,
.ce-prices th {
	border: 0;
	border-bottom: 1px solid var(--ce-hairline);
	padding: 0.8rem 0.5rem 0.8rem 0;
	text-align: left;
	vertical-align: top;
}

.ce-prices td:last-child {
	text-align: right;
	white-space: nowrap;
}

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

.ce-quote .wp-block-quote {
	margin: 0;
}

.ce-quote .wp-block-quote cite {
	display: block;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--medium);
	font-style: normal;
	margin-top: 1.25rem;
}

/* ---------- FAQ ---------- */

.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	list-style: none;
	padding-right: 2rem;
	position: relative;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "+";
	font-family: var(--wp--preset--font-family--sans);
	position: absolute;
	right: 0.25rem;
	top: 0;
}

.wp-block-details[open] summary::after {
	content: "â€“";
}

.wp-block-details > :not(summary) {
	margin-top: 0.75rem;
	max-width: 38rem;
}

/* ---------- Signature ---------- */

.ce-signature img {
	width: 11rem;
}

/* ---------- Inquiry form ---------- */

.ce-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25rem;
}

.ce-field {
	display: flex;
	flex: 1 1 100%;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0 0 1.25rem;
}

@media (min-width: 600px) {
	.ce-field--half {
		flex-basis: calc(50% - 0.625rem);
	}
}

.ce-field label {
	font-weight: 600;
}

.ce-hint,
.ce-optional {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	opacity: 0.8;
}

.ce-form input[type="text"],
.ce-form input[type="email"],
.ce-form input[type="date"],
.ce-form select,
.ce-form textarea {
	background: var(--wp--preset--color--white);
	border: 1px solid rgba(43, 38, 34, 0.35);
	border-radius: 3px;
	box-sizing: border-box;
	color: inherit;
	font: inherit;
	max-width: 100%;
	min-height: 2.9rem;
	padding: 0.7rem 0.8rem;
	width: 100%;
}

.ce-form input[type="file"] {
	font: inherit;
	max-width: 100%;
}

.ce-form,
.ce-field {
	min-width: 0;
}

.ce-form button {
	align-self: flex-start;
	cursor: pointer;
}

.ce-hp {
	left: -9999px;
	position: absolute;
}

.ce-form-note {
	border-left: 3px solid var(--wp--preset--color--olive);
	flex: 1 1 100%;
	margin-bottom: 1.25rem;
	padding: 0.25rem 0 0.25rem 1rem;
}

.ce-form-note--error {
	border-color: var(--wp--preset--color--clay);
}

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

.ce-footer a {
	text-decoration: none;
}

.ce-footer a:hover {
	text-decoration: underline;
}
