/*
Theme Name: TiinyCloud
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: tiinycloud
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;
}

/* Links underline in tomato. */
a {
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

/* Section headings and lead text balance their lines. */
:where(h1, h2, h3) {
	text-wrap: balance;
}

:where(p) {
	text-wrap: pretty;
}

/* Inline SVG drawings (the hero illustration, the cloud) scale with their box. */
.wp-block-html > svg,
.wp-site-blocks svg.tiinycloud-art {
	display: block;
	max-width: 100%;
	height: auto;
}

/* The header: a slim paper bar with a hairline ink rule under it. */
.site-header {
	border-bottom: 2px solid var(--wp--preset--color--ink);
}

/* The announcement bar above the header. */
.site-announcement a {
	color: inherit;
}

/* On a phone the bar keeps to two short lines: smaller text, the link
   tucked beside it. */
@media (max-width: 600px) {
	.site-announcement > .wp-block-group {
		flex-wrap: nowrap;
		justify-content: space-between;
		text-align: left;
	}

	.site-announcement :is(p, .wp-element-button) {
		font-size: var(--wp--preset--font-size--xs) !important;
		line-height: 1.4;
	}

	.site-announcement .wp-block-buttons {
		flex: none;
	}
}

/* A label and its value on one row, such as a plugin's requirements. */
.spec-row {
	gap: var(--wp--preset--spacing--40);
	padding-block: 0.15rem;
}

.spec-row > p {
	margin: 0;
}

/* A feature card's optional icon: the plugin-mark glyph in a small cream box. */
.feature-icon img {
	box-sizing: border-box;
	padding: 0.55rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--sm);
	background-color: var(--wp--preset--color--cream);
}

/* Image-and-text sections alternate sides down the page. */
@media (min-width: 782px) {
	.plugin-section:nth-child(even) .section-split > .wp-block-columns {
		flex-direction: row-reverse;
	}
}

/* Steps: numbered by CSS, colored in turn with the swatches. */
.steps-grid {
	counter-reset: step;
}

.step-card {
	counter-increment: step;
}

.step-card::before {
	content: counter(step, decimal-leading-zero);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--lg);
}

.step-card:nth-child(3n + 1) { background-color: var(--wp--preset--color--sky); }
.step-card:nth-child(3n + 2) { background-color: var(--wp--preset--color--butter); }
.step-card:nth-child(3n) { background-color: var(--wp--preset--color--mint); }

/* Comparison: one row per topic, dashed rules between them. */
.compare-row {
	grid-template-columns: 1fr 1.3fr 1.3fr !important;
	padding-block: var(--wp--preset--spacing--30);
	border-top: 2px dashed var(--wp--preset--color--ink);
}

.compare-row > p {
	margin: 0;
}

.compare-head {
	border-top: 0;
}

.compare-topic,
.compare-ours {
	font-weight: 600;
}

@media (max-width: 600px) {
	.compare-row {
		grid-template-columns: 1fr 1fr !important;
	}

	.compare-row {
		row-gap: var(--wp--preset--spacing--20) !important;
	}

	.compare-row > :first-child {
		grid-column: 1 / -1;
		font-family: var(--wp--preset--font-family--mono);
		font-size: var(--wp--preset--font-size--sm);
	}
}

/* The capabilities outline: lists inside each folded group, ruled apart. */
.capability-list + .capability-list {
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px dashed var(--wp--preset--color--muted);
}

.capability-list > p:first-child {
	color: var(--wp--preset--color--ink);
}

.capability-list > p {
	margin: 0;
}

/* Form fields share the ink outline. */
:where(input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], input[type="number"], select, textarea) {
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--sm);
	background-color: var(--wp--preset--color--snow);
	color: var(--wp--preset--color--ink);
	font: inherit;
	padding: 0.6rem 0.8rem;
}

/* The article body of a blog post: readable links and spacing. */
.article-body > * + * {
	margin-block-start: 1.1em;
}

.article-body :where(h2, h3) {
	margin-block-start: 1.8em;
}

/* Easy Digital Downloads' buttons (purchase, checkout, account) look like the
   theme's, over EDD's own grey button styles. */
.wp-site-blocks .edd-submit.button:not(.plain),
.wp-site-blocks #edd-purchase-button,
.wp-site-blocks [type="submit"].edd-submit:not(.plain) {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--md);
	box-shadow: var(--wp--preset--shadow--hard-sm);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--md);
	font-weight: 600;
	line-height: 1.2;
	padding: 0.7rem 1.25rem;
	white-space: normal;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wp-site-blocks .edd-submit.button:not(.plain):hover,
.wp-site-blocks #edd-purchase-button:hover,
.wp-site-blocks [type="submit"].edd-submit:not(.plain):hover {
	transform: translate(-1px, -1px);
	box-shadow: var(--wp--preset--shadow--hard);
}

/* Inside a card, EDD's forms (log in, register) drop their own grey frame:
   the card is the frame. */
.wp-site-blocks .is-style-card .edd-blocks-form {
	border: 0;
	padding: 0;
}

/* EDD's empty cart is full width with its own padding: keep it inside its
   column, as a dashed card. */
.wp-site-blocks .edd_empty_cart {
	box-sizing: border-box;
	background: var(--wp--preset--color--cream);
	border: 2px dashed var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--lg);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* On a desktop, a plugin's "At a glance" card stays in view beside a long page. */
@media (min-width: 782px) {
	.plugin-glance {
		position: sticky;
		top: var(--wp--preset--spacing--50);
	}

	.admin-bar .plugin-glance {
		top: calc(32px + var(--wp--preset--spacing--50));
	}
}

/* The media gallery in this site's look: ink outlines and hard shadows (blocks/media-gallery/style.css). */
.wp-block-shader-media-gallery {
	--mg-radius: var(--wp--custom--radius--md);
	--mg-border: 2px solid var(--wp--preset--color--ink);
	--mg-shadow: var(--wp--preset--shadow--hard-sm);
	--mg-shadow-hover: var(--wp--preset--shadow--hard);
	--mg-tile-bg: var(--wp--preset--color--cream);
}
