/**
 * Global styles shared by all blocks (front end + editor).
 * Design tokens come from theme.json as --wp--preset--* variables.
 * Block-specific styles live in each block's style.css.
 */

:root {
	--arch-gutter: clamp(20px, 4vw, 48px);
	--arch-wide: 1200px;
	--arch-frame-inset: max(12px, calc(50% - 640px));
	--arch-ease: 200ms ease;
	--arch-font-display: var(--wp--preset--font-family--display);
	--arch-font-body: var(--wp--preset--font-family--body);
	--arch-copper: #D08A5A;
	--arch-copper-dark: #9E5430;
	--arch-navy: #10232A;
	--arch-deep: #0B1A1F;
	--arch-ivory: #F4F5F1;
	--arch-mist: #E9EFEC;
	--arch-panel: #18343C;
}

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

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

/* Header, main and footer sit flush (overrides the root blockGap between template parts). */
.wp-site-blocks {
	padding: 0;
}

.wp-site-blocks > *,
.wp-site-blocks > main > .wp-block-post-content {
	margin-block: 0;
}

/* Theme blocks are full bleed and sit flush against each other. */
.wp-block-post-content > [class*="wp-block-archtide-"],
.arch-section {
	margin-block: 0;
}

.wp-block-post-content > .alignfull[class*="wp-block-archtide-"],
main > .alignfull[class*="wp-block-archtide-"] {
	max-width: none;
	margin-inline: 0;
}

:where(.arch-section) img {
	max-width: 100%;
	height: auto;
}

::selection {
	background: var(--arch-copper);
	color: var(--arch-navy);
}

:focus-visible {
	outline: 2px solid var(--arch-copper);
	outline-offset: 3px;
}

/* ---------- Sections and colour themes ---------- */

.arch-section {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	--arch-text: var(--arch-mist);
	--arch-muted: #B9C8C6;
	--arch-lead: #C8D4D2;
	--arch-label: #8FA3A1;
	--arch-eyebrow: var(--arch-copper);
	--arch-accent: var(--arch-copper);
	--arch-line: #2E4B53;
	--arch-outline: #4C6469;
	--arch-frame-line: rgba(233, 239, 236, 0.10);
	--arch-card: var(--arch-panel);
	background: var(--arch-navy);
	color: var(--arch-text);
}

.arch-theme-deep {
	background: var(--arch-deep);
}

.arch-theme-ivory {
	--arch-text: var(--arch-navy);
	--arch-muted: #45565B;
	--arch-lead: #33454A;
	--arch-label: #6B7B7F;
	--arch-eyebrow: var(--arch-copper-dark);
	--arch-accent: var(--arch-copper-dark);
	--arch-line: #D6DCD8;
	--arch-outline: #C5CEC9;
	--arch-frame-line: rgba(16, 35, 42, 0.12);
	--arch-card: #FFFFFF;
	background: var(--arch-ivory);
	color: var(--arch-text);
}

.arch-container {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--arch-wide);
	margin-inline: auto;
	padding-inline: var(--arch-gutter);
}

.arch-section a:where(:not([class])) {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--arch-accent);
	text-underline-offset: 0.2em;
}

.arch-section a:where(:not([class])):hover {
	color: var(--arch-accent);
}

/* ---------- Decor ---------- */

.arch-frame {
	position: absolute;
	inset: 0 var(--arch-frame-inset);
	z-index: 0;
	border-inline: 1px solid var(--arch-frame-line);
	pointer-events: none;
}

.arch-frame__arch {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 140px;
	overflow: visible;
}

