/*
Theme Name: Tulkit
Description: A neutral, light block theme for TULKIT Design. Quiet by default so app imagery leads; each app page takes its own colour wash.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tulkit
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* WordPress inserts a margin-block-start equal to the block gap (24px unless
   theme.json sets styles.spacing.blockGap) between the template's top-level
   sections (header part, main, footer part) — a gap that exists even when no
   markup asks for it. Zero it so sections butt edge-to-edge and own their
   vertical rhythm via padding; this does not affect block gaps inside nested
   layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main carries its own vertical padding so templates this
   theme does not author (WooCommerce shop, product, cart…) still clear the
   header and footer. A descendant selector, not a child one: WooCommerce wraps
   the single-product main in an extra group. Templates built from full-bleed
   sections opt out with is-flush and let the sections own the rhythm. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* === Design system: neutral, light, lets the apps carry the colour ===
   Palette slugs wash / wash-deep / accent are re-pointed per app page from
   functions.php (body.has-app-wash). Everywhere else they fall back to the
   neutral defaults in theme.json. */
body {
	background-color: var(--wp--preset--color--wash);
	-webkit-font-smoothing: antialiased;
}
body.has-app-wash {
	background-image: linear-gradient(180deg, var(--wp--preset--color--wash) 0%, var(--wp--preset--color--wash-deep) 100%);
	background-repeat: no-repeat;
}

/* === Layout === */
html {
	scroll-behavior: smooth;
	scroll-padding-top: 6rem;
}

/* Fixed header bar */
.site-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 50;
	border-bottom: 1px solid var(--wp--preset--color--line) !important;
	padding: 0;
}
/* Frosted bar. The blur lives on a pseudo-element: backdrop-filter on the
   header itself would become the containing block for the fixed-position
   menu overlay and trap it inside the bar. */
.site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: color-mix(in srgb, var(--wp--preset--color--wash) 94%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	backdrop-filter: saturate(1.4) blur(14px);
}
.site-header > .wp-block-group,
.site-header > nav {
	width: 100%;
}

/* Masthead row (site name, logo, menu) */
.header-logo-row {
	background: transparent;
	color: var(--wp--preset--color--text);
	padding: 10px 0;
	margin-bottom: 0;
}
.header-logo-row a {
	color: inherit;
	text-decoration: none;
}
.header-logo-row .wp-block-site-title {
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--muted);
}
.header-logo-row .header-nav a:hover,
.header-logo-row a:hover {
	color: var(--wp--preset--color--accent);
}
.header-logo-img img {
	max-height: 40px;
	width: auto;
	height: auto;
	/* the logo is a square on white: multiply lets the page tint show through */
	mix-blend-mode: multiply;
}

/* Homepage: a larger mark in the masthead (inner pages keep the compact one) */
body.home .header-logo-img img {
	max-height: 64px;
}
body.home .home-hero {
	padding-top: 11.5rem;
}

/* Primary nav */
.site-header .header-nav .wp-block-navigation a {
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	color: inherit;
}
.site-header .header-nav a:hover {
	color: var(--wp--preset--color--accent);
}

/* App ticker strip pinned to the base of the header */
.header-ticker {
	margin: 0;
	padding: 7px 0;
	border-top: 1px solid var(--wp--preset--color--line);
	gap: 0;
	width: 100%;
}
.header-tick {
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-left: 1px solid var(--wp--preset--color--line);
	min-width: 0;
}
.header-tick:first-child {
	border-left: none;
}
.header-tick .app-icon img {
	height: 26px;
	width: auto;
	object-fit: contain;
}
.header-tick .app-icon a {
	display: inline-block;
	line-height: 0;
}
.header-tick .app-name {
	margin: 0;
	font-size: 0.72rem;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--muted);
	white-space: nowrap;
}
.header-tick .app-name a {
	color: inherit;
	text-decoration: none;
}
.header-tick .app-name a:hover {
	color: var(--wp--preset--color--accent);
}

