/*
Theme Name: Johnny on the Go
Theme URI: https://jotgfl.com
Author: Johnny on the Go Auto Care
Description: Graphite and JOTG red, set like a race-team poster. Built for jotgfl.com.
Version: 0.3.9
Requires at least: 6.5
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: jotg
*/

/* Colours and type come from theme.json; these are the layout's own measures. */
:root {
	--gutter-l: max(20px, env(safe-area-inset-left, 0px));
	--gutter-r: max(20px, env(safe-area-inset-right, 0px));
	/* One column edge for every section and the header: 1360px wide, centred, never closer than the gutter. */
	/* --sbw is the scrollbar width, measured by the script, so both margins match where scrollbars take space. */
	--edge-l: max(var(--gutter-l), calc((100vw - var(--sbw, 0px) - 1360px) / 2));
	--edge-r: max(var(--gutter-r), calc((100vw - var(--sbw, 0px) - 1360px) / 2));
	--step-row: clamp(1.25rem, 0.8rem + 1vw, 1.625rem);
	--step-shout: clamp(5.25rem, 1rem + 13.4vw, 14.5rem);
	--ease-out: cubic-bezier(.22, 1, .36, 1);
	--ease-expo: cubic-bezier(.16, 1, .3, 1);
	--ease-in-out: cubic-bezier(.76, 0, .24, 1);
	--ground: var(--wp--preset--color--ground);
	--ground-2: var(--wp--preset--color--ground-2);
	--ground-3: #202329;
	--ink: var(--wp--preset--color--ink);
	--soft: var(--wp--preset--color--soft);
	--red: var(--wp--preset--color--red);
	--display: var(--wp--preset--font-family--display);
	--text: var(--wp--preset--font-family--text);
	color-scheme: dark;
}
body { margin: 0; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.wp-site-blocks { position: relative; }
.wp-site-blocks > * { margin-block: 0; }

/* Header */
.site-header { position: relative; z-index: 20; }
.home .site-header { position: absolute; inset: 0 0 auto 0; }
.top { display: flex; align-items: center; gap: 24px; padding: 20px var(--edge-r) 20px var(--edge-l); }
.top > * { margin: 0 !important; }
.wordmark { display: block; flex: none; line-height: 0; }
.wordmark img { height: 20px; width: auto; }
.top .nav { margin-left: auto !important; font: 600 15px/1 var(--text); letter-spacing: .02em; }
.top .nav .wp-block-navigation__container { gap: 28px; }
.top .nav a { text-decoration: none; padding: 10px 0; }
.top .nav a:hover { color: var(--soft); }
.call { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1 var(--text); letter-spacing: .02em; text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.call svg { width: 16px; height: 16px; }
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { color: var(--ink); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.wp-block-navigation__responsive-container-open svg, .wp-block-navigation__responsive-container-close svg { width: 26px; height: 26px; }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--ground) !important; color: var(--ink) !important; padding: 84px var(--gutter-r) 40px var(--gutter-l) !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 4px !important; align-items: flex-start !important; justify-content: flex-start !important; text-align: left; }
/* WordPress pushes a right-aligned menu list over with margin-left: auto; the open menu starts at the left like the mockup. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { margin-left: 0 !important; margin-right: auto !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { align-items: flex-start !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font: 800 44px/1.05 var(--display); text-transform: uppercase; padding: 6px 0 !important; }

/* Landing pages (services, towns, fleet, about, contact). Each section is a full-width field with a
   1280px column inside; text sits flush left in that column, poster style. */
.lp-content > * { margin-block: 0 !important; }
/* WordPress gives every block after the first a top margin; inside these grids that knocks items out of line. */
.cards > *, .steps > *, .faq > *, .prices > *, .team > *, .ways > *, .service-list > *, .proof > * { margin-block: 0 !important; }
.lp-hero, .proof, .section, .cta { padding-left: var(--edge-l); padding-right: var(--edge-r); }
.lp-hero { padding-block: clamp(48px, 7vw, 112px) clamp(48px, 6vw, 96px); }
.lp-hero > *, .section > *, .cta > * { margin-block: 0; }
.lp-hero h1 { max-width: 17ch; font-size: clamp(3rem, 1.2rem + 5.6vw, 6.75rem); line-height: .9; letter-spacing: -.005em; }
.lp-hero > p { max-width: 56ch; margin-top: 24px; font-size: var(--wp--preset--font-size--lead); line-height: 1.45; }
.lp-hero .wp-block-buttons { margin-top: 32px; gap: 12px; }
mark.has-red-color { background: none; }

.proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-block: 28px 32px; background: var(--ground-2); }
.proof > * { margin: 0 !important; }
.stat > * { margin: 0; }
.stat-num { font: 800 clamp(2.75rem, 1.8rem + 2.6vw, 4.25rem)/.9 var(--display); color: var(--red); }
.stat-label { margin-top: 6px !important; max-width: 30ch; color: var(--soft); font-size: var(--wp--preset--font-size--small); line-height: 1.4; }