.arch-frame__arch path,
.arch-rings path {
	fill: none;
	stroke: var(--arch-frame-line);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

.arch-frame__arch .is-copper {
	stroke: rgba(208, 138, 90, 0.6);
	stroke-width: 1.25;
}

.arch-theme-ivory .arch-frame__arch .is-copper {
	stroke: rgba(158, 84, 48, 0.55);
}

.arch-frame__arch .is-fainter {
	stroke: color-mix(in srgb, var(--arch-frame-line) 80%, transparent);
}

.arch-frame__arch .is-faintest {
	stroke: color-mix(in srgb, var(--arch-frame-line) 60%, transparent);
}

.arch-rings {
	display: block;
	height: auto;
	aspect-ratio: 2 / 1;
	overflow: visible;
	pointer-events: none;
}

.arch-rings path {
	stroke-width: 1.25;
	vector-effect: none;
}

.arch-rings .is-faint {
	stroke: color-mix(in srgb, var(--arch-text) 8%, transparent);
}

.arch-rings .is-copper {
	stroke: rgba(208, 138, 90, 0.5);
	stroke-width: 1.5;
}

.arch-bars {
	position: absolute;
	top: 14px;
	left: 50%;
	z-index: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	transform: translateX(-50%);
	pointer-events: none;
}

.arch-bars span {
	display: block;
	background: rgba(208, 138, 90, 0.5);
}

.arch-bars span:nth-child(1) { width: 280px; height: 2.5px; }
.arch-bars span:nth-child(2) { width: 200px; height: 2px; background: rgba(208, 138, 90, 0.4); }
.arch-bars span:nth-child(3) { width: 120px; height: 1.5px; background: rgba(208, 138, 90, 0.32); }
.arch-bars span:nth-child(4) { width: 56px; height: 1px; background: rgba(208, 138, 90, 0.26); }

.arch-theme-ivory .arch-bars span:nth-child(1) { background: rgba(158, 84, 48, 0.45); }
.arch-theme-ivory .arch-bars span:nth-child(2) { background: rgba(158, 84, 48, 0.36); }
.arch-theme-ivory .arch-bars span:nth-child(3) { background: rgba(158, 84, 48, 0.28); }
.arch-theme-ivory .arch-bars span:nth-child(4) { background: rgba(158, 84, 48, 0.22); }

.arch-bars--3 {
	top: 12px;
	gap: 6px;
}

.arch-bars--3 span:nth-child(1) { width: 260px; height: 2px; background: rgba(208, 138, 90, 0.45); }
.arch-bars--3 span:nth-child(2) { width: 180px; height: 1.5px; background: rgba(208, 138, 90, 0.35); }
.arch-bars--3 span:nth-child(3) { width: 100px; height: 1px; background: rgba(208, 138, 90, 0.28); }

.arch-badge {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	width: 84px;
	color: var(--arch-accent);
}

.arch-badge__arch {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 84px;
	height: 64px;
	padding-top: 12px;
	border: 1.5px solid currentColor;
	border-bottom: 0;
	border-radius: 42px 42px 0 0;
	font-family: var(--arch-font-display);
	font-size: 26px;
	line-height: 1;
}

.arch-badge__lines {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	margin-top: -10px;
}

.arch-badge__lines span {
	display: block;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
}

.arch-badge__lines span:nth-child(1) { width: 66px; }
.arch-badge__lines span:nth-child(2) { width: 48px; }
.arch-badge__lines span:nth-child(3) { width: 30px; }
.arch-badge__lines span:nth-child(4) { width: 14px; }

/* Logo mark colours: light arch, copper tide. */
.arch-mark {
	display: block;
	flex-shrink: 0;
	height: auto;
}

.arch-mark__arch {
	fill: #E9EFED;
}

.arch-mark__tide {
	fill: #CF8953;
}

.arch-theme-ivory .arch-mark__arch {
	fill: var(--arch-navy);
}

.arch-theme-ivory .arch-mark__tide {
	fill: #B0623A;
}

.arch-icon {
	display: inline-block;
	flex-shrink: 0;
	vertical-align: middle;
}

.arch-icon--arch {
	color: var(--arch-copper);
}

/* Arch-topped image frames. */
.arch-shape {
	overflow: hidden;
	border-radius: 50% 50% 6px 6px / 30% 30% 6px 6px;
	background: var(--arch-card);
}

.arch-shape--portrait {
	border-radius: 999px 999px 6px 6px;
}

.arch-shape img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- Logo lockup ---------- */

.arch-logo {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	color: var(--arch-mist);
	text-decoration: none;
}

.arch-logo--stacked {
	flex-direction: column;
	gap: 14px;
}

.arch-wordmark {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 21px;
}

.arch-wordmark--stacked {
	align-items: center;
	gap: 22px;
}

.arch-wordmark__name {
	font-family: var(--arch-font-display);
	font-size: 30px;
	line-height: 1;
	letter-spacing: -0.01em;
	white-space: nowrap;
	color: var(--arch-mist);
}

.arch-wordmark--stacked .arch-wordmark__name {
	font-size: 34px;
}

.arch-wordmark__tide {
	position: relative;
	display: inline-block;
	margin-left: 0.02em;
	color: var(--arch-copper);
}

.arch-wordmark__slice {
	position: absolute;
	width: 130%;
	height: 0.072em;
	overflow: hidden;
}

.arch-wordmark__slice > span {
	position: absolute;
	left: 0;
	line-height: 1;
	white-space: nowrap;
	transform: scaleY(-0.6);
	transform-origin: 0 0.86em;
}

.arch-wordmark__studio {
	padding-left: 0.46em; /* balances the trailing letter-spacing so STUDIO sits centred */
	font-family: var(--arch-font-body);
	font-size: 6.36px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.46em;
	color: #8FA3A1;
}

.arch-wordmark--stacked .arch-wordmark__studio {
	font-size: 11px;
}

/* ---------- Typography ---------- */

.arch-eyebrow {
	margin: 0 0 20px;
	font-family: var(--arch-font-body);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--arch-eyebrow);
}

