/* ==========================================================================
   Zadravec Tech — base
   Context colours, focus, motion and section-level shapes. Every value is a
   theme.json token (--wp--preset--* / --wp--custom--*); nothing is hard-coded
   here that the design system does not define.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Context colours
   Blocks read --zt-* instead of fixed colours, so the same heading, paragraph,
   overline, link or button looks right on navy, on paper and on the gradient
   band without the editor having to pick colours.
   -------------------------------------------------------------------------- */
:root,
.editor-styles-wrapper {
	--zt-text: var(--wp--custom--color--text);
	--zt-heading: var(--wp--preset--color--white);
	--zt-body: var(--wp--preset--color--mist);
	--zt-body-strong: var(--wp--preset--color--mist);
	--zt-muted: var(--wp--custom--color--muted);
	--zt-strong: var(--wp--preset--color--white);
	--zt-overline: var(--wp--preset--color--teal);
	--zt-kicker: var(--wp--preset--color--teal);
	--zt-link: var(--wp--preset--color--mint);
	--zt-link-hover: var(--wp--preset--color--ice);
	--zt-line: var(--wp--custom--color--line);
	--zt-btn-fill: var(--wp--preset--gradient--monogram);
	--zt-btn-fill-text: var(--wp--preset--color--navy-900);
	--zt-btn-fill-hover-text: var(--wp--preset--color--navy-900);
	--zt-btn-outline: var(--wp--custom--color--line-strong);
	--zt-btn-outline-text: var(--wp--custom--color--text);
	--zt-btn-outline-hover: var(--wp--preset--color--mint);
	--zt-btn-outline-hover-text: var(--wp--preset--color--white);
	--zt-btn-outline-hover-bg: var(--wp--custom--color--mint-wash);
	--zt-btn-glow: var(--wp--custom--shadow--glow);
}

/* Paper context: light sections and white step cards. */
.is-style-section-paper,
.is-style-section-paper-diagonal,
.is-style-section-paper-diagonal-alt,
.is-style-step,
.zt-context-paper {
	--zt-text: var(--wp--custom--color--ink-paper);
	--zt-heading: var(--wp--preset--color--navy-900);
	--zt-body: var(--wp--preset--color--slate);
	--zt-body-strong: var(--wp--custom--color--slate-dark);
	--zt-muted: var(--wp--preset--color--slate);
	--zt-strong: var(--wp--preset--color--navy-900);
	--zt-overline: var(--wp--preset--color--teal-deep);
	--zt-kicker: var(--wp--preset--color--teal-deep);
	--zt-link: var(--wp--preset--color--navy-900);
	--zt-link-hover: var(--wp--preset--color--teal-deep);
	--zt-line: var(--wp--custom--color--line-paper);
	--zt-btn-fill: var(--wp--preset--color--navy-900);
	--zt-btn-fill-text: var(--wp--preset--color--white);
	--zt-btn-fill-hover-text: var(--wp--preset--color--mint);
	--zt-btn-outline: var(--wp--preset--color--navy-900);
	--zt-btn-outline-text: var(--wp--preset--color--navy-900);
	--zt-btn-outline-hover: var(--wp--preset--color--navy-900);
	--zt-btn-outline-hover-text: var(--wp--preset--color--navy-900);
	--zt-btn-outline-hover-bg: rgba(0, 23, 47, 0.06);
	--zt-btn-glow: 0 10px 30px -12px rgba(0, 23, 47, 0.45);
}

/* Navy context nested inside paper (highlighted step, stats band, panels). */
.is-style-step-highlight,
.is-style-card,
.is-style-card-highlight,
.is-style-panel,
.zt-context-navy {
	--zt-text: var(--wp--custom--color--text);
	--zt-heading: var(--wp--preset--color--white);
	--zt-body: var(--wp--preset--color--mist);
	--zt-body-strong: var(--wp--preset--color--mist);
	--zt-muted: var(--wp--custom--color--muted);
	--zt-strong: var(--wp--preset--color--white);
	--zt-overline: var(--wp--preset--color--teal);
	--zt-kicker: var(--wp--preset--color--teal);
	--zt-link: var(--wp--preset--color--mint);
	--zt-link-hover: var(--wp--preset--color--ice);
	--zt-line: var(--wp--custom--color--line);
	--zt-btn-fill: var(--wp--preset--gradient--monogram);
	--zt-btn-fill-text: var(--wp--preset--color--navy-900);
	--zt-btn-fill-hover-text: var(--wp--preset--color--navy-900);
	--zt-btn-outline: var(--wp--custom--color--line-strong);
	--zt-btn-outline-text: var(--wp--custom--color--text);
	--zt-btn-outline-hover: var(--wp--preset--color--mint);
	--zt-btn-outline-hover-text: var(--wp--preset--color--white);
	--zt-btn-outline-hover-bg: var(--wp--custom--color--mint-wash);
	--zt-btn-glow: var(--wp--custom--shadow--glow);
}

