/* =========================================================================
   jonnymccrink.com — child theme styles
   Only what is unique to this site. Palette, fonts and heading sizes come from
   Appearance → Brand identity (exposed by the parent as --jmc-* variables), so
   the colours below are only the extra shades the palette doesn't cover.
   ========================================================================= */

:root {
	/* Extra shades mixed from the palette, so any Brand identity palette works.
	   With this site's palette they come out at #10273d and #193958. */
	--jm-card: color-mix(in srgb, var(--jmc-hero) 8%, var(--jmc-page));     /* cards, stat pills, contact card */
	--jm-glow: color-mix(in srgb, var(--jmc-hero) 25%, var(--jmc-inverse)); /* hero and badge glow */
	--jm-tint: color-mix(in srgb, var(--jmc-hero) 12%, transparent); /* icon tiles, eyebrow pill */
	--jm-line: color-mix(in srgb, var(--jmc-hero) 15%, transparent); /* subtle blue borders */
	--jm-width: 1100px;                                              /* content width of the sections */
	--jmc-text-muted: color-mix(in srgb, var(--jmc-text) 70%, var(--jmc-page)); /* softer copy; ≈ #a3aebb here */
	--jmc-gutter: clamp(1rem, 4vw, 2rem);
	--jmc-radius-sm: 10px;
}

/* ---------------------------------------------------------------- buttons */
/* Square-ish 8px buttons with a soft glow, instead of the parent's pills. */
.wp-block-button__link,
.jmc-btn { border-radius: 8px; font-weight: 600; padding: 14px 30px; }
.jmc-btn--accent .wp-block-button__link { box-shadow: 0 4px 20px color-mix(in srgb, var(--jmc-accent) 35%, transparent); }
.jmc-btn--accent .wp-block-button__link:hover {
	background: color-mix(in srgb, var(--jmc-accent) 85%, #fff);
	box-shadow: 0 8px 28px color-mix(in srgb, var(--jmc-accent) 45%, transparent);
}
.is-style-outline .wp-block-button__link {
	border: 2px solid var(--jmc-hero);
	color: var(--jmc-hero);
	background: transparent;
	padding: 12px 28px;
}
.is-style-outline .wp-block-button__link:hover { background: var(--jmc-accent); border-color: var(--jmc-accent); color: var(--jmc-on-accent); }

/* ---------------------------------------------------------------- header */
.jmc-header { border-bottom-color: var(--jm-line); }
.jmc-header__inner { max-width: none; }                 /* logo and menu at the edges, as before */
.jmc-header__nav { justify-content: flex-end; }
.jmc-nav__list a { font-weight: 600; }
/* All menu links are jump links on the homepage, so none is "the current page". */
.jmc-nav__list .current-menu-item > a { color: var(--jmc-text); }
.jmc-nav__list .current-menu-item > a:hover { color: var(--jmc-hero); }
/* Five short links and no header button: keep the menu visible down to 641px
   (the parent switches to the hamburger at 1100px to make room for its button). */
@media (min-width: 641px) and (max-width: 1100px) {
	.jmc-header__nav { display: flex; }
	.jmc-menu-toggle { display: none; }
}

/* -------------------------------------------------------------- sections */
/* Side-by-side rows (stats, service cards, process steps, About columns):
   WordPress' default block spacing adds a top margin to every block except
   the first, which in a row pushes items 2, 3, 4 lower than item 1. The grid
   and flex gaps do the spacing here instead. */
.jm-home .jmc-section :is(.jm-stats, .jm-cards, .jm-steps, .jm-about) > * { margin-block: 0; }
.jm-home .jm-cards, .jm-home .jm-steps { margin-top: 2.5rem; }
.jm-home .jm-stats { margin-top: 1.5rem; }
.jm-home .jmc-section {
	max-width: calc(var(--jm-width) + 2 * var(--jmc-gutter));
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.jm-alt { border-block: 1px solid color-mix(in srgb, var(--jmc-hero) 10%, transparent); }

/* Small uppercase label above each section heading. */
.jm-label {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--jmc-hero);
	margin: 0 0 0.5rem;
}
.jm-home h2 { margin-top: 0; }
.jm-intro { color: var(--jmc-text-muted); font-size: 1.05rem; }

/* ------------------------------------------------------------------ hero */
.jm-hero {
	position: relative;
	overflow: hidden; /* fallback for older browsers */
	overflow: clip;   /* crop the glow without making the box scrollable */
	min-height: 88vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--jm-glow) 0%, var(--jmc-inverse) 70%);
}
/* Dot-grid texture. */
.jm-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle, color-mix(in srgb, var(--jmc-hero) 18%, transparent) 1px, transparent 1px);
	background-size: 32px 32px;
	pointer-events: none;
}
/* Fade into the page colour at the bottom. */
.jm-hero::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 120px;
	background: linear-gradient(to bottom, transparent, var(--jmc-page));
	pointer-events: none;
}
/* The hero background is always dark (glow into the Dark colour), so its text uses
   the "on dark" colours, not the page's body text: readable on any palette. */
