/**
 * PrettyCoolApp: the global stylesheet.
 *
 * Everything a page should get without writing any CSS of its own: the tokens,
 * the base type, page widths, titles, buttons and cards. It loads on every
 * front-end screen, ahead of style.css, which keeps what belongs to one part
 * of the app (the shell, the front page, the dashboard).
 *
 * Contents
 * 1. Tokens
 * 2. Base
 * 3. Page layout
 * 4. Titles and text
 * 5. Buttons, chips and badges
 * 6. Page blocks: sections, grids, cards, steps and calls to action
 * 7. Tablet and desktop
 * 8. Motion
 *
 * Mobile first: everything outside §7 is the phone layout.
 */

/* 1. Tokens
 * The PrettyCool palette and faces, with the marketing theme's 3px outlines
 * and big offset shadows turned down for a screen people work in all day.
 * ------------------------------------------------------------ */

:root {
	--pc-pink: #ff4d9d;
	--pc-pink-dark: #e62e82;
	--pc-pink-darker: #b91f65;
	--pc-pink-200: #ffc7e0;
	--pc-pink-100: #ffe0ee;
	--pc-pink-50: #fff2f8;
	--pc-sky: #6cd0ff;
	--pc-sky-dark: #39c0ff;
	--pc-sky-darker: #0088c8;
	--pc-sky-200: #a9e4ff;
	--pc-sky-100: #c8edff;
	--pc-sky-50: #e6f7ff;
	--pc-ink: #101014;
	--pc-ink-70: #4a4a52;
	--pc-ink-40: #8b8b94;
	--pc-ink-10: #e7e7ea;
	--pc-white: #ffffff;
	--pc-bg: #fffdfe;
	--pc-night: #05060f;

	--pc-line: 2px solid var(--pc-ink);
	--pc-line-thin: 2px solid var(--pc-ink);
	--pc-line-soft: 1px solid var(--pc-ink-10);
	--pc-shadow: 3px 3px 0 var(--pc-ink);
	--pc-shadow-sm: 2px 2px 0 var(--pc-ink);
	--pc-shadow-lg: 5px 5px 0 var(--pc-ink);
	--pc-shadow-sky: 3px 3px 0 var(--pc-sky);
	--pc-shadow-pink: 3px 3px 0 var(--pc-pink);

	/* Type steps. */
	--pc-step--1: 0.875rem;
	--pc-step-0: 1rem;
	--pc-step-1: 1.25rem;
	--pc-step-2: 1.5rem;
	--pc-space-2xs: 0.375rem;
	--pc-space-xs: 0.625rem;
	--pc-space-sm: 1rem;
	--pc-space-md: 1.5rem;
	--pc-space-lg: 2.5rem;
	--pc-space-xl: 4rem;
	--pc-space-2xl: 6rem;

	--pc-radius-sm: 10px;
	--pc-radius: 16px;
	--pc-radius-lg: 22px;
	--pc-radius-pill: 999px;

	--pc-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--pc-font-display: "Plus Jakarta Sans", var(--pc-font-body);

	--app-header-h: 56px;
	--app-tabbar-h: 64px;
	--app-gutter: 16px;
	--app-width: 66rem;

	--pc-ease-bounce: cubic-bezier(0.2, 1.6, 0.4, 1);
	--pc-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Base
 * ------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	background-color: var(--pc-bg);
	color: var(--pc-ink);
	font-family: var(--pc-font-body);
	font-size: 1rem;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
}

img,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: var(--pc-pink-dark);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--pc-ink);
}

:focus-visible {
	outline: 3px solid var(--pc-pink);
	outline-offset: 2px;
	border-radius: 4px;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.5em;
	font-family: var(--pc-font-display);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.05em;
	word-spacing: 0.1em;
}

p {
	margin: 0 0 1em;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 0.6rem 1rem;
	clip: auto;
	clip-path: none;
	background: var(--pc-white);
	border: var(--pc-line);
	border-radius: var(--pc-radius-sm);
	color: var(--pc-ink);
	font-weight: 700;
}