/* Gradient context: CTA band. */
.is-style-cta-gradient,
.zt-context-gradient {
	--zt-text: var(--wp--custom--color--ink-paper);
	--zt-heading: var(--wp--preset--color--navy-900);
	--zt-body: var(--wp--custom--color--ink-paper);
	--zt-body-strong: var(--wp--custom--color--ink-paper);
	--zt-muted: var(--wp--custom--color--ink-paper);
	--zt-strong: var(--wp--preset--color--navy-900);
	--zt-overline: var(--wp--preset--color--navy-900);
	--zt-kicker: var(--wp--preset--color--navy-900);
	--zt-link: var(--wp--preset--color--navy-900);
	--zt-link-hover: var(--wp--preset--color--navy-900);
	--zt-line: rgba(0, 23, 47, 0.2);
	--zt-btn-fill: var(--wp--preset--color--navy-900);
	--zt-btn-fill-text: var(--wp--preset--color--white);
	--zt-btn-fill-hover-text: var(--wp--preset--color--mint);
	--zt-btn-outline: var(--wp--preset--color--navy-900);
	--zt-btn-outline-text: var(--wp--preset--color--navy-900);
	--zt-btn-outline-hover: var(--wp--preset--color--navy-900);
	--zt-btn-outline-hover-text: var(--wp--preset--color--navy-900);
	--zt-btn-outline-hover-bg: rgba(0, 23, 47, 0.08);
	--zt-btn-glow: 0 10px 30px -12px rgba(0, 23, 47, 0.45);
}

/* --------------------------------------------------------------------------
   2. Global
   -------------------------------------------------------------------------- */
html {
	scroll-behavior: smooth;
}

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

a {
	text-underline-offset: 3px;
}

:where(h1, h2, h3, h4) {
	text-wrap: balance;
}

:where(p, li, dd) {
	text-wrap: pretty;
}

strong,
b {
	color: var(--zt-strong);
	font-weight: 700;
}

/* Anchored sections land below the sticky header. */
:where([id]) {
	scroll-margin-top: var(--wp--custom--header--height);
}

/* Top-level template blocks and page sections sit flush; spacing comes from
   the sections themselves. */
.wp-site-blocks > * + *,
.zt-sections > * + * {
	margin-block-start: 0;
}

/* Focus: 3px navy ring + 6px mint halo, readable on navy, paper and gradient. */
:focus-visible {
	outline: 3px solid var(--wp--preset--color--navy-900);
	outline-offset: 0;
	box-shadow: 0 0 0 6px var(--wp--preset--color--mint);
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--mint);
	color: var(--wp--preset--color--navy-900);
	font-weight: 700;
	text-decoration: none;
}

::selection {
	background: var(--wp--preset--color--mint);
	color: var(--wp--preset--color--navy-900);
}

/* --------------------------------------------------------------------------
   3. Sections (core/group block styles)
   -------------------------------------------------------------------------- */
.is-style-section {
	padding-top: var(--wp--custom--section--padding-top);
	padding-bottom: var(--wp--custom--section--padding-bottom);
}

.is-style-section-paper,
.is-style-section-paper-diagonal,
.is-style-section-paper-diagonal-alt {
	position: relative;
	padding-top: var(--wp--custom--section--padding-top-paper);
	padding-bottom: var(--wp--custom--section--padding-bottom);
	background-color: var(--wp--preset--color--paper);
	color: var(--zt-text);
}

/* Diagonal dividers live in the section's own top and bottom margin, so the
   editor never handles separate divider blocks. */