.jm-hero { color: var(--jmc-on-dark); }
.jm-hero .jm-hero__title { color: var(--jmc-on-dark); }
.jm-hero .jm-hero__title mark.has-hero-color { color: var(--jmc-text-accent) !important; }
.jm-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 700px;
	padding: clamp(4rem, 10vw, 8rem) var(--jmc-gutter);
}
.jm-pill {
	display: inline-block;
	margin: 0 0 1rem;
	padding: 4px 14px;
	border: 1px solid color-mix(in srgb, var(--jmc-text-accent) 35%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--jmc-text-accent) 8%, transparent);
	color: var(--jmc-text-accent);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.jm-hero__title { margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.jm-hero__lede {
	max-width: 540px;
	margin: 0 auto 2rem;
	color: color-mix(in srgb, var(--jmc-on-dark) 75%, transparent);
	font-size: clamp(1.05rem, 2.5vw, 1.25rem);
}
.jm-hero .wp-block-buttons { justify-content: center; }

/* ----------------------------------------------------------------- about */
.jm-about {
	display: grid;
	grid-template-columns: 3fr 2fr; /* 60/40: room for the copy and stats; the badge is decorative */
	gap: clamp(2rem, 5vw, 4rem);
	align-items: center;
}
/* Direct paragraphs only, so the stat boxes keep their own (big blue) styling. */
.jm-about__text > p:not(.jm-label) { color: var(--jmc-text-muted); }
/* Three equal boxes in one row (labels wrap inside the box if needed). */
.jm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 460px; margin-top: 1.5rem; }
.jm-stat {
	padding: 0.75rem 0.75rem;
	border: 1px solid var(--jm-line);
	border-radius: 8px;
	background: var(--jm-card);
	text-align: center;
}
.jm-stat p { margin: 0; }
.jm-stat__value { font-size: 1.6rem; font-weight: 600; line-height: 1; color: var(--jmc-hero); }
.jm-stat__label { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jmc-text-muted); }

/* The W badge: image inside a slowly turning dashed ring. */
.jm-badge {
	position: relative;
	width: clamp(180px, 30vw, 260px);
	aspect-ratio: 1;
	margin: 0 auto;
}
.jm-badge::before {
	content: "";
	position: absolute;
	inset: 0;
	border: 2px dashed color-mix(in srgb, var(--jmc-hero) 35%, transparent);
	border-radius: 50%;
	animation: jm-spin 24s linear infinite;
}
@keyframes jm-spin { to { transform: rotate(360deg); } }
.jm-badge .wp-block-image {
	position: absolute;
	inset: 16px;
	margin: 0;
	display: grid;
	place-items: center;
	border: 1px solid color-mix(in srgb, var(--jmc-hero) 20%, transparent);
	border-radius: 50%;
	background: linear-gradient(135deg, var(--jm-glow), var(--jmc-surface));
}
.jm-badge .wp-block-image img { width: 56%; height: auto; }

