/*
Theme Name: Studio Toolbox
Description: Child theme for the Studio Toolbox marketing site (studiotoolbox.com). All site design lives here under version control — see docs/website/design-system.md for the rules it implements.
Template: generatepress
Version: 0.2.4
Requires PHP: 8.1
*/

/* ==========================================================================
   Base — enforces design-system.md defaults over GeneratePress customizer CSS.
   All values come from theme.json tokens (--wp--preset--*, --wp--custom--*).
   ========================================================================== */

body {
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--wp--preset--font-family--inter);
	font-weight: 700;
	line-height: 1.2;
	color: var(--wp--preset--color--ink);
}

a {
	color: var(--wp--preset--color--primary);
}

/* Reading width: design-system.md caps body copy at ~70ch */
.entry-content p {
	max-width: 70ch;
}

/* ==========================================================================
   Buttons — primary is filled indigo pill; secondary is white/border/indigo;
   ghost is text-only (design-system.md "Buttons")
   ========================================================================== */

.wp-block-button__link,
.ms-btn {
	border-radius: var(--wp--custom--radius--pill);
	font-weight: 600;
	padding: 12px 28px;
	text-decoration: none;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.ms-btn-secondary .wp-block-button__link {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
	border: 1px solid var(--wp--preset--color--border-strong);
}

.ms-btn-ghost .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   Cards (design-system.md "Cards")
   ========================================================================== */

.ms-card {
	background-color: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--custom--shadow--card);
	padding: var(--wp--preset--spacing--40);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ms-card:hover {
	box-shadow: var(--wp--custom--shadow--card-hover);
}

.ms-card h3 {
	margin-top: 0;
}

/* ==========================================================================
   Sections
   ========================================================================== */

/* GP compensates alignfull blocks for container padding (-40px margins).
   On full-width pattern pages that padding doesn't exist, so the compensation
   drags sections past the viewport edge and clips content. Neutralize it and
   let sections carry their own gutters. */
.full-width-content .entry-content .alignfull {
	margin-left: 0;
	margin-right: 0;
	width: 100%;
	max-width: 100%;
}

/* Design-system rule: never any horizontal scrolling. */
body {
	overflow-x: clip;
}

/* Standard container for non-full-width pages (WooCommerce account, cart,
   checkout, blog): cap the width and keep a consistent gutter so content and
   cards never sit flush to the viewport edge. Full-width pattern pages opt out
   via the .full-width-content body class and manage their own section widths. */
body:not(.full-width-content) .site-main {
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--wp--preset--spacing--40);
	padding-right: var(--wp--preset--spacing--40);
}

.ms-section {
	padding-top: var(--wp--preset--spacing--70);
	padding-bottom: var(--wp--preset--spacing--70);
	padding-left: var(--wp--preset--spacing--30);
	padding-right: var(--wp--preset--spacing--30);
}

.ms-section-dark {
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--surface);
}

.ms-section-dark h1,
.ms-section-dark h2,
.ms-section-dark h3 {
	color: var(--wp--preset--color--surface);
}

.ms-eyebrow {
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: var(--wp--preset--font-size--small);
}

.ms-muted {
	color: var(--wp--preset--color--text-secondary);
}

/* Placeholder frame for product screenshots until real assets exist
   (docs/assets/screenshots is empty; see design-system.md "Product Screenshots") */