.is-style-section-paper-diagonal,
.is-style-section-paper-diagonal-alt {
	margin-block: var(--wp--custom--section--divider) !important;
}

.is-style-section-paper-diagonal::before,
.is-style-section-paper-diagonal::after,
.is-style-section-paper-diagonal-alt::before,
.is-style-section-paper-diagonal-alt::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: var(--wp--custom--section--divider);
	background-color: var(--wp--preset--color--paper);
	pointer-events: none;
}

.is-style-section-paper-diagonal::before,
.is-style-section-paper-diagonal-alt::before {
	bottom: calc(100% - 1px);
}

.is-style-section-paper-diagonal::after,
.is-style-section-paper-diagonal-alt::after {
	top: calc(100% - 1px);
}

/* navy → paper rising to the right, paper → navy falling to the left */
.is-style-section-paper-diagonal::before {
	clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.is-style-section-paper-diagonal::after {
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* mirrored: rising to the left, falling to the right */
.is-style-section-paper-diagonal-alt::before {
	clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.is-style-section-paper-diagonal-alt::after {
	clip-path: polygon(0 0, 100% 0, 100% 100%);
}

/* Hero: own padding plus the skewed light plane top right. */
.is-style-hero {
	position: relative;
	overflow: hidden;
	padding-top: clamp(56px, 9vw, 120px);
	padding-bottom: clamp(72px, 10vw, 136px);
}

.is-style-hero::before,
.zt-plane::before {
	content: "";
	position: absolute;
	top: -10%;
	right: -12%;
	width: 52%;
	height: 120%;
	background: linear-gradient(160deg, rgba(154, 251, 251, 0.08), rgba(194, 220, 251, 0) 70%);
	transform: skewX(-18deg);
	pointer-events: none;
}

.is-style-hero > *,
.zt-plane > * {
	position: relative;
}

/* Inner-page header: breadcrumb, overline, h1, lead — with the same plane. */
.zt-plane {
	position: relative;
	overflow: hidden;
}

.zt-page-header {
	padding-top: clamp(40px, 6vw, 80px);
	padding-bottom: clamp(48px, 6vw, 80px);
}

/* Long-form text (legal pages, blog posts, service pages). */
.zt-prose > :is(h2, h3, h4) {
	margin-block-start: 1.8em;
}

.zt-prose > :is(h2, h3, h4) + * {
	margin-block-start: 0.6em;
}

.zt-prose :is(p, li) {
	color: var(--zt-body-strong);
}

/* Utilities usable on any block via "Additional CSS class". */
.zt-lead {
	color: var(--zt-body);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.6;
}

.zt-kicker {
	color: var(--zt-kicker);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 13px;
	line-height: 1.5;
}

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

/* --------------------------------------------------------------------------
   4. Scroll fade-in (assets/js/reveal.js adds .zt-reveal-ready to <html>)
   Content is visible without JS and under reduced motion.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	.zt-reveal-ready .zt-reveal {
		opacity: 0;
		transform: translateY(16px);
		transition: opacity 0.6s ease, transform 0.6s ease;
	}

	.zt-reveal-ready .zt-reveal.is-visible {
		opacity: 1;
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   5. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

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

/* --------------------------------------------------------------------------
   6. Header (parts/header.html)
   Sticky; the translucent background and blur sit on ::before because a
   backdrop-filter on the header itself would become the containing block of
   the fixed mobile menu panel.
   -------------------------------------------------------------------------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
}

.zt-header {
	position: relative;
	isolation: isolate;
	border-bottom: 1px solid var(--wp--custom--color--line-soft);
}

.zt-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--custom--color--header-bg);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

.zt-header__bar {
	min-height: var(--wp--custom--header--height);
}

/* --------------------------------------------------------------------------
   7. Footer (parts/footer.html)
   -------------------------------------------------------------------------- */
.zt-footer {
	padding-top: clamp(48px, 6vw, 80px);
	padding-bottom: 32px;
	border-top: 1px solid var(--wp--custom--color--line-soft);
	background-color: var(--wp--preset--color--navy-950);
}

.zt-footer p.zt-footer__about {
	max-width: 22em;
	color: var(--wp--custom--color--muted);
	font-size: 14px;
}

.zt-footer p.zt-footer__title {
	margin-bottom: 4px;
	color: var(--wp--preset--color--teal);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}

.zt-footer__bottom {
	padding-top: 24px;
	border-top: 1px solid var(--wp--custom--color--line-soft);
}

.zt-footer__bottom p {
	color: var(--wp--custom--color--muted-strong);
	font-size: 13px;
}

.zt-consent-settings {
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--mist);
	font: inherit;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
}

.zt-consent-settings:hover {
	color: var(--wp--preset--color--mint);
}

/* CTA band directly after a paper section needs its own top spacing. */
:is(.is-style-section-paper, .is-style-section-paper-diagonal, .is-style-section-paper-diagonal-alt) + .zt-cta-section {
	padding-top: var(--wp--custom--section--padding-top) !important;
}

/* --------------------------------------------------------------------------
   8. Layout utilities (Additional CSS class in the editor)
   -------------------------------------------------------------------------- */
.zt-measure {
	max-width: 34em;
}

.zt-measure-narrow {
	max-width: 26em;
}

.zt-w-640 {
	max-width: 640px;
}

.zt-w-680 {
	max-width: 680px;
}

.is-layout-grid.zt-align-center {
	align-items: center;
}

.is-layout-grid.zt-align-start {
	align-items: start;
}

/* Long text that is slate-dark on paper and mist on navy. */
p.zt-text-strong {
	color: var(--zt-body-strong);
}

p.zt-link-strong a {
	font-weight: 600;
}

/* Hero meta row: "10+ years PHP & backend · One direct contact · …" */
.zt-hero-meta {
	margin-top: 8px !important;
	padding-top: 28px;
	border-top: 1px solid var(--wp--custom--color--line-card);
}

.zt-hero-meta p {
	color: var(--zt-muted);
	font-size: 14px;
}

/* Contact list: label left, value right, hairlines between rows. */
.zt-contact-list {
	border-top: 1px solid var(--zt-line);
}

.zt-contact-list > .wp-block-group {
	padding: 20px 0;
	border-bottom: 1px solid var(--zt-line);
}

.zt-contact-list p.is-style-fact-label {
	letter-spacing: 0.24em;
}

.zt-contact-list p.is-style-fact-label + p {
	margin-block-start: 0;
}

.zt-contact-list p:not(.is-style-fact-label),
.zt-contact-list p:not(.is-style-fact-label) a {
	color: var(--zt-strong);
	font-weight: 600;
	text-decoration: none;
}

.zt-contact-list a:hover {
	color: var(--zt-link);
}

/* Column gaps that core's layout cannot store (it rejects clamp() in gaps). */
.is-layout-grid.zt-gap-hero {
	gap: clamp(48px, 6vw, 80px);
}

.is-layout-grid.zt-gap-split {
	gap: clamp(40px, 6vw, 96px);
}

.is-layout-grid.zt-gap-faq {
	gap: clamp(32px, 6vw, 96px);
}

/* Highlighted words (inline colour) never get the browser's yellow. */
mark.has-inline-color {
	background-color: transparent;
}

/* --------------------------------------------------------------------------
   9. Case study page (templates/single-case_study.html)
   -------------------------------------------------------------------------- */
.zt-cs-hero {
	padding-top: clamp(40px, 6vw, 80px);
	padding-bottom: 0;
}

.zt-cs-story-section {
	padding-top: clamp(56px, 8vw, 112px);
	padding-bottom: clamp(56px, 8vw, 112px);
}

.zt-cs-story-section > .wp-block-zadravec-case-study-stats {
	margin-block-start: clamp(56px, 8vw, 112px);
}

/* Paper section that only falls back to navy at the bottom (to the left). */
.zt-fall-left {
	margin-bottom: var(--wp--custom--section--divider) !important;
}

.zt-fall-left::after {
	content: "";
	position: absolute;
	top: calc(100% - 1px);
	left: 0;
	right: 0;
	height: var(--wp--custom--section--divider);
	background-color: var(--wp--preset--color--paper);
	clip-path: polygon(0 0, 100% 0, 0 100%);
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   10. Accessibility helpers
   -------------------------------------------------------------------------- */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
	word-wrap: normal !important;
}