/* 3. Page layout
 * ------------------------------------------------------------ */

.app-main {
	flex: 1 0 auto;
	width: 100%;
	max-width: var(--app-width);
	margin: 0 auto;
	padding: 1.25rem var(--app-gutter) 2rem;
}

.app-main--doc {
	max-width: 46rem;
}

/* The Full Width template (templates/full-width.php): the header, the page
 * and the footer all run the width of the window. */
.app--full {
	--app-width: 100%;
}

/* 4. Titles and text
 * ------------------------------------------------------------ */

.app-page-head {
	margin-bottom: 1.25rem;
}

.app-page-head--split {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.75rem 1rem;
}

.app-page-title {
	margin: 0;
	font-size: 1.75rem;
}

.app-eyebrow {
	margin: 0 0 0.25rem;
	color: var(--pc-pink-dark);
	font-size: 0.875rem;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.app-summary {
	margin: -0.5rem 0 1rem;
	color: var(--pc-ink-70);
	font-size: 0.9375rem;
}

.app-section-title {
	margin: 2rem 0 0.75rem;
	font-size: 1.25rem;
}

.app-doc + .app-doc {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: var(--pc-line-soft);
}

.app-doc__title {
	font-size: 1.375rem;
}

.app-doc__title a {
	color: var(--pc-ink);
	text-decoration: none;
}

.app-doc__content {
	font-size: 1.0625rem;
	line-height: 1.7;
}

.app-doc__content > * + * {
	margin-top: 1em;
}

/* wpautop leaves empty paragraphs around blocks written as HTML. */
.app-doc__content p:empty {
	display: none;
}

.app-doc__content h2 {
	margin-top: 1.75em;
	font-size: 1.375rem;
}

.app-doc__content h3 {
	margin-top: 1.5em;
	font-size: 1.125rem;
}

.pc-lead {
	color: var(--pc-ink-70);
	font-size: var(--pc-step-1);
}

.pc-meta {
	color: var(--pc-ink-70);
	font-size: var(--pc-step--1);
}

.pc-eyebrow {
	display: inline-block;
	margin-bottom: var(--pc-space-sm);
	padding: 0.3em 0.9em;
	background: var(--pc-pink);
	border: var(--pc-line-thin);
	border-radius: var(--pc-radius-pill);
	color: var(--pc-white);
	font-size: var(--pc-step--1);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	rotate: -1.5deg;
}

.pc-eyebrow--sky {
	background: var(--pc-sky);
	color: var(--pc-ink);
	rotate: 1.5deg;
}

/* 5. Buttons, chips and badges
 * ------------------------------------------------------------ */

.app-button,
.pc-button,
.woocommerce .button,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-height: 44px;
	padding: 0.6rem 1.15rem;
	background: var(--pc-white);
	border: var(--pc-line);
	border-radius: var(--pc-radius-pill);
	box-shadow: var(--pc-shadow);
	color: var(--pc-ink);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s var(--pc-ease-bounce), box-shadow 0.15s var(--pc-ease-bounce), background-color 0.15s var(--pc-ease);
}

.app-button:hover,
.pc-button:hover,
.woocommerce .button:hover {
	background: var(--pc-sky-100);
	color: var(--pc-ink);
	transform: translate(-1px, -1px);
	box-shadow: 4px 4px 0 var(--pc-ink);
}

.app-button:active,
.pc-button:active,
.woocommerce .button:active {
	transform: translate(2px, 2px);
	box-shadow: 1px 1px 0 var(--pc-ink);
}

.app-button--primary,
.pc-button {
	background: var(--pc-pink);
	color: var(--pc-white);
}

.app-button--primary:hover,
.pc-button:hover {
	background: var(--pc-pink-dark);
	color: var(--pc-white);
}

.app-button--block {
	width: 100%;
}

.app-button--sm,
.pc-button--sm {
	min-height: 36px;
	padding: 0.35rem 0.9rem;
	font-size: 0.875rem;
	box-shadow: 2px 2px 0 var(--pc-ink);
}