/* === Home: statement, work, what we do, who we are === */
.home-hero,
.home-section {
	padding-inline: var(--wp--style--root--padding-left);
}
.home-hero {
	padding-block: 9.5rem clamp(3rem, 7vw, 5rem);
}
.home-section {
	padding-block: clamp(3rem, 7vw, 5.5rem);
	border-top: 1px solid var(--wp--preset--color--line);
}
.home-inner {
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
}
.home-hero .home-inner > *,
.home-section .home-inner > * {
	margin-block: 0;
}
.home-eyebrow {
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
	margin-bottom: 1.25rem;
}
.home-title {
	font-size: var(--wp--preset--font-size--display);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -0.025em;
	max-width: 14em;
	margin-bottom: 1.5rem !important;
}
.home-lede {
	max-width: 46ch;
	font-size: 1.1875rem;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
	margin-bottom: 2rem !important;
}
.home-h2 {
	font-size: clamp(1.6rem, 3vw, 2.25rem);
	font-weight: 400;
	letter-spacing: -0.02em;
	margin-bottom: clamp(1.5rem, 4vw, 2.5rem) !important;
}

/* Our work */
.work-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1.5rem;
	margin-bottom: 1.25rem !important;
}
.work-head h3 {
	font-size: 1.125rem;
	font-weight: 500;
	margin: 0;
}
.work-head .work-role {
	margin: 0;
	font-size: 0.875rem;
	color: var(--wp--preset--color--muted);
}
.app-grid + .work-head {
	margin-top: clamp(3rem, 7vw, 5rem) !important;
}
.app-grid,
.web-grid,
.service-grid {
	display: grid;
	gap: clamp(1rem, 2vw, 1.5rem);
}
.app-grid {
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.web-grid {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
	row-gap: clamp(2rem, 4vw, 3rem);
}
.service-grid {
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: clamp(1.5rem, 3vw, 3rem);
}
.app-grid > *,
.web-grid > *,
.service-grid > * {
	margin: 0;
}

/* App tiles take the colours of each app's own wash (see functions.php) */
.app-tile {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	padding: 1.5rem 1.5rem 0;
	border-radius: var(--wp--custom--rounded--md);
	background: linear-gradient(180deg, var(--tile-wash, var(--wp--preset--color--surface)), var(--tile-wash-deep, var(--wp--preset--color--surface)));
	color: var(--tile-ink, var(--wp--preset--color--text));
	transition: transform 0.25s ease;
}
.app-tile > * {
	margin: 0;
}
.app-tile h3 {
	font-size: 1.25rem;
	font-weight: 500;
}
.app-tile h3 a,
.web-tile h3 a {
	color: inherit;
	text-decoration: none;
}
/* the whole tile is the link */
.app-tile h3 a::before,
.web-tile h3 a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.app-tile p {
	margin-top: 0.25rem;
	font-size: 0.9375rem;
	color: var(--tile-muted, var(--wp--preset--color--muted));
}
.app-tile .wp-block-image {
	height: 21rem;
	margin-top: 1.5rem;
	overflow: hidden;
}
.app-tile .wp-block-image img {
	display: block;
	width: 76%;
	height: auto;
	margin-inline: auto;
	filter: drop-shadow(0 18px 15px rgba(24, 22, 30, 0.3));
}
.app-tile:hover {
	transform: translateY(-4px);
}

.web-tile {
	position: relative;
}
.web-tile > * {
	margin: 0;
}
.web-tile .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--rounded--sm);
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 1px 2px rgba(30, 28, 24, 0.06), 0 14px 36px rgba(30, 28, 24, 0.1);
}
.web-tile h3 {
	margin-top: 1rem !important;
	font-size: 1.0625rem;
	font-weight: 500;
}
.web-tile h3 a::after {
	content: " \2197";
	color: var(--wp--preset--color--muted);
}
.web-tile:hover h3 a {
	color: var(--wp--preset--color--accent);
}

/* What we do */
.service {
	border-top: 1px solid var(--wp--preset--color--text);
	padding-top: 1.25rem;
}
.service > * {
	margin: 0;
}
.service .home-eyebrow {
	margin-bottom: 2rem;
}
.service h3 {
	font-size: 1.375rem;
	margin-bottom: 0.75rem;
}
.service p:last-child {
	color: var(--wp--preset--color--muted);
	max-width: 34ch;
}

