/**
 * Site frame: announcement bar, header, menu and footer.
 *
 * Breakpoints
 * 1023px - compact header: menu button, centred logo (tablets and phones).
 *          WordPress folds its menu at 600px, but five links do not fit
 *          next to the logo and cart until about 1024px.
 *  600px - phone sizes (matches settings.viewport.mobile in theme.json).
 */

/* Header, main and footer touch; each section sets its own spacing. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* Short pages (empty cart, 404) keep the footer at the bottom of the screen. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* Content edges line up with the 1120px wide layout on large screens. */
.prismette-announcement,
.prismette-header,
.prismette-footer {
	--prismette-edge: max(var(--wp--custom--gutter), calc((100% - var(--wp--style--global--wide-size)) / 2));
}

/* -------------------------------------------------------------------------
 * 1. Announcement bar: navy, small caps, star between the messages.
 * ---------------------------------------------------------------------- */
.wp-block-group.prismette-announcement {
	align-items: center;
	box-sizing: border-box;
	column-gap: 16px;
	min-height: 38px;
	padding: 6px var(--prismette-edge);
	row-gap: 2px;
}

.prismette-announcement p {
	font-size: var(--wp--preset--font-size--label);
	font-weight: 600;
	letter-spacing: 0.2em;
	line-height: 1.3;
	margin: 0;
	text-align: center;
	text-transform: uppercase;
}

.prismette-announcement p + p {
	align-items: center;
	display: inline-flex;
	gap: 16px;
}

.prismette-announcement p + p::before {
	background: currentColor;
	content: "";
	flex: none;
	height: 8px;
	-webkit-mask: var(--prismette-star) center / contain no-repeat;
	mask: var(--prismette-star) center / contain no-repeat;
	width: 8px;
}

.prismette-announcement a {
	color: inherit;
	text-underline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * 2. Header: logo left, menu centred, cart right.
 * ---------------------------------------------------------------------- */
.wp-block-group.prismette-header {
	align-items: center;
	background: var(--wp--preset--color--base);
	border-bottom: 1px solid var(--wp--preset--color--silver);
	display: grid;
	gap: 24px;
	grid-template-areas: "logo nav cart";
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	padding: 14px var(--prismette-edge);
}

.wp-block-group.prismette-header > * {
	margin: 0;
}

.prismette-header .wp-block-prismette-wordmark {
	grid-area: logo;
	justify-self: start;
}

.prismette-header .wp-block-navigation {
	grid-area: nav;
}

.prismette-header .wp-block-prismette-cart-link {
	grid-area: cart;
	justify-self: end;
}

.prismette-header .wp-block-navigation .wp-block-navigation-item__content {
	padding: 8px 0;
	text-underline-offset: 6px;
}

.prismette-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--navy);
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

/* Menu button and close button: 44 x 44 tap targets. */
.prismette-header .wp-block-navigation__responsive-container-open,
.prismette-header .wp-block-navigation__responsive-container-close {
	align-items: center;
	border-radius: var(--wp--preset--border-radius--pill);
	color: var(--wp--preset--color--navy);
	height: 44px;
	justify-content: center;
	width: 44px;
}

.prismette-header .wp-block-navigation__responsive-container-close {
	display: flex;
}

/* -------------------------------------------------------------------------
 * 3. Menu panel (opens from the menu button): white, large serif links.
 * ---------------------------------------------------------------------- */
.prismette-header .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
	padding: 6px var(--wp--custom--gutter) 40px;
}

/* Close button sits exactly where the menu button was. */
.prismette-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	left: calc(0px - var(--wp--custom--gutter) + 12px);
	right: auto;
	top: 0;
}

.prismette-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content {
	padding-top: 64px;
}

.prismette-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: stretch;
	border-top: 1px solid var(--wp--preset--color--silver);
	gap: 0;
	width: 100%;
}

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

.prismette-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 30px;
	font-weight: 600;
	letter-spacing: -0.005em;
	line-height: 1.1;
	padding: 16px 0;
	text-transform: none;
	width: 100%;
}

/* -------------------------------------------------------------------------
 * 4. Compact header (tablets and phones): menu, centred logo, cart.
 * ---------------------------------------------------------------------- */
@media (max-width: 1023px) {
	.wp-block-group.prismette-header {
		gap: 8px;
		grid-template-areas: "nav logo cart";
		grid-template-columns: 44px minmax(0, 1fr) 44px;
		padding: 6px var(--wp--custom--gutter);
	}

	.prismette-header .wp-block-prismette-wordmark {
		justify-self: center;
	}

	/* Keep WordPress's menu button visible up to 1023px (it hides it at 600px). */
	.prismette-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.prismette-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

@media (max-width: 600px) {
	.wp-block-group.prismette-announcement {
		column-gap: 10px;
		min-height: 34px;
		padding: 5px 12px;
	}

	.prismette-announcement p {
		font-size: 10px;
		letter-spacing: 0.16em;
	}

	.prismette-announcement p + p {
		gap: 10px;
	}

	.prismette-announcement p + p::before {
		height: 7px;
		width: 7px;
	}

	.wp-block-group.prismette-header {
		padding: 6px 12px;
	}

	.prismette-header .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
		padding: 6px 20px 40px;
	}

	.prismette-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
		left: -8px;
	}
}

