/*
Theme Name: Simon Says Game
Description: A WordPress block theme built with Shader and VX Framework, with block templates and theme.json.
Author: Shader
Author URI: https://vxframework.com
Text Domain: simon-says-game
Version: 0.1.0
Requires at least: 7.1
Requires PHP: 8.1
Update URI: false
*/

/*
 * Plumbing only. The look lives in theme.json; this file holds what theme.json
 * can't express. It loads on the site and in the editor, so its rules must hold
 * in both.
 */

/* Room for a scrollbar on every page, so a short page and a long one line up
   where scrollbars take space, as on Windows, instead of the layout jumping
   sideways between them. */
html {
	scrollbar-gutter: stable;
}

/* WordPress puts a block gap between the template's top-level blocks: the
   header part, main and the footer part. Sections own their spacing instead.
   The editor's canvas root is .wp-site-blocks too while it shows a template,
   but there WordPress prints that gap after this file, so :root makes this win. */
:root .wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main keeps its distance from the header and footer. A
   template whose main starts or ends with a full-bleed section adds the
   is-flush class to main. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--50);
}

.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* Keyboard focus stays visible on every control, and only there: in the
   editor, the text being typed in has focus too. */
:where(a, button, input, select, textarea, summary, [tabindex]:not([contenteditable])):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Simon Says Game ---------- */

/* The header sits on a chunky ink rule, like the edge of a game board. */
.site-header {
	border-bottom: var(--wp--custom--border--width) solid var(--wp--preset--color--ink);
}
/*
 * The header stays on screen while the page scrolls, so the site's address is always in view: a class watching a
 * projector never sees the browser's address bar. Below the admin bar when signed in (on phones WordPress lets the
 * admin bar scroll away), and not on short landscape screens, where it would take too much of the page.
 */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 40;
}
@media (max-width: 600px) {
	.wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}
@media (max-height: 500px) {
	.wp-site-blocks > header.wp-block-template-part {
		position: static;
	}
}
/* A link to a section (/play/#recipes) lands below the header, not under it. */
html {
	scroll-padding-top: calc(var(--wp-admin--admin-bar--height, 0px) + 6rem);
}

/*
 * The wordmark: the site's address, "SimonSaysGame.com", in place of a site name, big enough to read from the back
 * of a room. The words alternate ink and tangerine so they read apart without spaces; the tangerine is deepened a
 * little to keep its contrast on paper.
 */
.site-wordmark {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.25rem, 0.75rem + 1.6vw, 2rem);
	font-weight: 800;
	letter-spacing: -0.015em;
	line-height: 1;
	white-space: nowrap;
}
.site-wordmark a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.site-wordmark__says {
	color: color-mix(in srgb, var(--wp--preset--color--tangerine) 85%, var(--wp--preset--color--ink));
}
.site-wordmark__tld {
	color: var(--wp--preset--color--slate);
	font-weight: 700;
}
.site-header .site-mark {
	width: clamp(2.1rem, 1.5rem + 1.1vw, 2.75rem);
	height: auto;
	flex-shrink: 0;
}
.header-play .wp-element-button {
	white-space: nowrap;
}
/*
 * Log in, or My account once signed in: a quiet text link set apart from the menu, so Play online stays the one
 * thing that stands out. On a phone just the person icon.
 */
.header-account {
	margin: 0;
	white-space: nowrap;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}
.header-account a {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 44px;
	color: var(--wp--preset--color--slate);
	text-decoration: none;
}
.header-account a:hover,
.header-account a:focus-visible {
	color: var(--wp--preset--color--ink);
}
.header-account a:hover .header-account__text,
.header-account a:focus-visible .header-account__text {
	text-decoration: underline;
}
@media (min-width: 601px) {
	.site-header .header-account {
		padding-inline-start: var(--wp--preset--spacing--40);
		border-inline-start: 2px solid color-mix(in srgb, var(--wp--preset--color--ink) 15%, transparent);
	}
}
.header-account__icon {
	display: none;
}
@media (max-width: 600px) {
	.header-account__icon {
		display: inline-grid;
		place-items: center;
		width: 36px;
		height: 36px;
		border: 2px solid var(--wp--preset--color--ink);
		border-radius: 50%;
		font-size: 1rem;
	}
	.header-account a {
		justify-content: center;
		min-width: 44px;
	}
	.header-account__text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}