/* Who we are */
.home-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	column-gap: clamp(1.5rem, 4vw, 4rem);
	align-items: start;
}
.home-split > * {
	margin: 0;
}
.about-body > * {
	margin: 0;
}
.about-statement {
	font-size: clamp(1.25rem, 2.2vw, 1.625rem);
	line-height: 1.45;
	letter-spacing: -0.01em;
	max-width: 36em;
}
.tul-card {
	margin-top: 2rem !important;
	padding: clamp(1.25rem, 3vw, 2rem);
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--rounded--md);
	max-width: 36em;
}
.tul-card > * {
	margin: 0;
}
.tul-glyph {
	font-size: 2.5rem;
	line-height: 1.1;
	margin-bottom: 0.75rem !important;
}
.tul-meaning {
	font-size: 0.9375rem;
	color: var(--wp--preset--color--muted);
}
.tul-meaning + .tul-meaning {
	margin-top: 0.75rem !important;
}
.about-link {
	margin-top: 1.5rem !important;
	font-weight: 500;
}

/* Footer: contact form */
.site-footer {
	background: var(--wp--preset--color--wash-deep);
	color: var(--wp--preset--color--text);
	padding: clamp(3rem, 7vw, 5.5rem) var(--wp--style--root--padding-left) 1.5rem;
	scroll-margin-top: 4rem;
}
.footer-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: clamp(2rem, 6vw, 6rem);
	row-gap: 2rem;
	align-items: start;
}
.footer-split > *,
.footer-intro > * {
	margin: 0;
}
.site-footer .footer-eyebrow {
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
	margin-bottom: 1.25rem;
}
.site-footer .footer-cta {
	font-size: var(--wp--preset--font-size--display);
	font-weight: 400;
	letter-spacing: -0.025em;
	margin-bottom: 1.25rem;
}
.site-footer .footer-lede {
	color: var(--wp--preset--color--muted);
	max-width: 30ch;
}
.site-footer a {
	color: var(--wp--preset--color--text);
}
.site-footer a:hover {
	color: var(--wp--preset--color--accent);
}
.footer-base {
	margin-top: clamp(2.5rem, 6vw, 4.5rem) !important;
	padding-top: 1.25rem;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--text) 18%, transparent);
}
.footer-base > * {
	margin: 0;
}
.site-footer .footer-copy,
.site-footer .footer-credit {
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--muted);
}

/* Contact form (Jetpack) */
.footer-form .wp-block-jetpack-contact-form {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.25rem;
}
.footer-form .wp-block-jetpack-contact-form > div {
	width: 100%;
}
.footer-form .grunion-field-label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
}
.footer-form .grunion-field-label .grunion-label-required {
	font-weight: 400;
	opacity: 0.8;
}
.footer-form input.grunion-field,
.footer-form textarea.grunion-field {
	width: 100%;
	box-sizing: border-box;
	padding: 0.8rem 1rem;
	font: inherit;
	color: var(--wp--preset--color--text);
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--rounded--sm);
}
.footer-form textarea.grunion-field {
	min-height: 9rem;
	resize: vertical;
}
.footer-form input.grunion-field:focus,
.footer-form textarea.grunion-field:focus {
	border-color: var(--wp--preset--color--accent);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--accent) 25%, transparent);
}
.footer-form .wp-block-button__link {
	cursor: pointer;
	border: 0;
}

@media (max-width: 800px) {
	.home-split,
	.footer-split {
		grid-template-columns: minmax(0, 1fr);
	}
	.home-hero,
	body.home .home-hero {
		padding-top: 8.5rem;
	}
}

/* Non-home pages: clear the fixed header */
.wp-site-blocks main {
	padding-top: 9.5rem;
}
.wp-site-blocks main.is-flush {
	padding-top: 0;
}

@media (max-width: 1024px) {
	/* Compact masthead: logo left, hamburger right, hide site title */
	.header-logo-row.wp-block-columns {
		flex-wrap: nowrap !important;
		flex-direction: row !important;
		gap: 0;
		padding-left: 0 !important;
	}
	.header-logo-row .wp-block-column {
		flex-basis: auto !important;
		flex-grow: 1;
		width: auto;
	}
	.header-logo-row .wp-block-column:first-child {
		display: none;
	}
	.header-logo-row .wp-block-column:nth-child(2) {
		text-align: left;
	}
	.header-logo-row .header-logo-img.aligncenter {
		margin-left: 0 !important;
		margin-right: auto !important;
		text-align: left;
	}
	.header-logo-row .wp-block-column:last-child {
		text-align: right;
	}
	/* App ticker is desktop-only; phones and tablets get the menu alone */
	.site-header .header-ticker {
		display: none;
	}
	.wp-site-blocks main {
		padding-top: 6.5rem;
	}
}