@media (max-width: 380px) {
	.prismette-announcement p {
		letter-spacing: 0.1em;
	}
}

/* -------------------------------------------------------------------------
 * 5. Footer: navy. Brand column plus three link columns, then the
 * copyright line and payment badges.
 * ---------------------------------------------------------------------- */
.wp-block-group.prismette-footer {
	/* A thin line keeps the footer apart from a navy section just above it. */
	border-top: 1px solid var(--wp--preset--color--navy-line);
	padding: 72px var(--prismette-edge) 36px;
}

.wp-block-group.prismette-footer > * {
	margin-block: 0;
}

.wp-block-group.prismette-footer__grid {
	border-bottom: 1px solid var(--wp--preset--color--navy-line);
	grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2fr));
	padding-bottom: 56px;
}

.prismette-footer__tagline {
	color: var(--wp--preset--color--silver);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	max-width: 300px;
}

.prismette-footer__email {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
}

.prismette-footer .prismette-footer__email a {
	color: var(--wp--preset--color--ivory);
	text-decoration: none;
}

.prismette-footer__title {
	color: var(--wp--preset--color--on-navy-muted);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	letter-spacing: 0.18em;
	line-height: 1;
	text-transform: uppercase;
}

.prismette-footer .wp-block-navigation {
	color: var(--wp--preset--color--ivory);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.3;
	text-transform: none;
}

.prismette-footer .wp-block-navigation .wp-block-navigation__container {
	gap: 14px;
}

.prismette-footer .wp-block-navigation a.wp-block-navigation-item__content,
.prismette-footer .wp-block-navigation .current-menu-item > a.wp-block-navigation-item__content {
	color: var(--wp--preset--color--ivory);
	text-decoration: none;
}