@media (max-width: 480px) {
	.site-header .site-wordmark {
		font-size: min(1.125rem, 4.5vw);
	}
	/* The menu button and "Play online" sit closer, so the site name stays on one line on a phone. */
	.site-header .alignwide > .wp-block-group:last-child {
		gap: 0.75rem;
	}
	.header-play .wp-element-button {
		padding: 0.45rem 0.85rem;
	}
	/* No room for it beside the site name: Log in and My account are in the footer, and on every lock. */
	.site-header .header-account {
		display: none;
	}
}
@media (max-width: 600px) {
	/* The address is the mark on phones: the speech bubble gives its room to the wordmark. */
	.site-header .site-mark {
		display: none;
	}
}
@media (max-width: 400px) {
	.site-header .alignwide > .wp-block-group:last-child {
		gap: 0.5rem;
	}
	.header-play .wp-element-button {
		padding-inline: 0.7rem;
	}
}

/* The series chips over the deck gallery: each term a pill. */
.term-chips .wp-block-term-template {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0;
	margin: var(--wp--preset--spacing--40) 0 0;
	list-style: none;
}
/* The flow layout spaces stacked blocks with a top margin; in a row of chips the gap does that. */
.term-chips .wp-block-term-template > *,
.term-chips .wp-block-term-name {
	margin: 0;
}
.term-chips .wp-block-term-name a {
	display: inline-block;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--chip);
	padding: 0.3rem 0.9rem;
	background: var(--wp--preset--color--white);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}
.term-chips .wp-block-term-name a:hover,
.term-chips .wp-block-term-name a:focus-visible {
	background: var(--wp--preset--color--sun);
}

/* Buttons pick up like cards and press down on click. One rule, on the element (visual.md, Buttons). */
.wp-element-button {
	transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}
.wp-element-button:hover,
.wp-element-button:focus-visible {
	transform: translate(-2px, -2px);
	box-shadow: 6px 6px 0 var(--wp--preset--color--ink);
}
.wp-element-button:active {
	transform: translate(2px, 2px);
	box-shadow: 0 0 0 var(--wp--preset--color--ink);
}

/* The buttons inside the custom blocks (player, game builder, command finder): the same chunky pill. */
.ssg-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.55rem 1.2rem;
	border: var(--wp--custom--border--width) solid var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--chip);
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-weight: 700;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ssg-btn:hover:not(:disabled),
.ssg-btn:focus-visible {
	transform: translate(-2px, -2px);
	box-shadow: 4px 4px 0 var(--wp--preset--color--ink);
}
.ssg-btn:active:not(:disabled) {
	transform: translate(1px, 1px);
	box-shadow: none;
}
.ssg-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
.ssg-btn.is-primary {
	min-width: 8.5rem;
	background: var(--wp--preset--color--sun);
	font-size: var(--wp--preset--font-size--medium);
}

.ssg-btn.is-small {
	min-height: 36px;
	padding: 0.35rem 0.9rem;
	font-size: var(--wp--preset--font-size--small);
}

/*
 * A tier's badge beside anything that comes with a plan: "🔵 Free account" on sky, "⭐ Plus" on grape. Every visitor
 * sees it, so members still know what's Plus. Where the visitor's plan doesn't include it, it adds a 🔒, gets an ink
 * outline, and links to where it opens (inc/access.php, ssg_tier_badge()). Pages and cards use the same colours.
 */
:root {
	--ssg-tier-account: color-mix(in srgb, var(--wp--preset--color--sky) 32%, var(--wp--preset--color--white));
	--ssg-tier-plus: color-mix(in srgb, var(--wp--preset--color--grape) 32%, var(--wp--preset--color--white));
}
.ssg-tier {
	display: inline-block;
	margin-inline-start: 0.4rem;
	padding: 0 0.45rem;
	border: 2px solid transparent;
	border-radius: var(--wp--custom--radius--chip);
	background: var(--wp--preset--color--shell);
	color: var(--wp--preset--color--ink);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
	vertical-align: 0.1em;
}
.ssg-tier.is-account {
	background: var(--ssg-tier-account);
}
.ssg-tier.is-plus {
	background: var(--ssg-tier-plus);
}
/* In the visitor's plan, the badge is just the mark: a small round chip. */
.ssg-tier.is-mark {
	padding: 0 0.25rem;
	min-width: 1.5rem;
	text-align: center;
}
/* On a deck, recipe, ruleset or twist page, over its title (the tier-badge block): a sticker. */
.tier-badge {
	margin: 0;
}
.ssg-tier.is-large {
	margin: 0;
	padding: 0.3rem 0.85rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 10px;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	transform: rotate(-2.5deg);
	box-shadow: 3px 3px 0 var(--wp--preset--color--ink);
}
.ssg-tier.is-large.is-mark {
	padding: 0.3rem 0.6rem;
	font-size: var(--wp--preset--font-size--base);
}

/*
 * Tooltips: an ⓘ beside a setting, or a tier's mark, that shows a short description on hover, on tap
 * (assets/js/theme.js) and while its field has keyboard focus. Screen readers get the same words as the control's
 * description (aria-describedby), so the bubble itself is hidden from them.
 */