/* Quiet links: thin underline, accent on hover */
:where(.wp-site-blocks) a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
:where(.wp-site-blocks) a:not(.wp-element-button):hover {
	color: var(--wp--preset--color--accent);
	text-decoration-color: currentColor;
}
ul, ol {
	padding-left: 1.25rem;
}

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

/* App page rows */
.row-eyebrow {
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
}
.app-preview {
	margin-block: 1rem;
}
.app-preview img {
	max-height: 540px;
	width: auto;
	margin: 0 auto;
	object-fit: contain;
}

/* Web page rows */
.page-lede {
	font-size: 1.25rem;
	max-width: 50ch;
}
.web-row + .web-row {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: 2.5rem;
	margin-top: 2.5rem;
}
.web-preview {
	margin-block: 1rem 1.75rem;
}
.web-preview img {
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--rounded--sm);
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 1px 2px rgba(30, 28, 24, 0.06), 0 14px 36px rgba(30, 28, 24, 0.1);
}
/* Masonry gallery of site screenshots (core Gallery block, className web-gallery).
   CSS columns do the packing: a tall homepage shot sits beside the shorter
   article and archive shots. */
.wp-block-gallery.web-gallery {
	display: block;
	columns: 2;
	column-gap: clamp(0.75rem, 2vw, 1.25rem);
	margin-block: 1rem 1.75rem;
}
.wp-block-gallery.web-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
	display: block;
	width: 100%;
	margin: 0 0 clamp(0.75rem, 2vw, 1.25rem);
	break-inside: avoid;
}
.wp-block-gallery.web-gallery img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--rounded--sm);
	box-shadow: 0 1px 2px rgba(30, 28, 24, 0.06), 0 14px 36px rgba(30, 28, 24, 0.1);
}
@media (max-width: 640px) {
	.wp-block-gallery.web-gallery {
		columns: 1;
	}
}

.web-link a {
	color: inherit;
	font-weight: 500;
}
.web-link a:hover {
	color: var(--wp--preset--color--accent);
}

/* Showcase: let app imagery float on the wash. drop-shadow follows the
   screenshot's alpha edge, so device frames get a soft, natural shadow.
   Store badges are left flat. */
.app-preview img,
.has-app-wash main .wp-block-image:not(:has(a[href*="apps.apple.com"], a[href*="play.google.com"])) img {
	filter: drop-shadow(0 22px 34px rgba(24, 22, 30, 0.16)) drop-shadow(0 2px 4px rgba(24, 22, 30, 0.06));
}

/* Outline button style */
.is-style-outline .wp-element-button {
	background: transparent;
	color: var(--wp--preset--color--primary);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 35%, transparent);
	padding: calc(0.8em - 1px) calc(1.6em - 1px);
}
.is-style-outline .wp-element-button:hover {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
}

/* Dark washes (EarthClock): shadows need more weight to read on black, and
   the logo is the white-on-transparent mark, so no blending. */
.has-dark-wash .app-preview img,
.has-dark-wash main .wp-block-image:not(:has(a[href*="apps.apple.com"], a[href*="play.google.com"])) img {
	filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.12));
}
.has-dark-wash .header-logo-img img {
	mix-blend-mode: normal;
}

/* The menu overlay stays neutral on every page, whatever the app wash. Reset
   the palette on the overlay container so app colours don't leak into it. */
.wp-block-navigation__responsive-container {
	--wp--preset--color--text: #26262a;
	--wp--preset--color--primary: #26262a;
	--wp--preset--color--background: #faf9f7;
	--wp--preset--color--muted: #6c6a66;
	--wp--preset--color--line: #e2dfd9;
	--wp--preset--color--surface: #f0eee9;
	--wp--preset--color--accent: #6c6a66;
	--wp--preset--color--wash-deep: #f0eee9;
	color: #26262a;
}
.wp-block-navigation__responsive-container .overlay-logo img {
	mix-blend-mode: multiply;
}

/* Visible focus, in the app's accent */
:where(.wp-site-blocks) :focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}