.arch-label {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--arch-label);
}

.arch-accent {
	color: var(--arch-accent);
}

.arch-h1,
.arch-h2,
.arch-h3 {
	margin: 0;
	font-family: var(--arch-font-display);
	font-weight: 400;
	color: inherit;
	text-wrap: balance;
}

.arch-h1 {
	font-size: clamp(3rem, 7vw, 5.75rem);
	line-height: 1.02;
	letter-spacing: -0.02em;
}

.arch-h2 {
	font-size: clamp(2.4rem, 5vw, 4rem);
	line-height: 1.05;
	letter-spacing: -0.015em;
}

.arch-h3 {
	font-size: clamp(1.5rem, 2.4vw, 1.875rem);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.arch-lead {
	margin: 0;
	font-size: 20px;
	line-height: 1.55;
	color: var(--arch-lead);
}

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

.arch-text > * {
	margin: 0;
}

.arch-text > * + * {
	margin-top: 1em;
}

.arch-rule {
	height: 0;
	margin: 0;
	border: 0;
	border-top: 2px solid currentColor;
}

/* ---------- Buttons ---------- */

.arch-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}

.arch-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-sizing: border-box;
	padding: 15px 26px;
	border: 1px solid var(--arch-copper);
	border-radius: 999px;
	background: var(--arch-copper);
	color: var(--arch-navy);
	font-family: var(--arch-font-body);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--arch-ease), border-color var(--arch-ease), color var(--arch-ease), transform var(--arch-ease);
}

.arch-button:hover {
	background: #E09C6C;
	border-color: #E09C6C;
	color: var(--arch-navy);
}

.arch-button--outline {
	background: transparent;
	border-color: var(--arch-outline);
	color: var(--arch-text);
}

.arch-button--outline:hover,
.arch-button--outline-copper:hover {
	background: transparent;
	border-color: var(--arch-accent);
	color: var(--arch-accent);
}

.arch-button--outline-copper {
	background: transparent;
	border-color: var(--arch-accent);
	color: var(--arch-text);
}

.arch-theme-ivory .arch-button:not(.arch-button--outline):not(.arch-button--outline-copper):not(.arch-button--text) {
	background: var(--arch-navy);
	border-color: var(--arch-navy);
	color: var(--arch-ivory);
}