.section { padding-block: clamp(56px, 7vw, 120px); }
.section.alt { background: var(--ground-2); }
.section h2 { max-width: 20ch; font-size: clamp(2.25rem, 1.3rem + 2.8vw, 4rem); line-height: .95; }
.section > p { max-width: 66ch; margin-top: 18px; }
.section > .lead { max-width: 60ch; font-size: var(--wp--preset--font-size--lead); line-height: 1.5; }
.section > .note { color: var(--soft); font-size: var(--wp--preset--font-size--small); }

.checks { list-style: none; margin: 32px 0 0; padding: 0; columns: 2 280px; column-gap: 48px; }
.checks li { position: relative; break-inside: avoid; padding: 0 0 14px 34px; font-size: var(--wp--preset--font-size--lead); line-height: 1.35; }
.checks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 20px; height: 20px; background: var(--red);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.checks a { text-decoration: none; }
.checks a:hover { color: var(--red); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 40px 32px; margin-top: 40px !important; }
.card > * { margin: 0; }
.card::before { content: ""; display: block; width: 40px; height: 5px; margin-bottom: 18px; background: var(--red); }
.card h3 { font-size: clamp(1.5rem, 1.2rem + .8vw, 1.875rem); line-height: 1; }
.card p { margin-top: 10px; color: var(--soft); }

/* How it works: one stage per line, stepping across like a staircase */
.steps { display: grid; gap: 48px; margin-top: 48px !important; }
.step > * { margin: 0; }
.step h3 { font-size: clamp(2rem, 1.2rem + 2.4vw, 3.75rem); line-height: .95; }
.step p { max-width: 40ch; margin-top: 12px; color: var(--soft); }
.step:nth-child(2) { margin-left: 12%; }
.step:nth-child(3) { margin-left: 24%; }
.step:nth-child(4) { margin-left: 36%; }
.step:last-child h3 { color: var(--red); }

/* FAQ: every answer visible, one band per question */
.faq { display: grid; margin-top: 40px !important; }
.faq-item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 48px; padding: 32px 0; }
.faq-item + .faq-item { box-shadow: 0 -1px 0 rgba(244, 244, 242, .12); }
.faq-item > * { margin: 0; }
.faq-item h3 { grid-column: 1; grid-row: 1 / span 9; font-size: clamp(1.375rem, 1.1rem + .7vw, 1.75rem); line-height: 1.1; }
.faq-item p { grid-column: 2; }
.faq-item p + p { margin-top: 12px; }

