/*
Theme Name: Groundwork
Theme URI:
Author:
Description: White-label block theme for a free marketing assessment business. All colours, fonts and corners come from theme tokens; pick a skin under Appearance > Editor > Styles.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.1.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: groundwork
*/

/* ---------- Basics ---------- */
html { scroll-behavior: smooth; }
:where(section, .wp-block-group)[id] { scroll-margin-top: 96px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}
.wp-block-button__link { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Header ---------- */
.gw-header { border-bottom: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--base); }

/* ---------- Eyebrow label ---------- */
.gw-eyebrow {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}
.has-primary-background-color .gw-eyebrow { color: var(--wp--preset--color--accent); }

/* ---------- Cards ---------- */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	padding: var(--wp--preset--spacing--50);
}
.wp-block-group.is-style-card-raised {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	padding: var(--wp--preset--spacing--50);
	box-shadow: var(--wp--custom--shadow--card);
}
.wp-block-group.is-style-placeholder {
	background: #fafbfc;
	border: 1px dashed #b9c2cd;
	border-radius: var(--wp--custom--radius--lg);
	padding: var(--wp--preset--spacing--50);
}
.gw-note {
	background: var(--wp--preset--color--tint);
	border-radius: min(var(--wp--custom--radius--sm), 14px);
	padding: 1rem 1.1rem;
}
.has-tint-background-color .gw-note {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
}

/* ---------- Icons (CSS masks, coloured by the primary token) ---------- */
/* Add "gw-icon gw-icon--phone" (etc.) to a heading: the icon sits above it. */
.gw-icon { position: relative; padding-top: 68px; }
.gw-icon::before {
	content: ""; position: absolute; top: 0; left: 0;
	width: 48px; height: 48px;
	border-radius: min(var(--wp--custom--radius--sm), 14px);
	background: var(--wp--preset--color--tint);
}
.gw-icon::after {
	content: ""; position: absolute; top: 12px; left: 12px; width: 24px; height: 24px;
	background: var(--wp--preset--color--primary);
	-webkit-mask: var(--gw-icon) center / contain no-repeat;
	mask: var(--gw-icon) center / contain no-repeat;
}
.gw-icon--phone { --gw-icon: url(assets/icons/phone.svg); }
.gw-icon--clock { --gw-icon: url(assets/icons/clock.svg); }
.gw-icon--dollar { --gw-icon: url(assets/icons/dollar.svg); }
.gw-icon--star { --gw-icon: url(assets/icons/star.svg); }
.gw-icon--map { --gw-icon: url(assets/icons/map.svg); }
.gw-icon--chat { --gw-icon: url(assets/icons/chat.svg); }

/* ---------- Numbered steps ---------- */
.gw-step-number {
	flex: none; box-sizing: border-box;
	width: 48px; height: 48px; margin: 0;
	border-radius: 999px;
	display: flex !important; align-items: center; justify-content: center;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-ink);
	font-weight: 800; font-size: 1.25rem; line-height: 1;
}
.gw-step-number--small { width: 36px; height: 36px; font-size: 1rem; background: var(--wp--preset--color--primary); color: #fff; }

/* ---------- Status chips (sample assessment card) ---------- */
.gw-row { border-top: 1px solid #eceff3; padding-top: 0.85rem; }
.gw-chip {
	display: inline-block; margin: 0;
	font-size: 0.8125rem; font-weight: 700; line-height: 1.2;
	padding: 0.4rem 0.75rem; border-radius: 999px; white-space: nowrap;
}
.gw-chip--bad { background: #fde8e4; color: #9b2c1a; }
.gw-chip--good { background: #e3f4ea; color: #1d6b3f; }
.gw-chip--warn { background: #fff1d6; color: #7a4f00; }
.gw-chip--neutral { background: #eef1f4; color: #3d4957; }

/* ---------- Check lists ---------- */
.wp-block-list.is-style-checks { list-style: none; padding-left: 0; }
.wp-block-list.is-style-checks li { position: relative; padding-left: 2.25rem; }
.wp-block-list.is-style-checks li::before {
	content: ""; position: absolute; left: 0; top: 0.2em;
	width: 1.4rem; height: 1.4rem;
	background: var(--wp--preset--color--primary);
	-webkit-mask: url(assets/icons/check-circle.svg) center / contain no-repeat;
	mask: url(assets/icons/check-circle.svg) center / contain no-repeat;
}
.wp-block-list.is-style-checks.gw-divided li { padding-top: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #eceff3; margin: 0; }
.wp-block-list.is-style-checks.gw-divided li::before { top: 1.15rem; }
.has-primary-background-color .wp-block-list.is-style-checks li::before { background: var(--wp--preset--color--accent); }

/* ---------- FAQ ---------- */
.wp-block-details summary {
	cursor: pointer; list-style: none;
	display: flex; justify-content: space-between; align-items: center; gap: 1rem;
	font-weight: 600; font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--heading); min-height: 44px;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; font-size: 1.6rem; font-weight: 400; color: var(--wp--preset--color--primary); }
.wp-block-details[open] summary::after { content: "\2212"; }
.wp-block-details > :not(summary) { margin-top: 0.75rem; color: var(--wp--preset--color--muted); }

/* ---------- Text on primary bands ---------- */
.has-primary-background-color :where(h1, h2, h3, h4) { color: #fff; }
.has-primary-background-color p { color: rgba(255, 255, 255, 0.88); }
.has-dark-background-color a { color: var(--wp--preset--color--on-dark); }

/* ---------- Forms (used by the assessment plugin) ---------- */
.gw-form input[type="text"], .gw-form input[type="email"], .gw-form input[type="tel"], .gw-form input[type="url"], .gw-form select, .gw-form textarea {
	width: 100%; min-height: 48px; padding: 0.75rem 0.9rem;
	border: 1px solid #b9c2cd; border-radius: var(--wp--custom--radius--input);
	font: inherit; color: var(--wp--preset--color--contrast); background: #fff;
}

/* ---------- Stacked full-width sections touch each other ---------- */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-top: 0; margin-bottom: 0; }

/* Header on tablets and phones: one row (name, menu, account). The hero's main button sits right below,
   so the header button only shows on wider screens. Selectors are doubled to win over WordPress's layout styles. */
@media (max-width: 781px) {
	.gw-header.gw-header > .alignwide { flex-wrap: nowrap; align-items: center; gap: 0.75rem; }
	.gw-header.gw-header > .alignwide > .wp-block-site-title { flex: 1 1 auto; min-width: 0; margin: 0; }
	.gw-header.gw-header > .alignwide > .wp-block-site-title a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.gw-header.gw-header > .alignwide > .wp-block-group { flex: 0 1 auto; flex-wrap: nowrap; align-items: center; gap: 0.5rem 1.25rem; }
	.gw-header.gw-header .wp-block-buttons { display: none; }
	.gw-header.gw-header .wp-block-navigation { order: 1; }
	.gw-header.gw-header .wp-block-woocommerce-customer-account { order: 2; }
	.gw-header.gw-header .wp-block-navigation__container { gap: 1rem; flex-wrap: nowrap; }
	.gw-header.gw-header .wc-block-customer-account__link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
}
@media (max-width: 600px) {
	/* Menu button last, with a 44px tap area. */
	.gw-header.gw-header .wp-block-navigation { order: 3; }
	.gw-header.gw-header .wp-block-navigation .wp-block-navigation__responsive-container-open { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; margin-right: -10px; }
}