/* -------------------------------------------------------------- services */
.jm-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1.5rem;
	margin-top: 2.5rem;
}
.jm-card {
	position: relative;
	overflow: hidden; /* fallback for older browsers */
	overflow: clip;   /* crop the glow without making the box scrollable */
	padding: 2rem 1.75rem;
	border: 1px solid color-mix(in srgb, var(--jmc-hero) 10%, transparent);
	border-radius: var(--jmc-radius-sm);
	background: var(--jm-card);
	transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
/* Gradient line along the top on hover. */
.jm-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	background: linear-gradient(90deg, var(--jmc-accent), #7ec8ff);
	opacity: 0;
	transition: opacity 0.3s;
}
.jm-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); border-color: color-mix(in srgb, var(--jmc-hero) 30%, transparent); }
.jm-card:hover::before { opacity: 1; }
.jm-card h3 { margin: 0 0 0.5rem; }
.jm-card p { margin: 0; color: var(--jmc-text-muted); font-size: 0.93rem; }
.jm-card__icon.wp-block-image {
	width: 48px;
	height: 48px;
	margin: 0 0 1.25rem;
	display: grid;
	place-items: center;
	border-radius: 10px;
	background: var(--jm-tint);
}
.jm-card__icon img { width: 24px; height: 24px; }

/* --------------------------------------------------------- project tiles */
/* Same card look as the services: card colour, blue line on hover. */
.jm-home .jmc-section .jmc-project-tiles { margin-top: 2.5rem; }
.jm-home .jmc-project-tile { border-color: color-mix(in srgb, var(--jmc-hero) 10%, transparent); background: var(--jm-card); }
.jm-home .jmc-project-tile::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	z-index: 1;
	height: 3px;
	background: linear-gradient(90deg, var(--jmc-accent), #7ec8ff);
	opacity: 0;
	transition: opacity 0.3s;
}
.jm-home .jmc-project-tile--linked:hover { border-color: color-mix(in srgb, var(--jmc-hero) 30%, transparent); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); }
.jm-home .jmc-project-tile--linked:hover::before { opacity: 1; }
.jm-home .jmc-project-tile__title { font-size: 1.05rem; line-height: 1.125; }
.jm-home .jmc-project-tile__text { font-size: 0.93rem; line-height: 1.4; }

/* ---------------------------------------------------------- testimonials */
/* The section stays hidden until at least one testimonial is published, so it can
   sit on the homepage ready (the Testimonials block prints nothing when empty). */
.jm-testimonials:not(:has(.jmc-testimonial-card, .jmc-quote-large)) { display: none; }
.jm-home .jmc-section .jmc-testimonial-grid { margin-top: 2.5rem; }
.jm-home .jmc-testimonial-grid[style*="--jmc-cols:1"] { max-width: 760px; } /* a single quote at reading width */
.jm-home .jmc-testimonial-card { border-color: var(--jm-line); border-radius: var(--jmc-radius-sm); background: var(--jm-card); }
.jm-home .jmc-testimonial-card .jmc-testimonial-card__quote { color: var(--jmc-text); font-size: 1rem; line-height: 1.5; }
.jm-home .jmc-testimonial-card__name strong { color: var(--jmc-text); }

/* --------------------------------------------------------------- process */
.jm-steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 2rem;
	margin-top: 2.5rem;
	counter-reset: jm-step;
}
/* Big faint 01, 02... drawn by CSS: decorative, and renumbers itself if steps
   are added or reordered. The heading carries the meaning. */
.jm-step { counter-increment: jm-step; }
.jm-step::before {
	content: counter(jm-step, decimal-leading-zero);
	content: counter(jm-step, decimal-leading-zero) / ""; /* "/ ''" = not read out (newer browsers) */
	display: block;
	margin-bottom: 0.5rem;
	font-size: 3rem;
	font-weight: 800;
	line-height: 1;
	color: color-mix(in srgb, var(--jmc-hero) 15%, transparent);
}
.jm-step h3 { margin: 0 0 0.4rem; }
.jm-step p { margin: 0; color: var(--jmc-text-muted); font-size: 0.88rem; }