.ms-screenshot-placeholder {
	background: linear-gradient(160deg, #EEF2FF 0%, #F8FAFC 100%);
	border: 1px dashed var(--wp--preset--color--border-strong);
	border-radius: var(--wp--custom--radius--large);
	color: var(--wp--preset--color--text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 360px;
	text-align: center;
}

/* Screenshot slot size modifiers (were inline styles; moved to classes so the
   blocks stay valid in the editor). */
.ms-shot-hero {
	margin-top: var(--wp--preset--spacing--60);
}

.ms-shot-half {
	min-height: 280px;
}

/* ==========================================================================
   Header / navigation
   ========================================================================== */

/* Single-row header: logo + menu + search on one line inside the nav bar.
   The stock GeneratePress header (separate logo area) is hidden — the logo is
   injected into the navigation via generate_inside_navigation. */
.site-header {
	display: none;
}

.main-navigation {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.main-navigation .inside-navigation {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 72px;
	/* Standard page gutter — content/logo never sits flush to the edge. */
	padding-left: var(--wp--preset--spacing--40);
	padding-right: var(--wp--preset--spacing--40);
}

/* Logo pinned left; menu, CTA, and search pushed to the right. The logo must
   never shrink — otherwise a wide menu squeezes it until the icon wraps above
   the text. flex-shrink:0 keeps it full-size and lets the menu flex instead. */
.ms-nav-branding {
	margin-right: auto;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.ms-nav-branding .ms-logo {
	display: inline-flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 9px;
	white-space: nowrap;
}

.ms-nav-branding .ms-logo svg {
	width: 29px;
	flex-shrink: 0;
}

.ms-nav-branding .ms-logo-text {
	font-size: 1.3rem;
}

/* Brand lockup — icon mark + two-tone text wordmark ("Studio" ink, "Toolbox"
   primary indigo; owner-decided 2026-07-21, spec: design-system.md Wordmark) */
.ms-logo {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
}

.ms-logo svg {
	width: 40px;
	height: auto;
	display: block;
}

.ms-logo-text {
	color: var(--wp--preset--color--ink);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

/* Logo uses the design-token palette (#4F46E5), so the "Toolbox" wordmark half
   just follows the token — one indigo across logo, wordmark, buttons, links. */
.ms-logo-tld {
	color: var(--wp--preset--color--primary);
}

.main-navigation .nav-cta > a {
	background-color: var(--wp--preset--color--primary);
	color: #ffffff !important;
	border-radius: var(--wp--custom--radius--pill);
	padding-left: 22px !important;
	padding-right: 22px !important;
	line-height: 1.2 !important;
	padding-top: 6px !important;
	padding-bottom: 6px !important;

	margin-left: 8px;
}

.main-navigation .nav-cta > a:hover {
	background-color: #4338CA;
}

/* Desktop menu as a single centered flex row. GeneratePress floats the menu
   items, which top-aligns them (so the shorter CTA pill isn't vertically
   centered) and lets them wrap onto a second line (dropping the logo off the
   row). Flex + align-items:center centers every item regardless of its height
   and keeps logo, menu, and search on one line. Scoped to desktop so the
   mobile slide-out menu (< 769px) is untouched. */
@media (min-width: 769px) {
	.main-navigation .inside-navigation {
		flex-wrap: nowrap;
	}
	.main-navigation .main-nav > ul {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
	}
	.main-navigation .main-nav > ul > li {
		float: none;
	}
}

/* Hide the page title on the front page — the hero pattern is the H1 */
.home .entry-header {
	display: none;
}

/* ==========================================================================
   Workflow flow — the signature diagram element (design-system.md
   "Workflow Diagrams"), CSS-only vertical version
   ========================================================================== */

.ms-flow {
	list-style: none;
	counter-reset: ms-step;
	max-width: 520px;
	margin: 48px auto 0;
	padding: 0;
}

.ms-flow li {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--custom--shadow--card);
	counter-increment: ms-step;
	font-weight: 600;
	padding: 16px 24px 16px 64px;
	position: relative;
}

.ms-flow li::before {
	content: counter(ms-step);
	background: var(--wp--preset--color--primary);
	border-radius: var(--wp--custom--radius--pill);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: var(--wp--preset--font-size--small);
	width: 28px;
	height: 28px;
	position: absolute;
	left: 20px;
	top: calc(50% - 14px);
}

.ms-flow li + li {
	margin-top: 40px;
}

.ms-flow li + li::after {
	content: "↓";
	color: var(--wp--preset--color--primary);
	font-size: 20px;
	position: absolute;
	top: -34px;
	left: 50%;
	transform: translateX(-50%);
}

/* Checklist (integrations etc.) */
.ms-checklist {
	list-style: none;
	margin: 32px auto 0;
	padding: 0;
	max-width: 560px;
}

.ms-checklist li {
	padding: 8px 0 8px 32px;
	position: relative;
}

.ms-checklist li::before {
	content: "✓";
	color: var(--wp--preset--color--success);
	font-weight: 700;
	position: absolute;
	left: 0;
}

/* FAQ (details/summary) */
details.ms-faq {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--small);
	margin-bottom: 16px;
	padding: 16px 24px;
}

details.ms-faq summary {
	cursor: pointer;
	font-weight: 600;
}

details.ms-faq p {
	margin: 12px 0 0;
	color: var(--wp--preset--color--text-secondary);
}

/* Demo signup dialog (TEC-style) + forms */
.msdemo-launch {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.msdemo-inline-sent {
	color: var(--wp--preset--color--success);
	font-weight: 600;
	margin: 0;
}

.msdemo-dialog {
	border: 0;
	border-radius: var(--wp--custom--radius--large);
	box-shadow: 0 24px 64px rgba(17, 24, 39, 0.3);
	padding: 40px;
	max-width: 460px;
	width: calc(100% - 32px);
}

.msdemo-dialog::backdrop {
	background: rgba(17, 24, 39, 0.55);
}

.msdemo-dialog h3 {
	margin: 0 0 8px;
	text-align: center;
}

.msdemo-dialog .msdemo-sub {
	text-align: center;
	color: var(--wp--preset--color--text-secondary);
	margin-top: 0;
}

.msdemo-dialog-close {
	position: absolute;
	top: 12px;
	right: 12px;
	margin: 0;
}

.msdemo-dialog-close button {
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	width: 32px;
	height: 32px;
}

.msdemo-form .msdemo-hp {
	position: absolute;
	left: -9999px;
}

.msdemo-form .msdemo-row {
	display: flex;
	gap: 16px;
}

.msdemo-form .msdemo-row p {
	flex: 1;
}

.msdemo-form label {
	font-weight: 600;
}

.msdemo-form .msdemo-hint {
	display: block;
	font-weight: 400;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-secondary);
}

.msdemo-form .msdemo-req {
	color: var(--wp--preset--color--error);
}

.msdemo-form input[type="text"],
.msdemo-form input[type="email"] {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--wp--preset--color--border-strong);
	border-radius: var(--wp--custom--radius--small);
	font-size: 16px;
	background: var(--wp--preset--color--background);
}

.msdemo-form .msdemo-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 0;
}

.msdemo-form .msdemo-skip {
	font-size: var(--wp--preset--font-size--small);
}

/* Pricing cards */
.ms-price {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
	margin: 8px 0 16px;
}

.ms-price span {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
}

.ms-card-featured {
	border: 2px solid var(--wp--preset--color--primary);
}

/* Account dashboard quick-links */
.ms-account-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin-top: 24px;
}