.pc-button--lg {
	min-height: 52px;
	padding: 0.8rem 1.6rem;
	font-size: 1.0625rem;
}

.pc-button--ghost {
	background: var(--pc-white);
	color: var(--pc-ink);
}

.pc-button--ghost:hover {
	background: var(--pc-sky-100);
	color: var(--pc-ink);
}

.pc-button--sky {
	background: var(--pc-sky);
	color: var(--pc-ink);
}

.pc-button--sky:hover {
	background: var(--pc-sky-dark);
	color: var(--pc-ink);
}

.app-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 36px;
	padding: 0.35rem 0.8rem;
	background: var(--pc-white);
	border: var(--pc-line);
	border-radius: var(--pc-radius-pill);
	color: var(--pc-ink);
	font-size: 0.8125rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.app-chip:hover {
	background: var(--pc-sky-100);
	color: var(--pc-ink);
}

.app-chip .app-icon {
	color: var(--pc-ink-70);
}

.app-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.6rem;
	border: var(--pc-line);
	border-radius: var(--pc-radius-pill);
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1.3;
	white-space: nowrap;
}

.app-badge::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.app-badge--live { background: var(--pc-sky-100); color: var(--pc-ink); }
.app-badge--live::before { background: #16a34a; }
.app-badge--working { background: var(--pc-white); color: var(--pc-ink-70); }
.app-badge--working::before { background: var(--pc-sky-dark); animation: app-pulse 1.2s ease-in-out infinite; }
.app-badge--failed { background: var(--pc-pink-50); color: var(--pc-pink-darker); }

@keyframes app-pulse {
	50% { opacity: 0.3; }
}

/* 6. Page blocks
 * The pieces a page's HTML is made from, so it needs little or no CSS of its
 * own. The README lists them. A <style> block in a page's content comes later
 * in the document, so a page can still restyle any of these.
 * ------------------------------------------------------------ */

.pc-section {
	margin-top: var(--pc-space-2xl);
	scroll-margin-top: var(--pc-space-xl);
}

.pc-section--sm {
	margin-top: var(--pc-space-xl);
}

.pc-section > .pc-eyebrow {
	margin-bottom: var(--pc-space-xs);
}

.pc-section > h2 {
	margin-top: 0;
}

/* Out of the reading column, up to the width of the app. */
.alignwide {
	--pc-wide: min(var(--app-width), 100vw - 2 * var(--app-gutter));
	width: var(--pc-wide);
	max-width: none;
	margin-inline: calc((100% - var(--pc-wide)) / 2);
}

.pc-grid {
	display: grid;
	gap: var(--pc-space-md);
	grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
	margin-top: var(--pc-space-lg);
}

.pc-grid > * {
	min-width: 0;
}

.pc-card,
.pc-sticker {
	padding: var(--pc-space-md);
	background: var(--pc-white);
	border: var(--pc-line);
	border-radius: var(--pc-radius);
	box-shadow: var(--pc-shadow);
}

.pc-card h2,
.pc-card h3,
.pc-sticker h2,
.pc-sticker h3 {
	margin: 0 0 var(--pc-space-2xs);
}

.pc-card p,
.pc-sticker p {
	color: var(--pc-ink-70);
}

/* Spaced by the blocks around them. The second selector is for the empty
 * paragraph wpautop can leave at the end of a block. */
.pc-card > :last-child,
.pc-sticker > :last-child,
.pc-card > :has(+ p:empty:last-child),
.pc-sticker > :has(+ p:empty:last-child) {
	margin-bottom: 0;
}

/* Tilts, in a rotating pattern so nothing lines up too neatly. */
.pc-tilt-1 { rotate: -2deg; }
.pc-tilt-2 { rotate: 1.5deg; }
.pc-tilt-3 { rotate: -1deg; }
.pc-tilt-4 { rotate: 2.5deg; }

/* A question and its answer. */
details.pc-card,
details.pc-sticker {
	margin-bottom: var(--pc-space-xs);
	padding: var(--pc-space-sm) var(--pc-space-md);
}

details.pc-card summary,
details.pc-sticker summary {
	font-weight: 700;
	cursor: pointer;
}

details.pc-card > :not(summary),
details.pc-sticker > :not(summary) {
	margin: var(--pc-space-xs) 0 0;
	color: var(--pc-ink-70);
}

details.pc-card ul,
details.pc-sticker ul {
	padding-left: 1.2em;
}

details.pc-card li,
details.pc-sticker li {
	margin-bottom: var(--pc-space-2xs);
}

/* Numbered cards. The number sits on the top edge, so they need the room. */
.pc-steps {
	counter-reset: pc-step;
	margin-top: var(--pc-space-xl);
	row-gap: var(--pc-space-lg);
}

.pc-step {
	position: relative;
	padding: var(--pc-space-lg) var(--pc-space-md) var(--pc-space-md);
	text-align: center;
}

.pc-step::before {
	content: counter(pc-step);
	counter-increment: pc-step;
	position: absolute;
	top: -1.35rem;
	left: 50%;
	display: grid;
	place-items: center;
	width: 2.7rem;
	height: 2.7rem;
	background: var(--pc-sky);
	border: var(--pc-line);
	border-radius: 50%;
	color: var(--pc-ink);
	font-family: var(--pc-font-display);
	font-size: 1.35rem;
	font-weight: 800;
	transform: translateX(-50%) rotate(-6deg);
}

/* A list of short facts, each in a sky tile. */
.pc-tiles {
	display: grid;
	gap: var(--pc-space-xs);
	grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
	margin-block: 0;
	padding: 0;
	list-style: none;
}

.pc-tiles li {
	padding: var(--pc-space-xs) var(--pc-space-sm);
	background: var(--pc-sky-50);
	border: var(--pc-line-thin);
	border-radius: var(--pc-radius);
}

.pc-tiles li strong {
	display: block;
}

/* A row of links, such as a page's table of contents. */
.pc-pills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--pc-space-xs);
	margin: var(--pc-space-lg) 0 0;
	padding: 0;
	list-style: none;
}

