/*
Theme Name:        wygge Shop Theme
Theme URI:         https://github.com/wygge-app/wygge-wordpress
Description:       Block theme for wygge Micro Tenant storefronts (DEC-033). Colours, font and logo come from the tenant's wygge branding at runtime (CSS variables written by the wygge Shop plugin); the values in theme.json are only the platform fallbacks.
Author:            wygge
Version:           0.2.1
Requires at least: 6.6
Tested up to:      7.1
Requires PHP:      8.3
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       wygge-shop-theme
*/

/* Layout and typography live in theme.json. Only what theme.json cannot express lives here. */

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.wp-site-blocks > main, .wp-site-blocks > .wygge-main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }

/* Header: brand bar in the tenant's primary colour (gradient to secondary when the tenant set one). */
header.wp-block-template-part { margin: 0; }
.wygge-header {
	background: var(--wygge-header-bg, #032425);
	color: var(--wygge-header-fg, #ffffff);
	padding-block: .5rem;
}
.wygge-header .wygge-header__bar { gap: .5rem 1rem; }
.wygge-header a { color: inherit; }
.wygge-header .wygge-nav__link:hover { background: rgba(255, 255, 255, .14); }
.wygge-header .wygge-nav__link[aria-current="page"]:hover { background: var(--wygge-color-accent, #c8ff16); }

/* Main column: 16 px gutter on phones (root padding from theme.json), breathing room on larger screens. */
.wygge-main { padding-block: 1.25rem 2.5rem; }
main.wp-block-group { margin-top: 0; }

footer.wp-block-template-part { margin-top: auto; }
.wygge-footer {
	border-top: 1px solid var(--wygge-color-border, #d5dddd);
	color: var(--wygge-color-text-muted, #4a5a5b);
	padding-block: 1rem;
}
.wygge-footer:empty, .wygge-footer > p:empty { display: none; }

@media (max-width: 47.99rem) {
	/* Phone: brand on the first row, the shop links below it — wrapping onto as many rows as they need
	   (five links no longer fit one row at 390 px: the page scrolled sideways). */
	.wygge-header .wygge-header__bar { flex-direction: column; align-items: stretch !important; }
	.wygge-header .wygge-nav ul { justify-content: flex-start; flex-wrap: wrap; gap: .25rem .35rem; }
	.wygge-header .wygge-nav__link { padding-inline: .6rem; font-size: .95rem; }
}

.wygge-health { font-weight: 600; }
.wygge-health--ok { color: var(--wygge-color-success, #1a7f37); }
.wygge-health--error { color: var(--wygge-color-danger, #b42318); }