.ms-account-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	padding: 20px 24px;
}

.ms-account-card strong {
	font-size: var(--wp--preset--font-size--large);
}

/* Header account link — plain link set just before the demo CTA pill */
.main-navigation .ms-account-item > a {
	font-weight: 600;
}

/* My Account → Licenses */
.msls-license {
	margin-bottom: var(--wp--preset--spacing--30);
}

.msls-license h3 {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 0;
}

.msls-status {
	border-radius: var(--wp--custom--radius--pill);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	padding: 2px 12px;
}

.msls-status-active {
	background: #DCFCE7;
	color: var(--wp--preset--color--success);
}

.msls-status-expired,
.msls-status-disabled {
	background: #FEF3C7;
	color: #92400E;
}

.msls-key {
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--small);
	padding: 6px 12px;
	user-select: all;
}

.msls-meta,
.msls-local {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--small);
}

.msls-activations {
	width: 100%;
	margin-top: 8px;
}

.msls-activations th,
.msls-activations td {
	border: none;
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 8px 12px;
	text-align: left;
}

.msls-activations form {
	margin: 0;
}

/* Embedded demo sandbox (/demo/run/) */
.ms-demo-frame {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--large);
	box-shadow: var(--wp--custom--shadow--card);
	margin-top: var(--wp--preset--spacing--40);
	overflow: hidden;
}

.ms-demo-frame-bar {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
	padding: 10px 20px;
	border-bottom: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-secondary);
}

.ms-demo-frame iframe {
	display: block;
	width: 100%;
	height: 78vh;
	border: 0;
	background: #fff;
}

/* Split-view demo (staff scheduling): manager + staff panes side by side.
   Two panes need real width — below 1280px they stack. The middle track is
   the drag divider; the pane fractions come from custom properties the drag
   JS sets (never inline grid-template-columns, so the stacking media query
   below always wins). minmax floors keep either pane from being dragged
   into uselessness. */
.ms-demo-split {
	display: grid;
	grid-template-columns: minmax(400px, var(--msdemo-left, 1fr)) 14px minmax(400px, var(--msdemo-right, 1fr));
	gap: 5px;
	margin-top: var(--wp--preset--spacing--40);
}

.msdemo-divider {
	cursor: col-resize;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: none;
	border-radius: 7px;
}