.prismette-footer .wp-block-navigation a.wp-block-navigation-item__content:hover,
.prismette-footer .prismette-footer__email a:hover {
	color: var(--wp--preset--color--ivory);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.wp-block-group.prismette-footer__bottom {
	padding-top: 28px;
}

.prismette-footer .prismette-copyright {
	color: var(--wp--preset--color--on-navy-muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	margin: 0;
}

.prismette-footer .prismette-payment-icons {
	justify-content: flex-end;
	margin: 0;
}

@media (max-width: 1023px) {
	.wp-block-group.prismette-footer__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.prismette-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 600px) {
	.wp-block-group.prismette-footer {
		padding: 44px 20px 32px;
	}

	.wp-block-group.prismette-footer__grid {
		gap: 32px 16px;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding-bottom: 36px;
	}

	/* Help on the left; Learn and Legal stacked on the right. */
	.prismette-footer__grid > .prismette-footer__col:nth-child(2) {
		grid-row: span 2;
	}

	/* Bigger tap targets for thumbs. */
	.prismette-footer .wp-block-navigation {
		font-size: 15px;
		font-weight: 500;
	}

	.prismette-footer .wp-block-navigation .wp-block-navigation__container {
		gap: 0;
	}

	.prismette-footer .wp-block-navigation a.wp-block-navigation-item__content {
		padding: 10px 0;
	}

	.prismette-footer .prismette-footer__email {
		font-size: 15px;
		font-weight: 600;
	}

	.wp-block-group.prismette-footer__bottom {
		flex-direction: column-reverse;
		align-items: flex-start;
		gap: 20px;
	}

	.prismette-footer .prismette-payment-icons {
		justify-content: flex-start;
	}
}

/* -------------------------------------------------------------------------
 * 6. Checkout header: logo and "Secure checkout" only, nothing to click away to.
 * ---------------------------------------------------------------------- */
.wp-block-group.prismette-checkout-header {
	--prismette-edge: max(var(--wp--custom--gutter), calc((100% - var(--wp--style--global--wide-size)) / 2));
	border-bottom: 1px solid var(--wp--preset--color--silver);
	padding: 14px var(--prismette-edge);
}

.prismette-checkout-header__secure {
	align-items: center;
	color: var(--wp--preset--color--navy);
	display: flex;
	font-size: var(--wp--preset--font-size--tiny);
	font-weight: 700;
	gap: 8px;
	letter-spacing: 0.14em;
	margin: 0;
	text-transform: uppercase;
}

.prismette-checkout-header__secure::before {
	background: currentColor;
	content: "";
	height: 16px;
	-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='1.8' stroke-linejoin='round'%3E%3Cpath d='M6 10.5h12v10H6zM8.5 10.5V7.5a3.5 3.5 0 0 1 7 0v3'/%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='1.8' stroke-linejoin='round'%3E%3Cpath d='M6 10.5h12v10H6zM8.5 10.5V7.5a3.5 3.5 0 0 1 7 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
	width: 16px;
}

/* Cart and checkout pages. */
.wp-block-group.prismette-shop-flow {
	padding-bottom: var(--wp--preset--spacing--100);
	padding-top: var(--wp--preset--spacing--80);
}

.prismette-shop-flow > .wp-block-post-title {
	font-size: var(--wp--preset--font-size--heading-m);
	margin-bottom: var(--wp--preset--spacing--70);
}

@media (max-width: 600px) {
	.wp-block-group.prismette-checkout-header {
		padding: 10px 16px;
	}

	.prismette-checkout-header__secure {
		font-size: 11px;
		letter-spacing: 0.1em;
	}
}

/* -------------------------------------------------------------------------
 * 7. WooCommerce Cart and Checkout blocks.
 * Their small headings use Manrope (the serif is for 28px and up), and the
 * order summary skips the product description so the bundle line stands out.
 * ---------------------------------------------------------------------- */
.wc-block-components-title.wc-block-components-title,
.wc-block-cart__totals-title.wc-block-cart__totals-title {
	color: var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0;
	line-height: 1.3;
}

.wc-block-components-order-summary-item .wc-block-components-product-metadata__description,
.wc-block-cart-item__product .wc-block-components-product-metadata__description {
	display: none;
}

/* WooCommerce mounts "no payment methods" while Stripe still checks Apple Pay
 * and Google Pay (up to ~15 s measured), then removes it. Show a calm loading
 * line instead; the real error appears only if it is still there after 30 s. */
.wc-block-components-notice-banner.is-error.wc-block-checkout__no-payment-methods-notice {
	animation: prismette-payment-error 0s linear 30s forwards;
	background-color: var(--wp--preset--color--mist);
	border-color: var(--wp--preset--color--silver);
	position: relative;
}

.wc-block-components-notice-banner.wc-block-checkout__no-payment-methods-notice > svg,
.wc-block-components-notice-banner.wc-block-checkout__no-payment-methods-notice > .wc-block-components-notice-banner__content {
	animation: prismette-payment-error-content 0s linear 30s forwards;
	visibility: hidden;
}

.wc-block-components-notice-banner.wc-block-checkout__no-payment-methods-notice::after {
	animation: prismette-payment-loading-line 0s linear 30s forwards;
	color: var(--wp--preset--color--navy);
	content: "Loading secure payment options…";
	inset: 0;
	padding: inherit;
	position: absolute;
}

@keyframes prismette-payment-error {
	to {
		background-color: #fff0f0;
		border-color: #cc1818;
	}
}

@keyframes prismette-payment-error-content {
	to {
		visibility: visible;
	}
}

@keyframes prismette-payment-loading-line {
	to {
		visibility: hidden;
	}
}

/* The wallet buttons arrive after the form, because Stripe tests them first.
 * Their place is kept from the start so the form does not jump while the
 * shopper types, except where no wallet is expected (inc/checkout-speed.php).
 * If no wallet comes, the place folds away after 45 s. WooCommerce adds the
 * empty box a moment after the form, so the form itself keeps the place until
 * then. */
html:not(.prismette-no-wallets) .wc-block-checkout__form:has(> fieldset:first-child) {
	animation: prismette-wallet-slot 0s linear 45s forwards;
	padding-block-start: 171px;
}

@media (min-width: 1024px) {
	html:not(.prismette-no-wallets) .wc-block-checkout__form:has(> fieldset:first-child) {
		padding-block-start: 119px;
	}
}

html:not(.prismette-no-wallets) .wc-block-checkout__form > div:first-child:empty {
	animation: prismette-wallet-slot 0s linear 45s forwards;
	background-color: var(--wp--preset--color--mist);
	border-radius: var(--wp--preset--border-radius--m);
	margin-block-end: 34px;
	min-height: 137px;
}

/* Wide layouts show the wallet buttons side by side. */
html:not(.prismette-no-wallets) .wc-block-checkout.is-large .wc-block-checkout__form > div:first-child:empty,
html:not(.prismette-no-wallets) .wc-block-checkout.is-medium .wc-block-checkout__form > div:first-child:empty {
	min-height: 85px;
}

@keyframes prismette-wallet-slot {
	to {
		background-color: transparent;
		margin-block-end: 0;
		min-height: 0;
		padding-block-start: 0;
	}
}

/* -------------------------------------------------------------------------
 * 8. Shop page: rounded product photos, navy titles that underline on hover.
 * ---------------------------------------------------------------------- */
.wp-block-woocommerce-product-collection.prismette-shop__grid {
	margin-block-start: var(--wp--preset--spacing--80);
}

.prismette-shop__grid .wc-block-components-product-image img {
	border-radius: var(--wp--preset--border-radius--l);
}

.prismette-shop__grid .wp-block-post-title a {
	color: var(--wp--preset--color--navy);
	text-decoration: none;
}

.prismette-shop__grid .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Phones: one wide card per row, so long product names stay readable. */
@media (max-width: 600px) {
	.prismette-shop__grid .wc-block-product-template.wc-block-product-template__responsive {
		grid-template-columns: minmax(0, 1fr);
	}
}