/* --------------------------------------------------------------- contact */
.jm-contact {
	position: relative;
	overflow: hidden; /* fallback for older browsers */
	overflow: clip;   /* crop the glow without making the box scrollable */
	max-width: 760px;
	margin-inline: auto;
	padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem);
	border: 1px solid color-mix(in srgb, var(--jmc-hero) 20%, transparent);
	border-radius: 16px;
	background: linear-gradient(135deg, var(--jm-card), var(--jmc-surface));
	text-align: center;
}
/* Two soft glows in opposite corners. */
.jm-contact::before,
.jm-contact::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
}
.jm-contact::before { top: -60px; right: -60px; width: 220px; height: 220px; background: radial-gradient(circle, color-mix(in srgb, var(--jmc-hero) 12%, transparent), transparent 70%); }
.jm-contact::after { bottom: -60px; left: -40px; width: 180px; height: 180px; background: radial-gradient(circle, color-mix(in srgb, var(--jmc-hero) 8%, transparent), transparent 70%); }
.jm-contact > * { position: relative; z-index: 1; }
.jm-contact h2 { padding-bottom: 1.25rem; }
.jm-contact p:not(.jm-label) { max-width: 460px; margin: 0 auto 2rem; color: var(--jmc-text-muted); }
.jm-contact .wp-block-buttons { justify-content: center; gap: 0.75rem; }

/* ------------------------------------------------- homepage type rhythm */
/* Matches the previous theme's tighter text: 1.4 line height for copy, 1.125
   for headings, 1.2rem between blocks, no gap under section headings. Measured
   against the live site at 1440px. */
.jm-home .jmc-section :is(p, li) { line-height: 1.4; }
.jm-home .jmc-section :is(h1, h2, h3) { line-height: 1.125; }
/* (Rows are excluded above with a more specific rule.) */
.jm-home .jmc-section :where(.is-layout-flow) > * + * { margin-block-start: 1.2rem; }
.jm-home .jmc-section .jm-label + h2,
.jm-home .jm-hero h1 { margin-block-start: 0; }
.jm-home .jmc-section h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 0; }
.jm-home .jm-about__text > p:not(.jm-label),
.jm-home .jm-intro { font-size: 1.05rem; }

.jm-home .jm-hero .jm-pill,
.jm-home .jm-hero .jm-hero__lede { line-height: 1.4; }
.jm-home .jm-hero .jm-hero__title { line-height: 1.125; }

.jm-home .jm-card h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.jm-home .jm-card p { margin-top: 0; }
.jm-home .jm-step h3 { font-size: 1rem; margin: 0 0 0.4rem; }
.jm-home .jm-step p { margin-top: 0; }

.jm-home .jm-contact .jm-label { margin-bottom: 2rem; }
.jm-home .jm-contact h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-top: 0; }
.jm-home .jm-contact p:not(.jm-label) { font-size: 1rem; margin-top: 0; }

/* --------------------------------------------------------- content pages */
/* Privacy, Cookies, Accessibility, Terms and any other plain page: one centred
   760px reading column with its own type sizes, as on the previous theme. The
   homepage is excluded (body:not(.jm-home)) so these never touch its sections. */
