/*
Theme Name: WebMaster Theme
Theme URI: https://groupy.pro
Author: WebMaster LLC
Author URI: https://groupy.pro
Description: A warm, modern block theme built from the Groupy.Pro design system: soft paper backgrounds, rounded cards, pill buttons and automatic dark mode. Edit everything in the Site Editor. Pairs with Groupy.Pro, sharing its accent color and giving community pages a full-width layout automatically, and works on any site without it.
Requires at least: 6.4
Tested up to: 7.2
Requires PHP: 8.1
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Update URI: https://groupy.pro/webmaster-theme
Text Domain: webmaster-theme
Tags: blog, portfolio, news, one-column, wide-blocks, block-patterns, block-styles, full-site-editing, custom-colors, custom-logo, custom-menu, editor-style, featured-images, style-variations, translation-ready, accessibility-ready
*/

/* ---------- Dark mode ----------
 * Swaps the palette's neutral colors. The accent stays the brand color.
 * Scheme is set under Appearance → WebMaster Theme (auto follows the visitor's device).
 */
body.wmt-scheme-dark {
	--wp--preset--color--base: #121110;
	--wp--preset--color--surface: #1b1a18;
	--wp--preset--color--surface-2: #242220;
	--wp--preset--color--contrast: #f3efe9;
	--wp--preset--color--contrast-2: #b8b1a7;
	--wp--preset--color--contrast-3: #847d74;
	--wp--preset--color--line: #2c2926;
	--wp--preset--color--accent-2: color-mix(in srgb, var(--wp--preset--color--accent) 65%, #fff);
	--wp--preset--color--accent-soft: color-mix(in srgb, var(--wp--preset--color--accent) 22%, #1b1a18);
	--wp--preset--shadow--soft: 0 1px 2px rgb(0 0 0 / .45);
	--wp--preset--shadow--pop: 0 16px 48px rgb(0 0 0 / .55);
	--wp--preset--gradient--accent-glow: radial-gradient(70% 80% at 50% 0%, color-mix(in srgb, var(--wp--preset--color--accent) 22%, #121110) 0%, transparent 70%);
	color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	body.wmt-scheme-auto {
		--wp--preset--color--base: #121110;
		--wp--preset--color--surface: #1b1a18;
		--wp--preset--color--surface-2: #242220;
		--wp--preset--color--contrast: #f3efe9;
		--wp--preset--color--contrast-2: #b8b1a7;
		--wp--preset--color--contrast-3: #847d74;
		--wp--preset--color--line: #2c2926;
		--wp--preset--color--accent-2: color-mix(in srgb, var(--wp--preset--color--accent) 65%, #fff);
		--wp--preset--color--accent-soft: color-mix(in srgb, var(--wp--preset--color--accent) 22%, #1b1a18);
		--wp--preset--shadow--soft: 0 1px 2px rgb(0 0 0 / .45);
		--wp--preset--shadow--pop: 0 16px 48px rgb(0 0 0 / .55);
		--wp--preset--gradient--accent-glow: radial-gradient(70% 80% at 50% 0%, color-mix(in srgb, var(--wp--preset--color--accent) 22%, #121110) 0%, transparent 70%);
		color-scheme: dark;
	}
}

/* ---------- Base refinements ---------- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(a) { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:where(a:hover) { text-decoration-thickness: 2px; }
:where(.wp-site-blocks) :focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--wp--preset--color--accent-soft); color: var(--wp--preset--color--contrast); }
img { height: auto; }

/* ---------- Header ---------- */
.wmt-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
	background: color-mix(in srgb, var(--wp--preset--color--base) 86%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--line) 70%, transparent);
}
.wmt-brand-mark .wp-block-site-logo img, .wmt-header .wp-block-site-logo img { border-radius: 10px; }
.wmt-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.wmt-header .wp-block-navigation-item__content { padding: 0.45em 0.8em; border-radius: var(--wp--custom--radius--pill); }
.wmt-header .wp-block-navigation-item__content:hover,
.wmt-header .current-menu-item > .wp-block-navigation-item__content { background: var(--wp--preset--color--surface-2); text-decoration: none; }
@media (max-width: 600px) {
	.wmt-header .wmt-header-cta { display: none; }
}

/* ---------- Cards and post grids ---------- */
.is-style-wmt-card, .wmt-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--soft);
}
.is-style-wmt-card { padding: var(--wp--preset--spacing--40); }
.is-style-wmt-tinted {
	background: var(--wp--preset--color--accent-soft);
	border-radius: var(--wp--custom--radius--lg);
	padding: var(--wp--preset--spacing--50);
}
.is-style-wmt-lift { transition: transform .2s var(--wp--custom--ease), box-shadow .2s; }
.is-style-wmt-lift:hover { transform: translateY(-3px); box-shadow: var(--wp--preset--shadow--pop); }

.wmt-post-card { height: 100%; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s var(--wp--custom--ease), box-shadow .2s; }
.wmt-post-card:hover { transform: translateY(-3px); box-shadow: var(--wp--preset--shadow--pop); }
.wmt-post-card .wp-block-post-featured-image { margin: 0; border-radius: 0; }
.wmt-post-card .wp-block-post-featured-image img { border-radius: 0; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.wmt-post-card .wmt-post-card-body { padding: var(--wp--preset--spacing--40); flex: 1; }
.wp-block-post-template.is-layout-grid > li { display: flex; }
.wp-block-post-template.is-layout-grid > li > * { flex: 1; }

/* ---------- Chips, eyebrows ---------- */
.is-style-wmt-eyebrow {
	display: block;
	width: fit-content;
	padding: 0.3em 0.85em;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--accent-2);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 650;
	letter-spacing: 0.02em;
}
.is-style-wmt-eyebrow.has-text-align-center { margin-left: auto !important; margin-right: auto !important; }

/* Quiet meta links: author names, comment authors and dates read as text, not calls to action. */
.wp-block-post-author-name a, .wp-block-comment-author-name a, .wp-block-comment-date a, .wp-block-post-date a {
	color: inherit;
	text-decoration: none;
}
.wp-block-post-author-name a:hover, .wp-block-comment-author-name a:hover, .wp-block-comment-date a:hover { text-decoration: underline; }
.wp-block-comment-reply-link a { font-weight: 600; text-decoration: none; }
.wp-block-comments .wp-block-avatar { flex: none; }

.wp-block-post-terms a, .wp-block-tag-cloud a {
	display: inline-block;
	padding: 0.2em 0.75em;
	margin: 0 0.15em 0.35em 0;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface-2);
	color: var(--wp--preset--color--contrast-2);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small) !important;
}
.wp-block-post-terms a:hover { background: var(--wp--preset--color--accent-soft); color: var(--wp--preset--color--accent-2); }
.wp-block-post-terms__separator { display: none; }

/* ---------- Buttons ---------- */
.wp-block-button__link { transition: background-color .15s, transform .12s var(--wp--custom--ease), box-shadow .15s; }
.wp-block-button__link:active { transform: scale(.97); }
.wp-block-button:not(.is-style-outline) .wp-block-button__link { box-shadow: 0 2px 10px color-mix(in srgb, var(--wp--preset--color--accent) 30%, transparent); }
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: none;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--surface-2); }
.wp-block-button.is-style-wmt-light .wp-block-button__link { background: #fff; color: #1d1b19; }

/* ---------- Forms ---------- */
.wp-block-search__input, .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]), .wp-block-post-comments-form textarea {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--md);
	padding: 0.7em 1em;
	font: inherit;
}
.wp-block-search__inside-wrapper { border: 0 !important; padding: 0 !important; gap: 8px; }
.wp-block-search__input { border-radius: var(--wp--custom--radius--pill) !important; padding-left: 1.2em !important; }
.wp-block-search__button { border-radius: var(--wp--custom--radius--pill) !important; margin-left: 0 !important; }
.wp-block-post-comments-form input[type=submit] {
	background: var(--wp--preset--color--accent); color: var(--wp--preset--color--on-accent);
	border: 0; border-radius: var(--wp--custom--radius--pill); padding: 0.7em 1.4em; font-weight: 650; cursor: pointer;
}