.cta { padding-block: clamp(64px, 8vw, 128px); background: var(--red); color: #fff; }
.cta h2 { max-width: 16ch; font-size: clamp(2.75rem, 1.4rem + 4.4vw, 5.75rem); line-height: .9; color: #fff; }
.cta mark { color: inherit !important; }
.cta p { max-width: 50ch; margin-top: 20px; font-size: var(--wp--preset--font-size--lead); }
.cta .wp-block-buttons { margin-top: 32px; gap: 12px; }

/* Buttons, shared by the home page and the landing pages */
.btn .wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 60px; padding: 0 30px; border-radius: 0; background: var(--ground); color: var(--ink); font: 700 18px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; transition: background-color .2s var(--ease-out), transform .2s var(--ease-out); }
.btn .wp-block-button__link::after { content: ""; width: 18px; height: 18px; background: currentColor; transition: transform .2s var(--ease-out);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.btn .wp-block-button__link:hover { background: #000; color: var(--ink); }
.btn .wp-block-button__link:hover::after { transform: translateX(4px); }
.btn .wp-block-button__link:active { transform: translateY(1px); }
.wp-block-button__link { box-sizing: border-box; }
.wp-block-button__link:active { transform: scale(.97); }
.btn-red .wp-block-button__link, .btn .wp-block-button__link, .is-style-outline .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 28px; border-radius: 0;
	font: 700 18px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
	transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out); }
.btn-red .wp-block-button__link { background: var(--red); color: #fff; }
.btn-red .wp-block-button__link:hover { background: #B81B12; color: #fff; }
.is-style-outline .wp-block-button__link { background: transparent; color: var(--ink); border: 2px solid currentColor; }
.is-style-outline .wp-block-button__link:hover { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.cta .is-style-outline .wp-block-button__link { color: #fff; }
.cta .is-style-outline .wp-block-button__link:hover { background: #fff; color: var(--red); border-color: #fff; }

/* Fleet prices */
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 40px !important; }
.price-item { padding: 26px 24px; background: var(--ground-2); }
.section.alt .price-item { background: var(--ground); }
.price-item > * { margin: 0; }
.price-item h3 { font-size: 1.375rem; line-height: 1.05; }
.price-label { margin-top: 20px !important; color: var(--soft); font-size: var(--wp--preset--font-size--small); text-transform: uppercase; letter-spacing: .06em; }
.price-amount { font: 800 3.25rem/1 var(--display); color: var(--red); font-variant-numeric: tabular-nums; }

/* About: story with the team photograph, then the people */
.section.story { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); column-gap: 56px; align-items: start; }
.section.story > * { grid-column: 1; }
.section.story > .story-photo { grid-column: 2; grid-row: 1 / span 6; margin: 0; }
.section.story > .story-photo img { width: 100%; height: auto; display: block; }
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 48px; margin-top: 40px !important; }
.member > * { margin: 0; }
.member .wp-block-image { margin-bottom: 20px; }
.member .wp-block-image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.member h3 { font-size: 2rem; line-height: 1; }
.role { margin-top: 6px !important; color: var(--red); font: 700 1rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.member p:not(.role) { margin-top: 14px; color: var(--soft); }

/* Contact: four ways to reach the team */
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 40px !important; }
.way { padding: 28px 26px; background: var(--ground-2); }
.section.alt .way { background: var(--ground); }
.way > * { margin: 0; }
.way h3 { font-size: 1.625rem; line-height: 1; }
.way p { margin-top: 10px; color: var(--soft); }
.way-link { margin-top: 18px !important; }
.way-link a { color: var(--red); font: 700 1.125rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .04em; text-decoration: none; overflow-wrap: anywhere; }

/* Services index */
.service-list { display: grid; margin-top: 32px !important; }
.service-item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 48px; padding: 26px 0; }
.service-item + .service-item { box-shadow: 0 -1px 0 rgba(244, 244, 242, .12); }
.service-item > * { margin: 0; }
.service-item h2 { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.5rem); line-height: 1; max-width: none; }
.service-item h2 a { text-decoration: none; }
.service-item h2 a:hover { color: var(--red); }
.service-item p { grid-column: 2; color: var(--soft); }

/* Ordinary pages and posts */
.page-wrap { padding: clamp(40px, 6vw, 88px) var(--edge-r) clamp(56px, 7vw, 104px) var(--edge-l); }
.page-title { font-size: clamp(2.75rem, 1.6rem + 4vw, 5.5rem) !important; line-height: .92 !important; margin-bottom: .4em; }
.post-meta { color: var(--soft); font-size: var(--wp--preset--font-size--small); }
.page-wrap .wp-block-post-content h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); margin-top: 1.6em; }
.page-wrap .wp-block-post-content h3 { font-size: 1.5rem; margin-top: 1.4em; }
/* Blog: a grid of repair stories, each led by its own photograph. */
.blog-wrap > .page-title, .blog-wrap > .blog-lead, .blog-wrap > .post-grid { max-width: none !important; }
.blog-lead { max-width: 52ch !important; color: var(--soft); font-size: var(--wp--preset--font-size--lead); margin-top: 0 !important; }
.post-grid { margin-top: clamp(40px, 5vw, 72px) !important; }
.post-cards { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(40px, 4vw, 56px) clamp(20px, 2.4vw, 32px); }
.post-cards > .wp-block-post { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0 !important; }
.post-cards > .wp-block-post > * { margin: 0 !important; }
.card-img { overflow: hidden; background: var(--ground-2); margin-bottom: 8px !important; }
.card-img a, .card-img img { display: block; width: 100%; height: 100%; }
.card-img img { object-fit: cover; transition: transform .6s var(--ease-out); }
.wp-block-post:hover .card-img img { transform: scale(1.03); }
.card-title { font-size: clamp(1.375rem, 1.15rem + .6vw, 1.75rem) !important; line-height: 1.02; text-wrap: balance; }
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--red-on-dark, #FF5A4E); }
.card-excerpt p { color: var(--soft); margin: 0; }
.card-excerpt .wp-block-post-excerpt__more-text { display: none; }
.post-pages { margin-top: clamp(48px, 6vw, 80px) !important; padding-top: 28px; box-shadow: 0 -1px 0 rgba(244, 244, 242, .12); font: 700 18px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; align-items: center; }
.post-pages a { text-decoration: none; }
.post-pages a:hover { color: var(--red-on-dark, #FF5A4E); }
.post-pages .page-numbers { padding: 10px 12px; }
.post-pages .page-numbers.current { color: var(--red-on-dark, #FF5A4E); }
@media (max-width: 1100px) { .post-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .post-cards { grid-template-columns: minmax(0, 1fr); } .post-pages .wp-block-query-pagination-numbers { display: none; } }

/* Footer */
.foot { display: grid; gap: 14px; padding: 56px var(--edge-r) max(40px, env(safe-area-inset-bottom, 0px)) var(--edge-l); background: #08090B; }
.foot > * { margin: 0 !important; }
.foot .wordmark img { height: 18px; }
.foot-line { max-width: 52ch; color: var(--soft); }
.foot-call a { font: 800 clamp(2rem, 1.4rem + 1.9vw, 2.8125rem)/1 var(--display); text-decoration: none; color: var(--red); font-variant-numeric: tabular-nums; }
.foot-small { color: var(--soft); font-size: .9375rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { color: var(--ink); text-decoration: none; }
.foot-links a:hover { color: var(--red-on-dark, #FF5A4E); text-decoration: underline; text-underline-offset: .2em; }

@media (max-width: 900px) {
	.wordmark img { height: 14px; }
	.top { gap: 12px; }
	.top .nav .wp-block-navigation__container { gap: 18px; }
	.call { order: 3; width: 44px; height: 44px; justify-content: center; }
	.call svg { width: 22px; height: 22px; }
	.call span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 700px) {
	.proof { grid-template-columns: 1fr; gap: 18px; }
	.stat { display: grid; grid-template-columns: 5.5rem 1fr; align-items: center; column-gap: 12px; }
	.stat-label { margin-top: 0 !important; }
	.step:nth-child(2) { margin-left: 6vw; }
	.step:nth-child(3) { margin-left: 12vw; }
	.step:nth-child(4) { margin-left: 18vw; }
	.faq-item, .service-item { grid-template-columns: 1fr; row-gap: 10px; }
	.faq-item h3, .faq-item p, .service-item p { grid-column: 1; grid-row: auto; }
	.section.story { grid-template-columns: 1fr; }
	.section.story > .story-photo { grid-column: 1; grid-row: auto; margin-top: 28px; }
	.lp-hero .wp-block-buttons, .cta .wp-block-buttons { flex-direction: column; align-items: stretch; }
	.lp-hero .wp-block-button, .cta .wp-block-button, .lp-hero .wp-block-button__link, .cta .wp-block-button__link { width: 100%; }
}