.msdemo-divider::before {
	content: "";
	width: 4px;
	height: 48px;
	border-radius: 2px;
	background: var(--wp--preset--color--border);
}

.msdemo-divider:hover::before,
.msdemo-divider:focus-visible::before,
.ms-demo-split.msdemo-dragging .msdemo-divider::before {
	background: var(--wp--preset--color--primary);
}

/* Mid-drag: iframes must not swallow the pointer; no accidental selection. */
.ms-demo-split.msdemo-dragging {
	user-select: none;
}

.ms-demo-split.msdemo-dragging iframe {
	pointer-events: none;
}

/* Full-width pane (the POS row in the suite demo): spans all columns, taller
   — a POS terminal is designed for a whole screen. */
.ms-demo-pane-full {
	grid-column: 1 / -1;
}

.ms-demo-pane-full iframe {
	height: 82vh;
}

/* Row toggle bars (multi-row demos): a full-width horizontal bar above each
   section; clicking hides/shows the whole row. Same full-bleed treatment as
   the split (see that rule's comment for the why). */
.msdemo-rowbar.msdemo-rowbar {
	display: block;
	max-width: none;
	width: 100vw;
	box-sizing: border-box;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	margin-top: 24px;
	padding: 12px 32px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-left: 0;
	border-right: 0;
	border-radius: 0;
	text-align: left;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--text-secondary);
	cursor: pointer;
}

.msdemo-rowbar.msdemo-rowbar:hover {
	color: var(--wp--preset--color--primary);
}

.msdemo-rowbar .msdemo-rowbar-chev {
	display: inline-block;
	width: 1.2em;
}

.msdemo-rowbar + .ms-demo-split {
	margin-top: 12px;
}

.msdemo-row-hidden {
	display: none !important;
}

/* Full-bleed: the panes take the whole window, not the content column.
   calc(50% - 50vw) pulls each edge from the centered container out to the
   viewport edge; the padding restores the site's 32px gutter. Doubled class
   + !important because the demo page renders the shortcode inside a
   constrained block group, whose core-emitted layout CSS caps children at
   the content width and sets auto side margins with !important. 100vw
   includes a classic scrollbar's width, so clip the possible ~15px sliver
   on pages that use this (macOS overlay scrollbars are unaffected). */
.ms-demo-split.ms-demo-split {
	max-width: none;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	padding-left: 32px;
	padding-right: 32px;
}

body:has(.ms-demo-split) {
	overflow-x: clip;
}

.ms-demo-split .ms-demo-frame {
	margin-top: 0;
	min-width: 0; /* let the grid actually shrink the panes */
}

.ms-demo-split iframe {
	height: 72vh;
}

.ms-demo-pane-actions {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	white-space: nowrap;
}

.ms-demo-frame-bar .msdemo-refresh {
	background: none;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 50%;
	width: 28px;
	height: 28px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	line-height: 1;
	color: inherit;
	cursor: pointer;
}

.ms-demo-frame-bar .msdemo-refresh:hover {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.ms-demo-frame-bar select {
	max-width: 160px;
}

.ms-demo-split-hint {
	margin-top: 12px;
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

/* Sandbox boot gate: shown while the demo studio's blueprint is still
   provisioning (frames sit blank behind it until the ready marker appears). */
.ms-demo-booting {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 16px;
	padding: 18px 24px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--large);
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--small);
}

.ms-demo-booting p {
	margin: 0;
}

.ms-demo-booting-spin {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	border: 2px solid var(--wp--preset--color--border);
	border-top-color: var(--wp--preset--color--primary);
	border-radius: 50%;
	animation: ms-demo-spin 0.9s linear infinite;
}

@keyframes ms-demo-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 1279px) {
	.ms-demo-split {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.msdemo-divider {
		display: none;
	}

	.ms-demo-split iframe {
		height: 60vh;
	}
}

/* Real screenshots (once assets land) */
.ms-screenshot img {
	border-radius: var(--wp--custom--radius--large);
	box-shadow: var(--wp--custom--shadow--card);
}

/* Comparison table (PRD "Why Studio Toolbox") */
.ms-compare table {
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--custom--shadow--card);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	width: 100%;
}

.ms-compare th,
.ms-compare td {
	border: none;
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 14px 20px;
}

.ms-compare tr:last-child td {
	border-bottom: none;
}

.ms-compare .ms-check {
	color: var(--wp--preset--color--success);
	font-weight: 700;
}