/* ---------- Details (FAQ) ---------- */
.wp-block-details summary { font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; font-size: 1.4em; line-height: 1; color: var(--wp--preset--color--accent); transition: transform .2s; }
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details[open] summary { margin-bottom: 0.6rem; }

/* ---------- Pricing ---------- */
.wmt-price { font-family: var(--wp--preset--font-family--rounded); font-weight: 800; letter-spacing: -0.03em; }
.wmt-plan-featured { border: 2px solid var(--wp--preset--color--accent) !important; position: relative; }
.wmt-checklist { list-style: none; padding-left: 0; }
.wmt-checklist li { padding-left: 1.6em; position: relative; margin-bottom: 0.5em; }
.wmt-checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--wp--preset--color--accent); font-weight: 800; }

/* ---------- Hero ---------- */
.wmt-hero .wp-block-cover__inner-container { max-width: 860px; }
.wmt-hero h1 { text-wrap: balance; }
.wmt-hero p { text-wrap: pretty; }

/* ---------- Groupy.Pro on app pages ---------- */
/* The theme header already shows the site name, so the app's own brand row is hidden here. */
.wmt-app-main .gp-brand { display: none; }
.wmt-app-main .groupy { border-radius: 0; }
.wmt-app-main .groupy-block, .wmt-app-main > .wp-block-post-content > .groupy-block { margin-top: 0; }

/* ---------- Footer ---------- */
.wmt-footer { border-top: 1px solid var(--wp--preset--color--line); }
.wmt-footer a { color: var(--wp--preset--color--contrast-2); text-decoration: none; }
.wmt-footer a:hover { color: var(--wp--preset--color--contrast); text-decoration: underline; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