.ssg-tip {
	position: relative;
	cursor: help;
}
.ssg-tip.is-help {
	display: inline-grid;
	place-items: center;
	width: 0.8rem;
	height: 0.8rem;
	margin-inline-start: 0.25rem;
	border: 1px solid currentColor;
	border-radius: 50%;
	color: var(--wp--preset--color--slate);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.55rem;
	font-style: normal;
	font-weight: 800;
	line-height: 1;
	vertical-align: 0.15em;
	opacity: 0.75;
}
.ssg-tip.is-help:hover,
.ssg-tip.is-help.is-open,
:is(.ssg-field, label):has(:focus-visible) .ssg-tip.is-help,
fieldset:has(:focus-visible) > legend .ssg-tip.is-help {
	opacity: 1;
}
/* Drawn here, with no alternative text, so the "i" never joins the field's name for screen readers. */
.ssg-tip.is-help::before {
	content: "i" / "";
}
/* A larger, invisible area around the small ⓘ, so it's still easy to tap. */
.ssg-tip.is-help::after {
	content: "";
	position: absolute;
	inset: -0.5rem;
}
.ssg-tip__text {
	display: none;
	position: absolute;
	z-index: 30;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	box-sizing: border-box;
	width: max-content;
	max-width: min(18rem, calc(100vw - 2rem));
	padding: 0.55rem 0.75rem;
	border-radius: 10px;
	background: var(--wp--preset--color--ink);
	box-shadow: 3px 3px 0 var(--wp--preset--color--sun);
	color: var(--wp--preset--color--paper);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	font-weight: 400;
	letter-spacing: normal;
	line-height: 1.4;
	text-align: start;
	text-transform: none;
	white-space: normal;
	pointer-events: none;
}
.ssg-tip:hover > .ssg-tip__text,
.ssg-tip.is-open > .ssg-tip__text,
:is(.ssg-field, label):has(:focus-visible) .ssg-tip.is-help > .ssg-tip__text,
fieldset:has(:focus-visible) > legend .ssg-tip.is-help > .ssg-tip__text {
	display: block;
}
a.ssg-tier {
	border-color: var(--wp--preset--color--ink);
	text-decoration: none;
}
a.ssg-tier:hover,
a.ssg-tier:focus-visible {
	background: var(--wp--preset--color--sun);
	text-decoration: underline;
}
/* The sentence that says what a plan opens, as a link to the Plans page. */
.ssg-plans-link,
.ssg-player__plans,
.ssg-builder__plans {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}
.ssg-field :disabled,
.ssg-player__cues input:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.ssg-player__cues label:has(input:disabled) {
	cursor: not-allowed;
	border-style: dashed;
}

/* A labelled field inside the custom blocks: the label small and bold over a chunky outlined control. */
.ssg-field {
	display: grid;
	gap: 0.35rem;
	min-width: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}
.ssg-field select,
.ssg-field input,
.ssg-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	padding: 0.55rem 0.8rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 12px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: var(--wp--preset--font-size--base);
	font-weight: 400;
}
/* Text boxes and dropdowns the same height, whatever the browser gives each by default. */
.ssg-field select,
.ssg-field input {
	height: 3rem;
}
.ssg-field textarea {
	resize: vertical;
}

/* The footer is an ink band; its links stay paper. */
.site-footer a {
	color: inherit;
}

/* Long reading text on articles and rules. */
.article-body {
	font-size: var(--wp--preset--font-size--medium);
}
.article-body > * + h2,
.article-body > * + h3 {
	margin-block-start: var(--wp--preset--spacing--60);
}

/* A numbered list of commands in a deck: each row counts itself. */
.command-list {
	counter-reset: ssg-command;
}
.command-list > .wp-block-group {
	counter-increment: ssg-command;
}
.command-list > .wp-block-group::before {
	content: counter(ssg-command);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	min-width: 2ch;
	color: var(--wp--preset--color--slate);
}

/* The numbered steps of a ruleset or twist: each row a sun-yellow number beside its step. */
.step-list {
	counter-reset: ssg-step;
	display: grid;
	gap: var(--wp--preset--spacing--40);
}
.step-list > .wp-block-group {
	counter-increment: ssg-step;
	display: grid;
	grid-template-columns: 2.6rem minmax(0, 1fr);
	gap: var(--wp--preset--spacing--30);
	align-items: start;
	margin: 0;
}
.step-list > .wp-block-group::before {
	content: counter(ssg-step);
	display: grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 50%;
	background: var(--wp--preset--color--sun);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
}
.step-list > .wp-block-group > * {
	margin: 0;
}