.arch-theme-ivory .arch-button:not(.arch-button--outline):not(.arch-button--outline-copper):not(.arch-button--text):hover {
	background: var(--arch-copper-dark);
	border-color: var(--arch-copper-dark);
}

.arch-button--small {
	padding: 10px 18px;
	font-size: 13px;
	letter-spacing: 0.08em;
}

/* Text link styled like the design's small caps links ("READ THE STORY →"). */
.arch-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--arch-font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--arch-accent);
	cursor: pointer;
}

.arch-link:hover {
	color: var(--arch-text);
}

.arch-link .arch-icon {
	transition: transform var(--arch-ease);
}

.arch-link:hover .arch-icon {
	transform: translateX(3px);
}

/* Small rounded tag, e.g. "Developers", course names, related work. */
.arch-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.arch-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 1px solid var(--arch-outline);
	border-radius: 999px;
	font-size: 14px;
	line-height: 1.3;
	color: var(--arch-text);
	text-decoration: none;
}

a.arch-chip:hover {
	border-color: var(--arch-accent);
	color: var(--arch-accent);
}

/* ---------- Dialogs (project stories, lightbox) ---------- */

.arch-dialog {
	box-sizing: border-box;
	width: min(1080px, calc(100vw - 32px));
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 1px solid #2E4B53;
	border-radius: 20px;
	background: var(--arch-navy);
	color: var(--arch-mist);
	overflow: auto;
	overscroll-behavior: contain;
}

.arch-dialog::backdrop {
	background: rgba(6, 15, 18, 0.82);
	backdrop-filter: blur(4px);
}

.arch-dialog__close {
	position: sticky;
	top: 12px;
	float: right;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 12px 12px -56px 0;
	border: 1px solid #4C6469;
	border-radius: 50%;
	background: rgba(16, 35, 42, 0.85);
	color: var(--arch-mist);
	cursor: pointer;
}

.arch-dialog__close:hover {
	border-color: var(--arch-copper);
	color: var(--arch-copper);
}

/* Lightbox (built by archtide.js) */
.arch-lightbox {
	box-sizing: border-box;
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 56px 72px;
	border: 0;
	background: rgba(6, 15, 18, 0.94);
	color: var(--arch-mist);
}

.arch-lightbox::backdrop {
	background: transparent;
}

.arch-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.arch-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	width: 100%;
	height: 100%;
	margin: 0;
}

.arch-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100% - 36px);
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.arch-lightbox__count {
	font-size: 13px;
	letter-spacing: 0.2em;
	color: #8FA3A1;
}

.arch-lightbox__btn {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 1px solid #4C6469;
	border-radius: 50%;
	background: rgba(16, 35, 42, 0.8);
	color: var(--arch-mist);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.arch-lightbox__btn:hover {
	border-color: var(--arch-copper);
	color: var(--arch-copper);
}

.arch-lightbox__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.arch-lightbox__next { right: 14px; top: 50%; transform: translateY(-50%); }
.arch-lightbox__close { right: 14px; top: 14px; }

.arch-lightbox.is-single .arch-lightbox__prev,
.arch-lightbox.is-single .arch-lightbox__next {
	display: none;
}

@media (max-width: 600px) {
	.arch-lightbox {
		padding: 64px 12px 80px;
	}

	.arch-lightbox__prev,
	.arch-lightbox__next {
		top: auto;
		bottom: 16px;
		transform: none;
	}

	.arch-lightbox__prev { left: calc(50% - 60px); }
	.arch-lightbox__next { right: calc(50% - 60px); }
}

html:has(dialog[open]) {
	overflow: hidden;
}

/* ---------- Editor helpers ---------- */

.arch-placeholder {
	padding: 32px;
	border: 1px dashed #8FA3A1;
	background: #F4F5F1;
	color: #45565B;
	font: 14px/1.5 var(--arch-font-body);
	text-align: center;
}

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