/*
 * Gut Insights theme: layout pieces theme.json cannot express.
 * Mobile first (375px). Breakpoints 600px and 960px; content max 1280px.
 * Tokens only, no raw colours.
 */

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

html {
	-webkit-text-size-adjust: 100%;
}

/* Padding and borders sit inside a box's width, so padded boxes (notices,
   the GP warning, CTA bands) line up with the text column. */
*,
*::before,
*::after {
	box-sizing: border-box;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--navy);
	outline-offset: 3px;
	border-radius: 4px;
}

input,
select,
textarea {
	font-size: max(16px, 1em);
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	overflow-wrap: normal !important;
}

/* Buttons: 52px tall, full width on phones. */
.wp-element-button,
.wp-block-button__link {
	min-height: var(--wp--custom--button--height);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

@media (max-width: 599px) {

	.gi-main .wp-block-buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.gi-main .wp-block-buttons > .wp-block-button,
	.gi-main .wp-block-buttons .wp-block-button__link {
		width: 100%;
	}
}

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

.wp-block-image.gi-logo {
	margin: 0;
	flex: none;
	line-height: 0;
}

.gi-logo a {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	border-radius: 4px;
}

.gi-logo img {
	display: block;
	width: 126px;
	height: 40px;
}

/* Header -------------------------------------------------------------- */

.gi-header-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 40;
}

.gi-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.gi-header__bar {
	min-height: var(--wp--custom--header--height);
	gap: 16px;
}

.gi-header__actions {
	align-items: center;
}

/* Basket (WooCommerce mini-cart) as a 48px square. */
.gi-header__cart .wc-block-mini-cart__button {
	min-width: var(--wp--custom--tap);
	min-height: var(--wp--custom--tap);
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--button);
	color: var(--wp--preset--color--ink);
	padding: 0 10px;
}

/*
 * WooCommerce only sets aria-hidden on the closed basket drawer, so Tab can
 * still reach its links. Hide it once the slide-out has finished.
 */
.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-mini-cart__drawer {
	visibility: hidden;
	transition: visibility 0s linear 0.3s;
}

/* Hamburger and close: 48px tap targets. */
.gi-nav .wp-block-navigation__responsive-container-open,
.gi-nav .wp-block-navigation__responsive-container-close {
	width: var(--wp--custom--tap);
	height: var(--wp--custom--tap);
	align-items: center;
	justify-content: center;
	border-radius: var(--wp--custom--radius--button);
	color: var(--wp--preset--color--ink);
}

.gi-nav .wp-block-navigation__responsive-container-open {
	border: 1.5px solid var(--wp--preset--color--line);
}

.gi-nav .wp-block-navigation__responsive-container-open svg,
.gi-nav .wp-block-navigation__responsive-container-close svg {
	width: 26px;
	height: 26px;
}

/* Mobile menu sheet: core's overlay restyled as a bottom sheet. */
@media (max-width: 599px) {

	/* Only below 600px: core hides the menu button from 600px up. */
	.gi-nav .wp-block-navigation__responsive-container-open {
		display: inline-flex;
	}


	.gi-nav .wp-block-navigation__responsive-container.is-menu-open {
		inset: auto 0 0 0;
		top: auto;
		max-height: 88vh;
		overflow-y: auto;
		border-radius: var(--wp--custom--radius--panel) var(--wp--custom--radius--panel) 0 0;
		padding: 16px var(--wp--custom--gutter) calc(24px + env(safe-area-inset-bottom));
		background-color: var(--wp--preset--color--card);
		color: var(--wp--preset--color--ink);
		box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--wp--preset--color--ink) 45%, transparent);
		animation: gi-sheet-up 0.22s ease-out;
	}

	.gi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		padding-top: 56px;
		align-items: stretch;
	}

	.gi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		gap: 0;
		align-items: stretch;
		width: 100%;
	}

	.gi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
		width: 100%;
		border-bottom: 1px solid var(--wp--preset--color--line);
	}

	.gi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		display: flex;
		align-items: center;
		min-height: 56px;
		width: 100%;
		font-size: var(--wp--preset--font-size--h-3);
		font-weight: 700;
		color: var(--wp--preset--color--ink);
	}

	/* Kit links become a pair of outlined buttons at the bottom of the sheet. */
	.gi-nav .wp-block-navigation__responsive-container.is-menu-open .gi-nav__secondary {
		border-bottom: 0;
		margin-top: 12px;
	}

	.gi-nav .wp-block-navigation__responsive-container.is-menu-open .gi-nav__secondary .wp-block-navigation-item__content {
		justify-content: center;
		min-height: var(--wp--custom--button--height);
		border: 1.5px solid var(--wp--preset--color--line);
		border-radius: var(--wp--custom--radius--button);
		font-size: var(--wp--preset--font-size--body);
	}

	.gi-nav .wp-block-navigation__responsive-container-close {
		top: 12px;
		right: 12px;
		background-color: var(--wp--preset--color--navy-soft);
	}
}