.pc-pills a,
.pc-tag {
	display: inline-block;
	padding: 0.3em 0.9em;
	background: var(--pc-sky-100);
	border: var(--pc-line-thin);
	border-radius: var(--pc-radius-pill);
	color: var(--pc-ink);
	font-size: var(--pc-step--1);
	font-weight: 700;
	text-decoration: none;
}

.pc-pills a:hover {
	background: var(--pc-sky-200);
	color: var(--pc-ink);
}

/* The closing call to action. */
.pc-cta {
	margin-top: var(--pc-space-2xl);
	padding: var(--pc-space-xl) var(--pc-space-md);
	background: var(--pc-pink);
	border: var(--pc-line);
	border-radius: var(--pc-radius-lg);
	box-shadow: var(--pc-shadow-lg);
	color: var(--pc-white);
	text-align: center;
}

.pc-cta h2 {
	margin-top: 0;
	color: var(--pc-white);
}

.pc-cta p {
	max-width: 34rem;
	margin-inline: auto;
	font-size: var(--pc-step-1);
}

.pc-cta p:last-child,
.pc-cta > :has(+ p:empty:last-child) {
	margin-bottom: 0;
}

.pc-cta .pc-button {
	background: var(--pc-white);
	color: var(--pc-ink);
}

.pc-cta .pc-button:hover {
	background: var(--pc-ink);
	color: var(--pc-white);
}

/* 7. Tablet and desktop
 * ------------------------------------------------------------ */

@media (min-width: 40rem) {
	:root {
		--app-gutter: 24px;
	}

	.app-page-title {
		font-size: 2rem;
	}
}

/* 8. Motion
 * ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.app-badge--working::before {
		animation: none;
	}

	.app-button,
	.app-button:hover,
	.app-button:active,
	.pc-button,
	.pc-button:hover,
	.pc-button:active {
		transition: none;
		transform: none;
	}
}