body:not(.jm-home) .jmc-page__header .jmc-container,
body:not(.jm-home) .jmc-page__content > *:not(.jmc-band):not(.jmc-section):not(.jmc-hero):not(.jmc-page-hero):not(.alignfull) {
	max-width: calc(760px + 2 * var(--jmc-gutter));
}
body:not(.jm-home) .jmc-page__header { padding: clamp(2.5rem, 6vw, 5rem) 0 1.25rem; }
body:not(.jm-home) .jmc-page__title { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.2; letter-spacing: -0.02em; }
body:not(.jm-home) .jmc-page__content { font-size: 1.05rem; line-height: 1.8; }
body:not(.jm-home) .jmc-page__content h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.3; margin-block: 2.75rem 1rem; }
body:not(.jm-home) .jmc-page__content h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); margin-block: 2.25rem 0.75rem; }
body:not(.jm-home) .jmc-page__content h4 { font-size: 1.15rem; margin-block: 1.75rem 0.5rem; }
body:not(.jm-home) .jmc-page__content p { margin-block: 0 1.25rem; }
body:not(.jm-home) .jmc-page__content :is(ul, ol) { margin-block: 0 1.25rem; }
body:not(.jm-home) .jmc-page__content > :is(ul, ol):not(.jmc-band):not(.jmc-section):not(.jmc-hero):not(.jmc-page-hero) { padding-left: calc(var(--jmc-gutter) + 1.5rem); }
body:not(.jm-home) .jmc-page__content li { margin-bottom: 0.5rem; line-height: 1.7; }
body:not(.jm-home) .jmc-page__content li::marker { color: var(--jmc-hero); }
/* Text links only: buttons are links too and keep their own colours. */
body:not(.jm-home) .jmc-page__content a:not(.wp-block-button__link):not(.wp-element-button) { color: var(--jmc-hero); text-decoration: underline; text-underline-offset: 2px; }
body:not(.jm-home) .jmc-page__content a:not(.wp-block-button__link):not(.wp-element-button):hover { color: color-mix(in srgb, var(--jmc-hero) 80%, #fff); }
body:not(.jm-home) .jmc-page__content > :last-child:not(.jmc-band):not(.alignfull) { margin-bottom: clamp(3.5rem, 9vw, 7rem); }

/* ---------------------------------------------------------------- footer */
.jm-footer {
	padding: 2.5rem var(--jmc-gutter);
	border-top: 1px solid color-mix(in srgb, var(--jmc-hero) 10%, transparent);
	background: var(--jmc-page);
	color: var(--jmc-text-muted);
	font-size: 0.85rem;
	text-align: center;
}
.jm-footer__inner { display: grid; justify-items: center; gap: 0.85rem; }
.jm-footer p { margin: 0; }
.jm-footer a { color: var(--jmc-text-muted); }
.jm-footer a:hover, .jm-footer a:focus-visible { color: var(--jmc-hero); }
.jm-footer__legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.jm-footer__legal a { text-decoration: none; }

/* ------------------------------------------------- fade in on scroll */
/* Only when site.js has run (no JS = everything visible). */
.jm-js .jm-fade { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.jm-js .jm-fade.jm-show { opacity: 1; transform: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
	.jm-about { grid-template-columns: 1fr; text-align: center; }
	.jm-about .jm-badge { order: -1; }
	.jm-stats { margin-inline: auto; }
	.jm-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.jm-hero__lede br { display: none; } /* the typed line break only suits wide screens */
	.jm-cards { grid-template-columns: 1fr; }
	.jm-contact .wp-block-buttons { flex-direction: column; align-items: center; }
	.jm-contact .wp-block-button { width: 100%; max-width: 280px; }
	.jm-contact .wp-block-button__link { display: block; text-align: center; }
}
@media (max-width: 400px) {
	.jm-steps { grid-template-columns: 1fr; }
}

/* Reduced motion: no spinning ring, no lift or fade. */
@media (prefers-reduced-motion: reduce) {
	.jm-badge::before { animation: none; }
	.jm-card { transition: none; }
	.jm-card:hover { transform: none; }
	.jm-js .jm-fade { opacity: 1; transform: none; transition: none; }
}

/* Windows high-contrast mode: keep card and button outlines visible. */
@media (forced-colors: active) {
	.jm-card, .jm-stat, .jm-contact { border: 1px solid CanvasText; }
}

/* Email address under the contact buttons, for visitors without a mail app. */
.jm-home .jm-contact p.jm-contact__email { margin: 1.5rem auto 0; font-size: 0.95rem; color: var(--jmc-text-muted); }
.jm-contact__email a { color: var(--jmc-hero); text-underline-offset: 2px; }