@keyframes gi-sheet-up {

	from {
		transform: translateY(24px);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {

	.gi-nav .wp-block-navigation__responsive-container.is-menu-open {
		animation: none;
	}
}

/* 600-959px: room for the main links only; kit links stay in the footer. */
@media (min-width: 600px) and (max-width: 959px) {

	.gi-nav .gi-nav__secondary {
		display: none;
	}

	.gi-nav .wp-block-navigation__container {
		gap: 20px;
	}
}

@media (min-width: 600px) {

	.gi-header__bar {
		min-height: 72px;
	}

	/* Links first, basket last. */
	.gi-header__actions .gi-nav {
		order: -1;
		margin-right: 12px;
	}
}

@media (min-width: 960px) {

	.gi-nav .gi-nav__secondary .wp-block-navigation-item__content {
		padding: 9px 14px;
		border: 1.5px solid var(--wp--preset--color--line);
		border-radius: var(--wp--custom--radius--button);
		font-size: var(--wp--preset--font-size--small);
		font-weight: 700;
	}

	.gi-nav .gi-nav__secondary + .gi-nav__secondary {
		margin-left: -18px;
	}
}

/* Footer -------------------------------------------------------------- */

.gi-footer {
	margin-block-start: 0;
}

.gi-footer a {
	color: var(--wp--preset--color--card);
	text-decoration: none;
}

.gi-footer a:hover {
	text-decoration: underline;
}

.gi-footer .gi-footer__heading {
	color: var(--wp--preset--color--card);
	font-size: var(--wp--preset--font-size--body);
	margin-bottom: 8px;
}

.gi-footer .gi-footer__links {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
}

.gi-footer .gi-footer__links li {
	min-height: 32px;
}

.gi-footer .gi-footer__rule {
	border-color: var(--wp--preset--color--muted);
	margin-block: var(--wp--preset--spacing--l) var(--wp--preset--spacing--m);
	opacity: 1;
}

/* Phones: link columns side by side, two per row. */
@media (max-width: 781px) {

	.gi-footer .gi-footer__cols {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.gi-footer .gi-footer__brand {
		grid-column: 1 / -1;
	}
}

/* Sticky mobile bar --------------------------------------------------- */

.gi-sticky-bar-part {
	display: none;
}

@media (max-width: 599px) {

	.gi-sticky-bar-part {
		display: block;
		position: fixed;
		inset: auto 0 0 0;
		z-index: 30;
	}

	.gi-sticky-bar {
		padding: 10px var(--wp--custom--gutter) calc(10px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--wp--preset--color--line);
		box-shadow: 0 -6px 20px color-mix(in srgb, var(--wp--preset--color--ink) 8%, transparent);
	}

	.gi-sticky-bar .gi-sticky-bar__buttons {
		flex: 1 1 auto;
	}

	.gi-sticky-bar .wp-block-button,
	.gi-sticky-bar .wp-block-button__link {
		width: 100%;
	}

	.gi-sticky-bar .gi-sticky-bar__note {
		flex: 0 1 132px;
		margin: 0;
		line-height: 1.25;
	}

	/* Keep the footer clear of the bar. The footer has inline padding,
	   so pad its wrapper. */
	body:has(.gi-sticky-bar-part) .gi-footer-part {
		padding-bottom: calc(84px + env(safe-area-inset-bottom));
		background-color: var(--wp--preset--color--ink);
	}
}

/* Section patterns ---------------------------------------------------- */

.gi-section {
	padding-top: var(--wp--preset--spacing--section);
	padding-bottom: var(--wp--preset--spacing--section);
}

.gi-lead {
	max-width: 34ch;
	font-size: clamp(18px, 0.35vw + 16.7px, 21px);
}

.gi-small {
	max-width: 62ch;
	margin-inline: auto;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

/*
 * Text narrower than its section (leads, intros, small print) starts at the
 * section's left edge, under its heading. Core's constrained layout would
 * centre it (with !important). Centred small print is left as it is.
 * In a full-width section the 1280px column starts (100% - 1280px) / 2 in,
 * so the offset is that, or 0 in anything narrower.
 *
 * Page content (.gi-page) is full width so full-width bands can sit in it;
 * everything else in it starts on the same 1280px column edge.
 */
.is-layout-constrained > :is(.gi-lead, .gi-hub-intro, .gi-small:not(.has-text-align-center)),
.gi-page > :not(.alignfull) {
	margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
}

/* A button styled as a text link (block style "Text link"),
   e.g. "Help me choose", "Learn more". */
.wp-block-button.is-style-text .wp-block-button__link {
	min-height: 48px;
	padding: 0 4px;
	color: var(--wp--preset--color--navy);
	text-decoration: underline;
	text-underline-offset: 3px;
	background: transparent;
}

.wp-block-button.is-style-text .wp-block-button__link:hover {
	color: var(--wp--preset--color--navy-dark);
	background: transparent;
}

/* Tick facts: a list with teal-ink ticks. */
.gi-ticks {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	padding: 0;
	font-size: var(--wp--preset--font-size--small);
	list-style: none;
}

.gi-ticks li {
	display: flex;
	gap: 8px;
	align-items: center;
}

.gi-ticks li::before {
	flex: none;
	width: 18px;
	height: 18px;
	content: "";
	background: var(--wp--preset--color--teal-ink);
	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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Hero */
.gi-hero__grid {
	display: grid;
	gap: var(--wp--preset--spacing--l);
	align-items: center;
}

.gi-hero__text > * {
	margin-block: 0;
}

.gi-hero__text > * + * {
	margin-top: var(--wp--preset--spacing--m);
}

.gi-hero .wp-block-image.gi-hero__art {
	margin: 0;
}

.gi-hero__art img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 560 / 440;
}

@media (min-width: 960px) {

	.gi-hero__grid {
		grid-template-columns: 1fr 1.1fr;
	}
}

/* Test doors: the one card style. */
.gi-doors {
	gap: var(--wp--preset--spacing--m);
}

.gi-door {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--s);
	padding: var(--wp--preset--spacing--m);
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
}

.gi-door > * {
	margin: 0;
}

.gi-door .wp-block-image.gi-door__art {
	margin: 0 0 var(--wp--preset--spacing--xs);
}

.gi-door__art img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 1;
	border-radius: 12px;
}

.gi-door__tag {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--navy);
}

.gi-door__price {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

.gi-door__price strong {
	display: block;
	margin-bottom: 4px;
	font-size: 30px;
	font-weight: 800;
	line-height: 1;
	color: var(--wp--preset--color--ink);
}

.gi-door__also {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--s);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	border-top: 1px solid var(--wp--preset--color--line);
}

.gi-door__row {
	gap: 12px;
	align-items: center;
	padding-top: 12px;
	border-top: 1px solid var(--wp--preset--color--line);
}

.gi-door__row p {
	margin: 0;
}

.gi-door__row-price {
	font-weight: 800;
	color: var(--wp--preset--color--ink);
	white-space: nowrap;
}

.gi-door__row-price a {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	margin-left: 12px;
	font-weight: 700;
}

.gi-kit-links a,
.gi-lead-band__links a {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	margin-right: 20px;
	font-weight: 700;
}

/* Ink band (clinical lead). Teal reads as text on ink, never on white. */
.gi-section--ink :is(h2, h3) {
	color: var(--wp--preset--color--card);
}

.gi-section--ink a {
	color: var(--wp--preset--color--card);
}

.gi-section--ink a:hover {
	color: var(--wp--preset--color--teal-soft);
}

.gi-lead-band > * + * {
	margin-top: var(--wp--preset--spacing--m);
}

.gi-roles {
	display: grid;
	gap: 8px;
	padding: 0;
	list-style: none;
}

.gi-roles li {
	padding-left: 14px;
	border-left: 3px solid var(--wp--preset--color--teal);
}

.gi-numbers {
	gap: var(--wp--preset--spacing--m);
}

.gi-numbers p {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
}

.gi-numbers strong {
	display: block;
	font-size: 34px;
	font-weight: 800;
	line-height: 1.05;
	color: var(--wp--preset--color--teal);
}

/* Heading on the left, content on the right (FAQ). */
.gi-split {
	display: grid;
	gap: var(--wp--preset--spacing--m);
}

@media (min-width: 960px) {

	.gi-split {
		grid-template-columns: 1fr 1.6fr;
		gap: var(--wp--preset--spacing--l);
	}
}

/* Big figure over a label: the <strong> is already a block. */
.gi-door__price br,
.gi-numbers br {
	display: none;
}

/* Top bar: one line of delivery and phone facts above the header.
   It scrolls away; only the header stays at the top. */
.gi-top-bar {
	padding: 8px var(--wp--custom--gutter);
	font-size: 13.5px;
	line-height: 1.4;
	color: var(--wp--preset--color--line);
}

.gi-top-bar p {
	margin: 0;
}

.gi-top-bar :is(strong, a) {
	color: var(--wp--preset--color--card);
}

.gi-top-bar a {
	display: inline-block;
	padding-block: 4px;
}

@media (min-width: 600px) {

	.gi-top-bar {
		font-size: var(--wp--preset--font-size--small);
	}
}

/* Front page: sections sit straight under the header. */
.gi-main--home {
	margin: 0;
	padding: 0;
}

.gi-main--home > .gi-section {
	margin-block: 0;
}

/* Finder: two equal columns from 960px. */
@media (min-width: 960px) {

	.gi-split.gi-split--even {
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}
}

.gi-finder__intro .wp-block-buttons {
	margin-top: var(--wp--preset--spacing--m);
}

/* Four questions: always open, a rule under each answer. */
.gi-qa > .gi-qa__q {
	margin: 0;
	padding-top: 20px;
}

.gi-qa > .gi-qa__a {
	margin: 6px 0 0;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.gi-qa__a strong {
	color: var(--wp--preset--color--ink);
}

/* Product page ----------------------------------------------------------- */

.gi-product-top {
	padding-top: var(--wp--preset--spacing--m);
}

.gi-breadcrumbs {
	margin-bottom: var(--wp--preset--spacing--m);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

.gi-product-grid {
	display: grid;
	gap: var(--wp--preset--spacing--m);
}

.gi-product-grid > * {
	min-width: 0;
	margin-block: 0;
}

.gi-product-grid__intro > * {
	margin-block: 0;
}

.gi-product-grid__intro > * + * {
	margin-top: var(--wp--preset--spacing--m);
}

.gi-product-grid__intro h1 {
	font-size: clamp(32px, 3vw + 20px, 52px);
}

.gi-product-grid .wp-block-image.gi-product-grid__media {
	margin: 0;
	padding: var(--wp--preset--spacing--m);
	background: var(--wp--preset--color--teal-soft);
	border-radius: var(--wp--custom--radius--panel);
}

.gi-product-grid__media img {
	display: block;
	width: 100%;
	max-width: 420px;
	height: auto;
	margin-inline: auto;
	aspect-ratio: 420 / 340;
}

.gi-product-grid__buy {
	display: grid;
	gap: var(--wp--preset--spacing--m);
	padding: 20px;
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
}

.gi-product-grid__buy > * {
	margin-block: 0;
}

@media (min-width: 960px) {

	.gi-product-grid {
		grid-template-areas:
			"media intro"
			"media buy";
		grid-template-rows: auto 1fr;
		grid-template-columns: 1.1fr 1fr;
		column-gap: var(--wp--preset--spacing--l);
		align-items: start;
	}

	.gi-product-grid__intro {
		grid-area: intro;
	}

	.gi-product-grid .wp-block-image.gi-product-grid__media {
		position: sticky;
		top: 96px;
		grid-area: media;
	}

	.gi-product-grid__buy {
		grid-area: buy;
	}
}

.gi-product-copy :where(h2) {
	margin-top: var(--wp--preset--spacing--l);
}

/* No product description yet: no empty band. */
.gi-product-copy:not(:has(.wp-block-post-content > *)) {
	display: none;
}

/* Checkout and thank-you pages ---------------------------------------- */

.gi-main--checkout > .wp-block-post-title,
.gi-main--thanks > .wp-block-post-title {
	margin-top: 0;
	font-size: var(--wp--preset--font-size--h-2);
}

/* WooCommerce caps the checkout title at 1000px, narrower than our column. */
.gi-main--checkout > .wp-block-post-title {
	max-width: 1280px;
}

/* Tests, Learn and help pages ----------------------------------------- */

.gi-section--top {
	padding-top: var(--wp--preset--spacing--l);
	padding-bottom: var(--wp--preset--spacing--l);
}

.gi-section--tight {
	padding-top: 0;
}

.gi-compare {
	display: grid;
	gap: var(--wp--preset--spacing--s);
}

.gi-compare__row {
	display: grid;
	gap: var(--wp--preset--spacing--s);
	align-items: center;
	padding: var(--wp--preset--spacing--m);
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
}

.gi-compare__text > * {
	margin: 0;
}

.gi-compare__text > * + * {
	margin-top: 8px;
}

.gi-compare__text h2 a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.gi-compare__text h2 a:hover {
	text-decoration: underline;
}

.gi-compare__versions a {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
}

.gi-compare__price {
	margin: 0;
}

@media (min-width: 600px) {

	.gi-compare__row {
		grid-template-columns: 1fr auto;
	}
}

.gi-hubs,
.gi-articles .wp-block-post-template {
	gap: var(--wp--preset--spacing--s);
	margin-top: var(--wp--preset--spacing--l);
}

.gi-article-card {
	height: 100%;
	padding: var(--wp--preset--spacing--m);
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
}

.gi-article-card > * {
	margin: 0;
}

.gi-article-card > * + * {
	margin-top: 8px;
}

.gi-article-card .wp-block-post-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.gi-article-card .wp-block-post-title a:hover {
	text-decoration: underline;
}

.gi-article-card__hub a {
	color: var(--wp--preset--color--teal-ink);
}

.gi-hub-intro {
	max-width: 62ch;
}

/* The answer-first summary uses the article's full text column (not 34ch). */
.gi-answer {
	max-width: var(--wp--style--global--content-size);
	margin-top: var(--wp--preset--spacing--s);
}

.gi-answer .wp-block-post-excerpt__more-text {
	display: none;
}

.gi-byline {
	gap: 4px 16px;
	margin-top: var(--wp--preset--spacing--s);
}

.gi-byline > * {
	margin: 0;
}

.gi-article {
	margin-top: var(--wp--preset--spacing--l);
}

.gi-article > :where(h2) {
	margin-top: var(--wp--preset--spacing--l);
}

.gi-article :where(table) {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}

.gi-article :where(th, td) {
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.gi-main--article .wp-block-gi-cta-band {
	margin-top: var(--wp--preset--spacing--section);
}

/* Help page building blocks */

.gi-page :where(h2) {
	margin-top: var(--wp--preset--spacing--l);
}

.gi-review-note {
	margin-bottom: var(--wp--preset--spacing--l);
}