/* Tips: a light-bulb beside each one. */
.tip-list {
	display: grid;
	gap: var(--wp--preset--spacing--30);
}
.tip-list > .wp-block-group {
	display: grid;
	grid-template-columns: 1.8rem minmax(0, 1fr);
	gap: var(--wp--preset--spacing--20);
	margin: 0;
}
.tip-list > .wp-block-group::before {
	content: "💡";
}
.tip-list > .wp-block-group > * {
	margin: 0;
}

/*
 * The home hero's heading ("Simon says… let's play!") in two even lines. Beside the card fan its size follows the
 * column's width, so "Simon says…" always fits on the first line; stacked on phones it keeps the Display size.
 */
.hero-title {
	text-wrap: balance;
}
@media (min-width: 782px) {
	.hero-title.has-display-font-size {
		font-size: min(6.5rem, 6.8vw) !important; /* the Display preset is !important */
	}
}

/* A blog post's picture, rounded like a card. */
.is-card-image img {
	border: var(--wp--custom--border--width) solid var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--card);
}

/* Printing a deck or the rules: ink on white, no chrome. */
@media print {
	.site-header,
	.site-footer,
	.wp-block-buttons,
	.no-print {
		display: none !important;
	}
	body {
		background: #fff;
	}
	.wp-block-group.is-style-card {
		box-shadow: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-element-button,
	.wp-element-button:hover,
	.wp-element-button:focus-visible,
	.wp-element-button:active,
	.ssg-btn,
	.ssg-btn:hover,
	.ssg-btn:focus-visible,
	.ssg-btn:active {
		transition: none;
		transform: none;
	}
}

/*
 * The footer's bottom row: the disclaimer, then the Green Cha Digital credit at the end of the row. On a phone the
 * credit wraps onto its own line under the disclaimer, aligned left like it.
 */
.site-footer__bottom > :first-child {
	flex: 1 1 28rem;
	margin: 0;
}
/* Beside the columns, the disclaimer is as wide as the blurb's column above it, so the two line up. */
@media (min-width: 782px) {
	.site-footer__bottom > :first-child {
		flex: 0 1 38%;
	}
}
.site-footer__credit {
	margin: 0;
}
/* The size of the footer's small print, which is larger than the credit's 12px. */
.site-footer__credit .gcd-credit {
	font-size: inherit;
}

/* Green Cha Digital footer credit, v1.2 */

/* Base: every variant needs these */
.gcd-credit{display:inline-flex;align-items:center;flex-wrap:wrap;gap:.2em .5em;font-size:12px;line-height:1.3;color:inherit;text-decoration:none;--gcd-green:#2d7a2d;--gcd-leaf:#339933}
.gcd-credit.gcd-on-dark{--gcd-green:#86d286;--gcd-leaf:#86d286}
.gcd-credit .gcd-by{opacity:.7}
.gcd-credit b{font-weight:600}
.gcd-credit i{font-style:normal}
.gcd-credit svg{width:1.3em;height:1.3em;fill:currentColor;flex:none}
.gcd-credit .gcd-name{display:inline-flex;align-items:center;gap:.35em}
.gcd-credit:hover b{text-decoration:underline;text-underline-offset:3px}
.gcd-credit:focus-visible{outline:2px solid currentColor;outline-offset:4px}
@media (prefers-reduced-motion:reduce){.gcd-credit,.gcd-credit *,.gcd-credit::before{transition:none!important}}

/* L5: green on hover and keyboard focus */
.gcd-wake svg{transition:fill .25s}
.gcd-wake i{transition:color .25s}
.gcd-wake:hover svg,.gcd-wake:focus-visible svg{fill:var(--gcd-leaf)}
.gcd-wake:hover i,.gcd-wake:focus-visible i{color:var(--gcd-green)}

/* Method B: the stylesheet draws the leaf. Add gcd-css-leaf and leave the <svg> out of the HTML */
.gcd-css-leaf{--gcd-leaf-shape:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 496'%3E%3Cpath d='M338 496C338 496 479 476 498 330C518 184 362 0 362 0C362 0 287 136 270 220C252 305 251 328 251 328C251 328 130 263 0 302C0 302 60 388 118 447C176 506 297 492 297 492C297 492 185 392 107 360C107 360 242 398 324 495C324 495 334 285 357 141C357 141 371 256 357 366C342 476 339 491 338 496Z'/%3E%3C/svg%3E")}
.gcd-css-leaf::before{content:"";width:1.3em;height:1.3em;flex:none;background:currentColor;-webkit-mask:var(--gcd-leaf-shape) center/contain no-repeat;mask:var(--gcd-leaf-shape) center/contain no-repeat}
.gcd-css-leaf.gcd-green-leaf::before{background:var(--gcd-leaf)}
.gcd-css-leaf.gcd-wake::before{transition:background .25s}
.gcd-css-leaf.gcd-wake:hover::before,.gcd-css-leaf.gcd-wake:focus-visible::before{background:var(--gcd-leaf)}
